From: Kalesh AP Date: Thu, 9 Jul 2020 09:38:30 +0000 (+0530) Subject: net/bnxt: fix unnecessary HWRM command X-Git-Url: http://git.droids-corp.org/?a=commitdiff_plain;h=f456684ac2afafc97106ab8d997c9aa477f6b15f;p=dpdk.git net/bnxt: fix unnecessary HWRM command During probe, driver issues HWRM_CFA_ADV_FLOW_MGNT_QCAPS command. But it is not using the command response anywhere which makes the fw call redundant. Remove the unnecessary HWRM_CFA_ADV_FLOW_MGNT_QCAPS call to fw. Remove the redundant flow_flags in bnxt struct. Fixes: afef822b2e1b ("net/bnxt: support creating SMAC and inner DMAC filters") Cc: stable@dpdk.org Signed-off-by: Kalesh AP Reviewed-by: Somnath Kotur Reviewed-by: Ajit Khaparde --- diff --git a/drivers/net/bnxt/bnxt.h b/drivers/net/bnxt/bnxt.h index 8325e87968..50f93ff5bf 100644 --- a/drivers/net/bnxt/bnxt.h +++ b/drivers/net/bnxt/bnxt.h @@ -638,8 +638,6 @@ struct bnxt { #define BNXT_FW_CAP_ADV_FLOW_COUNTERS BIT(6) #define BNXT_FW_CAP_HCOMM_FW_STATUS BIT(7) - uint32_t flow_flags; -#define BNXT_FLOW_FLAG_L2_HDR_SRC_FILTER_EN BIT(0) pthread_mutex_t flow_lock; uint32_t vnic_cap_flags; diff --git a/drivers/net/bnxt/bnxt_ethdev.c b/drivers/net/bnxt/bnxt_ethdev.c index 712de18696..318d6b33a5 100644 --- a/drivers/net/bnxt/bnxt_ethdev.c +++ b/drivers/net/bnxt/bnxt_ethdev.c @@ -5472,10 +5472,6 @@ static int bnxt_init_fw(struct bnxt *bp) bnxt_hwrm_port_phy_qcaps(bp); - rc = bnxt_hwrm_cfa_adv_flow_mgmt_qcaps(bp); - if (rc) - return rc; - bnxt_alloc_error_recovery_info(bp); /* Get the adapter error recovery support info */ rc = bnxt_hwrm_error_recovery_qcfg(bp); diff --git a/drivers/net/bnxt/bnxt_hwrm.c b/drivers/net/bnxt/bnxt_hwrm.c index 6ade32d1b2..f9c7461097 100644 --- a/drivers/net/bnxt/bnxt_hwrm.c +++ b/drivers/net/bnxt/bnxt_hwrm.c @@ -5320,38 +5320,6 @@ int bnxt_hwrm_port_ts_query(struct bnxt *bp, uint8_t path, uint64_t *timestamp) return rc; } -int bnxt_hwrm_cfa_adv_flow_mgmt_qcaps(struct bnxt *bp) -{ - struct hwrm_cfa_adv_flow_mgnt_qcaps_output *resp = - bp->hwrm_cmd_resp_addr; - struct hwrm_cfa_adv_flow_mgnt_qcaps_input req = {0}; - uint32_t flags = 0; - int rc = 0; - - if (!(bp->fw_cap & BNXT_FW_CAP_ADV_FLOW_MGMT)) - return rc; - - if (!(BNXT_PF(bp) || BNXT_VF_IS_TRUSTED(bp))) { - PMD_DRV_LOG(DEBUG, - "Not a PF or trusted VF. Command not supported\n"); - return 0; - } - - HWRM_PREP(&req, HWRM_CFA_ADV_FLOW_MGNT_QCAPS, BNXT_USE_KONG(bp)); - rc = bnxt_hwrm_send_message(bp, &req, sizeof(req), BNXT_USE_KONG(bp)); - - HWRM_CHECK_RESULT(); - flags = rte_le_to_cpu_32(resp->flags); - HWRM_UNLOCK(); - - if (flags & HWRM_CFA_ADV_FLOW_MGNT_QCAPS_L2_HDR_SRC_FILTER_EN) { - bp->flow_flags |= BNXT_FLOW_FLAG_L2_HDR_SRC_FILTER_EN; - PMD_DRV_LOG(INFO, "Source L2 header filtering enabled\n"); - } - - return rc; -} - int bnxt_hwrm_cfa_counter_qcaps(struct bnxt *bp, uint16_t *max_fc) { int rc = 0; diff --git a/drivers/net/bnxt/bnxt_hwrm.h b/drivers/net/bnxt/bnxt_hwrm.h index 9e0b79904d..1704eddba8 100644 --- a/drivers/net/bnxt/bnxt_hwrm.h +++ b/drivers/net/bnxt/bnxt_hwrm.h @@ -259,7 +259,6 @@ int bnxt_hwrm_error_recovery_qcfg(struct bnxt *bp); int bnxt_hwrm_fw_reset(struct bnxt *bp); int bnxt_hwrm_port_ts_query(struct bnxt *bp, uint8_t path, uint64_t *timestamp); -int bnxt_hwrm_cfa_adv_flow_mgmt_qcaps(struct bnxt *bp); int bnxt_hwrm_cfa_counter_qcaps(struct bnxt *bp, uint16_t *max_fc); int bnxt_hwrm_ctx_rgtr(struct bnxt *bp, rte_iova_t dma_addr, uint16_t *ctx_id); int bnxt_hwrm_ctx_unrgtr(struct bnxt *bp, uint16_t ctx_id);