[dpdk-stable] patch 'net/bnxt: avoid invalid vnic id in set L2 Rx mask' has been queued to LTS release 17.11.3

Yuanhan Liu yliu at fridaylinux.org
Sun May 6 08:36:33 CEST 2018


Hi,

FYI, your patch has been queued to LTS release 17.11.3

Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 05/09/18. So please
shout if anyone has objections.

Thanks.

	--yliu

---
>From f18d545e659b0ad798f4e9784bedf473bbed2ccb Mon Sep 17 00:00:00 2001
From: Ajit Khaparde <ajit.khaparde at broadcom.com>
Date: Fri, 20 Apr 2018 07:22:01 -0700
Subject: [PATCH] net/bnxt: avoid invalid vnic id in set L2 Rx mask

[ upstream commit 1b533790f44ee160bae86bdcc5307d7b52225726 ]

In some cases bnxt_hwrm_cfa_l2_set_rx_mask is being called before
VNICs are allocated. The FW returns an error in such cases.
Move bnxt_init_nic to bnxt_dev_init such that the ids are initialized
to an invalid id.
Prevent sending the command to the FW only with a valid vnic id.

Fixes: 244bc98b0da7 ("net/bnxt: set L2 Rx mask")

Signed-off-by: Ajit Khaparde <ajit.khaparde at broadcom.com>
---
 drivers/net/bnxt/bnxt_ethdev.c | 7 ++-----
 drivers/net/bnxt/bnxt_hwrm.c   | 3 +++
 2 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/drivers/net/bnxt/bnxt_ethdev.c b/drivers/net/bnxt/bnxt_ethdev.c
index 049afd0bf..b011f437f 100644
--- a/drivers/net/bnxt/bnxt_ethdev.c
+++ b/drivers/net/bnxt/bnxt_ethdev.c
@@ -400,10 +400,6 @@ static int bnxt_init_nic(struct bnxt *bp)
 	bnxt_init_vnics(bp);
 	bnxt_init_filters(bp);
 
-	rc = bnxt_init_chip(bp);
-	if (rc)
-		return rc;
-
 	return 0;
 }
 
@@ -573,7 +569,7 @@ static int bnxt_dev_start_op(struct rte_eth_dev *eth_dev)
 	}
 	bp->dev_stopped = 0;
 
-	rc = bnxt_init_nic(bp);
+	rc = bnxt_init_chip(bp);
 	if (rc)
 		goto error;
 
@@ -3058,6 +3054,7 @@ skip_init:
 		goto error_free_int;
 
 	bnxt_enable_int(bp);
+	bnxt_init_nic(bp);
 
 	return 0;
 
diff --git a/drivers/net/bnxt/bnxt_hwrm.c b/drivers/net/bnxt/bnxt_hwrm.c
index 120043d2f..5018d3511 100644
--- a/drivers/net/bnxt/bnxt_hwrm.c
+++ b/drivers/net/bnxt/bnxt_hwrm.c
@@ -252,6 +252,9 @@ int bnxt_hwrm_cfa_l2_set_rx_mask(struct bnxt *bp,
 	struct hwrm_cfa_l2_set_rx_mask_output *resp = bp->hwrm_cmd_resp_addr;
 	uint32_t mask = 0;
 
+	if (vnic->fw_vnic_id == INVALID_HW_RING_ID)
+		return rc;
+
 	HWRM_PREP(req, CFA_L2_SET_RX_MASK);
 	req.vnic_id = rte_cpu_to_le_16(vnic->fw_vnic_id);
 
-- 
2.11.0



More information about the stable mailing list