From: Kalesh A P <kalesh-anakkur.purayil@broadcom.com>
To: stable@dpdk.org
Subject: [dpdk-stable] [PATCH 18.11 1/5] net/bnxt: fix structure variable initialization
Date: Tue, 1 Dec 2020 09:09:26 +0530 [thread overview]
Message-ID: <20201201033930.17869-2-kalesh-anakkur.purayil@broadcom.com> (raw)
In-Reply-To: <20201201033930.17869-1-kalesh-anakkur.purayil@broadcom.com>
From: Kalesh AP <kalesh-anakkur.purayil@broadcom.com>
[ upstream commit ce41561d1b998d9e15f74f9c3a6aff78e0f99871 ]
During port start if bnxt_alloc_all_hwrm_stat_ctxs() fails,
in the cleanup path we do see errors like below:
bnxt_hwrm_ring_free(): hwrm_ring_free cp failed. rc:2
bnxt_hwrm_ring_free(): hwrm_ring_free rx failed. rc:2
The reason for this is in bnxt_free_all_hwrm_rings(), the check
is made against "ring->fw_ring_id != INVALID_HW_RING_ID" which
always return true as ring->fw_ring_id is not set to INVALID_HW_RING_ID
while initialising the ring structs.
Fixes: 6eb3cc2294fd ("net/bnxt: add initial Tx code")
Fixes: 2eb53b134aae ("net/bnxt: add initial Rx code")
Signed-off-by: Kalesh AP <kalesh-anakkur.purayil@broadcom.com>
Reviewed-by: Lance Richardson <lance.richardson@broadcom.com>
Reviewed-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
---
drivers/net/bnxt/bnxt_rxr.c | 3 +++
drivers/net/bnxt/bnxt_txr.c | 2 ++
2 files changed, 5 insertions(+)
diff --git a/drivers/net/bnxt/bnxt_rxr.c b/drivers/net/bnxt/bnxt_rxr.c
index a4234d1..433323b 100644
--- a/drivers/net/bnxt/bnxt_rxr.c
+++ b/drivers/net/bnxt/bnxt_rxr.c
@@ -695,6 +695,7 @@ int bnxt_init_rx_ring_struct(struct bnxt_rx_queue *rxq, unsigned int socket_id)
ring->bd_dma = rxr->rx_desc_mapping;
ring->vmem_size = ring->ring_size * sizeof(struct bnxt_sw_rx_bd);
ring->vmem = (void **)&rxr->rx_buf_ring;
+ ring->fw_ring_id = INVALID_HW_RING_ID;
cpr = rte_zmalloc_socket("bnxt_rx_ring",
sizeof(struct bnxt_cp_ring_info),
@@ -716,6 +717,7 @@ int bnxt_init_rx_ring_struct(struct bnxt_rx_queue *rxq, unsigned int socket_id)
ring->bd_dma = cpr->cp_desc_mapping;
ring->vmem_size = 0;
ring->vmem = NULL;
+ ring->fw_ring_id = INVALID_HW_RING_ID;
/* Allocate Aggregator rings */
ring = rte_zmalloc_socket("bnxt_rx_ring_struct",
@@ -731,6 +733,7 @@ int bnxt_init_rx_ring_struct(struct bnxt_rx_queue *rxq, unsigned int socket_id)
ring->bd_dma = rxr->ag_desc_mapping;
ring->vmem_size = ring->ring_size * sizeof(struct bnxt_sw_rx_bd);
ring->vmem = (void **)&rxr->ag_buf_ring;
+ ring->fw_ring_id = INVALID_HW_RING_ID;
return 0;
}
diff --git a/drivers/net/bnxt/bnxt_txr.c b/drivers/net/bnxt/bnxt_txr.c
index 348b111..449c729 100644
--- a/drivers/net/bnxt/bnxt_txr.c
+++ b/drivers/net/bnxt/bnxt_txr.c
@@ -79,6 +79,7 @@ int bnxt_init_tx_ring_struct(struct bnxt_tx_queue *txq, unsigned int socket_id)
ring->bd_dma = txr->tx_desc_mapping;
ring->vmem_size = ring->ring_size * sizeof(struct bnxt_sw_tx_bd);
ring->vmem = (void **)&txr->tx_buf_ring;
+ ring->fw_ring_id = INVALID_HW_RING_ID;
cpr = rte_zmalloc_socket("bnxt_tx_ring",
sizeof(struct bnxt_cp_ring_info),
@@ -99,6 +100,7 @@ int bnxt_init_tx_ring_struct(struct bnxt_tx_queue *txq, unsigned int socket_id)
ring->bd_dma = cpr->cp_desc_mapping;
ring->vmem_size = 0;
ring->vmem = NULL;
+ ring->fw_ring_id = INVALID_HW_RING_ID;
return 0;
}
--
2.10.1
next prev parent reply other threads:[~2020-12-01 3:25 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-12-01 3:39 [dpdk-stable] [PATCH 18.11 0/5] Backporting bnxt patches to 18.11 Kalesh A P
2020-12-01 3:39 ` Kalesh A P [this message]
2020-12-01 3:39 ` [dpdk-stable] [PATCH 18.11 2/5] net/bnxt: fix UDP tunnel port removal Kalesh A P
2020-12-01 3:39 ` [dpdk-stable] [PATCH 18.11 3/5] net/bnxt: fix boolean operator usage Kalesh A P
2020-12-01 3:39 ` [dpdk-stable] [PATCH 18.11 4/5] net/bnxt: fix drop enable in get Rx queue info Kalesh A P
2020-12-01 3:39 ` [dpdk-stable] [PATCH 18.11 5/5] net/bnxt: increase size of Rx CQ Kalesh A P
2020-12-02 14:50 ` [dpdk-stable] [PATCH 18.11 0/5] Backporting bnxt patches to 18.11 Kevin Traynor
2020-12-02 16:27 ` Kalesh Anakkur Purayil
2020-12-03 4:48 ` Somnath Kotur
2020-12-03 16:39 ` Kevin Traynor
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20201201033930.17869-2-kalesh-anakkur.purayil@broadcom.com \
--to=kalesh-anakkur.purayil@broadcom.com \
--cc=stable@dpdk.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).