net/bnxt: add core changes for EM and EEM lookups
[dpdk.git] / drivers / net / bnxt / tf_core / hwrm_tf.h
index f346d62..59185da 100644 (file)
@@ -23,13 +23,12 @@ typedef enum tf_subtype {
        HWRM_TFT_SESSION_SRAM_RESC_FREE = 727,
        HWRM_TFT_SESSION_SRAM_RESC_FLUSH = 728,
        HWRM_TFT_TBL_SCOPE_CFG = 731,
-       HWRM_TFT_EM_RULE_INSERT = 739,
-       HWRM_TFT_EM_RULE_DELETE = 740,
        HWRM_TFT_REG_GET = 821,
        HWRM_TFT_REG_SET = 822,
        HWRM_TFT_TBL_TYPE_SET = 823,
        HWRM_TFT_TBL_TYPE_GET = 824,
-       TF_SUBTYPE_LAST = HWRM_TFT_TBL_TYPE_GET,
+       HWRM_TFT_TBL_TYPE_BULK_GET = 825,
+       TF_SUBTYPE_LAST = HWRM_TFT_TBL_TYPE_BULK_GET,
 } tf_subtype_t;
 
 /* Request and Response compile time checking */
@@ -38,11 +37,6 @@ typedef enum tf_subtype {
 /* u32_t       tlv_resp_value[170]; */
 #define TF_MAX_RESP_SIZE 680
 
-#define __BUILD_BUG_ON(condition, line) \
-       char p##line[(condition) ? 1 : -1]
-#define _BUILD_BUG_ON(condition, line) __BUILD_BUG_ON(condition, line)
-#define BUILD_BUG_ON(condition) _BUILD_BUG_ON(condition, __LINE__)
-
 /* Use this to allocate/free any kind of
  * indexes over HWRM and fill the parms pointer
  */
@@ -88,9 +82,8 @@ struct tf_session_sram_resc_flush_input;
 struct tf_tbl_type_set_input;
 struct tf_tbl_type_get_input;
 struct tf_tbl_type_get_output;
-struct tf_em_internal_insert_input;
-struct tf_em_internal_insert_output;
-struct tf_em_internal_delete_input;
+struct tf_tbl_type_bulk_get_input;
+struct tf_tbl_type_bulk_get_output;
 /* Input params for session attach */
 typedef struct tf_session_attach_input {
        /* Firmware session id returned when HWRM_TF_SESSION_OPEN is sent */
@@ -98,7 +91,6 @@ typedef struct tf_session_attach_input {
        /* Session Name */
        char                             session_name[TF_SESSION_NAME_MAX];
 } tf_session_attach_input_t, *ptf_session_attach_input_t;
-BUILD_BUG_ON(sizeof(tf_session_attach_input_t) <= TF_MAX_REQ_SIZE);
 
 /* Input params for session resource HW qcaps */
 typedef struct tf_session_hw_resc_qcaps_input {
@@ -111,7 +103,6 @@ typedef struct tf_session_hw_resc_qcaps_input {
        /* When set to 1, indicates the query apply to TX */
 #define TF_SESSION_HW_RESC_QCAPS_INPUT_FLAGS_DIR_TX      (0x1)
 } tf_session_hw_resc_qcaps_input_t, *ptf_session_hw_resc_qcaps_input_t;
-BUILD_BUG_ON(sizeof(tf_session_hw_resc_qcaps_input_t) <= TF_MAX_REQ_SIZE);
 
 /* Output params for session resource HW qcaps */
 typedef struct tf_session_hw_resc_qcaps_output {
@@ -216,7 +207,6 @@ typedef struct tf_session_hw_resc_qcaps_output {
        /* Maximum non-guaranteed number of LAG table entries */
        uint16_t                         lag_tbl_entries_max;
 } tf_session_hw_resc_qcaps_output_t, *ptf_session_hw_resc_qcaps_output_t;
-BUILD_BUG_ON(sizeof(tf_session_hw_resc_qcaps_output_t) <= TF_MAX_RESP_SIZE);
 
 /* Input params for session resource HW alloc */
 typedef struct tf_session_hw_resc_alloc_input {
@@ -275,7 +265,6 @@ typedef struct tf_session_hw_resc_alloc_input {
        /* Number of LAG table entries to be allocated */
        uint16_t                         num_lag_tbl_entries;
 } tf_session_hw_resc_alloc_input_t, *ptf_session_hw_resc_alloc_input_t;
-BUILD_BUG_ON(sizeof(tf_session_hw_resc_alloc_input_t) <= TF_MAX_REQ_SIZE);
 
 /* Output params for session resource HW alloc */
 typedef struct tf_session_hw_resc_alloc_output {
@@ -368,7 +357,6 @@ typedef struct tf_session_hw_resc_alloc_output {
        /* Number of LAG table entries allocated */
        uint16_t                         lag_tbl_entries_stride;
 } tf_session_hw_resc_alloc_output_t, *ptf_session_hw_resc_alloc_output_t;
-BUILD_BUG_ON(sizeof(tf_session_hw_resc_alloc_output_t) <= TF_MAX_RESP_SIZE);
 
 /* Input params for session resource HW free */
 typedef struct tf_session_hw_resc_free_input {
@@ -471,7 +459,6 @@ typedef struct tf_session_hw_resc_free_input {
        /* Number of LAG table entries allocated */
        uint16_t                         lag_tbl_entries_stride;
 } tf_session_hw_resc_free_input_t, *ptf_session_hw_resc_free_input_t;
-BUILD_BUG_ON(sizeof(tf_session_hw_resc_free_input_t) <= TF_MAX_REQ_SIZE);
 
 /* Input params for session resource HW flush */
 typedef struct tf_session_hw_resc_flush_input {
@@ -574,7 +561,6 @@ typedef struct tf_session_hw_resc_flush_input {
        /* Number of LAG table entries allocated */
        uint16_t                         lag_tbl_entries_stride;
 } tf_session_hw_resc_flush_input_t, *ptf_session_hw_resc_flush_input_t;
-BUILD_BUG_ON(sizeof(tf_session_hw_resc_flush_input_t) <= TF_MAX_REQ_SIZE);
 
 /* Input params for session resource SRAM qcaps */
 typedef struct tf_session_sram_resc_qcaps_input {
@@ -587,7 +573,6 @@ typedef struct tf_session_sram_resc_qcaps_input {
        /* When set to 1, indicates the query apply to TX */
 #define TF_SESSION_SRAM_RESC_QCAPS_INPUT_FLAGS_DIR_TX    (0x1)
 } tf_session_sram_resc_qcaps_input_t, *ptf_session_sram_resc_qcaps_input_t;
-BUILD_BUG_ON(sizeof(tf_session_sram_resc_qcaps_input_t) <= TF_MAX_REQ_SIZE);
 
 /* Output params for session resource SRAM qcaps */
 typedef struct tf_session_sram_resc_qcaps_output {
@@ -654,7 +639,6 @@ typedef struct tf_session_sram_resc_qcaps_output {
        /* Maximum non-guaranteed number of NAT D_IPV4 */
        uint16_t                         nat_d_ipv4_max;
 } tf_session_sram_resc_qcaps_output_t, *ptf_session_sram_resc_qcaps_output_t;
-BUILD_BUG_ON(sizeof(tf_session_sram_resc_qcaps_output_t) <= TF_MAX_RESP_SIZE);
 
 /* Input params for session resource SRAM alloc */
 typedef struct tf_session_sram_resc_alloc_input {
@@ -695,7 +679,6 @@ typedef struct tf_session_sram_resc_alloc_input {
        /* Number of NAT destination IPV4 addresses to be allocated */
        uint16_t                         num_nat_d_ipv4;
 } tf_session_sram_resc_alloc_input_t, *ptf_session_sram_resc_alloc_input_t;
-BUILD_BUG_ON(sizeof(tf_session_sram_resc_alloc_input_t) <= TF_MAX_REQ_SIZE);
 
 /* Output params for session resource SRAM alloc */
 typedef struct tf_session_sram_resc_alloc_output {
@@ -757,7 +740,6 @@ typedef struct tf_session_sram_resc_alloc_output {
        /* Number of NAT destination IPV4 addresses allocated */
        uint16_t                         nat_d_ipv4_stride;
 } tf_session_sram_resc_alloc_output_t, *ptf_session_sram_resc_alloc_output_t;
-BUILD_BUG_ON(sizeof(tf_session_sram_resc_alloc_output_t) <= TF_MAX_RESP_SIZE);
 
 /* Input params for session resource SRAM free */
 typedef struct tf_session_sram_resc_free_input {
@@ -825,7 +807,6 @@ typedef struct tf_session_sram_resc_free_input {
        /* Number of NAT destination IPV4 addresses allocated */
        uint16_t                         nat_d_ipv4_stride;
 } tf_session_sram_resc_free_input_t, *ptf_session_sram_resc_free_input_t;
-BUILD_BUG_ON(sizeof(tf_session_sram_resc_free_input_t) <= TF_MAX_REQ_SIZE);
 
 /* Input params for session resource SRAM flush */
 typedef struct tf_session_sram_resc_flush_input {
@@ -893,7 +874,26 @@ typedef struct tf_session_sram_resc_flush_input {
        /* Number of NAT destination IPV4 addresses allocated */
        uint16_t                         nat_d_ipv4_stride;
 } tf_session_sram_resc_flush_input_t, *ptf_session_sram_resc_flush_input_t;
-BUILD_BUG_ON(sizeof(tf_session_sram_resc_flush_input_t) <= TF_MAX_REQ_SIZE);
+
+/* Input params for table type set */
+typedef struct tf_tbl_type_set_input {
+       /* Session Id */
+       uint32_t                         fw_session_id;
+       /* flags */
+       uint16_t                         flags;
+       /* When set to 0, indicates the get apply to RX */
+#define TF_TBL_TYPE_SET_INPUT_FLAGS_DIR_RX                     (0x0)
+       /* When set to 1, indicates the get apply to TX */
+#define TF_TBL_TYPE_SET_INPUT_FLAGS_DIR_TX                     (0x1)
+       /* Type of the object to set */
+       uint32_t                         type;
+       /* Size of the data to set in bytes */
+       uint16_t                         size;
+       /* Data to set */
+       uint8_t                   data[TF_BULK_SEND];
+       /* Index to set */
+       uint32_t                         index;
+} tf_tbl_type_set_input_t, *ptf_tbl_type_set_input_t;
 
 /* Input params for table type get */
 typedef struct tf_tbl_type_get_input {
@@ -910,7 +910,6 @@ typedef struct tf_tbl_type_get_input {
        /* Index to get */
        uint32_t                         index;
 } tf_tbl_type_get_input_t, *ptf_tbl_type_get_input_t;
-BUILD_BUG_ON(sizeof(tf_tbl_type_get_input_t) <= TF_MAX_REQ_SIZE);
 
 /* Output params for table type get */
 typedef struct tf_tbl_type_get_output {
@@ -919,57 +918,33 @@ typedef struct tf_tbl_type_get_output {
        /* Data read */
        uint8_t                   data[TF_BULK_RECV];
 } tf_tbl_type_get_output_t, *ptf_tbl_type_get_output_t;
-BUILD_BUG_ON(sizeof(tf_tbl_type_get_output_t) <= TF_MAX_RESP_SIZE);
 
-/* Input params for EM internal rule insert */
-typedef struct tf_em_internal_insert_input {
-       /* Firmware Session Id */
+/* Input params for table type get */
+typedef struct tf_tbl_type_bulk_get_input {
+       /* Session Id */
        uint32_t                         fw_session_id;
        /* flags */
        uint16_t                         flags;
        /* When set to 0, indicates the get apply to RX */
-#define TF_EM_INTERNAL_INSERT_INPUT_FLAGS_DIR_RX         (0x0)
+#define TF_TBL_TYPE_BULK_GET_INPUT_FLAGS_DIR_RX           (0x0)
        /* When set to 1, indicates the get apply to TX */
-#define TF_EM_INTERNAL_INSERT_INPUT_FLAGS_DIR_TX         (0x1)
-       /* strength */
-       uint16_t                         strength;
-       /* index to action */
-       uint32_t                         action_ptr;
-       /* index of em record */
-       uint32_t                         em_record_idx;
-       /* EM Key value */
-       uint64_t                         em_key[8];
-       /* number of bits in em_key */
-       uint16_t                         em_key_bitlen;
-} tf_em_internal_insert_input_t, *ptf_em_internal_insert_input_t;
-BUILD_BUG_ON(sizeof(tf_em_internal_insert_input_t) <= TF_MAX_REQ_SIZE);
-
-/* Output params for EM internal rule insert */
-typedef struct tf_em_internal_insert_output {
-       /* EM record pointer index */
-       uint16_t                         rptr_index;
-       /* EM record offset 0~3 */
-       uint8_t                   rptr_entry;
-} tf_em_internal_insert_output_t, *ptf_em_internal_insert_output_t;
-BUILD_BUG_ON(sizeof(tf_em_internal_insert_output_t) <= TF_MAX_RESP_SIZE);
+#define TF_TBL_TYPE_BULK_GET_INPUT_FLAGS_DIR_TX           (0x1)
+       /* When set to 1, indicates the clear entry on read */
+#define TF_TBL_TYPE_BULK_GET_INPUT_FLAGS_CLEAR_ON_READ   (0x2)
+       /* Type of the object to set */
+       uint32_t                         type;
+       /* Starting index to get from */
+       uint32_t                         start_index;
+       /* Number of entries to get */
+       uint32_t                         num_entries;
+       /* Host memory where data will be stored */
+       uint64_t                         host_addr;
+} tf_tbl_type_bulk_get_input_t, *ptf_tbl_type_bulk_get_input_t;
 
-/* Input params for EM INTERNAL rule delete */
-typedef struct tf_em_internal_delete_input {
-       /* Session Id */
-       uint32_t                         tf_session_id;
-       /* flags */
-       uint16_t                         flags;
-       /* When set to 0, indicates the get apply to RX */
-#define TF_EM_INTERNAL_DELETE_INPUT_FLAGS_DIR_RX         (0x0)
-       /* When set to 1, indicates the get apply to TX */
-#define TF_EM_INTERNAL_DELETE_INPUT_FLAGS_DIR_TX         (0x1)
-       /* EM internal flow hanndle */
-       uint64_t                         flow_handle;
-       /* EM Key value */
-       uint64_t                         em_key[8];
-       /* number of bits in em_key */
-       uint16_t                         em_key_bitlen;
-} tf_em_internal_delete_input_t, *ptf_em_internal_delete_input_t;
-BUILD_BUG_ON(sizeof(tf_em_internal_delete_input_t) <= TF_MAX_REQ_SIZE);
+/* Output params for table type get */
+typedef struct tf_tbl_type_bulk_get_output {
+       /* Size of the total data read in bytes */
+       uint16_t                         size;
+} tf_tbl_type_bulk_get_output_t, *ptf_tbl_type_bulk_get_output_t;
 
 #endif /* _HWRM_TF_H_ */