[v2,07/12] net/bnxt: handle default vnic change async event
diff mbox series

Message ID 20201010041153.63921-8-ajit.khaparde@broadcom.com
State Accepted
Delegated to: Ajit Khaparde
Headers show
Series
  • [v2,01/12] net/bnxt: fix the corruption of the session details
Related show

Checks

Context Check Description
ci/checkpatch success coding style OK

Commit Message

Ajit Khaparde Oct. 10, 2020, 4:11 a.m. UTC
From: Venkat Duvvuru <venkatkumar.duvvuru@broadcom.com>

Currently, we are only registering to this event if the function
is a trusted VF. This patch extends it for PFs as well.

Fixes: 322bd6e70272 ("net/bnxt: add port representor infrastructure")
Cc: stable@dpdk.org

Signed-off-by: Venkat Duvvuru <venkatkumar.duvvuru@broadcom.com>
Reviewed-by: Somnath Kotur <somnath.kotur@broadcom.com>
Reviewed-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
---
 drivers/net/bnxt/bnxt_cpr.c  | 7 ++-----
 drivers/net/bnxt/bnxt_hwrm.c | 2 +-
 2 files changed, 3 insertions(+), 6 deletions(-)

Patch
diff mbox series

diff --git a/drivers/net/bnxt/bnxt_cpr.c b/drivers/net/bnxt/bnxt_cpr.c
index 54923948f..91d1ffe46 100644
--- a/drivers/net/bnxt/bnxt_cpr.c
+++ b/drivers/net/bnxt/bnxt_cpr.c
@@ -50,7 +50,7 @@  static void
 bnxt_process_default_vnic_change(struct bnxt *bp,
 				 struct hwrm_async_event_cmpl *async_cmp)
 {
-	uint16_t fid, vnic_state, parent_id, vf_fid, vf_id;
+	uint16_t vnic_state, vf_fid, vf_id;
 	struct bnxt_representor *vf_rep_bp;
 	struct rte_eth_dev *eth_dev;
 	bool vfr_found = false;
@@ -67,10 +67,7 @@  bnxt_process_default_vnic_change(struct bnxt *bp,
 	if (vnic_state != BNXT_DEFAULT_VNIC_ALLOC)
 		return;
 
-	parent_id = (event_data & BNXT_DEFAULT_VNIC_CHANGE_PF_ID_MASK) >>
-			BNXT_DEFAULT_VNIC_CHANGE_PF_ID_SFT;
-	fid = BNXT_PF(bp) ? bp->fw_fid : bp->parent->fid;
-	if (parent_id != fid || !bp->rep_info)
+	if (!bp->rep_info)
 		return;
 
 	vf_fid = (event_data & BNXT_DEFAULT_VNIC_CHANGE_VF_ID_MASK) >>
diff --git a/drivers/net/bnxt/bnxt_hwrm.c b/drivers/net/bnxt/bnxt_hwrm.c
index 8133afc74..eef282b69 100644
--- a/drivers/net/bnxt/bnxt_hwrm.c
+++ b/drivers/net/bnxt/bnxt_hwrm.c
@@ -938,7 +938,7 @@  int bnxt_hwrm_func_driver_register(struct bnxt *bp)
 		req.async_event_fwd[1] |=
 			rte_cpu_to_le_32(ASYNC_CMPL_EVENT_ID_DBG_NOTIFICATION);
 
-	if (BNXT_VF_IS_TRUSTED(bp))
+	if (BNXT_PF(bp) || BNXT_VF_IS_TRUSTED(bp))
 		req.async_event_fwd[1] |=
 		rte_cpu_to_le_32(ASYNC_CMPL_EVENT_ID_DEFAULT_VNIC_CHANGE);