* [dpdk-dev] [PATCH 0/7] bnxt patchset with bug fixes
@ 2020-02-06 16:33 Kalesh A P
2020-02-06 16:33 ` [dpdk-dev] [PATCH 1/7] net/bnxt: avoid an unnecessary delay in port stop Kalesh A P
` (7 more replies)
0 siblings, 8 replies; 17+ messages in thread
From: Kalesh A P @ 2020-02-06 16:33 UTC (permalink / raw)
To: dev; +Cc: ferruh.yigit, ajit.khaparde
From: Kalesh AP <kalesh-anakkur.purayil@broadcom.com>
Please apply.
Kalesh AP (5):
net/bnxt: avoid an unnecessary delay in port stop
net/bnxt: log firmware debug notifications
net/bnxt: register for debug notification async event from fw
net/bnxt: fix to call port stop when error recovery fails
net/bnxt: move locally used functions to static
Rahul Gupta (1):
net/bnxt: fix default timeout for ver_get command
Santoshkumar Karanappa Rastapur (1):
net/bnxt: fix buffer allocation reattempt logic
drivers/net/bnxt/bnxt.h | 7 ++++---
drivers/net/bnxt/bnxt_cpr.c | 5 +++++
drivers/net/bnxt/bnxt_ethdev.c | 17 ++++++++++-------
drivers/net/bnxt/bnxt_hwrm.c | 29 +++++++++++++++++------------
drivers/net/bnxt/bnxt_hwrm.h | 9 +++------
drivers/net/bnxt/bnxt_rxr.c | 7 ++++---
6 files changed, 43 insertions(+), 31 deletions(-)
--
2.10.1
^ permalink raw reply [flat|nested] 17+ messages in thread
* [dpdk-dev] [PATCH 1/7] net/bnxt: avoid an unnecessary delay in port stop
2020-02-06 16:33 [dpdk-dev] [PATCH 0/7] bnxt patchset with bug fixes Kalesh A P
@ 2020-02-06 16:33 ` Kalesh A P
2020-02-06 16:33 ` [dpdk-dev] [PATCH 2/7] net/bnxt: fix default timeout for ver_get command Kalesh A P
` (6 subsequent siblings)
7 siblings, 0 replies; 17+ messages in thread
From: Kalesh A P @ 2020-02-06 16:33 UTC (permalink / raw)
To: dev; +Cc: ferruh.yigit, ajit.khaparde
From: Kalesh AP <kalesh-anakkur.purayil@broadcom.com>
VFs and multifunction PFs do not have the privilege to change
link configuration. We force the physical link down as a part
of device stop only for single physical function(SPF).
This change also helps in eliminating the logs when a VF port
is stopped:
"Port 0: link state change event"
"bnxt_print_link_info(): Port 0 Link Up - speed 25000 Mbps - full-duplex"
Cc: stable@dpdk.org
Signed-off-by: Kalesh AP <kalesh-anakkur.purayil@broadcom.com>
Reviewed-by: Somnath Kotur <somnath.kotur@broadcom.com>
Reviewed-by: Ajit Kumar Khaparde <ajit.khaparde@broadcom.com>
---
drivers/net/bnxt/bnxt_ethdev.c | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/drivers/net/bnxt/bnxt_ethdev.c b/drivers/net/bnxt/bnxt_ethdev.c
index c1cb401..5378209 100644
--- a/drivers/net/bnxt/bnxt_ethdev.c
+++ b/drivers/net/bnxt/bnxt_ethdev.c
@@ -948,9 +948,10 @@ static void bnxt_dev_stop_op(struct rte_eth_dev *eth_dev)
bnxt_dev_set_link_down_op(eth_dev);
/* Wait for link to be reset and the async notification to process.
- * During reset recovery, there is no need to wait
+ * During reset recovery, there is no need to wait and
+ * VF/NPAR functions do not have privilege to change PHY config.
*/
- if (!is_bnxt_in_error(bp))
+ if (!is_bnxt_in_error(bp) && BNXT_SINGLE_PF(bp))
bnxt_link_update(eth_dev, 1, ETH_LINK_DOWN);
/* Clean queue intr-vector mapping */
--
2.10.1
^ permalink raw reply [flat|nested] 17+ messages in thread
* [dpdk-dev] [PATCH 2/7] net/bnxt: fix default timeout for ver_get command
2020-02-06 16:33 [dpdk-dev] [PATCH 0/7] bnxt patchset with bug fixes Kalesh A P
2020-02-06 16:33 ` [dpdk-dev] [PATCH 1/7] net/bnxt: avoid an unnecessary delay in port stop Kalesh A P
@ 2020-02-06 16:33 ` Kalesh A P
2020-02-06 16:33 ` [dpdk-dev] [PATCH 3/7] net/bnxt: log firmware debug notifications Kalesh A P
` (5 subsequent siblings)
7 siblings, 0 replies; 17+ messages in thread
From: Kalesh A P @ 2020-02-06 16:33 UTC (permalink / raw)
To: dev; +Cc: ferruh.yigit, ajit.khaparde
From: Rahul Gupta <rahul.gupta@broadcom.com>
Initially when driver is loading, there is no HWRM timeout configured
by FW, the VER_GET command needs use default timeout as 500ms and
while recovering from fatal/non-fatal FW error, it should use timeout
as 50ms.
Fixes: 458f0360e8dc ("net/bnxt: get default HWRM command timeout from FW")
Cc: stable@dpdk.org
Signed-off-by: Rahul Gupta <rahul.gupta@broadcom.com>
Reviewed-by: Kalesh Anakkur Purayil <kalesh-anakkur.purayil@broadcom.com>
Reviewed-by: Somnath Kotur <somnath.kotur@broadcom.com>
---
drivers/net/bnxt/bnxt.h | 6 ++++--
drivers/net/bnxt/bnxt_ethdev.c | 4 ++--
drivers/net/bnxt/bnxt_hwrm.c | 11 ++++-------
drivers/net/bnxt/bnxt_hwrm.h | 2 +-
4 files changed, 11 insertions(+), 12 deletions(-)
diff --git a/drivers/net/bnxt/bnxt.h b/drivers/net/bnxt/bnxt.h
index 68786a8..e8a30fa 100644
--- a/drivers/net/bnxt/bnxt.h
+++ b/drivers/net/bnxt/bnxt.h
@@ -606,8 +606,10 @@ struct bnxt {
uint16_t max_resp_len;
uint16_t hwrm_max_ext_req_len;
- /* default command timeout value of 50ms */
-#define HWRM_CMD_TIMEOUT 50000
+ /* default command timeout value of 500ms */
+#define DFLT_HWRM_CMD_TIMEOUT 500000
+ /* short command timeout value of 50ms */
+#define SHORT_HWRM_CMD_TIMEOUT 50000
/* default HWRM request timeout value */
uint32_t hwrm_cmd_timeout;
diff --git a/drivers/net/bnxt/bnxt_ethdev.c b/drivers/net/bnxt/bnxt_ethdev.c
index 5378209..7147cc8 100644
--- a/drivers/net/bnxt/bnxt_ethdev.c
+++ b/drivers/net/bnxt/bnxt_ethdev.c
@@ -3998,7 +3998,7 @@ static void bnxt_dev_recover(void *arg)
bp->flags &= ~BNXT_FLAG_FATAL_ERROR;
do {
- rc = bnxt_hwrm_ver_get(bp);
+ rc = bnxt_hwrm_ver_get(bp, SHORT_HWRM_CMD_TIMEOUT);
if (rc == 0)
break;
rte_delay_ms(BNXT_FW_READY_WAIT_INTERVAL);
@@ -4688,7 +4688,7 @@ static int bnxt_init_fw(struct bnxt *bp)
bp->fw_cap = 0;
- rc = bnxt_hwrm_ver_get(bp);
+ rc = bnxt_hwrm_ver_get(bp, DFLT_HWRM_CMD_TIMEOUT);
if (rc)
return rc;
diff --git a/drivers/net/bnxt/bnxt_hwrm.c b/drivers/net/bnxt/bnxt_hwrm.c
index f325aff..96b3431 100644
--- a/drivers/net/bnxt/bnxt_hwrm.c
+++ b/drivers/net/bnxt/bnxt_hwrm.c
@@ -100,11 +100,7 @@ static int bnxt_hwrm_send_message(struct bnxt *bp, void *msg,
if (bp->flags & BNXT_FLAG_FATAL_ERROR)
return 0;
- /* For VER_GET command, set timeout as 50ms */
- if (rte_cpu_to_le_16(req->req_type) == HWRM_VER_GET)
- timeout = HWRM_CMD_TIMEOUT;
- else
- timeout = bp->hwrm_cmd_timeout;
+ timeout = bp->hwrm_cmd_timeout;
if (bp->flags & BNXT_FLAG_SHORT_CMD ||
msg_len > bp->max_req_len) {
@@ -949,7 +945,7 @@ int bnxt_hwrm_func_resc_qcaps(struct bnxt *bp)
return rc;
}
-int bnxt_hwrm_ver_get(struct bnxt *bp)
+int bnxt_hwrm_ver_get(struct bnxt *bp, uint32_t timeout)
{
int rc = 0;
struct hwrm_ver_get_input req = {.req_type = 0 };
@@ -960,6 +956,7 @@ int bnxt_hwrm_ver_get(struct bnxt *bp)
uint32_t dev_caps_cfg;
bp->max_req_len = HWRM_MAX_REQ_LEN;
+ bp->hwrm_cmd_timeout = timeout;
HWRM_PREP(req, VER_GET, BNXT_USE_CHIMP_MB);
req.hwrm_intf_maj = HWRM_VERSION_MAJOR;
@@ -994,7 +991,7 @@ int bnxt_hwrm_ver_get(struct bnxt *bp)
/* convert timeout to usec */
bp->hwrm_cmd_timeout *= 1000;
if (!bp->hwrm_cmd_timeout)
- bp->hwrm_cmd_timeout = HWRM_CMD_TIMEOUT;
+ bp->hwrm_cmd_timeout = DFLT_HWRM_CMD_TIMEOUT;
if (resp->hwrm_intf_maj_8b != HWRM_VERSION_MAJOR) {
PMD_DRV_LOG(ERR, "Unsupported firmware API version\n");
diff --git a/drivers/net/bnxt/bnxt_hwrm.h b/drivers/net/bnxt/bnxt_hwrm.h
index d8d1360..2753720 100644
--- a/drivers/net/bnxt/bnxt_hwrm.h
+++ b/drivers/net/bnxt/bnxt_hwrm.h
@@ -120,7 +120,7 @@ int bnxt_hwrm_stat_ctx_free(struct bnxt *bp,
int bnxt_hwrm_ctx_qstats(struct bnxt *bp, uint32_t cid, int idx,
struct rte_eth_stats *stats, uint8_t rx);
-int bnxt_hwrm_ver_get(struct bnxt *bp);
+int bnxt_hwrm_ver_get(struct bnxt *bp, uint32_t timeout);
int bnxt_hwrm_vnic_alloc(struct bnxt *bp, struct bnxt_vnic_info *vnic);
int bnxt_hwrm_vnic_cfg(struct bnxt *bp, struct bnxt_vnic_info *vnic);
--
2.10.1
^ permalink raw reply [flat|nested] 17+ messages in thread
* [dpdk-dev] [PATCH 3/7] net/bnxt: log firmware debug notifications
2020-02-06 16:33 [dpdk-dev] [PATCH 0/7] bnxt patchset with bug fixes Kalesh A P
2020-02-06 16:33 ` [dpdk-dev] [PATCH 1/7] net/bnxt: avoid an unnecessary delay in port stop Kalesh A P
2020-02-06 16:33 ` [dpdk-dev] [PATCH 2/7] net/bnxt: fix default timeout for ver_get command Kalesh A P
@ 2020-02-06 16:33 ` Kalesh A P
2020-02-06 16:33 ` [dpdk-dev] [PATCH 4/7] net/bnxt: register for debug notification async event from fw Kalesh A P
` (4 subsequent siblings)
7 siblings, 0 replies; 17+ messages in thread
From: Kalesh A P @ 2020-02-06 16:33 UTC (permalink / raw)
To: dev; +Cc: ferruh.yigit, ajit.khaparde
From: Kalesh AP <kalesh-anakkur.purayil@broadcom.com>
The debug notifications are not functional in nature, they should
only have diagnostic value. Other than logging to system log,
drivers shall not take any other functional action based on this
async event.
Signed-off-by: Kalesh AP <kalesh-anakkur.purayil@broadcom.com>
Reviewed-by: Somnath Kotur <somnath.kotur@broadcom.com>
Reviewed-by: Ajit Kumar Khaparde <ajit.khaparde@broadcom.com>
---
drivers/net/bnxt/bnxt_cpr.c | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/drivers/net/bnxt/bnxt_cpr.c b/drivers/net/bnxt/bnxt_cpr.c
index bb316b9..0f7b5e9 100644
--- a/drivers/net/bnxt/bnxt_cpr.c
+++ b/drivers/net/bnxt/bnxt_cpr.c
@@ -133,6 +133,11 @@ void bnxt_handle_async_event(struct bnxt *bp,
bnxt_schedule_fw_health_check(bp);
break;
+ case HWRM_ASYNC_EVENT_CMPL_EVENT_ID_DEBUG_NOTIFICATION:
+ PMD_DRV_LOG(INFO, "DNC event: evt_data1 %#x evt_data2 %#x\n",
+ rte_le_to_cpu_32(async_cmp->event_data1),
+ rte_le_to_cpu_32(async_cmp->event_data2));
+ break;
default:
PMD_DRV_LOG(DEBUG, "handle_async_event id = 0x%x\n", event_id);
break;
--
2.10.1
^ permalink raw reply [flat|nested] 17+ messages in thread
* [dpdk-dev] [PATCH 4/7] net/bnxt: register for debug notification async event from fw
2020-02-06 16:33 [dpdk-dev] [PATCH 0/7] bnxt patchset with bug fixes Kalesh A P
` (2 preceding siblings ...)
2020-02-06 16:33 ` [dpdk-dev] [PATCH 3/7] net/bnxt: log firmware debug notifications Kalesh A P
@ 2020-02-06 16:33 ` Kalesh A P
2020-02-06 16:33 ` [dpdk-dev] [PATCH 5/7] net/bnxt: fix to call port stop when error recovery fails Kalesh A P
` (3 subsequent siblings)
7 siblings, 0 replies; 17+ messages in thread
From: Kalesh A P @ 2020-02-06 16:33 UTC (permalink / raw)
To: dev; +Cc: ferruh.yigit, ajit.khaparde
From: Kalesh AP <kalesh-anakkur.purayil@broadcom.com>
PF driver has to register for the debug notification async event
with firmware in the HWRM_FUNC_DRV_RGTR command.
Signed-off-by: Kalesh AP <kalesh-anakkur.purayil@broadcom.com>
Reviewed-by: Ajit Kumar Khaparde <ajit.khaparde@broadcom.com>
---
drivers/net/bnxt/bnxt_hwrm.c | 3 +++
drivers/net/bnxt/bnxt_hwrm.h | 2 ++
2 files changed, 5 insertions(+)
diff --git a/drivers/net/bnxt/bnxt_hwrm.c b/drivers/net/bnxt/bnxt_hwrm.c
index 96b3431..4d99d82 100644
--- a/drivers/net/bnxt/bnxt_hwrm.c
+++ b/drivers/net/bnxt/bnxt_hwrm.c
@@ -814,6 +814,9 @@ int bnxt_hwrm_func_driver_register(struct bnxt *bp)
req.async_event_fwd[1] |=
rte_cpu_to_le_32(ASYNC_CMPL_EVENT_ID_PF_DRVR_UNLOAD |
ASYNC_CMPL_EVENT_ID_VF_CFG_CHANGE);
+ if (BNXT_PF(bp))
+ req.async_event_fwd[1] |=
+ rte_cpu_to_le_32(ASYNC_CMPL_EVENT_ID_DBG_NOTIFICATION);
rc = bnxt_hwrm_send_message(bp, &req, sizeof(req), BNXT_USE_CHIMP_MB);
diff --git a/drivers/net/bnxt/bnxt_hwrm.h b/drivers/net/bnxt/bnxt_hwrm.h
index 2753720..56a851b 100644
--- a/drivers/net/bnxt/bnxt_hwrm.h
+++ b/drivers/net/bnxt/bnxt_hwrm.h
@@ -31,6 +31,8 @@ struct bnxt_cp_ring_info;
(1 << (HWRM_ASYNC_EVENT_CMPL_EVENT_ID_PF_DRVR_UNLOAD - 32))
#define ASYNC_CMPL_EVENT_ID_VF_CFG_CHANGE \
(1 << (HWRM_ASYNC_EVENT_CMPL_EVENT_ID_VF_CFG_CHANGE - 32))
+#define ASYNC_CMPL_EVENT_ID_DBG_NOTIFICATION \
+ (1 << (HWRM_ASYNC_EVENT_CMPL_EVENT_ID_DEBUG_NOTIFICATION - 32))
#define HWRM_QUEUE_SERVICE_PROFILE_LOSSY \
HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID0_SERVICE_PROFILE_LOSSY
--
2.10.1
^ permalink raw reply [flat|nested] 17+ messages in thread
* [dpdk-dev] [PATCH 5/7] net/bnxt: fix to call port stop when error recovery fails
2020-02-06 16:33 [dpdk-dev] [PATCH 0/7] bnxt patchset with bug fixes Kalesh A P
` (3 preceding siblings ...)
2020-02-06 16:33 ` [dpdk-dev] [PATCH 4/7] net/bnxt: register for debug notification async event from fw Kalesh A P
@ 2020-02-06 16:33 ` Kalesh A P
2020-02-06 16:33 ` [dpdk-dev] [PATCH 6/7] net/bnxt: move locally used functions to static Kalesh A P
` (2 subsequent siblings)
7 siblings, 0 replies; 17+ messages in thread
From: Kalesh A P @ 2020-02-06 16:33 UTC (permalink / raw)
To: dev; +Cc: ferruh.yigit, ajit.khaparde
From: Kalesh AP <kalesh-anakkur.purayil@broadcom.com>
During live FW upgrade or error recovery, if restoring the filter
settings fail after port start, driver invokes bnxt_uninit_resources()
only. Fix it to invoke bnxt_dev_stop_op() first before calling
bnxt_uninit_resources().
Fixes: df6cd7c1f73a ("net/bnxt: handle reset notify async event from FW")
Cc: stable@dpdk.org
Signed-off-by: Kalesh AP <kalesh-anakkur.purayil@broadcom.com>
Reviewed-by: Somnath Kotur <somnath.kotur@broadcom.com>
Reviewed-by: Rahul Gupta <rahul.gupta@broadcom.com>
---
drivers/net/bnxt/bnxt_ethdev.c | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/drivers/net/bnxt/bnxt_ethdev.c b/drivers/net/bnxt/bnxt_ethdev.c
index 7147cc8..3c40f4b 100644
--- a/drivers/net/bnxt/bnxt_ethdev.c
+++ b/drivers/net/bnxt/bnxt_ethdev.c
@@ -4022,15 +4022,17 @@ static void bnxt_dev_recover(void *arg)
rc = bnxt_dev_start_op(bp->eth_dev);
if (rc) {
PMD_DRV_LOG(ERR, "Failed to start port after reset\n");
- goto err;
+ goto err_start;
}
rc = bnxt_restore_filters(bp);
if (rc)
- goto err;
+ goto err_start;
PMD_DRV_LOG(INFO, "Recovered from FW reset\n");
return;
+err_start:
+ bnxt_dev_stop_op(bp->eth_dev);
err:
bp->flags |= BNXT_FLAG_FATAL_ERROR;
bnxt_uninit_resources(bp, false);
--
2.10.1
^ permalink raw reply [flat|nested] 17+ messages in thread
* [dpdk-dev] [PATCH 6/7] net/bnxt: move locally used functions to static
2020-02-06 16:33 [dpdk-dev] [PATCH 0/7] bnxt patchset with bug fixes Kalesh A P
` (4 preceding siblings ...)
2020-02-06 16:33 ` [dpdk-dev] [PATCH 5/7] net/bnxt: fix to call port stop when error recovery fails Kalesh A P
@ 2020-02-06 16:33 ` Kalesh A P
2020-02-06 16:33 ` [dpdk-dev] [PATCH 7/7] net/bnxt: fix buffer allocation reattempt logic Kalesh A P
2020-02-06 18:44 ` [dpdk-dev] [PATCH v2 0/7] bnxt patchset with bug fixes Ajit Khaparde
7 siblings, 0 replies; 17+ messages in thread
From: Kalesh A P @ 2020-02-06 16:33 UTC (permalink / raw)
To: dev; +Cc: ferruh.yigit, ajit.khaparde
From: Kalesh AP <kalesh-anakkur.purayil@broadcom.com>
bnxt_rss_ctxts() function is declared in header file bnxt.h,
implemented in bnxt_ethdev.c, and called only in bnxt_ethdev.c.
Also many functions are declared in header file bnxt_hwrm.h,
implemented in bnxt_hwrm.c, and called only in bnxt_hwrm.c.
This patch moves these function declarations into bnxt_ethdev.c
and bnxt_hwrm.c, as static functions.
Signed-off-by: Kalesh AP <kalesh-anakkur.purayil@broadcom.com>
Reviewed-by: Ajit Kumar Khaparde <ajit.khaparde@broadcom.com>
---
drivers/net/bnxt/bnxt.h | 1 -
drivers/net/bnxt/bnxt_ethdev.c | 2 +-
drivers/net/bnxt/bnxt_hwrm.c | 15 ++++++++++-----
drivers/net/bnxt/bnxt_hwrm.h | 5 -----
4 files changed, 11 insertions(+), 12 deletions(-)
diff --git a/drivers/net/bnxt/bnxt.h b/drivers/net/bnxt/bnxt.h
index e8a30fa..3ae08a2 100644
--- a/drivers/net/bnxt/bnxt.h
+++ b/drivers/net/bnxt/bnxt.h
@@ -686,7 +686,6 @@ int bnxt_link_update(struct rte_eth_dev *eth_dev, int wait_to_complete,
bool exp_link_status);
int bnxt_rcv_msg_from_vf(struct bnxt *bp, uint16_t vf_id, void *msg);
int is_bnxt_in_error(struct bnxt *bp);
-uint16_t bnxt_rss_ctxts(const struct bnxt *bp);
int bnxt_map_fw_health_status_regs(struct bnxt *bp);
uint32_t bnxt_read_fw_status_reg(struct bnxt *bp, uint32_t index);
diff --git a/drivers/net/bnxt/bnxt_ethdev.c b/drivers/net/bnxt/bnxt_ethdev.c
index 3c40f4b..18aa313 100644
--- a/drivers/net/bnxt/bnxt_ethdev.c
+++ b/drivers/net/bnxt/bnxt_ethdev.c
@@ -150,7 +150,7 @@ int is_bnxt_in_error(struct bnxt *bp)
* High level utility functions
*/
-uint16_t bnxt_rss_ctxts(const struct bnxt *bp)
+static uint16_t bnxt_rss_ctxts(const struct bnxt *bp)
{
if (!BNXT_CHIP_THOR(bp))
return 1;
diff --git a/drivers/net/bnxt/bnxt_hwrm.c b/drivers/net/bnxt/bnxt_hwrm.c
index 4d99d82..acecf27 100644
--- a/drivers/net/bnxt/bnxt_hwrm.c
+++ b/drivers/net/bnxt/bnxt_hwrm.c
@@ -2254,7 +2254,8 @@ int bnxt_clear_all_hwrm_stat_ctxs(struct bnxt *bp)
return 0;
}
-int bnxt_free_all_hwrm_stat_ctxs(struct bnxt *bp)
+static int
+bnxt_free_all_hwrm_stat_ctxs(struct bnxt *bp)
{
int rc;
unsigned int i;
@@ -2305,7 +2306,8 @@ int bnxt_alloc_all_hwrm_stat_ctxs(struct bnxt *bp)
return rc;
}
-int bnxt_free_all_hwrm_ring_grps(struct bnxt *bp)
+static int
+bnxt_free_all_hwrm_ring_grps(struct bnxt *bp)
{
uint16_t idx;
uint32_t rc = 0;
@@ -2396,7 +2398,8 @@ void bnxt_free_hwrm_rx_ring(struct bnxt *bp, int queue_index)
bp->grp_info[queue_index].cp_fw_ring_id = INVALID_HW_RING_ID;
}
-int bnxt_free_all_hwrm_rings(struct bnxt *bp)
+static int
+bnxt_free_all_hwrm_rings(struct bnxt *bp)
{
unsigned int i;
@@ -2485,7 +2488,8 @@ int bnxt_alloc_hwrm_resources(struct bnxt *bp)
return 0;
}
-int bnxt_clear_hwrm_vnic_filters(struct bnxt *bp, struct bnxt_vnic_info *vnic)
+static int
+bnxt_clear_hwrm_vnic_filters(struct bnxt *bp, struct bnxt_vnic_info *vnic)
{
struct bnxt_filter_info *filter;
int rc = 0;
@@ -2546,7 +2550,8 @@ int bnxt_set_hwrm_vnic_filters(struct bnxt *bp, struct bnxt_vnic_info *vnic)
return rc;
}
-void bnxt_free_tunnel_ports(struct bnxt *bp)
+static void
+bnxt_free_tunnel_ports(struct bnxt *bp)
{
if (bp->vxlan_port_cnt)
bnxt_hwrm_tunnel_dst_port_free(bp, bp->vxlan_fw_dst_port_id,
diff --git a/drivers/net/bnxt/bnxt_hwrm.h b/drivers/net/bnxt/bnxt_hwrm.h
index 56a851b..5eb2ee8 100644
--- a/drivers/net/bnxt/bnxt_hwrm.h
+++ b/drivers/net/bnxt/bnxt_hwrm.h
@@ -142,14 +142,10 @@ int bnxt_hwrm_vnic_tpa_cfg(struct bnxt *bp,
int bnxt_alloc_all_hwrm_stat_ctxs(struct bnxt *bp);
int bnxt_clear_all_hwrm_stat_ctxs(struct bnxt *bp);
-int bnxt_free_all_hwrm_stat_ctxs(struct bnxt *bp);
-int bnxt_free_all_hwrm_rings(struct bnxt *bp);
-int bnxt_free_all_hwrm_ring_grps(struct bnxt *bp);
int bnxt_alloc_all_hwrm_ring_grps(struct bnxt *bp);
void bnxt_free_cp_ring(struct bnxt *bp, struct bnxt_cp_ring_info *cpr);
void bnxt_free_nq_ring(struct bnxt *bp, struct bnxt_cp_ring_info *cpr);
int bnxt_set_hwrm_vnic_filters(struct bnxt *bp, struct bnxt_vnic_info *vnic);
-int bnxt_clear_hwrm_vnic_filters(struct bnxt *bp, struct bnxt_vnic_info *vnic);
void bnxt_free_all_hwrm_resources(struct bnxt *bp);
void bnxt_free_hwrm_resources(struct bnxt *bp);
void bnxt_free_hwrm_rx_ring(struct bnxt *bp, int queue_index);
@@ -174,7 +170,6 @@ int bnxt_hwrm_tunnel_dst_port_alloc(struct bnxt *bp, uint16_t port,
uint8_t tunnel_type);
int bnxt_hwrm_tunnel_dst_port_free(struct bnxt *bp, uint16_t port,
uint8_t tunnel_type);
-void bnxt_free_tunnel_ports(struct bnxt *bp);
int bnxt_hwrm_set_default_vlan(struct bnxt *bp, int vf, uint8_t is_vf);
int bnxt_hwrm_port_qstats(struct bnxt *bp);
int bnxt_hwrm_port_clr_stats(struct bnxt *bp);
--
2.10.1
^ permalink raw reply [flat|nested] 17+ messages in thread
* [dpdk-dev] [PATCH 7/7] net/bnxt: fix buffer allocation reattempt logic
2020-02-06 16:33 [dpdk-dev] [PATCH 0/7] bnxt patchset with bug fixes Kalesh A P
` (5 preceding siblings ...)
2020-02-06 16:33 ` [dpdk-dev] [PATCH 6/7] net/bnxt: move locally used functions to static Kalesh A P
@ 2020-02-06 16:33 ` Kalesh A P
2020-02-06 18:44 ` [dpdk-dev] [PATCH v2 0/7] bnxt patchset with bug fixes Ajit Khaparde
7 siblings, 0 replies; 17+ messages in thread
From: Kalesh A P @ 2020-02-06 16:33 UTC (permalink / raw)
To: dev; +Cc: ferruh.yigit, ajit.khaparde
From: Santoshkumar Karanappa Rastapur <santosh.rastapur@broadcom.com>
In case of a buffer allocation failure, we reattempt buffer allocation
before the rx handler exits. We were not attempting this when producer
index is greater than the number of buffers to allocate. Fixed it with
correct checks.
Fixes: d9dd0b29ed31 ("net/bnxt: fix Rx handling and buffer allocation logic")
Cc: stable@dpdk.org
Signed-off-by: Santoshkumar Karanappa Rastapur <santosh.rastapur@broadcom.com>
Reviewed-by: Somnath Kotur <somnath.kotur@broadcom.com>
---
drivers/net/bnxt/bnxt_rxr.c | 7 ++++---
1 file changed, 4 insertions(+), 3 deletions(-)
diff --git a/drivers/net/bnxt/bnxt_rxr.c b/drivers/net/bnxt/bnxt_rxr.c
index 1f47db9..bef9720 100644
--- a/drivers/net/bnxt/bnxt_rxr.c
+++ b/drivers/net/bnxt/bnxt_rxr.c
@@ -678,10 +678,11 @@ uint16_t bnxt_recv_pkts(void *rx_queue, struct rte_mbuf **rx_pkts,
/* Attempt to alloc Rx buf in case of a previous allocation failure. */
if (rc == -ENOMEM) {
- int i;
+ int i = RING_NEXT(rxr->rx_ring_struct, prod);
+ int cnt = nb_rx_pkts;
- for (i = prod; i <= nb_rx_pkts;
- i = RING_NEXT(rxr->rx_ring_struct, i)) {
+ for (; cnt;
+ i = RING_NEXT(rxr->rx_ring_struct, i), cnt--) {
struct bnxt_sw_rx_bd *rx_buf = &rxr->rx_buf_ring[i];
/* Buffer already allocated for this index. */
--
2.10.1
^ permalink raw reply [flat|nested] 17+ messages in thread
* [dpdk-dev] [PATCH v2 0/7] bnxt patchset with bug fixes
2020-02-06 16:33 [dpdk-dev] [PATCH 0/7] bnxt patchset with bug fixes Kalesh A P
` (6 preceding siblings ...)
2020-02-06 16:33 ` [dpdk-dev] [PATCH 7/7] net/bnxt: fix buffer allocation reattempt logic Kalesh A P
@ 2020-02-06 18:44 ` Ajit Khaparde
2020-02-06 18:44 ` [dpdk-dev] [PATCH v2 1/7] net/bnxt: fix unnecessary delay in port stop Ajit Khaparde
` (7 more replies)
7 siblings, 8 replies; 17+ messages in thread
From: Ajit Khaparde @ 2020-02-06 18:44 UTC (permalink / raw)
To: dev; +Cc: ferruh.yigit
v1->v2: fixed the commit logs.
Kalesh AP (5):
net/bnxt: fix unnecessary delay in port stop
net/bnxt: log firmware debug notifications
net/bnxt: register for debug notification event from FW
net/bnxt: fix to call port stop when error recovery fails
net/bnxt: move locally used functions to static
Rahul Gupta (1):
net/bnxt: fix default timeout for command to get FW version
Santoshkumar Karanappa Rastapur (1):
net/bnxt: fix buffer allocation reattempt logic
drivers/net/bnxt/bnxt.h | 7 ++++---
drivers/net/bnxt/bnxt_cpr.c | 5 +++++
drivers/net/bnxt/bnxt_ethdev.c | 17 ++++++++++-------
drivers/net/bnxt/bnxt_hwrm.c | 29 +++++++++++++++++------------
drivers/net/bnxt/bnxt_hwrm.h | 9 +++------
drivers/net/bnxt/bnxt_rxr.c | 7 ++++---
6 files changed, 43 insertions(+), 31 deletions(-)
--
2.21.1 (Apple Git-122.3)
^ permalink raw reply [flat|nested] 17+ messages in thread
* [dpdk-dev] [PATCH v2 1/7] net/bnxt: fix unnecessary delay in port stop
2020-02-06 18:44 ` [dpdk-dev] [PATCH v2 0/7] bnxt patchset with bug fixes Ajit Khaparde
@ 2020-02-06 18:44 ` Ajit Khaparde
2020-02-06 18:44 ` [dpdk-dev] [PATCH v2 2/7] net/bnxt: fix default timeout for command to get FW version Ajit Khaparde
` (6 subsequent siblings)
7 siblings, 0 replies; 17+ messages in thread
From: Ajit Khaparde @ 2020-02-06 18:44 UTC (permalink / raw)
To: dev; +Cc: ferruh.yigit, Kalesh AP, stable, Somnath Kotur
From: Kalesh AP <kalesh-anakkur.purayil@broadcom.com>
VFs and multifunction PFs do not have the privilege to change
link configuration. We force the physical link down as a part
of device stop only for single physical function(SPF).
This change also helps in eliminating the logs when a VF port
is stopped:
"Port 0: link state change event"
"bnxt_print_link_info(): Port 0 Link Up - speed 25000 Mbps - full-duplex"
Fixes: 316e412299fd ("net/bnxt: fix crash when closing")
Cc: stable@dpdk.org
Signed-off-by: Kalesh AP <kalesh-anakkur.purayil@broadcom.com>
Reviewed-by: Somnath Kotur <somnath.kotur@broadcom.com>
Reviewed-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
---
drivers/net/bnxt/bnxt_ethdev.c | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/drivers/net/bnxt/bnxt_ethdev.c b/drivers/net/bnxt/bnxt_ethdev.c
index c1cb40160..537820960 100644
--- a/drivers/net/bnxt/bnxt_ethdev.c
+++ b/drivers/net/bnxt/bnxt_ethdev.c
@@ -948,9 +948,10 @@ static void bnxt_dev_stop_op(struct rte_eth_dev *eth_dev)
bnxt_dev_set_link_down_op(eth_dev);
/* Wait for link to be reset and the async notification to process.
- * During reset recovery, there is no need to wait
+ * During reset recovery, there is no need to wait and
+ * VF/NPAR functions do not have privilege to change PHY config.
*/
- if (!is_bnxt_in_error(bp))
+ if (!is_bnxt_in_error(bp) && BNXT_SINGLE_PF(bp))
bnxt_link_update(eth_dev, 1, ETH_LINK_DOWN);
/* Clean queue intr-vector mapping */
--
2.21.1 (Apple Git-122.3)
^ permalink raw reply [flat|nested] 17+ messages in thread
* [dpdk-dev] [PATCH v2 2/7] net/bnxt: fix default timeout for command to get FW version
2020-02-06 18:44 ` [dpdk-dev] [PATCH v2 0/7] bnxt patchset with bug fixes Ajit Khaparde
2020-02-06 18:44 ` [dpdk-dev] [PATCH v2 1/7] net/bnxt: fix unnecessary delay in port stop Ajit Khaparde
@ 2020-02-06 18:44 ` Ajit Khaparde
2020-02-06 18:44 ` [dpdk-dev] [PATCH v2 3/7] net/bnxt: log firmware debug notifications Ajit Khaparde
` (5 subsequent siblings)
7 siblings, 0 replies; 17+ messages in thread
From: Ajit Khaparde @ 2020-02-06 18:44 UTC (permalink / raw)
To: dev
Cc: ferruh.yigit, Rahul Gupta, stable, Kalesh Anakkur Purayil, Somnath Kotur
From: Rahul Gupta <rahul.gupta@broadcom.com>
Initially when driver is loading, there is no HWRM timeout configured
by FW, the VER_GET command needs use default timeout as 500ms and
while recovering from fatal/non-fatal FW error, it should use timeout
as 50ms.
Fixes: 458f0360e8dc ("net/bnxt: get default HWRM command timeout from FW")
Cc: stable@dpdk.org
Signed-off-by: Rahul Gupta <rahul.gupta@broadcom.com>
Reviewed-by: Kalesh Anakkur Purayil <kalesh-anakkur.purayil@broadcom.com>
Reviewed-by: Somnath Kotur <somnath.kotur@broadcom.com>
Reviewed-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
---
drivers/net/bnxt/bnxt.h | 6 ++++--
drivers/net/bnxt/bnxt_ethdev.c | 4 ++--
drivers/net/bnxt/bnxt_hwrm.c | 11 ++++-------
drivers/net/bnxt/bnxt_hwrm.h | 2 +-
4 files changed, 11 insertions(+), 12 deletions(-)
diff --git a/drivers/net/bnxt/bnxt.h b/drivers/net/bnxt/bnxt.h
index 68786a89b..e8a30fa31 100644
--- a/drivers/net/bnxt/bnxt.h
+++ b/drivers/net/bnxt/bnxt.h
@@ -606,8 +606,10 @@ struct bnxt {
uint16_t max_resp_len;
uint16_t hwrm_max_ext_req_len;
- /* default command timeout value of 50ms */
-#define HWRM_CMD_TIMEOUT 50000
+ /* default command timeout value of 500ms */
+#define DFLT_HWRM_CMD_TIMEOUT 500000
+ /* short command timeout value of 50ms */
+#define SHORT_HWRM_CMD_TIMEOUT 50000
/* default HWRM request timeout value */
uint32_t hwrm_cmd_timeout;
diff --git a/drivers/net/bnxt/bnxt_ethdev.c b/drivers/net/bnxt/bnxt_ethdev.c
index 537820960..7147cc8fe 100644
--- a/drivers/net/bnxt/bnxt_ethdev.c
+++ b/drivers/net/bnxt/bnxt_ethdev.c
@@ -3998,7 +3998,7 @@ static void bnxt_dev_recover(void *arg)
bp->flags &= ~BNXT_FLAG_FATAL_ERROR;
do {
- rc = bnxt_hwrm_ver_get(bp);
+ rc = bnxt_hwrm_ver_get(bp, SHORT_HWRM_CMD_TIMEOUT);
if (rc == 0)
break;
rte_delay_ms(BNXT_FW_READY_WAIT_INTERVAL);
@@ -4688,7 +4688,7 @@ static int bnxt_init_fw(struct bnxt *bp)
bp->fw_cap = 0;
- rc = bnxt_hwrm_ver_get(bp);
+ rc = bnxt_hwrm_ver_get(bp, DFLT_HWRM_CMD_TIMEOUT);
if (rc)
return rc;
diff --git a/drivers/net/bnxt/bnxt_hwrm.c b/drivers/net/bnxt/bnxt_hwrm.c
index f325aff82..96b34317b 100644
--- a/drivers/net/bnxt/bnxt_hwrm.c
+++ b/drivers/net/bnxt/bnxt_hwrm.c
@@ -100,11 +100,7 @@ static int bnxt_hwrm_send_message(struct bnxt *bp, void *msg,
if (bp->flags & BNXT_FLAG_FATAL_ERROR)
return 0;
- /* For VER_GET command, set timeout as 50ms */
- if (rte_cpu_to_le_16(req->req_type) == HWRM_VER_GET)
- timeout = HWRM_CMD_TIMEOUT;
- else
- timeout = bp->hwrm_cmd_timeout;
+ timeout = bp->hwrm_cmd_timeout;
if (bp->flags & BNXT_FLAG_SHORT_CMD ||
msg_len > bp->max_req_len) {
@@ -949,7 +945,7 @@ int bnxt_hwrm_func_resc_qcaps(struct bnxt *bp)
return rc;
}
-int bnxt_hwrm_ver_get(struct bnxt *bp)
+int bnxt_hwrm_ver_get(struct bnxt *bp, uint32_t timeout)
{
int rc = 0;
struct hwrm_ver_get_input req = {.req_type = 0 };
@@ -960,6 +956,7 @@ int bnxt_hwrm_ver_get(struct bnxt *bp)
uint32_t dev_caps_cfg;
bp->max_req_len = HWRM_MAX_REQ_LEN;
+ bp->hwrm_cmd_timeout = timeout;
HWRM_PREP(req, VER_GET, BNXT_USE_CHIMP_MB);
req.hwrm_intf_maj = HWRM_VERSION_MAJOR;
@@ -994,7 +991,7 @@ int bnxt_hwrm_ver_get(struct bnxt *bp)
/* convert timeout to usec */
bp->hwrm_cmd_timeout *= 1000;
if (!bp->hwrm_cmd_timeout)
- bp->hwrm_cmd_timeout = HWRM_CMD_TIMEOUT;
+ bp->hwrm_cmd_timeout = DFLT_HWRM_CMD_TIMEOUT;
if (resp->hwrm_intf_maj_8b != HWRM_VERSION_MAJOR) {
PMD_DRV_LOG(ERR, "Unsupported firmware API version\n");
diff --git a/drivers/net/bnxt/bnxt_hwrm.h b/drivers/net/bnxt/bnxt_hwrm.h
index d8d1360f9..2753720ae 100644
--- a/drivers/net/bnxt/bnxt_hwrm.h
+++ b/drivers/net/bnxt/bnxt_hwrm.h
@@ -120,7 +120,7 @@ int bnxt_hwrm_stat_ctx_free(struct bnxt *bp,
int bnxt_hwrm_ctx_qstats(struct bnxt *bp, uint32_t cid, int idx,
struct rte_eth_stats *stats, uint8_t rx);
-int bnxt_hwrm_ver_get(struct bnxt *bp);
+int bnxt_hwrm_ver_get(struct bnxt *bp, uint32_t timeout);
int bnxt_hwrm_vnic_alloc(struct bnxt *bp, struct bnxt_vnic_info *vnic);
int bnxt_hwrm_vnic_cfg(struct bnxt *bp, struct bnxt_vnic_info *vnic);
--
2.21.1 (Apple Git-122.3)
^ permalink raw reply [flat|nested] 17+ messages in thread
* [dpdk-dev] [PATCH v2 3/7] net/bnxt: log firmware debug notifications
2020-02-06 18:44 ` [dpdk-dev] [PATCH v2 0/7] bnxt patchset with bug fixes Ajit Khaparde
2020-02-06 18:44 ` [dpdk-dev] [PATCH v2 1/7] net/bnxt: fix unnecessary delay in port stop Ajit Khaparde
2020-02-06 18:44 ` [dpdk-dev] [PATCH v2 2/7] net/bnxt: fix default timeout for command to get FW version Ajit Khaparde
@ 2020-02-06 18:44 ` Ajit Khaparde
2020-02-06 18:44 ` [dpdk-dev] [PATCH v2 4/7] net/bnxt: register for debug notification event from FW Ajit Khaparde
` (4 subsequent siblings)
7 siblings, 0 replies; 17+ messages in thread
From: Ajit Khaparde @ 2020-02-06 18:44 UTC (permalink / raw)
To: dev; +Cc: ferruh.yigit, Kalesh AP, Somnath Kotur
From: Kalesh AP <kalesh-anakkur.purayil@broadcom.com>
The debug notifications are not functional in nature, they should
only have diagnostic value. Other than logging to system log,
drivers shall not take any other functional action based on this
async event.
Signed-off-by: Kalesh AP <kalesh-anakkur.purayil@broadcom.com>
Reviewed-by: Somnath Kotur <somnath.kotur@broadcom.com>
Reviewed-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
---
drivers/net/bnxt/bnxt_cpr.c | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/drivers/net/bnxt/bnxt_cpr.c b/drivers/net/bnxt/bnxt_cpr.c
index bb316b9e0..0f7b5e96c 100644
--- a/drivers/net/bnxt/bnxt_cpr.c
+++ b/drivers/net/bnxt/bnxt_cpr.c
@@ -133,6 +133,11 @@ void bnxt_handle_async_event(struct bnxt *bp,
bnxt_schedule_fw_health_check(bp);
break;
+ case HWRM_ASYNC_EVENT_CMPL_EVENT_ID_DEBUG_NOTIFICATION:
+ PMD_DRV_LOG(INFO, "DNC event: evt_data1 %#x evt_data2 %#x\n",
+ rte_le_to_cpu_32(async_cmp->event_data1),
+ rte_le_to_cpu_32(async_cmp->event_data2));
+ break;
default:
PMD_DRV_LOG(DEBUG, "handle_async_event id = 0x%x\n", event_id);
break;
--
2.21.1 (Apple Git-122.3)
^ permalink raw reply [flat|nested] 17+ messages in thread
* [dpdk-dev] [PATCH v2 4/7] net/bnxt: register for debug notification event from FW
2020-02-06 18:44 ` [dpdk-dev] [PATCH v2 0/7] bnxt patchset with bug fixes Ajit Khaparde
` (2 preceding siblings ...)
2020-02-06 18:44 ` [dpdk-dev] [PATCH v2 3/7] net/bnxt: log firmware debug notifications Ajit Khaparde
@ 2020-02-06 18:44 ` Ajit Khaparde
2020-02-06 18:44 ` [dpdk-dev] [PATCH v2 5/7] net/bnxt: fix to call port stop when error recovery fails Ajit Khaparde
` (3 subsequent siblings)
7 siblings, 0 replies; 17+ messages in thread
From: Ajit Khaparde @ 2020-02-06 18:44 UTC (permalink / raw)
To: dev; +Cc: ferruh.yigit, Kalesh AP
From: Kalesh AP <kalesh-anakkur.purayil@broadcom.com>
PF driver has to register for the debug notification async event
with firmware in the HWRM_FUNC_DRV_RGTR command.
Signed-off-by: Kalesh AP <kalesh-anakkur.purayil@broadcom.com>
Reviewed-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
---
drivers/net/bnxt/bnxt_hwrm.c | 3 +++
drivers/net/bnxt/bnxt_hwrm.h | 2 ++
2 files changed, 5 insertions(+)
diff --git a/drivers/net/bnxt/bnxt_hwrm.c b/drivers/net/bnxt/bnxt_hwrm.c
index 96b34317b..4d99d824e 100644
--- a/drivers/net/bnxt/bnxt_hwrm.c
+++ b/drivers/net/bnxt/bnxt_hwrm.c
@@ -814,6 +814,9 @@ int bnxt_hwrm_func_driver_register(struct bnxt *bp)
req.async_event_fwd[1] |=
rte_cpu_to_le_32(ASYNC_CMPL_EVENT_ID_PF_DRVR_UNLOAD |
ASYNC_CMPL_EVENT_ID_VF_CFG_CHANGE);
+ if (BNXT_PF(bp))
+ req.async_event_fwd[1] |=
+ rte_cpu_to_le_32(ASYNC_CMPL_EVENT_ID_DBG_NOTIFICATION);
rc = bnxt_hwrm_send_message(bp, &req, sizeof(req), BNXT_USE_CHIMP_MB);
diff --git a/drivers/net/bnxt/bnxt_hwrm.h b/drivers/net/bnxt/bnxt_hwrm.h
index 2753720ae..56a851b8a 100644
--- a/drivers/net/bnxt/bnxt_hwrm.h
+++ b/drivers/net/bnxt/bnxt_hwrm.h
@@ -31,6 +31,8 @@ struct bnxt_cp_ring_info;
(1 << (HWRM_ASYNC_EVENT_CMPL_EVENT_ID_PF_DRVR_UNLOAD - 32))
#define ASYNC_CMPL_EVENT_ID_VF_CFG_CHANGE \
(1 << (HWRM_ASYNC_EVENT_CMPL_EVENT_ID_VF_CFG_CHANGE - 32))
+#define ASYNC_CMPL_EVENT_ID_DBG_NOTIFICATION \
+ (1 << (HWRM_ASYNC_EVENT_CMPL_EVENT_ID_DEBUG_NOTIFICATION - 32))
#define HWRM_QUEUE_SERVICE_PROFILE_LOSSY \
HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID0_SERVICE_PROFILE_LOSSY
--
2.21.1 (Apple Git-122.3)
^ permalink raw reply [flat|nested] 17+ messages in thread
* [dpdk-dev] [PATCH v2 5/7] net/bnxt: fix to call port stop when error recovery fails
2020-02-06 18:44 ` [dpdk-dev] [PATCH v2 0/7] bnxt patchset with bug fixes Ajit Khaparde
` (3 preceding siblings ...)
2020-02-06 18:44 ` [dpdk-dev] [PATCH v2 4/7] net/bnxt: register for debug notification event from FW Ajit Khaparde
@ 2020-02-06 18:44 ` Ajit Khaparde
2020-02-06 18:44 ` [dpdk-dev] [PATCH v2 6/7] net/bnxt: move locally used functions to static Ajit Khaparde
` (2 subsequent siblings)
7 siblings, 0 replies; 17+ messages in thread
From: Ajit Khaparde @ 2020-02-06 18:44 UTC (permalink / raw)
To: dev; +Cc: ferruh.yigit, Kalesh AP, stable, Somnath Kotur, Rahul Gupta
From: Kalesh AP <kalesh-anakkur.purayil@broadcom.com>
During live FW upgrade or error recovery, if restoring the filter
settings fail after port start, driver invokes bnxt_uninit_resources()
only. Fix it to invoke bnxt_dev_stop_op() first before calling
bnxt_uninit_resources().
Fixes: df6cd7c1f73a ("net/bnxt: handle reset notify async event from FW")
Cc: stable@dpdk.org
Signed-off-by: Kalesh AP <kalesh-anakkur.purayil@broadcom.com>
Reviewed-by: Somnath Kotur <somnath.kotur@broadcom.com>
Reviewed-by: Rahul Gupta <rahul.gupta@broadcom.com>
---
drivers/net/bnxt/bnxt_ethdev.c | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/drivers/net/bnxt/bnxt_ethdev.c b/drivers/net/bnxt/bnxt_ethdev.c
index 7147cc8fe..3c40f4b59 100644
--- a/drivers/net/bnxt/bnxt_ethdev.c
+++ b/drivers/net/bnxt/bnxt_ethdev.c
@@ -4022,15 +4022,17 @@ static void bnxt_dev_recover(void *arg)
rc = bnxt_dev_start_op(bp->eth_dev);
if (rc) {
PMD_DRV_LOG(ERR, "Failed to start port after reset\n");
- goto err;
+ goto err_start;
}
rc = bnxt_restore_filters(bp);
if (rc)
- goto err;
+ goto err_start;
PMD_DRV_LOG(INFO, "Recovered from FW reset\n");
return;
+err_start:
+ bnxt_dev_stop_op(bp->eth_dev);
err:
bp->flags |= BNXT_FLAG_FATAL_ERROR;
bnxt_uninit_resources(bp, false);
--
2.21.1 (Apple Git-122.3)
^ permalink raw reply [flat|nested] 17+ messages in thread
* [dpdk-dev] [PATCH v2 6/7] net/bnxt: move locally used functions to static
2020-02-06 18:44 ` [dpdk-dev] [PATCH v2 0/7] bnxt patchset with bug fixes Ajit Khaparde
` (4 preceding siblings ...)
2020-02-06 18:44 ` [dpdk-dev] [PATCH v2 5/7] net/bnxt: fix to call port stop when error recovery fails Ajit Khaparde
@ 2020-02-06 18:44 ` Ajit Khaparde
2020-02-06 18:44 ` [dpdk-dev] [PATCH v2 7/7] net/bnxt: fix buffer allocation reattempt logic Ajit Khaparde
2020-02-06 18:50 ` [dpdk-dev] [PATCH v2 0/7] bnxt patchset with bug fixes Ajit Khaparde
7 siblings, 0 replies; 17+ messages in thread
From: Ajit Khaparde @ 2020-02-06 18:44 UTC (permalink / raw)
To: dev; +Cc: ferruh.yigit, Kalesh AP
From: Kalesh AP <kalesh-anakkur.purayil@broadcom.com>
bnxt_rss_ctxts() function is declared in header file bnxt.h,
implemented in bnxt_ethdev.c, and called only in bnxt_ethdev.c.
Also many functions are declared in header file bnxt_hwrm.h,
implemented in bnxt_hwrm.c, and called only in bnxt_hwrm.c.
This patch moves these function declarations into bnxt_ethdev.c
and bnxt_hwrm.c, as static functions.
Signed-off-by: Kalesh AP <kalesh-anakkur.purayil@broadcom.com>
Reviewed-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
---
drivers/net/bnxt/bnxt.h | 1 -
drivers/net/bnxt/bnxt_ethdev.c | 2 +-
drivers/net/bnxt/bnxt_hwrm.c | 15 ++++++++++-----
drivers/net/bnxt/bnxt_hwrm.h | 5 -----
4 files changed, 11 insertions(+), 12 deletions(-)
diff --git a/drivers/net/bnxt/bnxt.h b/drivers/net/bnxt/bnxt.h
index e8a30fa31..3ae08a2ed 100644
--- a/drivers/net/bnxt/bnxt.h
+++ b/drivers/net/bnxt/bnxt.h
@@ -686,7 +686,6 @@ int bnxt_link_update(struct rte_eth_dev *eth_dev, int wait_to_complete,
bool exp_link_status);
int bnxt_rcv_msg_from_vf(struct bnxt *bp, uint16_t vf_id, void *msg);
int is_bnxt_in_error(struct bnxt *bp);
-uint16_t bnxt_rss_ctxts(const struct bnxt *bp);
int bnxt_map_fw_health_status_regs(struct bnxt *bp);
uint32_t bnxt_read_fw_status_reg(struct bnxt *bp, uint32_t index);
diff --git a/drivers/net/bnxt/bnxt_ethdev.c b/drivers/net/bnxt/bnxt_ethdev.c
index 3c40f4b59..18aa313fd 100644
--- a/drivers/net/bnxt/bnxt_ethdev.c
+++ b/drivers/net/bnxt/bnxt_ethdev.c
@@ -150,7 +150,7 @@ int is_bnxt_in_error(struct bnxt *bp)
* High level utility functions
*/
-uint16_t bnxt_rss_ctxts(const struct bnxt *bp)
+static uint16_t bnxt_rss_ctxts(const struct bnxt *bp)
{
if (!BNXT_CHIP_THOR(bp))
return 1;
diff --git a/drivers/net/bnxt/bnxt_hwrm.c b/drivers/net/bnxt/bnxt_hwrm.c
index 4d99d824e..acecf2784 100644
--- a/drivers/net/bnxt/bnxt_hwrm.c
+++ b/drivers/net/bnxt/bnxt_hwrm.c
@@ -2254,7 +2254,8 @@ int bnxt_clear_all_hwrm_stat_ctxs(struct bnxt *bp)
return 0;
}
-int bnxt_free_all_hwrm_stat_ctxs(struct bnxt *bp)
+static int
+bnxt_free_all_hwrm_stat_ctxs(struct bnxt *bp)
{
int rc;
unsigned int i;
@@ -2305,7 +2306,8 @@ int bnxt_alloc_all_hwrm_stat_ctxs(struct bnxt *bp)
return rc;
}
-int bnxt_free_all_hwrm_ring_grps(struct bnxt *bp)
+static int
+bnxt_free_all_hwrm_ring_grps(struct bnxt *bp)
{
uint16_t idx;
uint32_t rc = 0;
@@ -2396,7 +2398,8 @@ void bnxt_free_hwrm_rx_ring(struct bnxt *bp, int queue_index)
bp->grp_info[queue_index].cp_fw_ring_id = INVALID_HW_RING_ID;
}
-int bnxt_free_all_hwrm_rings(struct bnxt *bp)
+static int
+bnxt_free_all_hwrm_rings(struct bnxt *bp)
{
unsigned int i;
@@ -2485,7 +2488,8 @@ int bnxt_alloc_hwrm_resources(struct bnxt *bp)
return 0;
}
-int bnxt_clear_hwrm_vnic_filters(struct bnxt *bp, struct bnxt_vnic_info *vnic)
+static int
+bnxt_clear_hwrm_vnic_filters(struct bnxt *bp, struct bnxt_vnic_info *vnic)
{
struct bnxt_filter_info *filter;
int rc = 0;
@@ -2546,7 +2550,8 @@ int bnxt_set_hwrm_vnic_filters(struct bnxt *bp, struct bnxt_vnic_info *vnic)
return rc;
}
-void bnxt_free_tunnel_ports(struct bnxt *bp)
+static void
+bnxt_free_tunnel_ports(struct bnxt *bp)
{
if (bp->vxlan_port_cnt)
bnxt_hwrm_tunnel_dst_port_free(bp, bp->vxlan_fw_dst_port_id,
diff --git a/drivers/net/bnxt/bnxt_hwrm.h b/drivers/net/bnxt/bnxt_hwrm.h
index 56a851b8a..5eb2ee883 100644
--- a/drivers/net/bnxt/bnxt_hwrm.h
+++ b/drivers/net/bnxt/bnxt_hwrm.h
@@ -142,14 +142,10 @@ int bnxt_hwrm_vnic_tpa_cfg(struct bnxt *bp,
int bnxt_alloc_all_hwrm_stat_ctxs(struct bnxt *bp);
int bnxt_clear_all_hwrm_stat_ctxs(struct bnxt *bp);
-int bnxt_free_all_hwrm_stat_ctxs(struct bnxt *bp);
-int bnxt_free_all_hwrm_rings(struct bnxt *bp);
-int bnxt_free_all_hwrm_ring_grps(struct bnxt *bp);
int bnxt_alloc_all_hwrm_ring_grps(struct bnxt *bp);
void bnxt_free_cp_ring(struct bnxt *bp, struct bnxt_cp_ring_info *cpr);
void bnxt_free_nq_ring(struct bnxt *bp, struct bnxt_cp_ring_info *cpr);
int bnxt_set_hwrm_vnic_filters(struct bnxt *bp, struct bnxt_vnic_info *vnic);
-int bnxt_clear_hwrm_vnic_filters(struct bnxt *bp, struct bnxt_vnic_info *vnic);
void bnxt_free_all_hwrm_resources(struct bnxt *bp);
void bnxt_free_hwrm_resources(struct bnxt *bp);
void bnxt_free_hwrm_rx_ring(struct bnxt *bp, int queue_index);
@@ -174,7 +170,6 @@ int bnxt_hwrm_tunnel_dst_port_alloc(struct bnxt *bp, uint16_t port,
uint8_t tunnel_type);
int bnxt_hwrm_tunnel_dst_port_free(struct bnxt *bp, uint16_t port,
uint8_t tunnel_type);
-void bnxt_free_tunnel_ports(struct bnxt *bp);
int bnxt_hwrm_set_default_vlan(struct bnxt *bp, int vf, uint8_t is_vf);
int bnxt_hwrm_port_qstats(struct bnxt *bp);
int bnxt_hwrm_port_clr_stats(struct bnxt *bp);
--
2.21.1 (Apple Git-122.3)
^ permalink raw reply [flat|nested] 17+ messages in thread
* [dpdk-dev] [PATCH v2 7/7] net/bnxt: fix buffer allocation reattempt logic
2020-02-06 18:44 ` [dpdk-dev] [PATCH v2 0/7] bnxt patchset with bug fixes Ajit Khaparde
` (5 preceding siblings ...)
2020-02-06 18:44 ` [dpdk-dev] [PATCH v2 6/7] net/bnxt: move locally used functions to static Ajit Khaparde
@ 2020-02-06 18:44 ` Ajit Khaparde
2020-02-06 18:50 ` [dpdk-dev] [PATCH v2 0/7] bnxt patchset with bug fixes Ajit Khaparde
7 siblings, 0 replies; 17+ messages in thread
From: Ajit Khaparde @ 2020-02-06 18:44 UTC (permalink / raw)
To: dev; +Cc: ferruh.yigit, Santoshkumar Karanappa Rastapur, stable, Somnath Kotur
From: Santoshkumar Karanappa Rastapur <santosh.rastapur@broadcom.com>
In case of a buffer allocation failure, we reattempt buffer allocation
before the rx handler exits. We were not attempting this when producer
index is greater than the number of buffers to allocate. Fixed it with
correct checks.
Fixes: d9dd0b29ed31 ("net/bnxt: fix Rx handling and buffer allocation logic")
Cc: stable@dpdk.org
Signed-off-by: Santoshkumar Karanappa Rastapur <santosh.rastapur@broadcom.com>
Reviewed-by: Somnath Kotur <somnath.kotur@broadcom.com>
---
drivers/net/bnxt/bnxt_rxr.c | 7 ++++---
1 file changed, 4 insertions(+), 3 deletions(-)
diff --git a/drivers/net/bnxt/bnxt_rxr.c b/drivers/net/bnxt/bnxt_rxr.c
index 1f47db97b..bef9720f5 100644
--- a/drivers/net/bnxt/bnxt_rxr.c
+++ b/drivers/net/bnxt/bnxt_rxr.c
@@ -678,10 +678,11 @@ uint16_t bnxt_recv_pkts(void *rx_queue, struct rte_mbuf **rx_pkts,
/* Attempt to alloc Rx buf in case of a previous allocation failure. */
if (rc == -ENOMEM) {
- int i;
+ int i = RING_NEXT(rxr->rx_ring_struct, prod);
+ int cnt = nb_rx_pkts;
- for (i = prod; i <= nb_rx_pkts;
- i = RING_NEXT(rxr->rx_ring_struct, i)) {
+ for (; cnt;
+ i = RING_NEXT(rxr->rx_ring_struct, i), cnt--) {
struct bnxt_sw_rx_bd *rx_buf = &rxr->rx_buf_ring[i];
/* Buffer already allocated for this index. */
--
2.21.1 (Apple Git-122.3)
^ permalink raw reply [flat|nested] 17+ messages in thread
* Re: [dpdk-dev] [PATCH v2 0/7] bnxt patchset with bug fixes
2020-02-06 18:44 ` [dpdk-dev] [PATCH v2 0/7] bnxt patchset with bug fixes Ajit Khaparde
` (6 preceding siblings ...)
2020-02-06 18:44 ` [dpdk-dev] [PATCH v2 7/7] net/bnxt: fix buffer allocation reattempt logic Ajit Khaparde
@ 2020-02-06 18:50 ` Ajit Khaparde
7 siblings, 0 replies; 17+ messages in thread
From: Ajit Khaparde @ 2020-02-06 18:50 UTC (permalink / raw)
To: dpdk-dev; +Cc: Ferruh Yigit
On Thu, Feb 6, 2020 at 10:44 AM Ajit Khaparde <ajit.khaparde@broadcom.com>
wrote:
> v1->v2: fixed the commit logs.
>
Patchset applied to dpdk-next-net-brcm.
>
> Kalesh AP (5):
> net/bnxt: fix unnecessary delay in port stop
> net/bnxt: log firmware debug notifications
> net/bnxt: register for debug notification event from FW
> net/bnxt: fix to call port stop when error recovery fails
> net/bnxt: move locally used functions to static
>
> Rahul Gupta (1):
> net/bnxt: fix default timeout for command to get FW version
>
> Santoshkumar Karanappa Rastapur (1):
> net/bnxt: fix buffer allocation reattempt logic
>
> drivers/net/bnxt/bnxt.h | 7 ++++---
> drivers/net/bnxt/bnxt_cpr.c | 5 +++++
> drivers/net/bnxt/bnxt_ethdev.c | 17 ++++++++++-------
> drivers/net/bnxt/bnxt_hwrm.c | 29 +++++++++++++++++------------
> drivers/net/bnxt/bnxt_hwrm.h | 9 +++------
> drivers/net/bnxt/bnxt_rxr.c | 7 ++++---
> 6 files changed, 43 insertions(+), 31 deletions(-)
>
> --
> 2.21.1 (Apple Git-122.3)
>
>
^ permalink raw reply [flat|nested] 17+ messages in thread
end of thread, other threads:[~2020-02-06 18:50 UTC | newest]
Thread overview: 17+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-02-06 16:33 [dpdk-dev] [PATCH 0/7] bnxt patchset with bug fixes Kalesh A P
2020-02-06 16:33 ` [dpdk-dev] [PATCH 1/7] net/bnxt: avoid an unnecessary delay in port stop Kalesh A P
2020-02-06 16:33 ` [dpdk-dev] [PATCH 2/7] net/bnxt: fix default timeout for ver_get command Kalesh A P
2020-02-06 16:33 ` [dpdk-dev] [PATCH 3/7] net/bnxt: log firmware debug notifications Kalesh A P
2020-02-06 16:33 ` [dpdk-dev] [PATCH 4/7] net/bnxt: register for debug notification async event from fw Kalesh A P
2020-02-06 16:33 ` [dpdk-dev] [PATCH 5/7] net/bnxt: fix to call port stop when error recovery fails Kalesh A P
2020-02-06 16:33 ` [dpdk-dev] [PATCH 6/7] net/bnxt: move locally used functions to static Kalesh A P
2020-02-06 16:33 ` [dpdk-dev] [PATCH 7/7] net/bnxt: fix buffer allocation reattempt logic Kalesh A P
2020-02-06 18:44 ` [dpdk-dev] [PATCH v2 0/7] bnxt patchset with bug fixes Ajit Khaparde
2020-02-06 18:44 ` [dpdk-dev] [PATCH v2 1/7] net/bnxt: fix unnecessary delay in port stop Ajit Khaparde
2020-02-06 18:44 ` [dpdk-dev] [PATCH v2 2/7] net/bnxt: fix default timeout for command to get FW version Ajit Khaparde
2020-02-06 18:44 ` [dpdk-dev] [PATCH v2 3/7] net/bnxt: log firmware debug notifications Ajit Khaparde
2020-02-06 18:44 ` [dpdk-dev] [PATCH v2 4/7] net/bnxt: register for debug notification event from FW Ajit Khaparde
2020-02-06 18:44 ` [dpdk-dev] [PATCH v2 5/7] net/bnxt: fix to call port stop when error recovery fails Ajit Khaparde
2020-02-06 18:44 ` [dpdk-dev] [PATCH v2 6/7] net/bnxt: move locally used functions to static Ajit Khaparde
2020-02-06 18:44 ` [dpdk-dev] [PATCH v2 7/7] net/bnxt: fix buffer allocation reattempt logic Ajit Khaparde
2020-02-06 18:50 ` [dpdk-dev] [PATCH v2 0/7] bnxt patchset with bug fixes Ajit Khaparde
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).