|
|
a6040a |
From 52bececea4d2327d842ee40e6c99388b6b3d8f93 Mon Sep 17 00:00:00 2001
|
|
|
a6040a |
Message-Id: <52bececea4d2327d842ee40e6c99388b6b3d8f93.1524241750.git.dcaratti@redhat.com>
|
|
|
a6040a |
In-Reply-To: <02bd8182658600ebf2cbe61168e80c19ce4cdaa5.1524241750.git.dcaratti@redhat.com>
|
|
|
a6040a |
References: <02bd8182658600ebf2cbe61168e80c19ce4cdaa5.1524241750.git.dcaratti@redhat.com>
|
|
|
a6040a |
From: Ajit Khaparde <ajit.khaparde@broadcom.com>
|
|
|
a6040a |
Date: Fri, 20 Apr 2018 07:22:01 -0700
|
|
|
a6040a |
Subject: [PATCH 2/3] net/bnxt: avoid invalid vnic id in set L2 Rx mask
|
|
|
a6040a |
|
|
|
a6040a |
In some cases bnxt_hwrm_cfa_l2_set_rx_mask is being called before
|
|
|
a6040a |
VNICs are allocated. The FW returns an error in such cases.
|
|
|
a6040a |
Move bnxt_init_nic to bnxt_dev_init such that the ids are initialized
|
|
|
a6040a |
to an invalid id.
|
|
|
a6040a |
Prevent sending the command to the FW only with a valid vnic id.
|
|
|
a6040a |
|
|
|
a6040a |
Fixes: 244bc98b0da7 ("net/bnxt: set L2 Rx mask")
|
|
|
a6040a |
Cc: stable@dpdk.org
|
|
|
a6040a |
|
|
|
a6040a |
Signed-off-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
|
|
|
a6040a |
---
|
|
|
a6040a |
drivers/net/bnxt/bnxt_ethdev.c | 7 ++-----
|
|
|
a6040a |
drivers/net/bnxt/bnxt_hwrm.c | 3 +++
|
|
|
a6040a |
2 files changed, 5 insertions(+), 5 deletions(-)
|
|
|
a6040a |
|
|
|
a6040a |
diff --git a/drivers/net/bnxt/bnxt_ethdev.c b/drivers/net/bnxt/bnxt_ethdev.c
|
|
|
a6040a |
index a133114a3..348129dad 100644
|
|
|
a6040a |
--- a/drivers/net/bnxt/bnxt_ethdev.c
|
|
|
a6040a |
+++ b/drivers/net/bnxt/bnxt_ethdev.c
|
|
|
a6040a |
@@ -395,10 +395,6 @@ static int bnxt_init_nic(struct bnxt *bp)
|
|
|
a6040a |
bnxt_init_vnics(bp);
|
|
|
a6040a |
bnxt_init_filters(bp);
|
|
|
a6040a |
|
|
|
a6040a |
- rc = bnxt_init_chip(bp);
|
|
|
a6040a |
- if (rc)
|
|
|
a6040a |
- return rc;
|
|
|
a6040a |
-
|
|
|
a6040a |
return 0;
|
|
|
a6040a |
}
|
|
|
a6040a |
|
|
|
a6040a |
@@ -594,7 +590,7 @@ static int bnxt_dev_start_op(struct rte_eth_dev *eth_dev)
|
|
|
a6040a |
}
|
|
|
a6040a |
bp->dev_stopped = 0;
|
|
|
a6040a |
|
|
|
a6040a |
- rc = bnxt_init_nic(bp);
|
|
|
a6040a |
+ rc = bnxt_init_chip(bp);
|
|
|
a6040a |
if (rc)
|
|
|
a6040a |
goto error;
|
|
|
a6040a |
|
|
|
a6040a |
@@ -3398,6 +3394,7 @@ bnxt_dev_init(struct rte_eth_dev *eth_dev)
|
|
|
a6040a |
goto error_free_int;
|
|
|
a6040a |
|
|
|
a6040a |
bnxt_enable_int(bp);
|
|
|
a6040a |
+ bnxt_init_nic(bp);
|
|
|
a6040a |
|
|
|
a6040a |
return 0;
|
|
|
a6040a |
|
|
|
a6040a |
diff --git a/drivers/net/bnxt/bnxt_hwrm.c b/drivers/net/bnxt/bnxt_hwrm.c
|
|
|
a6040a |
index 11204bf42..bc8773509 100644
|
|
|
a6040a |
--- a/drivers/net/bnxt/bnxt_hwrm.c
|
|
|
a6040a |
+++ b/drivers/net/bnxt/bnxt_hwrm.c
|
|
|
a6040a |
@@ -221,6 +221,9 @@ int bnxt_hwrm_cfa_l2_set_rx_mask(struct bnxt *bp,
|
|
|
a6040a |
struct hwrm_cfa_l2_set_rx_mask_output *resp = bp->hwrm_cmd_resp_addr;
|
|
|
a6040a |
uint32_t mask = 0;
|
|
|
a6040a |
|
|
|
a6040a |
+ if (vnic->fw_vnic_id == INVALID_HW_RING_ID)
|
|
|
a6040a |
+ return rc;
|
|
|
a6040a |
+
|
|
|
a6040a |
HWRM_PREP(req, CFA_L2_SET_RX_MASK);
|
|
|
a6040a |
req.vnic_id = rte_cpu_to_le_16(vnic->fw_vnic_id);
|
|
|
a6040a |
|
|
|
a6040a |
--
|
|
|
a6040a |
2.14.3
|
|
|
a6040a |
|