X-Git-Url: http://git.droids-corp.org/?a=blobdiff_plain;f=drivers%2Fnet%2Fbnxt%2Ftf_ulp%2Fulp_mapper.h;h=4c5dd4b83669326234a31ea3f18e29dd5803fc4a;hb=d75b55121bcd618a958128489ae4cbeb243f413c;hp=542e41e5aa24e49b82e58de12b38ca27ca48a288;hpb=be8acb27c20f974b8f4e78cc842b2d301d5d77c2;p=dpdk.git diff --git a/drivers/net/bnxt/tf_ulp/ulp_mapper.h b/drivers/net/bnxt/tf_ulp/ulp_mapper.h index 542e41e5aa..4c5dd4b836 100644 --- a/drivers/net/bnxt/tf_ulp/ulp_mapper.h +++ b/drivers/net/bnxt/tf_ulp/ulp_mapper.h @@ -1,5 +1,5 @@ /* SPDX-License-Identifier: BSD-3-Clause - * Copyright(c) 2014-2019 Broadcom + * Copyright(c) 2014-2021 Broadcom * All rights reserved. */ @@ -14,41 +14,21 @@ #include "ulp_template_struct.h" #include "bnxt_ulp.h" #include "ulp_utils.h" +#include "ulp_gen_tbl.h" #define ULP_IDENTS_INVALID ((uint16_t)0xffff) -/* - * The cache table opcode is used to convey informat from the cache handler - * to the tcam handler. The opcodes do the following: - * NORMAL - tcam should process all instructions as normal - * SKIP - tcam is using the cached entry and doesn't need to process the - * instruction. - * ALLOC - tcam needs to allocate the tcam index and store in the cache entry - */ -enum bnxt_ulp_cache_table_opc { - BNXT_ULP_MAPPER_TCAM_TBL_OPC_NORMAL, - BNXT_ULP_MAPPER_TCAM_TBL_OPC_CACHE_SKIP, - BNXT_ULP_MAPPER_TCAM_TBL_OPC_CACHE_ALLOC -}; - -struct bnxt_ulp_mapper_cache_entry { - uint32_t ref_count; - uint16_t tcam_idx; - uint16_t idents[BNXT_ULP_CACHE_TBL_IDENT_MAX_NUM]; - uint8_t ident_types[BNXT_ULP_CACHE_TBL_IDENT_MAX_NUM]; -}; - struct bnxt_ulp_mapper_glb_resource_entry { enum bnxt_ulp_resource_func resource_func; uint32_t resource_type; /* TF_ enum type */ uint64_t resource_hndl; + bool shared; }; struct bnxt_ulp_mapper_data { struct bnxt_ulp_mapper_glb_resource_entry - glb_res_tbl[TF_DIR_MAX][BNXT_ULP_GLB_RESOURCE_TBL_MAX_SZ]; - struct bnxt_ulp_mapper_cache_entry - *cache_tbl[BNXT_ULP_CACHE_TBL_MAX_SZ]; + glb_res_tbl[TF_DIR_MAX][BNXT_ULP_GLB_RF_IDX_LAST]; + struct ulp_mapper_gen_tbl_list gen_tbl_list[BNXT_ULP_GEN_TBL_MAX_SZ]; }; /* Internal Structure for passing the arguments around */ @@ -65,19 +45,22 @@ struct bnxt_ulp_mapper_parms { struct ulp_rte_act_bitmap *act_bitmap; struct ulp_rte_hdr_bitmap *hdr_bitmap; struct ulp_rte_hdr_field *hdr_field; + struct ulp_rte_field_bitmap *fld_bitmap; uint32_t *comp_fld; struct ulp_regfile *regfile; - struct tf *tfp; struct bnxt_ulp_context *ulp_ctx; - uint8_t encap_byte_swap; uint32_t fid; enum bnxt_ulp_fdb_type flow_type; struct bnxt_ulp_mapper_data *mapper_data; - enum bnxt_ulp_cache_table_opc tcam_tbl_opc; - struct bnxt_ulp_mapper_cache_entry *cache_ptr; - struct bnxt_ulp_device_params *device_params; + struct bnxt_ulp_device_params *device_params; uint32_t parent_fid; uint32_t parent_flow; + uint8_t tun_idx; + uint32_t app_priority; + uint64_t shared_hndl; + uint32_t flow_pattern_id; + uint32_t act_pattern_id; + uint8_t app_id; }; struct bnxt_ulp_mapper_create_parms { @@ -87,16 +70,25 @@ struct bnxt_ulp_mapper_create_parms { uint32_t *comp_fld; struct ulp_rte_act_bitmap *act; struct ulp_rte_act_prop *act_prop; + struct ulp_rte_field_bitmap *fld_bitmap; uint32_t class_tid; uint32_t act_tid; uint16_t func_id; uint32_t dir_attr; enum bnxt_ulp_fdb_type flow_type; + uint32_t flow_id; /* if set then create it as a child flow with parent as parent_fid */ uint32_t parent_fid; /* if set then create a parent flow */ uint32_t parent_flow; + uint8_t tun_idx; + uint64_t shared_hndl; + + /* support pattern based rejection */ + uint32_t flow_pattern_id; + uint32_t act_pattern_id; + uint8_t app_id; }; /* Function to initialize any dynamic mapper data. */ @@ -113,8 +105,7 @@ ulp_mapper_deinit(struct bnxt_ulp_context *ulp_ctx); */ int32_t ulp_mapper_flow_create(struct bnxt_ulp_context *ulp_ctx, - struct bnxt_ulp_mapper_create_parms *parms, - uint32_t *flowid); + struct bnxt_ulp_mapper_create_parms *parms); /* Function that frees all resources associated with the flow. */ int32_t @@ -131,4 +122,10 @@ ulp_mapper_resources_free(struct bnxt_ulp_context *ulp_ctx, enum bnxt_ulp_fdb_type flow_type, uint32_t fid); +int32_t +ulp_mapper_get_shared_fid(struct bnxt_ulp_context *ulp, + uint32_t id, + uint16_t key, + uint32_t *fid); + #endif /* _ULP_MAPPER_H_ */