aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Chan <michael.chan@broadcom.com>2019-08-17 17:04:47 -0400
committerDavid S. Miller <davem@davemloft.net>2019-08-18 16:05:00 -0400
commita46ecb116fb7f722fa8cb2da01959c36e4e10c41 (patch)
treefcedd6fc439246e32b9c39273ae2372fea88cada
parentf1472cb09f11ddb41d4be84f0650835cb65a9073 (diff)
bnxt_en: Fix VNIC clearing logic for 57500 chips.
During device shutdown, the VNIC clearing sequence needs to be modified to free the VNIC first before freeing the RSS contexts. The current code is doing the reverse and we can get mis-directed RX completions to CP ring ID 0 when the RSS contexts are freed and zeroed. The clearing of RSS contexts is not required with the new sequence. Refactor the VNIC clearing logic into a new function bnxt_clear_vnic() and do the chip specific VNIC clearing sequence. Fixes: 7b3af4f75b81 ("bnxt_en: Add RSS support for 57500 chips.") Signed-off-by: Michael Chan <michael.chan@broadcom.com> Signed-off-by: David S. Miller <davem@davemloft.net>
-rw-r--r--drivers/net/ethernet/broadcom/bnxt/bnxt.c26
1 files changed, 18 insertions, 8 deletions
diff --git a/drivers/net/ethernet/broadcom/bnxt/bnxt.c b/drivers/net/ethernet/broadcom/bnxt/bnxt.c
index 7070349915bc..1ef224fbe302 100644
--- a/drivers/net/ethernet/broadcom/bnxt/bnxt.c
+++ b/drivers/net/ethernet/broadcom/bnxt/bnxt.c
@@ -7016,19 +7016,29 @@ static void bnxt_hwrm_clear_vnic_rss(struct bnxt *bp)
7016 bnxt_hwrm_vnic_set_rss(bp, i, false); 7016 bnxt_hwrm_vnic_set_rss(bp, i, false);
7017} 7017}
7018 7018
7019static void bnxt_hwrm_resource_free(struct bnxt *bp, bool close_path, 7019static void bnxt_clear_vnic(struct bnxt *bp)
7020 bool irq_re_init)
7021{ 7020{
7022 if (bp->vnic_info) { 7021 if (!bp->vnic_info)
7023 bnxt_hwrm_clear_vnic_filter(bp); 7022 return;
7023
7024 bnxt_hwrm_clear_vnic_filter(bp);
7025 if (!(bp->flags & BNXT_FLAG_CHIP_P5)) {
7024 /* clear all RSS setting before free vnic ctx */ 7026 /* clear all RSS setting before free vnic ctx */
7025 bnxt_hwrm_clear_vnic_rss(bp); 7027 bnxt_hwrm_clear_vnic_rss(bp);
7026 bnxt_hwrm_vnic_ctx_free(bp); 7028 bnxt_hwrm_vnic_ctx_free(bp);
7027 /* before free the vnic, undo the vnic tpa settings */
7028 if (bp->flags & BNXT_FLAG_TPA)
7029 bnxt_set_tpa(bp, false);
7030 bnxt_hwrm_vnic_free(bp);
7031 } 7029 }
7030 /* before free the vnic, undo the vnic tpa settings */
7031 if (bp->flags & BNXT_FLAG_TPA)
7032 bnxt_set_tpa(bp, false);
7033 bnxt_hwrm_vnic_free(bp);
7034 if (bp->flags & BNXT_FLAG_CHIP_P5)
7035 bnxt_hwrm_vnic_ctx_free(bp);
7036}
7037
7038static void bnxt_hwrm_resource_free(struct bnxt *bp, bool close_path,
7039 bool irq_re_init)
7040{
7041 bnxt_clear_vnic(bp);
7032 bnxt_hwrm_ring_free(bp, close_path); 7042 bnxt_hwrm_ring_free(bp, close_path);
7033 bnxt_hwrm_ring_grp_free(bp); 7043 bnxt_hwrm_ring_grp_free(bp);
7034 if (irq_re_init) { 7044 if (irq_re_init) {