X-Git-Url: http://git.droids-corp.org/?a=blobdiff_plain;f=drivers%2Fnet%2Fbnxt%2Ftf_ulp%2Fulp_template_struct.h;h=0cbac662371e96e5ddf7e1b7d4dfa1219c339ffd;hb=b37ed6def36798342172f298516c5fc6d0d8e070;hp=5d11a7ec4622a6617a32157e8ec2169d91040eef;hpb=7e3a1670b712bedbb84bdd45126537633eb9e1bc;p=dpdk.git diff --git a/drivers/net/bnxt/tf_ulp/ulp_template_struct.h b/drivers/net/bnxt/tf_ulp/ulp_template_struct.h index 5d11a7ec46..0cbac66237 100644 --- a/drivers/net/bnxt/tf_ulp/ulp_template_struct.h +++ b/drivers/net/bnxt/tf_ulp/ulp_template_struct.h @@ -1,5 +1,5 @@ /* SPDX-License-Identifier: BSD-3-Clause - * Copyright(c) 2014-2019 Broadcom + * Copyright(c) 2014-2021 Broadcom * All rights reserved. */ @@ -18,7 +18,7 @@ #include "tf_core.h" /* Number of fields for each protocol */ -#define BNXT_ULP_PROTO_HDR_SVIF_NUM 1 +#define BNXT_ULP_PROTO_HDR_SVIF_NUM 2 #define BNXT_ULP_PROTO_HDR_ETH_NUM 3 #define BNXT_ULP_PROTO_HDR_S_VLAN_NUM 3 #define BNXT_ULP_PROTO_HDR_VLAN_NUM 6 @@ -27,8 +27,15 @@ #define BNXT_ULP_PROTO_HDR_UDP_NUM 4 #define BNXT_ULP_PROTO_HDR_TCP_NUM 9 #define BNXT_ULP_PROTO_HDR_VXLAN_NUM 4 +#define BNXT_ULP_PROTO_HDR_GRE_NUM 6 +#define BNXT_ULP_PROTO_HDR_ICMP_NUM 5 #define BNXT_ULP_PROTO_HDR_MAX 128 -#define BNXT_ULP_PROTO_HDR_FIELD_SVIF_IDX 0 +#define BNXT_ULP_PROTO_HDR_FIELD_SVIF_IDX 1 + +/* Direction attributes */ +#define BNXT_ULP_FLOW_ATTR_TRANSFER 0x1 +#define BNXT_ULP_FLOW_ATTR_INGRESS 0x2 +#define BNXT_ULP_FLOW_ATTR_EGRESS 0x4 struct ulp_rte_hdr_bitmap { uint64_t bits; @@ -57,16 +64,31 @@ struct ulp_rte_act_prop { /* Structure to be used for passing all the parser functions */ struct ulp_rte_parser_params { + STAILQ_ENTRY(ulp_rte_parser_params) next; struct ulp_rte_hdr_bitmap hdr_bitmap; + struct ulp_rte_hdr_bitmap hdr_fp_bit; struct ulp_rte_field_bitmap fld_bitmap; + struct ulp_rte_field_bitmap fld_s_bitmap; struct ulp_rte_hdr_field hdr_field[BNXT_ULP_PROTO_HDR_MAX]; - uint32_t comp_fld[BNXT_ULP_CF_IDX_LAST]; + uint64_t comp_fld[BNXT_ULP_CF_IDX_LAST]; uint32_t field_idx; - uint32_t vlan_idx; struct ulp_rte_act_bitmap act_bitmap; struct ulp_rte_act_prop act_prop; - uint32_t dir; + uint32_t dir_attr; + uint32_t priority; + uint32_t fid; + uint32_t parent_flow; + uint32_t parent_fid; + uint16_t func_id; + uint16_t port_id; + uint32_t class_id; + uint32_t act_tmpl; struct bnxt_ulp_context *ulp_ctx; + uint32_t hdr_sig_id; + uint32_t flow_sig_id; + uint32_t flow_pattern_id; + uint32_t act_pattern_id; + uint8_t app_id; }; /* Flow Parser Header Information Structure */ @@ -112,6 +134,10 @@ struct bnxt_ulp_class_match_info { uint32_t class_tid; uint8_t act_vnic; uint8_t wc_pri; + uint8_t app_sig; + uint32_t hdr_sig_id; + uint32_t flow_sig_id; + uint32_t flow_pattern_id; }; /* Flow Matcher templates Structure for class entries */ @@ -128,41 +154,108 @@ struct bnxt_ulp_act_match_info { struct ulp_rte_bitmap act_sig; uint32_t act_hid; uint32_t act_tid; + uint32_t act_pattern_id; + uint8_t app_sig; }; /* Flow Matcher templates Structure for action entries */ extern uint16_t ulp_act_sig_tbl[]; extern struct bnxt_ulp_act_match_info ulp_act_match_list[]; +/* Device Specific Tables for mapper */ +struct bnxt_ulp_mapper_cond_info { + enum bnxt_ulp_cond_opc cond_opcode; + uint32_t cond_operand; +}; + +struct bnxt_ulp_mapper_cond_list_info { + enum bnxt_ulp_cond_list_opc cond_list_opcode; + uint32_t cond_start_idx; + uint32_t cond_nums; + int32_t cond_true_goto; + int32_t cond_false_goto; +}; + +struct bnxt_ulp_mapper_func_info { + enum bnxt_ulp_func_opc func_opc; + enum bnxt_ulp_func_src func_src1; + enum bnxt_ulp_func_src func_src2; + uint16_t func_opr1; + uint16_t func_opr2; + uint16_t func_dst_opr; +}; + +struct bnxt_ulp_template_device_tbls { + struct bnxt_ulp_mapper_tmpl_info *tmpl_list; + uint32_t tmpl_list_size; + struct bnxt_ulp_mapper_tbl_info *tbl_list; + uint32_t tbl_list_size; + struct bnxt_ulp_mapper_key_info *key_info_list; + uint32_t key_info_list_size; + struct bnxt_ulp_mapper_field_info *result_field_list; + uint32_t result_field_list_size; + struct bnxt_ulp_mapper_ident_info *ident_list; + uint32_t ident_list_size; + struct bnxt_ulp_mapper_cond_info *cond_list; + uint32_t cond_list_size; +}; + /* Device specific parameters */ struct bnxt_ulp_device_params { uint8_t description[16]; - uint32_t global_fid_enable; enum bnxt_ulp_byte_order byte_order; uint8_t encap_byte_swap; - uint32_t lfid_entries; - uint32_t lfid_entry_size; - uint64_t gfid_entries; - uint32_t gfid_entry_size; - uint64_t num_flows; + uint8_t num_phy_ports; + uint32_t mark_db_lfid_entries; + uint64_t mark_db_gfid_entries; + uint64_t int_flow_db_num_entries; + uint64_t ext_flow_db_num_entries; + uint32_t flow_count_db_entries; + uint32_t fdb_parent_flow_entries; uint32_t num_resources_per_flow; + uint32_t ext_cntr_table_type; + uint64_t byte_count_mask; + uint64_t packet_count_mask; + uint32_t byte_count_shift; + uint32_t packet_count_shift; + uint32_t dynamic_pad_en; + uint16_t em_blk_size_bits; + uint16_t em_blk_align_bits; + uint16_t em_key_align_bytes; + uint16_t em_result_size_bits; + uint16_t wc_slice_width; + uint16_t wc_max_slices; + uint32_t wc_mode_list[4]; + uint32_t wc_mod_list_max_size; + uint32_t wc_ctl_size_bits; + const struct bnxt_ulp_template_device_tbls *dev_tbls; }; /* Flow Mapper */ -struct bnxt_ulp_mapper_tbl_list_info { - uint32_t device_name; - uint32_t start_tbl_idx; - uint32_t num_tbls; +struct bnxt_ulp_mapper_tmpl_info { + uint32_t device_name; + uint32_t start_tbl_idx; + uint32_t num_tbls; + struct bnxt_ulp_mapper_cond_list_info reject_info; }; struct bnxt_ulp_mapper_tbl_info { enum bnxt_ulp_resource_func resource_func; uint32_t resource_type; /* TF_ enum type */ enum bnxt_ulp_resource_sub_type resource_sub_type; - uint8_t direction; - uint32_t priority; - uint8_t srch_b4_alloc; - enum bnxt_ulp_critical_resource critical_resource; + struct bnxt_ulp_mapper_cond_list_info execute_info; + struct bnxt_ulp_mapper_func_info func_info; + enum bnxt_ulp_cond_opc cond_opcode; + uint32_t cond_operand; + uint8_t direction; + enum bnxt_ulp_pri_opc pri_opcode; + uint32_t pri_operand; + enum bnxt_ulp_byte_order byte_order; + + /* conflict resolution opcode */ + enum bnxt_ulp_accept_opc accept_opcode; + + enum bnxt_ulp_critical_resource critical_resource; /* Information for accessing the ulp_key_field_list */ uint32_t key_start_idx; @@ -181,24 +274,36 @@ struct bnxt_ulp_mapper_tbl_info { uint32_t ident_start_idx; uint16_t ident_nums; - enum bnxt_ulp_regfile_index regfile_idx; - enum bnxt_ulp_mark_db_opcode mark_db_opcode; + enum bnxt_ulp_mark_db_opc mark_db_opcode; + + /* Table opcode for table operations */ + uint32_t tbl_opcode; + uint32_t tbl_operand; + enum bnxt_ulp_generic_tbl_lkup_type gen_tbl_lkup_type; + + /* FDB table opcode */ + enum bnxt_ulp_fdb_opc fdb_opcode; + uint32_t fdb_operand; + + /* Shared session */ + enum bnxt_ulp_shared_session shared_session; }; -struct bnxt_ulp_mapper_class_key_field_info { +struct bnxt_ulp_mapper_field_info { uint8_t description[64]; - enum bnxt_ulp_mapper_opc mask_opcode; - enum bnxt_ulp_mapper_opc spec_opcode; uint16_t field_bit_size; - uint8_t mask_operand[16]; - uint8_t spec_operand[16]; + enum bnxt_ulp_field_opc field_opc; + enum bnxt_ulp_field_src field_src1; + uint8_t field_opr1[16]; + enum bnxt_ulp_field_src field_src2; + uint8_t field_opr2[16]; + enum bnxt_ulp_field_src field_src3; + uint8_t field_opr3[16]; }; -struct bnxt_ulp_mapper_result_field_info { - uint8_t description[64]; - enum bnxt_ulp_mapper_opc result_opcode; - uint16_t field_bit_size; - uint8_t result_operand[16]; +struct bnxt_ulp_mapper_key_info { + struct bnxt_ulp_mapper_field_info field_info_spec; + struct bnxt_ulp_mapper_field_info field_info_mask; }; struct bnxt_ulp_mapper_ident_info { @@ -208,20 +313,51 @@ struct bnxt_ulp_mapper_ident_info { uint16_t ident_type; uint16_t ident_bit_size; uint16_t ident_bit_pos; - enum bnxt_ulp_regfile_index regfile_idx; + enum bnxt_ulp_rf_idx regfile_idx; }; struct bnxt_ulp_glb_resource_info { + uint8_t app_id; + enum bnxt_ulp_device_id device_id; + enum tf_dir direction; enum bnxt_ulp_resource_func resource_func; uint32_t resource_type; /* TF_ enum type */ - enum bnxt_ulp_glb_regfile_index glb_regfile_index; + enum bnxt_ulp_glb_rf_idx glb_regfile_index; +}; + +struct bnxt_ulp_resource_resv_info { + uint8_t app_id; + enum bnxt_ulp_device_id device_id; enum tf_dir direction; + enum bnxt_ulp_resource_func resource_func; + uint32_t resource_type; /* TF_ enum type */ + uint32_t count; +}; + +struct bnxt_ulp_app_capabilities_info { + uint8_t app_id; + enum bnxt_ulp_device_id device_id; + uint32_t flags; }; struct bnxt_ulp_cache_tbl_params { uint16_t num_entries; }; +struct bnxt_ulp_generic_tbl_params { + const char *name; + uint16_t result_num_entries; + uint16_t result_num_bytes; + enum bnxt_ulp_byte_order result_byte_order; + uint32_t hash_tbl_entries; + uint16_t num_buckets; + uint16_t key_num_bytes; +}; + +struct bnxt_ulp_shared_act_info { + uint64_t act_bitmask; +}; + /* * Flow Mapper Static Data Externs: * Access to the below static data should be done through access functions and @@ -235,66 +371,55 @@ struct bnxt_ulp_cache_tbl_params { extern struct bnxt_ulp_device_params ulp_device_params[]; /* - * The ulp_class_tmpl_list and ulp_act_tmpl_list are indexed by the dev_id - * and template id (either class or action) returned by the matcher. - * The result provides the start index and number of entries in the connected - * ulp_class_tbl_list/ulp_act_tbl_list. + * The ulp_act_prop_map_table provides the mapping to index and size of action + * properties. */ -extern struct bnxt_ulp_mapper_tbl_list_info ulp_class_tmpl_list[]; -extern struct bnxt_ulp_mapper_tbl_list_info ulp_act_tmpl_list[]; +extern uint32_t ulp_act_prop_map_table[]; /* - * The ulp_class_tbl_list and ulp_act_tbl_list are indexed based on the results - * of the template lists. Each entry describes the high level details of the - * table entry to include the start index and number of instructions in the - * field lists. + * The ulp_glb_resource_tbl provides the list of global resources that need to + * be initialized and where to store them. */ -extern struct bnxt_ulp_mapper_tbl_info ulp_class_tbl_list[]; -extern struct bnxt_ulp_mapper_tbl_info ulp_act_tbl_list[]; +extern struct bnxt_ulp_glb_resource_info ulp_glb_resource_tbl[]; /* - * The ulp_class_result_field_list provides the instructions for creating result - * records such as tcam/em results. + * The ulp_app_glb_resource_tbl provides the list of shared resources required + * in the event that shared session is enabled. */ -extern struct bnxt_ulp_mapper_result_field_info ulp_class_result_field_list[]; +extern struct bnxt_ulp_glb_resource_info ulp_app_glb_resource_tbl[]; /* - * The ulp_data_field_list provides the instructions for creating an action - * record. It uses the same structure as the result list, but is only used for - * actions. + * The ulp_resource_resv_list provides the list of tf resources required when + * calling tf_open. */ -extern -struct bnxt_ulp_mapper_result_field_info ulp_act_result_field_list[]; +extern struct bnxt_ulp_resource_resv_info ulp_resource_resv_list[]; /* - * The ulp_act_prop_map_table provides the mapping to index and size of action - * tcam and em tables. + * The ulp_app_resource_resv_list provides the list of tf resources required + * when calling tf_open. */ -extern -struct bnxt_ulp_mapper_class_key_field_info ulp_class_key_field_list[]; +extern struct bnxt_ulp_resource_resv_info ulp_app_resource_resv_list[]; /* - * The ulp_ident_list provides the instructions for creating identifiers such - * as profile ids. + * The_app_cap_info_list provides the list of ULP capabilities per app/device. */ -extern struct bnxt_ulp_mapper_ident_info ulp_ident_list[]; +extern struct bnxt_ulp_app_capabilities_info ulp_app_cap_info_list[]; /* - * The ulp_act_prop_map_table provides the mapping to index and size of action - * properties. + * The ulp_cache_tbl_parms table provides the sizes of the cache tables the + * mapper must dynamically allocate during initialization. */ -extern uint32_t ulp_act_prop_map_table[]; +extern struct bnxt_ulp_cache_tbl_params ulp_cache_tbl_params[]; /* - * The ulp_glb_resource_tbl provides the list of global resources that need to - * be initialized and where to store them. + * The ulp_generic_tbl_parms table provides the sizes of the generic tables the + * mapper must dynamically allocate during initialization. */ -extern struct bnxt_ulp_glb_resource_info ulp_glb_resource_tbl[]; - +extern struct bnxt_ulp_generic_tbl_params ulp_generic_tbl_params[]; /* - * The ulp_cache_tbl_parms table provides the sizes of the cache tables the - * mapper must dynamically allocate during initialization. + * The ulp_global template table is used to initialize default entries + * that could be reused by other templates. */ -extern struct bnxt_ulp_cache_tbl_params ulp_cache_tbl_params[]; +extern uint32_t ulp_glb_template_tbl[]; #endif /* _ULP_TEMPLATE_STRUCT_H_ */