net/bnxt/tf_core: fix truflow PF init failure on sriov disabled
PATCH v4 53/57 net/bnxt/tf_core: fix truflow PF init failure on sriov disabled
From: Farah Smith <[email protected]>
When sriov is disabled and running DPDK on PFs fix invalid max VF check during table scope creation.
--- drivers/net/bnxt/tf_core/v3/tfc_tbl_scope.c | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-)
drivers/net/bnxt/tf_core/v3/tfc_tbl_scope.c +2 -10
@@ -1210,7 +1210,8 @@ int tfc_tbl_scope_mem_alloc(struct tfc *tfcp, uint16_t fid, uint8_t tsid,return rc;if (fid > max_vf) { -PMD_DRV_LOG_LINE (ERR ,"fid out of range %d" , fid); +PMD_DRV_LOG_LINE (ERR ,"%s fid out of range %d" , + __func__, fid);return -EINVAL ; }
@@ -1419,16 +1420,7 @@ int tfc_tbl_scope_mem_free(struct tfc *tfcp, uint16_t fid, uint8_t tsid, }if (scope_type !=CFA_SCOPE_TYPE_NON_SHARED && is_pf) {uint16_t pool_cnt; -uint16_t max_vf; - rc =tfc_bp_vf_max (tfcp, &max_vf); -if (rc) -return rc; - -if (fid > max_vf) { -PMD_DRV_LOG_LINE (ERR ,"invalid fid 0x%x" , fid); -return -EINVAL ; - } rc =tbl_scope_tpm_fid_rem (tfcp, fid, tsid, &pool_cnt);if (rc) { PMD_DRV_LOG_LINE(ERR, "error getting tsid(%d) pools status %s",
Signature · 1 line
2.39.5 (Apple Git-154)
PATCH v4 54/57 net/bnxt/tf_ulp: fixes to enable TF functionality
1. Fix RTE_ACTION last item
--- drivers/net/bnxt/tf_ulp/ulp_rte_parser.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/bnxt/tf_ulp/ulp_rte_parser.c +1 -1
@@ -211,7 +211,7 @@ bnxt_ulp_rte_parser_act_parse(const struct rte_flow_action actions[], hdr_info = &ulp_vendor_act_info[action_item->type -BNXT_RTE_FLOW_ACTION_TYPE_END ]; }else { -if (action_item->type >RTE_FLOW_ACTION_TYPE_INDIRECT ) +if (action_item->type >RTE_FLOW_ACTION_TYPE_REPRESENTED_PORT ) goto act_parser_error;/* get the header information from the act info table */ hdr_info = &ulp_act_info[action_item->type];
Signature · 1 line
2.39.5 (Apple Git-154)
PATCH v4 55/57 net/bnxt/tf_ulp: add feature bit rx miss handling
In reply to Manish KurupFrom: Shahaji Bhosle <[email protected]>
Added a new feature bit to all applications to send the miss packets to parent PF.
--- drivers/net/bnxt/tf_ulp/bnxt_ulp_utils.h | 9 ++++++++- drivers/net/bnxt/tf_ulp/ulp_template_db_enum.h | 4 +++- 2 files changed, 11 insertions(+), 2 deletions(-)
drivers/net/bnxt/tf_ulp/bnxt_ulp_utils.h +8 -1
@@ -1039,11 +1039,16 @@ bnxt_ulp_cap_feat_process(uint64_t feat_bits, uint64_t *out_bits)uint64_t bit =0 ;#endif *out_bits =0 ; +if ((feat_bits | bit) != feat_bits) {BNXT_DRV_DBG (ERR ,"Invalid TF feature bit is set %" PRIu64"\n" , bit);return -EINVAL ; } + +if (!bit) +return 0 ; +if ((bit &BNXT_ULP_FEATURE_BIT_PARENT_DMAC ) && (bit &BNXT_ULP_FEATURE_BIT_PORT_DMAC )) {BNXT_DRV_DBG (ERR ,"Invalid both Port and Parent Mac set\n" );
@@ -1068,8 +1073,10 @@ bnxt_ulp_cap_feat_process(uint64_t feat_bits, uint64_t *out_bits)BNXT_DRV_DBG (ERR ,"Non VFR Feature is enabled" );if (bit &BNXT_ULP_FEATURE_BIT_UNICAST_ONLY )BNXT_DRV_DBG (ERR ,"Unicast only Feature is enabled" ); - +if (bit &BNXT_ULP_FEATURE_BIT_RX_MISS_SEND_TO_PF ) +BNXT_DRV_DBG (ERR ,"Rx miss send to parent PF Feature is enabled" ); *out_bits = bit; +return 0 ; }
drivers/net/bnxt/tf_ulp/ulp_template_db_enum.h +3 -1
@@ -915,7 +915,9 @@ enum bnxt_ulp_feature_bit {BNXT_ULP_FEATURE_BIT_HOT_UPGRADE =0x00000040 ,BNXT_ULP_FEATURE_BIT_GLOBAL_TBL_SCOPE =0x00000080 ,BNXT_ULP_FEATURE_BIT_NON_VFR_MODE =0x00000100 , -BNXT_ULP_FEATURE_BIT_UNICAST_ONLY =0x00000200 +BNXT_ULP_FEATURE_BIT_UNICAST_ONLY =0x00000200 , +BNXT_ULP_FEATURE_BIT_REDIRECT_ONLY =0x00000400 , +BNXT_ULP_FEATURE_BIT_RX_MISS_SEND_TO_PF =0x00000800 }; enum bnxt_ulp_flow_dir_bitmask {
Signature · 1 line
2.39.5 (Apple Git-154)
PATCH v4 56/57 net/bnxt: add support for truflow promiscuous mode
In reply to Manish KurupFrom: Kishore Padmanabha <[email protected]>
The truflow application support promiscuous mode to enable or disable receiving the packets with unknown destination mac addresses.
--- drivers/net/bnxt/bnxt_ethdev.c | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-)
drivers/net/bnxt/bnxt_ethdev.c +13 -2
@@ -2161,9 +2161,15 @@ static int bnxt_promiscuous_enable_op(struct rte_eth_dev *eth_dev) old_flags = vnic->flags; vnic->flags |=BNXT_VNIC_INFO_PROMISC ; rc =bnxt_hwrm_cfa_l2_set_rx_mask (bp, vnic,0 ,NULL ); -if (rc !=0 ) +if (rc !=0 ) { vnic->flags = old_flags; - +return rc; + } + rc =bnxt_ulp_promisc_mode_set (bp,1 ); +if (rc !=0 ) { + vnic->flags = old_flags; + rc =bnxt_hwrm_cfa_l2_set_rx_mask (bp, vnic,0 ,NULL ); + }return rc; }
@@ -2185,6 +2191,11 @@ static int bnxt_promiscuous_disable_op(struct rte_eth_dev *eth_dev)if (bp->vnic_info ==NULL )return 0 ; +if (bnxt_ulp_promisc_mode_set (bp,0 )) { +PMD_DRV_LOG_LINE (ERR ,"Unable to disable promiscuous mode" ); +return -EINVAL ; + } + vnic =bnxt_get_default_vnic (bp); old_flags = vnic->flags;
Signature · 1 line
2.39.5 (Apple Git-154)
PATCH v4 57/57 net/bnxt/tf_ulp: remove Truflow DEBUG code
In reply to Manish KurupThis commit cleans up TruFlow debug/non-production prints
--- drivers/net/bnxt/bnxt_hwrm.c | 23 ------- drivers/net/bnxt/tf_ulp/bnxt_tf_common.h | 5 -- drivers/net/bnxt/tf_ulp/bnxt_tf_pmd_shim.c | 6 -- drivers/net/bnxt/tf_ulp/bnxt_ulp_tf.c | 5 -- drivers/net/bnxt/tf_ulp/ulp_alloc_tbl.c | 4 -- drivers/net/bnxt/tf_ulp/ulp_def_rules.c | 6 -- drivers/net/bnxt/tf_ulp/ulp_flow_db.c | 6 -- drivers/net/bnxt/tf_ulp/ulp_mapper.c | 38 ------------ drivers/net/bnxt/tf_ulp/ulp_mapper_tf.c | 71 ---------------------- drivers/net/bnxt/tf_ulp/ulp_mapper_tfc.c | 71 ---------------------- drivers/net/bnxt/tf_ulp/ulp_matcher.c | 9 --- 11 files changed, 244 deletions(-)
drivers/net/bnxt/bnxt_hwrm.c +0 -23
@@ -2868,29 +2868,6 @@ static uint32_t bnxt_sanitize_rss_type(struct bnxt *bp, uint32_t types)return hwrm_type; } -#ifdef RTE_LIBRTE_BNXT_TRUFLOW_DEBUG -static int -bnxt_hwrm_vnic_rss_qcfg_p5 (struct bnxt *bp) -{ -struct hwrm_vnic_rss_qcfg_output *resp = bp->hwrm_cmd_resp_addr; -struct hwrm_vnic_rss_qcfg_input req = {0 }; -int rc; - -HWRM_PREP (&req,HWRM_VNIC_RSS_QCFG ,BNXT_USE_CHIMP_MB ); -/* vnic_id and rss_ctx_idx must be set to INVALID to read the -* global hash mode. -*/ - req.vnic_id =rte_cpu_to_le_16 (BNXT_DFLT_VNIC_ID_INVALID ); - req.rss_ctx_idx =rte_cpu_to_le_16 (BNXT_RSS_CTX_IDX_INVALID ); - rc =bnxt_hwrm_send_message (bp, &req,sizeof (req), -BNXT_USE_CHIMP_MB ); -HWRM_CHECK_RESULT (); -HWRM_UNLOCK (); -PMD_DRV_LOG_LINE (DEBUG ,"RSS QCFG: Hash level %d" , resp->hash_mode_flags); - -return rc; -} -#endif static int bnxt_hwrm_vnic_rss_cfg_p5 (struct bnxt *bp,struct bnxt_vnic_info *vnic)
drivers/net/bnxt/tf_ulp/bnxt_tf_common.h +0 -5
@@ -14,11 +14,6 @@#define BNXT_DRV_DBG (lvl, fmt, ...) \ RTE_LOG(lvl, BNXT, "%s(): " fmt, __func__, ## __VA_ARGS__) -#ifdef RTE_LIBRTE_BNXT_TRUFLOW_DEBUG -#define BNXT_DRV_INF (fmt, ...) RTE_LOG(INFO, fmt, ## __VA_ARGS__) -#else -#define BNXT_DRV_INF (fmt, ...) -#endif #define BNXT_ULP_EM_FLOWS 8192#define BNXT_ULP_1M_FLOWS 1000000
drivers/net/bnxt/tf_ulp/bnxt_tf_pmd_shim.c +0 -6
@@ -16,9 +16,6 @@#include "bnxt_hwrm.h" #include "bnxt_tf_common.h" #include "bnxt_tf_pmd_shim.h" -#ifdef RTE_LIBRTE_BNXT_TRUFLOW_DEBUG -#include "ulp_template_debug_proto.h" -#endif int
@@ -617,9 +614,6 @@ bnxt_pmd_global_tunnel_set(struct bnxt_ulp_context *ulp_ctx, port_id, rc);return rc; } -#ifdef RTE_LIBRTE_BNXT_TRUFLOW_DEBUG -ulp_mapper_global_register_tbl_dump (type, udp_port); -#endif if (udp_port)bnxt_pmd_global_reg_data_to_hndl (port_id, lupar_id, type, udp_port, handle);
drivers/net/bnxt/tf_ulp/bnxt_ulp_tf.c +0 -5
@@ -948,11 +948,6 @@ ulp_tf_eem_tbl_scope_init(struct bnxt *bp)return rc; } -#ifdef RTE_LIBRTE_BNXT_TRUFLOW_DEBUG -BNXT_DRV_DBG (DEBUG ,"TableScope=0x%0x %d\n" , - params.tbl_scope_id, - params.tbl_scope_id); -#endif rc =bnxt_ulp_cntxt_tbl_scope_id_set (bp->ulp_ctx, params.tbl_scope_id);if (rc) {
drivers/net/bnxt/tf_ulp/ulp_alloc_tbl.c +0 -4
@@ -10,10 +10,6 @@#include "ulp_alloc_tbl.h" #include "bnxt_ulp_utils.h" -#ifdef RTE_LIBRTE_BNXT_TRUFLOW_DEBUG -#include "ulp_template_debug_proto.h" -#include "ulp_tf_debug.h" -#endif /* Retrieve the allocator table initialization parameters for the tbl_idx */ static const struct bnxt_ulp_allocator_tbl_params*
drivers/net/bnxt/tf_ulp/ulp_def_rules.c +0 -6
@@ -960,12 +960,6 @@ bnxt_ulp_grp_miss_act_set(struct rte_eth_dev *dev,/* Perform the rte flow post process */ bnxt_ulp_rte_parser_post_process (¶ms); -#ifdef RTE_LIBRTE_BNXT_TRUFLOW_DEBUG -#ifdef RTE_LIBRTE_BNXT_TRUFLOW_DEBUG_PARSER -/* Dump the rte flow action */ -ulp_parser_act_info_dump (¶ms); -#endif -#endif ret =ulp_matcher_action_match (¶ms, ¶ms.act_tmpl);if (unlikely (ret !=BNXT_TF_RC_SUCCESS ))
drivers/net/bnxt/tf_ulp/ulp_flow_db.c +0 -6
@@ -532,9 +532,6 @@ ulp_flow_db_fid_alloc(struct bnxt_ulp_context *ulp_ctxt,if (flow_type ==BNXT_ULP_FDB_TYPE_REGULAR )ulp_flow_db_func_id_set (flow_db, *fid, func_id); -#ifdef RTE_LIBRTE_BNXT_TRUFLOW_DEBUG -BNXT_DRV_DBG (DEBUG ,"flow_id = %u:%u allocated\n" , flow_type, *fid); -#endif /* return success */ return 0 ; }
@@ -805,9 +802,6 @@ ulp_flow_db_fid_free(struct bnxt_ulp_context *ulp_ctxt,if (flow_type ==BNXT_ULP_FDB_TYPE_REGULAR )ulp_flow_db_func_id_set (flow_db, fid,0 ); -#ifdef RTE_LIBRTE_BNXT_TRUFLOW_DEBUG -BNXT_DRV_DBG (DEBUG ,"flow_id = %u:%u freed\n" , flow_type, fid); -#endif /* all good, return success */ return 0 ; }
drivers/net/bnxt/tf_ulp/ulp_mapper.c +0 -38
@@ -653,12 +653,6 @@ ulp_mapper_priority_opc_process(struct bnxt_ulp_mapper_parms *parms, rc = -EINVAL ;break ; } -#ifdef RTE_LIBRTE_BNXT_TRUFLOW_DEBUG -#ifdef RTE_LIBRTE_BNXT_TRUFLOW_DEBUG_MAPPER -if (!rc) -BNXT_DRV_DBG (DEBUG ,"Tcam priority = 0x%x\n" , *priority); -#endif -#endif return rc; }
@@ -1504,13 +1498,6 @@ ulp_mapper_key_recipe_alloc(struct bnxt_ulp_context *ulp_ctx,BNXT_DRV_DBG (ERR ,"Unable to alloc key recipe\n" );return NULL ; } -#ifdef RTE_LIBRTE_BNXT_TRUFLOW_DEBUG -#ifdef RTE_LIBRTE_BNXT_TRUFLOW_DEBUG_MAPPER -BNXT_DRV_INF ("Alloc key recipe [%s]:[%s] = 0x%X\n" , - (dir ==BNXT_ULP_DIRECTION_INGRESS ) ?"rx" :"tx" , -ulp_mapper_key_recipe_type_to_str (stype), recipe_id); -#endif -#endif }else if (alloc_only) {BNXT_DRV_DBG (ERR ,"Recipe ID (%d) already allocated\n" , recipe_id);
@@ -1554,13 +1541,6 @@ ulp_mapper_key_recipe_free(struct bnxt_ulp_context *ulp_ctx, }rte_free (recipes[index]); recipes[index] =NULL ; -#ifdef RTE_LIBRTE_BNXT_TRUFLOW_DEBUG -#ifdef RTE_LIBRTE_BNXT_TRUFLOW_DEBUG_MAPPER -BNXT_DRV_INF ("Free key recipe [%s]:[%s] = 0x%X\n" , - (dir ==BNXT_ULP_DIRECTION_INGRESS ) ?"rx" :"tx" , -ulp_mapper_key_recipe_type_to_str (stype), index); -#endif -#endif return 0 ; }
@@ -1768,13 +1748,6 @@ ulp_mapper_key_recipe_field_opc_process(struct bnxt_ulp_mapper_parms *parms, } } } -#ifdef RTE_LIBRTE_BNXT_TRUFLOW_DEBUG -#ifdef RTE_LIBRTE_BNXT_TRUFLOW_DEBUG_MAPPER -if (*written && is_key) -BNXT_DRV_DBG (DEBUG ,"%-20s bits = %-3d\n" , fld->description, - fld->field_bit_size); -#endif -#endif return rc; }
@@ -3064,11 +3037,6 @@ ulp_mapper_stats_cache_tbl_process(struct bnxt_ulp_mapper_parms *parms, rc);return rc; } -#ifdef RTE_LIBRTE_BNXT_TRUFLOW_DEBUG -#ifdef RTE_LIBRTE_BNXT_TRUFLOW_DEBUG_MAPPER -BNXT_DRV_DBG (DEBUG ,"flow id =0x%x\n" , parms->flow_id); -#endif -#endif return rc; }
@@ -4039,12 +4007,6 @@ ulp_mapper_func_info_process(struct bnxt_ulp_mapper_parms *parms, func_info->func_dst_opr);return -EINVAL ; } -#ifdef RTE_LIBRTE_BNXT_TRUFLOW_DEBUG -#ifdef RTE_LIBRTE_BNXT_TRUFLOW_DEBUG_MAPPER -BNXT_DRV_DBG (DEBUG ,"write the %" PRIX64 " into func_opc %u\n" , res, - func_info->func_dst_opr); -#endif -#endif return rc; }
drivers/net/bnxt/tf_ulp/ulp_mapper_tf.c +0 -71
149 lines not on this page · raw message
drivers/net/bnxt/tf_ulp/ulp_mapper_tfc.c +0 -71
143 lines not on this page · raw message
drivers/net/bnxt/tf_ulp/ulp_matcher.c +0 -9
@@ -225,12 +225,6 @@ ulp_matcher_pattern_match(struct ulp_rte_parser_params *params, error:BNXT_DRV_DBG (DEBUG ,"Did not find any matching template\n" ); -#ifdef RTE_LIBRTE_BNXT_TRUFLOW_DEBUG -BNXT_DRV_DBG (DEBUG , -"hid:%x,Hdr:%" PRIX64 " Fld:%" PRIX64 " SFl:%" PRIX64 "\n" , - class_match_idx, params->hdr_bitmap.bits, - params->fld_bitmap.bits, params->fld_s_bitmap.bits); -#endif *class_id =0 ;return BNXT_TF_RC_ERROR ; }
@@ -326,9 +320,6 @@ ulp_matcher_action_match(struct ulp_rte_parser_params *params,return BNXT_TF_RC_SUCCESS ; error:BNXT_DRV_DBG (DEBUG ,"Did not find any matching action template\n" ); -#ifdef RTE_LIBRTE_BNXT_TRUFLOW_DEBUG -BNXT_DRV_DBG (DEBUG ,"Hdr:%" PRIX64 "\n" , params->act_bitmap.bits); -#endif *act_id =0 ;return BNXT_TF_RC_ERROR ; }
Signature · 1 line
2.39.5 (Apple Git-154)