* [dpdk-dev] [PATCH 00/10] bnxt patchset with bug fixes
@ 2019-10-04 5:02 Ajit Khaparde
2019-10-04 5:02 ` [dpdk-dev] [PATCH 01/10] net/bnxt: change return value of few routines Ajit Khaparde
` (9 more replies)
0 siblings, 10 replies; 27+ messages in thread
From: Ajit Khaparde @ 2019-10-04 5:02 UTC (permalink / raw)
To: dev; +Cc: ferruh.yigit
This patch against dpdk-next-net contains bug fixes
for issues found during testing.
This patch is dependent on bnxt patchset
https://patchwork.dpdk.org/project/dpdk/list/?series=6686
Please apply. Thanks
Ajit Khaparde (2):
net/bnxt: update trusted VF status only when it changes
net/bnxt: get the default HWRM command timeout from firmware
Kalesh AP (5):
net/bnxt: change return value of few routines
net/bnxt: return error if setting link up fail
net/bnxt: remove redundant header file inclusion
net/bnxt: fix to handle if change status in port start only
net/bnxt: remove a useless check in validate flow routine
Rahul Gupta (2):
net/bnxt: reduce cleanup time during reset recovery
net/bnxt: change msix vector to queue mapping
Santoshkumar Karanappa Rastapur (1):
net/bnxt: free default completion ring before VF configuration
drivers/net/bnxt/bnxt.h | 8 ++++++
drivers/net/bnxt/bnxt_cpr.c | 1 -
drivers/net/bnxt/bnxt_ethdev.c | 45 ++++++++++++++++++++++------------
drivers/net/bnxt/bnxt_flow.c | 4 +--
drivers/net/bnxt/bnxt_hwrm.c | 22 ++++++++++++-----
drivers/net/bnxt/bnxt_irq.c | 1 -
drivers/net/bnxt/bnxt_irq.h | 3 ---
drivers/net/bnxt/bnxt_ring.c | 7 ++----
drivers/net/bnxt/bnxt_ring.h | 2 +-
drivers/net/bnxt/bnxt_rxq.c | 1 -
drivers/net/bnxt/bnxt_rxr.c | 1 -
drivers/net/bnxt/bnxt_txq.c | 1 -
drivers/net/bnxt/bnxt_txr.c | 1 -
13 files changed, 57 insertions(+), 40 deletions(-)
--
2.20.1 (Apple Git-117)
^ permalink raw reply [flat|nested] 27+ messages in thread
* [dpdk-dev] [PATCH 01/10] net/bnxt: change return value of few routines
2019-10-04 5:02 [dpdk-dev] [PATCH 00/10] bnxt patchset with bug fixes Ajit Khaparde
@ 2019-10-04 5:02 ` Ajit Khaparde
2019-10-04 5:02 ` [dpdk-dev] [PATCH 02/10] net/bnxt: free default completion ring before VF configuration Ajit Khaparde
` (8 subsequent siblings)
9 siblings, 0 replies; 27+ messages in thread
From: Ajit Khaparde @ 2019-10-04 5:02 UTC (permalink / raw)
To: dev
Cc: ferruh.yigit, Kalesh AP, Somnath Kotur, Santoshkumar Karanappa Rastapur
From: Kalesh AP <kalesh-anakkur.purayil@broadcom.com>
Change bnxt_init_nic() and bnxt_init_ring_grps() to void functions
as these can never fail.
Signed-off-by: Kalesh AP <kalesh-anakkur.purayil@broadcom.com>
Reviewed-by: Somnath Kotur <somnath.kotur@broadcom.com>
Reviewed-by: Santoshkumar Karanappa Rastapur <santosh.rastapur@broadcom.com>
---
drivers/net/bnxt/bnxt_ethdev.c | 13 +++----------
drivers/net/bnxt/bnxt_ring.c | 4 +---
drivers/net/bnxt/bnxt_ring.h | 2 +-
3 files changed, 5 insertions(+), 14 deletions(-)
diff --git a/drivers/net/bnxt/bnxt_ethdev.c b/drivers/net/bnxt/bnxt_ethdev.c
index 5160ac002b..533c6a07fd 100644
--- a/drivers/net/bnxt/bnxt_ethdev.c
+++ b/drivers/net/bnxt/bnxt_ethdev.c
@@ -518,20 +518,13 @@ static int bnxt_shutdown_nic(struct bnxt *bp)
return 0;
}
-static int bnxt_init_nic(struct bnxt *bp)
+static void bnxt_init_nic(struct bnxt *bp)
{
- int rc;
-
- if (BNXT_HAS_RING_GRPS(bp)) {
- rc = bnxt_init_ring_grps(bp);
- if (rc)
- return rc;
- }
+ if (BNXT_HAS_RING_GRPS(bp))
+ bnxt_init_ring_grps(bp);
bnxt_init_vnics(bp);
bnxt_init_filters(bp);
-
- return 0;
}
/*
diff --git a/drivers/net/bnxt/bnxt_ring.c b/drivers/net/bnxt/bnxt_ring.c
index 19fc45395d..0ee31ed4e8 100644
--- a/drivers/net/bnxt/bnxt_ring.c
+++ b/drivers/net/bnxt/bnxt_ring.c
@@ -39,15 +39,13 @@ void bnxt_free_ring(struct bnxt_ring *ring)
* Ring groups
*/
-int bnxt_init_ring_grps(struct bnxt *bp)
+void bnxt_init_ring_grps(struct bnxt *bp)
{
unsigned int i;
for (i = 0; i < bp->max_ring_grps; i++)
memset(&bp->grp_info[i], (uint8_t)HWRM_NA_SIGNATURE,
sizeof(struct bnxt_ring_grp_info));
-
- return 0;
}
int bnxt_alloc_ring_grps(struct bnxt *bp)
diff --git a/drivers/net/bnxt/bnxt_ring.h b/drivers/net/bnxt/bnxt_ring.h
index 833118391b..645dcf0e87 100644
--- a/drivers/net/bnxt/bnxt_ring.h
+++ b/drivers/net/bnxt/bnxt_ring.h
@@ -65,7 +65,7 @@ struct bnxt_tx_ring_info;
struct bnxt_rx_ring_info;
struct bnxt_cp_ring_info;
void bnxt_free_ring(struct bnxt_ring *ring);
-int bnxt_init_ring_grps(struct bnxt *bp);
+void bnxt_init_ring_grps(struct bnxt *bp);
int bnxt_alloc_ring_grps(struct bnxt *bp);
int bnxt_alloc_rings(struct bnxt *bp, uint16_t qidx,
struct bnxt_tx_queue *txq,
--
2.20.1 (Apple Git-117)
^ permalink raw reply [flat|nested] 27+ messages in thread
* [dpdk-dev] [PATCH 02/10] net/bnxt: free default completion ring before VF configuration
2019-10-04 5:02 [dpdk-dev] [PATCH 00/10] bnxt patchset with bug fixes Ajit Khaparde
2019-10-04 5:02 ` [dpdk-dev] [PATCH 01/10] net/bnxt: change return value of few routines Ajit Khaparde
@ 2019-10-04 5:02 ` Ajit Khaparde
2019-10-04 5:02 ` [dpdk-dev] [PATCH 03/10] net/bnxt: return error if setting link up fail Ajit Khaparde
` (7 subsequent siblings)
9 siblings, 0 replies; 27+ messages in thread
From: Ajit Khaparde @ 2019-10-04 5:02 UTC (permalink / raw)
To: dev; +Cc: ferruh.yigit, Santoshkumar Karanappa Rastapur
From: Santoshkumar Karanappa Rastapur <santosh.rastapur@broadcom.com>
If the VF resources need to be reconfigured using the
bnxt_hwrm_func_reserve_vf_resc, make sure that the default completion
ring is freed first before the resources are reserved.
Reallocate the ring once the VF resources are configured.
Signed-off-by: Santoshkumar Karanappa Rastapur <santosh.rastapur@broadcom.com>
Reviewed-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
---
drivers/net/bnxt/bnxt_ethdev.c | 17 +++++++++++++++++
1 file changed, 17 insertions(+)
diff --git a/drivers/net/bnxt/bnxt_ethdev.c b/drivers/net/bnxt/bnxt_ethdev.c
index 533c6a07fd..2a9b7e5459 100644
--- a/drivers/net/bnxt/bnxt_ethdev.c
+++ b/drivers/net/bnxt/bnxt_ethdev.c
@@ -662,11 +662,28 @@ static int bnxt_dev_configure_op(struct rte_eth_dev *eth_dev)
return -ENOSPC;
}
+ /* If a resource has already been allocated - in this case
+ * it is the async completion ring, free it. Reallocate it after
+ * resource reservation. This will ensure the resource counts
+ * are calculated correctly.
+ */
+ if (!BNXT_HAS_NQ(bp) && bp->async_cp_ring) {
+ bnxt_disable_int(bp);
+ bnxt_free_cp_ring(bp, bp->async_cp_ring);
+ }
+
rc = bnxt_hwrm_func_reserve_vf_resc(bp, false);
if (rc) {
PMD_DRV_LOG(ERR, "HWRM resource alloc fail:%x\n", rc);
return -ENOSPC;
}
+
+ if (!BNXT_HAS_NQ(bp) && bp->async_cp_ring) {
+ rc = bnxt_alloc_async_cp_ring(bp);
+ if (rc)
+ return rc;
+ bnxt_enable_int(bp);
+ }
} else {
/* legacy driver needs to get updated values */
rc = bnxt_hwrm_func_qcaps(bp);
--
2.20.1 (Apple Git-117)
^ permalink raw reply [flat|nested] 27+ messages in thread
* [dpdk-dev] [PATCH 03/10] net/bnxt: return error if setting link up fail
2019-10-04 5:02 [dpdk-dev] [PATCH 00/10] bnxt patchset with bug fixes Ajit Khaparde
2019-10-04 5:02 ` [dpdk-dev] [PATCH 01/10] net/bnxt: change return value of few routines Ajit Khaparde
2019-10-04 5:02 ` [dpdk-dev] [PATCH 02/10] net/bnxt: free default completion ring before VF configuration Ajit Khaparde
@ 2019-10-04 5:02 ` Ajit Khaparde
2019-10-04 5:02 ` [dpdk-dev] [PATCH 04/10] net/bnxt: remove redundant header file inclusion Ajit Khaparde
` (6 subsequent siblings)
9 siblings, 0 replies; 27+ messages in thread
From: Ajit Khaparde @ 2019-10-04 5:02 UTC (permalink / raw)
To: dev; +Cc: ferruh.yigit, Kalesh AP, stable, Somnath Kotur
From: Kalesh AP <kalesh-anakkur.purayil@broadcom.com>
Currently bnxt driver does not return error in case setting link up fails.
Fixes: 5c206086feaa ("net/bnxt: add link state operations")
Cc: stable@dpdk.org
Signed-off-by: Kalesh AP <kalesh-anakkur.purayil@broadcom.com>
Reviewed-by: Somnath Kotur <somnath.kotur@broadcom.com>
---
drivers/net/bnxt/bnxt_ethdev.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/net/bnxt/bnxt_ethdev.c b/drivers/net/bnxt/bnxt_ethdev.c
index 2a9b7e5459..e9eab098b5 100644
--- a/drivers/net/bnxt/bnxt_ethdev.c
+++ b/drivers/net/bnxt/bnxt_ethdev.c
@@ -923,7 +923,7 @@ static int bnxt_dev_set_link_up_op(struct rte_eth_dev *eth_dev)
eth_dev->data->dev_link.link_status = 1;
bnxt_print_link_info(eth_dev);
- return 0;
+ return rc;
}
static int bnxt_dev_set_link_down_op(struct rte_eth_dev *eth_dev)
--
2.20.1 (Apple Git-117)
^ permalink raw reply [flat|nested] 27+ messages in thread
* [dpdk-dev] [PATCH 04/10] net/bnxt: remove redundant header file inclusion
2019-10-04 5:02 [dpdk-dev] [PATCH 00/10] bnxt patchset with bug fixes Ajit Khaparde
` (2 preceding siblings ...)
2019-10-04 5:02 ` [dpdk-dev] [PATCH 03/10] net/bnxt: return error if setting link up fail Ajit Khaparde
@ 2019-10-04 5:02 ` Ajit Khaparde
2019-10-08 8:44 ` Ferruh Yigit
2019-10-04 5:02 ` [dpdk-dev] [PATCH 05/10] net/bnxt: update trusted VF status only when it changes Ajit Khaparde
` (5 subsequent siblings)
9 siblings, 1 reply; 27+ messages in thread
From: Ajit Khaparde @ 2019-10-04 5:02 UTC (permalink / raw)
To: dev; +Cc: ferruh.yigit, Kalesh AP
From: Kalesh AP <kalesh-anakkur.purayil@broadcom.com>
bnxt.h header includes bnxt_cpr.h and bnxt_util.h.
There is no need to include these headers file explicitly.
This commit does not cause any functional change.
Signed-off-by: Kalesh AP <kalesh-anakkur.purayil@broadcom.com>
Reviewed-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
---
drivers/net/bnxt/bnxt_cpr.c | 1 -
drivers/net/bnxt/bnxt_ethdev.c | 2 --
drivers/net/bnxt/bnxt_flow.c | 1 -
drivers/net/bnxt/bnxt_hwrm.c | 1 -
drivers/net/bnxt/bnxt_irq.c | 1 -
drivers/net/bnxt/bnxt_ring.c | 1 -
drivers/net/bnxt/bnxt_rxq.c | 1 -
drivers/net/bnxt/bnxt_rxr.c | 1 -
drivers/net/bnxt/bnxt_txq.c | 1 -
drivers/net/bnxt/bnxt_txr.c | 1 -
10 files changed, 11 deletions(-)
diff --git a/drivers/net/bnxt/bnxt_cpr.c b/drivers/net/bnxt/bnxt_cpr.c
index f58372516a..118cf034d2 100644
--- a/drivers/net/bnxt/bnxt_cpr.c
+++ b/drivers/net/bnxt/bnxt_cpr.c
@@ -8,7 +8,6 @@
#include <rte_cycles.h>
#include "bnxt.h"
-#include "bnxt_cpr.h"
#include "bnxt_hwrm.h"
#include "bnxt_ring.h"
#include "hsi_struct_def_dpdk.h"
diff --git a/drivers/net/bnxt/bnxt_ethdev.c b/drivers/net/bnxt/bnxt_ethdev.c
index e9eab098b5..3b48f44f85 100644
--- a/drivers/net/bnxt/bnxt_ethdev.c
+++ b/drivers/net/bnxt/bnxt_ethdev.c
@@ -14,7 +14,6 @@
#include <rte_alarm.h>
#include "bnxt.h"
-#include "bnxt_cpr.h"
#include "bnxt_filter.h"
#include "bnxt_hwrm.h"
#include "bnxt_irq.h"
@@ -27,7 +26,6 @@
#include "bnxt_vnic.h"
#include "hsi_struct_def_dpdk.h"
#include "bnxt_nvm_defs.h"
-#include "bnxt_util.h"
#define DRV_MODULE_NAME "bnxt"
static const char bnxt_version[] =
diff --git a/drivers/net/bnxt/bnxt_flow.c b/drivers/net/bnxt/bnxt_flow.c
index 0a91c08eee..d753a334b9 100644
--- a/drivers/net/bnxt/bnxt_flow.c
+++ b/drivers/net/bnxt/bnxt_flow.c
@@ -17,7 +17,6 @@
#include "bnxt_ring.h"
#include "bnxt_rxq.h"
#include "bnxt_vnic.h"
-#include "bnxt_util.h"
#include "hsi_struct_def_dpdk.h"
static int
diff --git a/drivers/net/bnxt/bnxt_hwrm.c b/drivers/net/bnxt/bnxt_hwrm.c
index 0d5362581e..f78beff711 100644
--- a/drivers/net/bnxt/bnxt_hwrm.c
+++ b/drivers/net/bnxt/bnxt_hwrm.c
@@ -13,7 +13,6 @@
#include <rte_version.h>
#include "bnxt.h"
-#include "bnxt_cpr.h"
#include "bnxt_filter.h"
#include "bnxt_hwrm.h"
#include "bnxt_rxq.h"
diff --git a/drivers/net/bnxt/bnxt_irq.c b/drivers/net/bnxt/bnxt_irq.c
index 729d68d704..6c5bcfb623 100644
--- a/drivers/net/bnxt/bnxt_irq.c
+++ b/drivers/net/bnxt/bnxt_irq.c
@@ -9,7 +9,6 @@
#include <rte_malloc.h>
#include "bnxt.h"
-#include "bnxt_cpr.h"
#include "bnxt_irq.h"
#include "bnxt_ring.h"
#include "hsi_struct_def_dpdk.h"
diff --git a/drivers/net/bnxt/bnxt_ring.c b/drivers/net/bnxt/bnxt_ring.c
index 0ee31ed4e8..4d6bad3dbe 100644
--- a/drivers/net/bnxt/bnxt_ring.c
+++ b/drivers/net/bnxt/bnxt_ring.c
@@ -9,7 +9,6 @@
#include <unistd.h>
#include "bnxt.h"
-#include "bnxt_cpr.h"
#include "bnxt_hwrm.h"
#include "bnxt_ring.h"
#include "bnxt_rxq.h"
diff --git a/drivers/net/bnxt/bnxt_rxq.c b/drivers/net/bnxt/bnxt_rxq.c
index 9439fcd1fb..a46f96827c 100644
--- a/drivers/net/bnxt/bnxt_rxq.c
+++ b/drivers/net/bnxt/bnxt_rxq.c
@@ -8,7 +8,6 @@
#include <rte_malloc.h>
#include "bnxt.h"
-#include "bnxt_cpr.h"
#include "bnxt_filter.h"
#include "bnxt_hwrm.h"
#include "bnxt_ring.h"
diff --git a/drivers/net/bnxt/bnxt_rxr.c b/drivers/net/bnxt/bnxt_rxr.c
index bda4f4c1b9..f0f9b020b1 100644
--- a/drivers/net/bnxt/bnxt_rxr.c
+++ b/drivers/net/bnxt/bnxt_rxr.c
@@ -12,7 +12,6 @@
#include <rte_memory.h>
#include "bnxt.h"
-#include "bnxt_cpr.h"
#include "bnxt_ring.h"
#include "bnxt_rxr.h"
#include "bnxt_rxq.h"
diff --git a/drivers/net/bnxt/bnxt_txq.c b/drivers/net/bnxt/bnxt_txq.c
index 5ad4ee155e..ebb9199d2d 100644
--- a/drivers/net/bnxt/bnxt_txq.c
+++ b/drivers/net/bnxt/bnxt_txq.c
@@ -8,7 +8,6 @@
#include <rte_malloc.h>
#include "bnxt.h"
-#include "bnxt_cpr.h"
#include "bnxt_ring.h"
#include "bnxt_txq.h"
#include "bnxt_txr.h"
diff --git a/drivers/net/bnxt/bnxt_txr.c b/drivers/net/bnxt/bnxt_txr.c
index 6e2ee86c05..16021407e8 100644
--- a/drivers/net/bnxt/bnxt_txr.c
+++ b/drivers/net/bnxt/bnxt_txr.c
@@ -9,7 +9,6 @@
#include <rte_malloc.h>
#include "bnxt.h"
-#include "bnxt_cpr.h"
#include "bnxt_ring.h"
#include "bnxt_txq.h"
#include "bnxt_txr.h"
--
2.20.1 (Apple Git-117)
^ permalink raw reply [flat|nested] 27+ messages in thread
* [dpdk-dev] [PATCH 05/10] net/bnxt: update trusted VF status only when it changes
2019-10-04 5:02 [dpdk-dev] [PATCH 00/10] bnxt patchset with bug fixes Ajit Khaparde
` (3 preceding siblings ...)
2019-10-04 5:02 ` [dpdk-dev] [PATCH 04/10] net/bnxt: remove redundant header file inclusion Ajit Khaparde
@ 2019-10-04 5:02 ` Ajit Khaparde
2019-10-04 5:02 ` [dpdk-dev] [PATCH 06/10] net/bnxt: get the default HWRM command timeout from firmware Ajit Khaparde
` (4 subsequent siblings)
9 siblings, 0 replies; 27+ messages in thread
From: Ajit Khaparde @ 2019-10-04 5:02 UTC (permalink / raw)
To: dev; +Cc: ferruh.yigit, stable, Somnath Kotur
We are currently logging trusted VF information everytime a VF config
change is indicated by the async message. Update it only when new setting
is different from the current setting.
Fixes: b42c15c83e88 ("net/bnxt: support trusted VF")
Cc: stable@dpdk.org
Signed-off-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
Reviewed-by: Somnath Kotur <somnath.kotur@broadcom.com>
---
drivers/net/bnxt/bnxt_hwrm.c | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/drivers/net/bnxt/bnxt_hwrm.c b/drivers/net/bnxt/bnxt_hwrm.c
index f78beff711..a40197e929 100644
--- a/drivers/net/bnxt/bnxt_hwrm.c
+++ b/drivers/net/bnxt/bnxt_hwrm.c
@@ -2873,10 +2873,13 @@ int bnxt_hwrm_func_qcfg(struct bnxt *bp, uint16_t *mtu)
if (BNXT_PF(bp) && (flags & HWRM_FUNC_QCFG_OUTPUT_FLAGS_MULTI_HOST))
bp->flags |= BNXT_FLAG_MULTI_HOST;
- if (BNXT_VF(bp) && (flags & HWRM_FUNC_QCFG_OUTPUT_FLAGS_TRUSTED_VF)) {
+ if (BNXT_VF(bp) &&
+ !BNXT_VF_IS_TRUSTED(bp) &&
+ (flags & HWRM_FUNC_QCFG_OUTPUT_FLAGS_TRUSTED_VF)) {
bp->flags |= BNXT_FLAG_TRUSTED_VF_EN;
PMD_DRV_LOG(INFO, "Trusted VF cap enabled\n");
} else if (BNXT_VF(bp) &&
+ BNXT_VF_IS_TRUSTED(bp) &&
!(flags & HWRM_FUNC_QCFG_OUTPUT_FLAGS_TRUSTED_VF)) {
bp->flags &= ~BNXT_FLAG_TRUSTED_VF_EN;
PMD_DRV_LOG(INFO, "Trusted VF cap disabled\n");
--
2.20.1 (Apple Git-117)
^ permalink raw reply [flat|nested] 27+ messages in thread
* [dpdk-dev] [PATCH 06/10] net/bnxt: get the default HWRM command timeout from firmware
2019-10-04 5:02 [dpdk-dev] [PATCH 00/10] bnxt patchset with bug fixes Ajit Khaparde
` (4 preceding siblings ...)
2019-10-04 5:02 ` [dpdk-dev] [PATCH 05/10] net/bnxt: update trusted VF status only when it changes Ajit Khaparde
@ 2019-10-04 5:02 ` Ajit Khaparde
2019-10-04 5:02 ` [dpdk-dev] [PATCH 07/10] net/bnxt: reduce cleanup time during reset recovery Ajit Khaparde
` (3 subsequent siblings)
9 siblings, 0 replies; 27+ messages in thread
From: Ajit Khaparde @ 2019-10-04 5:02 UTC (permalink / raw)
To: dev; +Cc: ferruh.yigit, Santoshkumar Karanappa Rastapur, Lance Richardson
The HWRM command timeout is set to a very high value.
VER_GET command response returns the default request timeout value.
Use this value for waiting for HWRM commands to complete.
Poll for the valid bit every 1us instead of 600us.
Signed-off-by: Santoshkumar Karanappa Rastapur <santosh.rastapur@broadcom.com>
Signed-off-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
Reviewed-by: Lance Richardson <lance.richardson@broadcom.com>
---
drivers/net/bnxt/bnxt.h | 5 +++++
drivers/net/bnxt/bnxt_hwrm.c | 13 +++++++++----
2 files changed, 14 insertions(+), 4 deletions(-)
diff --git a/drivers/net/bnxt/bnxt.h b/drivers/net/bnxt/bnxt.h
index ad0b18dddd..5020cd3415 100644
--- a/drivers/net/bnxt/bnxt.h
+++ b/drivers/net/bnxt/bnxt.h
@@ -525,6 +525,11 @@ 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 HWRM request timeout value */
+ uint32_t hwrm_cmd_timeout;
+
struct bnxt_link_info link_info;
struct bnxt_cos_queue_info rx_cos_queue[BNXT_COS_QUEUE_COUNT];
struct bnxt_cos_queue_info tx_cos_queue[BNXT_COS_QUEUE_COUNT];
diff --git a/drivers/net/bnxt/bnxt_hwrm.c b/drivers/net/bnxt/bnxt_hwrm.c
index a40197e929..5e3117fee9 100644
--- a/drivers/net/bnxt/bnxt_hwrm.c
+++ b/drivers/net/bnxt/bnxt_hwrm.c
@@ -25,8 +25,6 @@
#include <rte_io.h>
-#define HWRM_CMD_TIMEOUT 6000000
-#define HWRM_SHORT_CMD_TIMEOUT 50000
#define HWRM_SPEC_CODE_1_8_3 0x10803
#define HWRM_VERSION_1_9_1 0x10901
#define HWRM_VERSION_1_9_2 0x10903
@@ -105,9 +103,9 @@ static int bnxt_hwrm_send_message(struct bnxt *bp, void *msg,
/* For VER_GET command, set timeout as 50ms */
if (rte_cpu_to_le_16(req->req_type) == HWRM_VER_GET)
- timeout = HWRM_SHORT_CMD_TIMEOUT;
- else
timeout = HWRM_CMD_TIMEOUT;
+ else
+ timeout = bp->hwrm_cmd_timeout;
if (bp->flags & BNXT_FLAG_SHORT_CMD ||
msg_len > bp->max_req_len) {
@@ -969,6 +967,13 @@ int bnxt_hwrm_ver_get(struct bnxt *bp)
fw_version |= resp->hwrm_intf_upd_8b;
bp->hwrm_spec_code = fw_version;
+ /* def_req_timeout value is in milliseconds */
+ bp->hwrm_cmd_timeout = rte_le_to_cpu_16(resp->def_req_timeout);
+ /* convert timeout to usec */
+ bp->hwrm_cmd_timeout *= 1000;
+ if (!bp->hwrm_cmd_timeout)
+ bp->hwrm_cmd_timeout = HWRM_CMD_TIMEOUT;
+
if (resp->hwrm_intf_maj_8b != HWRM_VERSION_MAJOR) {
PMD_DRV_LOG(ERR, "Unsupported firmware API version\n");
rc = -EINVAL;
--
2.20.1 (Apple Git-117)
^ permalink raw reply [flat|nested] 27+ messages in thread
* [dpdk-dev] [PATCH 07/10] net/bnxt: reduce cleanup time during reset recovery
2019-10-04 5:02 [dpdk-dev] [PATCH 00/10] bnxt patchset with bug fixes Ajit Khaparde
` (5 preceding siblings ...)
2019-10-04 5:02 ` [dpdk-dev] [PATCH 06/10] net/bnxt: get the default HWRM command timeout from firmware Ajit Khaparde
@ 2019-10-04 5:02 ` Ajit Khaparde
2019-10-04 5:02 ` [dpdk-dev] [PATCH 08/10] net/bnxt: change msix vector to queue mapping Ajit Khaparde
` (2 subsequent siblings)
9 siblings, 0 replies; 27+ messages in thread
From: Ajit Khaparde @ 2019-10-04 5:02 UTC (permalink / raw)
To: dev; +Cc: ferruh.yigit, Rahul Gupta, Kalesh Anakkur Purayil
From: Rahul Gupta <rahul.gupta@broadcom.com>
In stop_op(), don't wait for link down event's ASYNC response from FW.
Signed-off-by: Rahul Gupta <rahul.gupta@broadcom.com>
Reviewed-by: Kalesh Anakkur Purayil <kalesh-anakkur.purayil@broadcom.com>
Reviewed-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
---
drivers/net/bnxt/bnxt_ethdev.c | 8 ++++++--
1 file changed, 6 insertions(+), 2 deletions(-)
diff --git a/drivers/net/bnxt/bnxt_ethdev.c b/drivers/net/bnxt/bnxt_ethdev.c
index 3b48f44f85..fb4deef821 100644
--- a/drivers/net/bnxt/bnxt_ethdev.c
+++ b/drivers/net/bnxt/bnxt_ethdev.c
@@ -960,8 +960,12 @@ static void bnxt_dev_stop_op(struct rte_eth_dev *eth_dev)
eth_dev->data->dev_link.link_status = 0;
}
bnxt_dev_set_link_down_op(eth_dev);
- /* Wait for link to be reset and the async notification to process. */
- rte_delay_ms(BNXT_LINK_WAIT_INTERVAL * 2);
+
+ /* Wait for link to be reset and the async notification to process.
+ * During reset recovery, there is no need to wait
+ */
+ if (!is_bnxt_in_error(bp))
+ rte_delay_ms(BNXT_LINK_WAIT_INTERVAL * 2);
/* Clean queue intr-vector mapping */
rte_intr_efd_disable(intr_handle);
--
2.20.1 (Apple Git-117)
^ permalink raw reply [flat|nested] 27+ messages in thread
* [dpdk-dev] [PATCH 08/10] net/bnxt: change msix vector to queue mapping
2019-10-04 5:02 [dpdk-dev] [PATCH 00/10] bnxt patchset with bug fixes Ajit Khaparde
` (6 preceding siblings ...)
2019-10-04 5:02 ` [dpdk-dev] [PATCH 07/10] net/bnxt: reduce cleanup time during reset recovery Ajit Khaparde
@ 2019-10-04 5:02 ` Ajit Khaparde
2019-10-04 5:02 ` [dpdk-dev] [PATCH 09/10] net/bnxt: fix to handle if change status in port start only Ajit Khaparde
2019-10-04 5:02 ` [dpdk-dev] [PATCH 10/10] net/bnxt: remove a useless check in validate flow routine Ajit Khaparde
9 siblings, 0 replies; 27+ messages in thread
From: Ajit Khaparde @ 2019-10-04 5:02 UTC (permalink / raw)
To: dev; +Cc: ferruh.yigit, Rahul Gupta
From: Rahul Gupta <rahul.gupta@broadcom.com>
DPDK PCIe-VFIO framework configures base MSIX vector for interrupts
which is supported by other h/w. In case of bnxt, base MSIX vector
starts with the RX completion queue 0. To comply with the DPDK
framework We need to increase the map index by 1 so that RXTX
completion queues events can be delivered to appropriate event listeners
by kernel VFIO.
Signed-off-by: Rahul Gupta <rahul.gupta@broadcom.com>
Reviewed-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
---
drivers/net/bnxt/bnxt.h | 3 +++
drivers/net/bnxt/bnxt_irq.h | 3 ---
drivers/net/bnxt/bnxt_ring.c | 2 +-
3 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/drivers/net/bnxt/bnxt.h b/drivers/net/bnxt/bnxt.h
index 5020cd3415..080365804c 100644
--- a/drivers/net/bnxt/bnxt.h
+++ b/drivers/net/bnxt/bnxt.h
@@ -58,6 +58,9 @@
#define BNXT_NUM_ASYNC_CPR(bp) 1
#endif
+#define BNXT_MISC_VEC_ID RTE_INTR_VEC_ZERO_OFFSET
+#define BNXT_RX_VEC_START RTE_INTR_VEC_RXTX_OFFSET
+
/* Chimp Communication Channel */
#define GRCPF_REG_CHIMP_CHANNEL_OFFSET 0x0
#define GRCPF_REG_CHIMP_COMM_TRIGGER 0x100
diff --git a/drivers/net/bnxt/bnxt_irq.h b/drivers/net/bnxt/bnxt_irq.h
index 1b56e08068..ad8a1df9ca 100644
--- a/drivers/net/bnxt/bnxt_irq.h
+++ b/drivers/net/bnxt/bnxt_irq.h
@@ -6,9 +6,6 @@
#ifndef _BNXT_IRQ_H_
#define _BNXT_IRQ_H_
-#define BNXT_MISC_VEC_ID RTE_INTR_VEC_ZERO_OFFSET
-#define BNXT_RX_VEC_START RTE_INTR_VEC_RXTX_OFFSET
-
struct bnxt_irq {
rte_intr_callback_fn handler;
unsigned int vector;
diff --git a/drivers/net/bnxt/bnxt_ring.c b/drivers/net/bnxt/bnxt_ring.c
index 4d6bad3dbe..a6e0915e2d 100644
--- a/drivers/net/bnxt/bnxt_ring.c
+++ b/drivers/net/bnxt/bnxt_ring.c
@@ -404,7 +404,7 @@ static int bnxt_alloc_cmpl_ring(struct bnxt *bp, int queue_index,
{
struct bnxt_ring *cp_ring = cpr->cp_ring_struct;
uint32_t nq_ring_id = HWRM_NA_SIGNATURE;
- int cp_ring_index = queue_index + BNXT_NUM_ASYNC_CPR(bp);
+ int cp_ring_index = queue_index + BNXT_RX_VEC_START;
struct bnxt_cp_ring_info *nqr = bp->rxtx_nq_ring;
uint8_t ring_type;
int rc = 0;
--
2.20.1 (Apple Git-117)
^ permalink raw reply [flat|nested] 27+ messages in thread
* [dpdk-dev] [PATCH 09/10] net/bnxt: fix to handle if change status in port start only
2019-10-04 5:02 [dpdk-dev] [PATCH 00/10] bnxt patchset with bug fixes Ajit Khaparde
` (7 preceding siblings ...)
2019-10-04 5:02 ` [dpdk-dev] [PATCH 08/10] net/bnxt: change msix vector to queue mapping Ajit Khaparde
@ 2019-10-04 5:02 ` Ajit Khaparde
2019-10-04 5:02 ` [dpdk-dev] [PATCH 10/10] net/bnxt: remove a useless check in validate flow routine Ajit Khaparde
9 siblings, 0 replies; 27+ messages in thread
From: Ajit Khaparde @ 2019-10-04 5:02 UTC (permalink / raw)
To: dev; +Cc: ferruh.yigit, Kalesh AP
From: Kalesh AP <kalesh-anakkur.purayil@broadcom.com>
Driver should handle if change status during port start only.
Also fixed to enable interrupts after issuing hwrm_if_change.
Fixes: 92d6617b6e33 ("net/bnxt: inform firmware about IF state changes")
Signed-off-by: Kalesh AP <kalesh-anakkur.purayil@broadcom.com>
---
drivers/net/bnxt/bnxt_ethdev.c | 3 ++-
drivers/net/bnxt/bnxt_hwrm.c | 3 +++
2 files changed, 5 insertions(+), 1 deletion(-)
diff --git a/drivers/net/bnxt/bnxt_ethdev.c b/drivers/net/bnxt/bnxt_ethdev.c
index fb4deef821..81d58a60c5 100644
--- a/drivers/net/bnxt/bnxt_ethdev.c
+++ b/drivers/net/bnxt/bnxt_ethdev.c
@@ -867,7 +867,6 @@ static int bnxt_dev_start_op(struct rte_eth_dev *eth_dev)
bp->rx_cp_nr_rings, RTE_ETHDEV_QUEUE_STAT_CNTRS);
}
- bnxt_enable_int(bp);
rc = bnxt_hwrm_if_change(bp, 1);
if (!rc) {
if (bp->flags & BNXT_FLAG_IF_CHANGE_HOT_FW_RESET_DONE) {
@@ -877,6 +876,8 @@ static int bnxt_dev_start_op(struct rte_eth_dev *eth_dev)
}
}
+ bnxt_enable_int(bp);
+
rc = bnxt_init_chip(bp);
if (rc)
goto error;
diff --git a/drivers/net/bnxt/bnxt_hwrm.c b/drivers/net/bnxt/bnxt_hwrm.c
index 5e3117fee9..f94fdde2b1 100644
--- a/drivers/net/bnxt/bnxt_hwrm.c
+++ b/drivers/net/bnxt/bnxt_hwrm.c
@@ -4858,6 +4858,9 @@ int bnxt_hwrm_if_change(struct bnxt *bp, bool up)
flags = rte_le_to_cpu_32(resp->flags);
HWRM_UNLOCK();
+ if (!up)
+ return 0;
+
if (flags & HWRM_FUNC_DRV_IF_CHANGE_OUTPUT_FLAGS_HOT_FW_RESET_DONE) {
PMD_DRV_LOG(INFO, "FW reset happened while port was down\n");
bp->flags |= BNXT_FLAG_IF_CHANGE_HOT_FW_RESET_DONE;
--
2.20.1 (Apple Git-117)
^ permalink raw reply [flat|nested] 27+ messages in thread
* [dpdk-dev] [PATCH 10/10] net/bnxt: remove a useless check in validate flow routine
2019-10-04 5:02 [dpdk-dev] [PATCH 00/10] bnxt patchset with bug fixes Ajit Khaparde
` (8 preceding siblings ...)
2019-10-04 5:02 ` [dpdk-dev] [PATCH 09/10] net/bnxt: fix to handle if change status in port start only Ajit Khaparde
@ 2019-10-04 5:02 ` Ajit Khaparde
2019-10-08 9:03 ` Ferruh Yigit
9 siblings, 1 reply; 27+ messages in thread
From: Ajit Khaparde @ 2019-10-04 5:02 UTC (permalink / raw)
To: dev; +Cc: ferruh.yigit, Kalesh AP
From: Kalesh AP <kalesh-anakkur.purayil@broadcom.com>
Since vnic->rx_queue_cnt is already checked against non-zero,
removed the useless check from the inside condition check.
Fixes: 4be31562a4ba ("net/bnxt: allow flow creation when RSS is enabled")
Signed-off-by: Kalesh AP <kalesh-anakkur.purayil@broadcom.com>
Reviewed-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
---
drivers/net/bnxt/bnxt_flow.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/drivers/net/bnxt/bnxt_flow.c b/drivers/net/bnxt/bnxt_flow.c
index d753a334b9..5aeb001408 100644
--- a/drivers/net/bnxt/bnxt_flow.c
+++ b/drivers/net/bnxt/bnxt_flow.c
@@ -1067,8 +1067,7 @@ bnxt_validate_and_parse_flow(struct rte_eth_dev *dev,
goto ret;
}
if (vnic->rx_queue_cnt) {
- if (vnic->rx_queue_cnt > 1 ||
- vnic->start_grp_id != act_q->index) {
+ if (vnic->start_grp_id != act_q->index) {
PMD_DRV_LOG(ERR,
"VNIC already in use\n");
rte_flow_error_set(error,
--
2.20.1 (Apple Git-117)
^ permalink raw reply [flat|nested] 27+ messages in thread
* Re: [dpdk-dev] [PATCH 04/10] net/bnxt: remove redundant header file inclusion
2019-10-04 5:02 ` [dpdk-dev] [PATCH 04/10] net/bnxt: remove redundant header file inclusion Ajit Khaparde
@ 2019-10-08 8:44 ` Ferruh Yigit
0 siblings, 0 replies; 27+ messages in thread
From: Ferruh Yigit @ 2019-10-08 8:44 UTC (permalink / raw)
To: Ajit Khaparde, dev; +Cc: Kalesh AP
On 10/4/2019 6:02 AM, Ajit Khaparde wrote:
> From: Kalesh AP <kalesh-anakkur.purayil@broadcom.com>
>
> bnxt.h header includes bnxt_cpr.h and bnxt_util.h.
> There is no need to include these headers file explicitly.
>
> This commit does not cause any functional change.
>
> Signed-off-by: Kalesh AP <kalesh-anakkur.purayil@broadcom.com>
> Reviewed-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
don't you want this patch to be backported? I think it may be good to backport
these kind of small fixes too to reduce conflicts in the driver in the future.
^ permalink raw reply [flat|nested] 27+ messages in thread
* Re: [dpdk-dev] [PATCH 10/10] net/bnxt: remove a useless check in validate flow routine
2019-10-04 5:02 ` [dpdk-dev] [PATCH 10/10] net/bnxt: remove a useless check in validate flow routine Ajit Khaparde
@ 2019-10-08 9:03 ` Ferruh Yigit
2019-10-10 1:41 ` [dpdk-dev] [PATCH v2 00/12] bnxt patchset with bug fixes Ajit Khaparde
0 siblings, 1 reply; 27+ messages in thread
From: Ferruh Yigit @ 2019-10-08 9:03 UTC (permalink / raw)
To: Ajit Khaparde, dev; +Cc: Kalesh AP
On 10/4/2019 6:02 AM, Ajit Khaparde wrote:
> From: Kalesh AP <kalesh-anakkur.purayil@broadcom.com>
>
> Since vnic->rx_queue_cnt is already checked against non-zero,
> removed the useless check from the inside condition check.
>
> Fixes: 4be31562a4ba ("net/bnxt: allow flow creation when RSS is enabled")
>
> Signed-off-by: Kalesh AP <kalesh-anakkur.purayil@broadcom.com>
> Reviewed-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
Squashed into relevant commit in next-net, thanks.
(please send new version of the patchset on top of latest next-net)
^ permalink raw reply [flat|nested] 27+ messages in thread
* [dpdk-dev] [PATCH v2 00/12] bnxt patchset with bug fixes
2019-10-08 9:03 ` Ferruh Yigit
@ 2019-10-10 1:41 ` Ajit Khaparde
2019-10-10 1:41 ` [dpdk-dev] [PATCH v2 01/12] net/bnxt: fix return checks and return values Ajit Khaparde
` (12 more replies)
0 siblings, 13 replies; 27+ messages in thread
From: Ajit Khaparde @ 2019-10-10 1:41 UTC (permalink / raw)
To: dev; +Cc: ferruh.yigit
This patch against dpdk-next-net mostly contains bug fixes
for issues found during testing.
v1->v2:
-Split patch 09/10 into two and reworded the commit messages.
-Rebased against latest dpdk-next-net
-Some of the patches were missing the Fixes tag. Added it to them.
Ajit Khaparde (2):
net/bnxt: update trusted VF status only when it changes
net/bnxt: get the default HWRM command timeout from firmware
Kalesh AP (7):
net/bnxt: fix return checks and return values
net/bnxt: return error if setting link up fail
net/bnxt: remove redundant header file inclusion
net/bnxt: enable interrupts after checking interface status from FW
net/bnxt: fix to handle interface change status in port start only
net/bnxt: fix coding style issues
net/bnxt: remove unnecessary variable assignment
Rahul Gupta (2):
net/bnxt: reduce cleanup time during reset recovery
net/bnxt: change msix vector to queue mapping
Santoshkumar Karanappa Rastapur (1):
net/bnxt: free default completion ring before VF configuration
drivers/net/bnxt/bnxt.h | 8 ++++++++
drivers/net/bnxt/bnxt_cpr.c | 1 -
drivers/net/bnxt/bnxt_ethdev.c | 32 +++++++++++++++++++++++-------
drivers/net/bnxt/bnxt_flow.c | 1 -
drivers/net/bnxt/bnxt_hwrm.c | 33 ++++++++++++++++++-------------
drivers/net/bnxt/bnxt_irq.c | 1 -
drivers/net/bnxt/bnxt_irq.h | 3 ---
drivers/net/bnxt/bnxt_ring.c | 3 +--
drivers/net/bnxt/bnxt_rxq.c | 15 ++++++--------
drivers/net/bnxt/bnxt_rxr.c | 1 -
drivers/net/bnxt/bnxt_stats.c | 36 +++++++++++-----------------------
drivers/net/bnxt/bnxt_txq.c | 1 -
drivers/net/bnxt/bnxt_txr.c | 1 -
13 files changed, 70 insertions(+), 66 deletions(-)
--
2.20.1 (Apple Git-117)
^ permalink raw reply [flat|nested] 27+ messages in thread
* [dpdk-dev] [PATCH v2 01/12] net/bnxt: fix return checks and return values
2019-10-10 1:41 ` [dpdk-dev] [PATCH v2 00/12] bnxt patchset with bug fixes Ajit Khaparde
@ 2019-10-10 1:41 ` Ajit Khaparde
2019-10-10 1:41 ` [dpdk-dev] [PATCH v2 02/12] net/bnxt: free default completion ring before VF configuration Ajit Khaparde
` (11 subsequent siblings)
12 siblings, 0 replies; 27+ messages in thread
From: Ajit Khaparde @ 2019-10-10 1:41 UTC (permalink / raw)
To: dev; +Cc: ferruh.yigit, Kalesh AP, stable, Somnath Kotur
From: Kalesh AP <kalesh-anakkur.purayil@broadcom.com>
This patch fixes few checks and few return values while getting
and clearing device statistics.
1. Fixed to return standard error code.
2. Clubbed few error checks
3. Removed an unnecessary return check
Fixes: bfb9c2260be2 ("net/bnxt: support xstats get/reset")
Fixes: 88920136688c ("net/bnxt: support xstats get by id")
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_stats.c | 36 +++++++++++------------------------
1 file changed, 11 insertions(+), 25 deletions(-)
diff --git a/drivers/net/bnxt/bnxt_stats.c b/drivers/net/bnxt/bnxt_stats.c
index 21012e1fee..f486a5634b 100644
--- a/drivers/net/bnxt/bnxt_stats.c
+++ b/drivers/net/bnxt/bnxt_stats.c
@@ -360,7 +360,7 @@ int bnxt_stats_get_op(struct rte_eth_dev *eth_dev,
memset(bnxt_stats, 0, sizeof(*bnxt_stats));
if (!(bp->flags & BNXT_FLAG_INIT_DONE)) {
PMD_DRV_LOG(ERR, "Device Initialization not complete!\n");
- return -1;
+ return -EIO;
}
num_q_stats = RTE_MIN(bp->rx_cp_nr_rings,
@@ -390,9 +390,8 @@ int bnxt_stats_get_op(struct rte_eth_dev *eth_dev,
if (unlikely(rc))
return rc;
}
+
rc = bnxt_hwrm_func_qstats(bp, 0xffff, bnxt_stats);
- if (unlikely(rc))
- return rc;
return rc;
}
@@ -573,30 +572,17 @@ int bnxt_dev_xstats_reset_op(struct rte_eth_dev *eth_dev)
if (ret)
return ret;
- if (bp->flags & BNXT_FLAG_PORT_STATS && BNXT_SINGLE_PF(bp)) {
- ret = bnxt_hwrm_port_clr_stats(bp);
- if (ret != 0) {
- PMD_DRV_LOG(ERR, "Operation failed: %s\n",
- strerror(-ret));
- return ret;
- }
- }
-
- ret = 0;
-
- if (BNXT_VF(bp)) {
- PMD_DRV_LOG(ERR, "Operation not supported on a VF device\n");
- ret = -ENOTSUP;
- }
- if (!BNXT_SINGLE_PF(bp)) {
- PMD_DRV_LOG(ERR, "Operation not supported on a MF device\n");
- ret = -ENOTSUP;
- }
- if (!(bp->flags & BNXT_FLAG_PORT_STATS)) {
+ if (BNXT_VF(bp) || !BNXT_SINGLE_PF(bp) ||
+ !(bp->flags & BNXT_FLAG_PORT_STATS)) {
PMD_DRV_LOG(ERR, "Operation not supported\n");
ret = -ENOTSUP;
}
+ ret = bnxt_hwrm_port_clr_stats(bp);
+ if (ret != 0)
+ PMD_DRV_LOG(ERR, "Failed to reset xstats: %s\n",
+ strerror(-ret));
+
return ret;
}
@@ -625,7 +611,7 @@ int bnxt_dev_xstats_get_by_id_op(struct rte_eth_dev *dev, const uint64_t *ids,
for (i = 0; i < limit; i++) {
if (ids[i] >= stat_cnt) {
PMD_DRV_LOG(ERR, "id value isn't valid");
- return -1;
+ return -EINVAL;
}
values[i] = values_copy[ids[i]];
}
@@ -659,7 +645,7 @@ int bnxt_dev_xstats_get_names_by_id_op(struct rte_eth_dev *dev,
for (i = 0; i < limit; i++) {
if (ids[i] >= stat_cnt) {
PMD_DRV_LOG(ERR, "id value isn't valid");
- return -1;
+ return -EINVAL;
}
strcpy(xstats_names[i].name,
xstats_names_copy[ids[i]].name);
--
2.20.1 (Apple Git-117)
^ permalink raw reply [flat|nested] 27+ messages in thread
* [dpdk-dev] [PATCH v2 02/12] net/bnxt: free default completion ring before VF configuration
2019-10-10 1:41 ` [dpdk-dev] [PATCH v2 00/12] bnxt patchset with bug fixes Ajit Khaparde
2019-10-10 1:41 ` [dpdk-dev] [PATCH v2 01/12] net/bnxt: fix return checks and return values Ajit Khaparde
@ 2019-10-10 1:41 ` Ajit Khaparde
2019-10-10 1:41 ` [dpdk-dev] [PATCH v2 03/12] net/bnxt: return error if setting link up fail Ajit Khaparde
` (10 subsequent siblings)
12 siblings, 0 replies; 27+ messages in thread
From: Ajit Khaparde @ 2019-10-10 1:41 UTC (permalink / raw)
To: dev; +Cc: ferruh.yigit, Santoshkumar Karanappa Rastapur, stable
From: Santoshkumar Karanappa Rastapur <santosh.rastapur@broadcom.com>
If the VF resources need to be reconfigured using the
bnxt_hwrm_func_reserve_vf_resc, make sure that the default completion
ring is freed first before the resources are reserved.
Reallocate the ring once the VF resources are configured.
Fixes: 7bc8e9a227cc ("net/bnxt: support async link notification")
Cc: stable@dpdk.org
Signed-off-by: Santoshkumar Karanappa Rastapur <santosh.rastapur@broadcom.com>
Reviewed-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
---
drivers/net/bnxt/bnxt_ethdev.c | 17 +++++++++++++++++
1 file changed, 17 insertions(+)
diff --git a/drivers/net/bnxt/bnxt_ethdev.c b/drivers/net/bnxt/bnxt_ethdev.c
index 5160ac002b..294a9505f9 100644
--- a/drivers/net/bnxt/bnxt_ethdev.c
+++ b/drivers/net/bnxt/bnxt_ethdev.c
@@ -669,11 +669,28 @@ static int bnxt_dev_configure_op(struct rte_eth_dev *eth_dev)
return -ENOSPC;
}
+ /* If a resource has already been allocated - in this case
+ * it is the async completion ring, free it. Reallocate it after
+ * resource reservation. This will ensure the resource counts
+ * are calculated correctly.
+ */
+ if (!BNXT_HAS_NQ(bp) && bp->async_cp_ring) {
+ bnxt_disable_int(bp);
+ bnxt_free_cp_ring(bp, bp->async_cp_ring);
+ }
+
rc = bnxt_hwrm_func_reserve_vf_resc(bp, false);
if (rc) {
PMD_DRV_LOG(ERR, "HWRM resource alloc fail:%x\n", rc);
return -ENOSPC;
}
+
+ if (!BNXT_HAS_NQ(bp) && bp->async_cp_ring) {
+ rc = bnxt_alloc_async_cp_ring(bp);
+ if (rc)
+ return rc;
+ bnxt_enable_int(bp);
+ }
} else {
/* legacy driver needs to get updated values */
rc = bnxt_hwrm_func_qcaps(bp);
--
2.20.1 (Apple Git-117)
^ permalink raw reply [flat|nested] 27+ messages in thread
* [dpdk-dev] [PATCH v2 03/12] net/bnxt: return error if setting link up fail
2019-10-10 1:41 ` [dpdk-dev] [PATCH v2 00/12] bnxt patchset with bug fixes Ajit Khaparde
2019-10-10 1:41 ` [dpdk-dev] [PATCH v2 01/12] net/bnxt: fix return checks and return values Ajit Khaparde
2019-10-10 1:41 ` [dpdk-dev] [PATCH v2 02/12] net/bnxt: free default completion ring before VF configuration Ajit Khaparde
@ 2019-10-10 1:41 ` Ajit Khaparde
2019-10-10 1:41 ` [dpdk-dev] [PATCH v2 04/12] net/bnxt: remove redundant header file inclusion Ajit Khaparde
` (9 subsequent siblings)
12 siblings, 0 replies; 27+ messages in thread
From: Ajit Khaparde @ 2019-10-10 1:41 UTC (permalink / raw)
To: dev; +Cc: ferruh.yigit, Kalesh AP, stable, Somnath Kotur
From: Kalesh AP <kalesh-anakkur.purayil@broadcom.com>
Currently bnxt driver does not return error in case setting link up fails.
Fixes: 5c206086feaa ("net/bnxt: add link state operations")
Cc: stable@dpdk.org
Signed-off-by: Kalesh AP <kalesh-anakkur.purayil@broadcom.com>
Reviewed-by: Somnath Kotur <somnath.kotur@broadcom.com>
---
drivers/net/bnxt/bnxt_ethdev.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/net/bnxt/bnxt_ethdev.c b/drivers/net/bnxt/bnxt_ethdev.c
index 294a9505f9..4b39586479 100644
--- a/drivers/net/bnxt/bnxt_ethdev.c
+++ b/drivers/net/bnxt/bnxt_ethdev.c
@@ -930,7 +930,7 @@ static int bnxt_dev_set_link_up_op(struct rte_eth_dev *eth_dev)
eth_dev->data->dev_link.link_status = 1;
bnxt_print_link_info(eth_dev);
- return 0;
+ return rc;
}
static int bnxt_dev_set_link_down_op(struct rte_eth_dev *eth_dev)
--
2.20.1 (Apple Git-117)
^ permalink raw reply [flat|nested] 27+ messages in thread
* [dpdk-dev] [PATCH v2 04/12] net/bnxt: remove redundant header file inclusion
2019-10-10 1:41 ` [dpdk-dev] [PATCH v2 00/12] bnxt patchset with bug fixes Ajit Khaparde
` (2 preceding siblings ...)
2019-10-10 1:41 ` [dpdk-dev] [PATCH v2 03/12] net/bnxt: return error if setting link up fail Ajit Khaparde
@ 2019-10-10 1:41 ` Ajit Khaparde
2019-10-10 1:41 ` [dpdk-dev] [PATCH v2 05/12] net/bnxt: update trusted VF status only when it changes Ajit Khaparde
` (8 subsequent siblings)
12 siblings, 0 replies; 27+ messages in thread
From: Ajit Khaparde @ 2019-10-10 1:41 UTC (permalink / raw)
To: dev; +Cc: ferruh.yigit, Kalesh AP, stable
From: Kalesh AP <kalesh-anakkur.purayil@broadcom.com>
bnxt.h header includes bnxt_cpr.h and bnxt_util.h.
There is no need to include these headers file explicitly.
This commit does not cause any functional change.
Cc: stable@dpdk.org
Signed-off-by: Kalesh AP <kalesh-anakkur.purayil@broadcom.com>
Reviewed-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
---
drivers/net/bnxt/bnxt_cpr.c | 1 -
drivers/net/bnxt/bnxt_ethdev.c | 2 --
drivers/net/bnxt/bnxt_flow.c | 1 -
drivers/net/bnxt/bnxt_hwrm.c | 1 -
drivers/net/bnxt/bnxt_irq.c | 1 -
drivers/net/bnxt/bnxt_ring.c | 1 -
drivers/net/bnxt/bnxt_rxq.c | 1 -
drivers/net/bnxt/bnxt_rxr.c | 1 -
drivers/net/bnxt/bnxt_txq.c | 1 -
drivers/net/bnxt/bnxt_txr.c | 1 -
10 files changed, 11 deletions(-)
diff --git a/drivers/net/bnxt/bnxt_cpr.c b/drivers/net/bnxt/bnxt_cpr.c
index f58372516a..118cf034d2 100644
--- a/drivers/net/bnxt/bnxt_cpr.c
+++ b/drivers/net/bnxt/bnxt_cpr.c
@@ -8,7 +8,6 @@
#include <rte_cycles.h>
#include "bnxt.h"
-#include "bnxt_cpr.h"
#include "bnxt_hwrm.h"
#include "bnxt_ring.h"
#include "hsi_struct_def_dpdk.h"
diff --git a/drivers/net/bnxt/bnxt_ethdev.c b/drivers/net/bnxt/bnxt_ethdev.c
index 4b39586479..84f7b87f31 100644
--- a/drivers/net/bnxt/bnxt_ethdev.c
+++ b/drivers/net/bnxt/bnxt_ethdev.c
@@ -14,7 +14,6 @@
#include <rte_alarm.h>
#include "bnxt.h"
-#include "bnxt_cpr.h"
#include "bnxt_filter.h"
#include "bnxt_hwrm.h"
#include "bnxt_irq.h"
@@ -27,7 +26,6 @@
#include "bnxt_vnic.h"
#include "hsi_struct_def_dpdk.h"
#include "bnxt_nvm_defs.h"
-#include "bnxt_util.h"
#define DRV_MODULE_NAME "bnxt"
static const char bnxt_version[] =
diff --git a/drivers/net/bnxt/bnxt_flow.c b/drivers/net/bnxt/bnxt_flow.c
index bf198f8f23..5aeb001408 100644
--- a/drivers/net/bnxt/bnxt_flow.c
+++ b/drivers/net/bnxt/bnxt_flow.c
@@ -17,7 +17,6 @@
#include "bnxt_ring.h"
#include "bnxt_rxq.h"
#include "bnxt_vnic.h"
-#include "bnxt_util.h"
#include "hsi_struct_def_dpdk.h"
static int
diff --git a/drivers/net/bnxt/bnxt_hwrm.c b/drivers/net/bnxt/bnxt_hwrm.c
index 0d5362581e..f78beff711 100644
--- a/drivers/net/bnxt/bnxt_hwrm.c
+++ b/drivers/net/bnxt/bnxt_hwrm.c
@@ -13,7 +13,6 @@
#include <rte_version.h>
#include "bnxt.h"
-#include "bnxt_cpr.h"
#include "bnxt_filter.h"
#include "bnxt_hwrm.h"
#include "bnxt_rxq.h"
diff --git a/drivers/net/bnxt/bnxt_irq.c b/drivers/net/bnxt/bnxt_irq.c
index 729d68d704..6c5bcfb623 100644
--- a/drivers/net/bnxt/bnxt_irq.c
+++ b/drivers/net/bnxt/bnxt_irq.c
@@ -9,7 +9,6 @@
#include <rte_malloc.h>
#include "bnxt.h"
-#include "bnxt_cpr.h"
#include "bnxt_irq.h"
#include "bnxt_ring.h"
#include "hsi_struct_def_dpdk.h"
diff --git a/drivers/net/bnxt/bnxt_ring.c b/drivers/net/bnxt/bnxt_ring.c
index 5bb2cdea91..886029c575 100644
--- a/drivers/net/bnxt/bnxt_ring.c
+++ b/drivers/net/bnxt/bnxt_ring.c
@@ -9,7 +9,6 @@
#include <unistd.h>
#include "bnxt.h"
-#include "bnxt_cpr.h"
#include "bnxt_hwrm.h"
#include "bnxt_ring.h"
#include "bnxt_rxq.h"
diff --git a/drivers/net/bnxt/bnxt_rxq.c b/drivers/net/bnxt/bnxt_rxq.c
index 9439fcd1fb..a46f96827c 100644
--- a/drivers/net/bnxt/bnxt_rxq.c
+++ b/drivers/net/bnxt/bnxt_rxq.c
@@ -8,7 +8,6 @@
#include <rte_malloc.h>
#include "bnxt.h"
-#include "bnxt_cpr.h"
#include "bnxt_filter.h"
#include "bnxt_hwrm.h"
#include "bnxt_ring.h"
diff --git a/drivers/net/bnxt/bnxt_rxr.c b/drivers/net/bnxt/bnxt_rxr.c
index bda4f4c1b9..f0f9b020b1 100644
--- a/drivers/net/bnxt/bnxt_rxr.c
+++ b/drivers/net/bnxt/bnxt_rxr.c
@@ -12,7 +12,6 @@
#include <rte_memory.h>
#include "bnxt.h"
-#include "bnxt_cpr.h"
#include "bnxt_ring.h"
#include "bnxt_rxr.h"
#include "bnxt_rxq.h"
diff --git a/drivers/net/bnxt/bnxt_txq.c b/drivers/net/bnxt/bnxt_txq.c
index 5ad4ee155e..ebb9199d2d 100644
--- a/drivers/net/bnxt/bnxt_txq.c
+++ b/drivers/net/bnxt/bnxt_txq.c
@@ -8,7 +8,6 @@
#include <rte_malloc.h>
#include "bnxt.h"
-#include "bnxt_cpr.h"
#include "bnxt_ring.h"
#include "bnxt_txq.h"
#include "bnxt_txr.h"
diff --git a/drivers/net/bnxt/bnxt_txr.c b/drivers/net/bnxt/bnxt_txr.c
index 6e2ee86c05..16021407e8 100644
--- a/drivers/net/bnxt/bnxt_txr.c
+++ b/drivers/net/bnxt/bnxt_txr.c
@@ -9,7 +9,6 @@
#include <rte_malloc.h>
#include "bnxt.h"
-#include "bnxt_cpr.h"
#include "bnxt_ring.h"
#include "bnxt_txq.h"
#include "bnxt_txr.h"
--
2.20.1 (Apple Git-117)
^ permalink raw reply [flat|nested] 27+ messages in thread
* [dpdk-dev] [PATCH v2 05/12] net/bnxt: update trusted VF status only when it changes
2019-10-10 1:41 ` [dpdk-dev] [PATCH v2 00/12] bnxt patchset with bug fixes Ajit Khaparde
` (3 preceding siblings ...)
2019-10-10 1:41 ` [dpdk-dev] [PATCH v2 04/12] net/bnxt: remove redundant header file inclusion Ajit Khaparde
@ 2019-10-10 1:41 ` Ajit Khaparde
2019-10-10 1:41 ` [dpdk-dev] [PATCH v2 06/12] net/bnxt: get the default HWRM command timeout from firmware Ajit Khaparde
` (7 subsequent siblings)
12 siblings, 0 replies; 27+ messages in thread
From: Ajit Khaparde @ 2019-10-10 1:41 UTC (permalink / raw)
To: dev; +Cc: ferruh.yigit, stable, Somnath Kotur
We are currently logging trusted VF information everytime a VF config
change is indicated by the async message. Update it only when new setting
is different from the current setting.
Fixes: b42c15c83e88 ("net/bnxt: support trusted VF")
Cc: stable@dpdk.org
Signed-off-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
Reviewed-by: Somnath Kotur <somnath.kotur@broadcom.com>
---
drivers/net/bnxt/bnxt_hwrm.c | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/drivers/net/bnxt/bnxt_hwrm.c b/drivers/net/bnxt/bnxt_hwrm.c
index f78beff711..a40197e929 100644
--- a/drivers/net/bnxt/bnxt_hwrm.c
+++ b/drivers/net/bnxt/bnxt_hwrm.c
@@ -2873,10 +2873,13 @@ int bnxt_hwrm_func_qcfg(struct bnxt *bp, uint16_t *mtu)
if (BNXT_PF(bp) && (flags & HWRM_FUNC_QCFG_OUTPUT_FLAGS_MULTI_HOST))
bp->flags |= BNXT_FLAG_MULTI_HOST;
- if (BNXT_VF(bp) && (flags & HWRM_FUNC_QCFG_OUTPUT_FLAGS_TRUSTED_VF)) {
+ if (BNXT_VF(bp) &&
+ !BNXT_VF_IS_TRUSTED(bp) &&
+ (flags & HWRM_FUNC_QCFG_OUTPUT_FLAGS_TRUSTED_VF)) {
bp->flags |= BNXT_FLAG_TRUSTED_VF_EN;
PMD_DRV_LOG(INFO, "Trusted VF cap enabled\n");
} else if (BNXT_VF(bp) &&
+ BNXT_VF_IS_TRUSTED(bp) &&
!(flags & HWRM_FUNC_QCFG_OUTPUT_FLAGS_TRUSTED_VF)) {
bp->flags &= ~BNXT_FLAG_TRUSTED_VF_EN;
PMD_DRV_LOG(INFO, "Trusted VF cap disabled\n");
--
2.20.1 (Apple Git-117)
^ permalink raw reply [flat|nested] 27+ messages in thread
* [dpdk-dev] [PATCH v2 06/12] net/bnxt: get the default HWRM command timeout from firmware
2019-10-10 1:41 ` [dpdk-dev] [PATCH v2 00/12] bnxt patchset with bug fixes Ajit Khaparde
` (4 preceding siblings ...)
2019-10-10 1:41 ` [dpdk-dev] [PATCH v2 05/12] net/bnxt: update trusted VF status only when it changes Ajit Khaparde
@ 2019-10-10 1:41 ` Ajit Khaparde
2019-10-10 1:41 ` [dpdk-dev] [PATCH v2 07/12] net/bnxt: reduce cleanup time during reset recovery Ajit Khaparde
` (6 subsequent siblings)
12 siblings, 0 replies; 27+ messages in thread
From: Ajit Khaparde @ 2019-10-10 1:41 UTC (permalink / raw)
To: dev
Cc: ferruh.yigit, stable, Santoshkumar Karanappa Rastapur, Lance Richardson
The HWRM command timeout is set to a very high value.
VER_GET command response returns the default request timeout value.
Use this value for waiting for HWRM commands to complete.
Poll for the valid bit every 1us instead of 600us.
Fixes: cbcd375d37d2 ("net/bnxt: fix HWRM macros and locking")
Cc: stable@dpdk.org
Signed-off-by: Santoshkumar Karanappa Rastapur <santosh.rastapur@broadcom.com>
Signed-off-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
Reviewed-by: Lance Richardson <lance.richardson@broadcom.com>
---
drivers/net/bnxt/bnxt.h | 5 +++++
drivers/net/bnxt/bnxt_hwrm.c | 13 +++++++++----
2 files changed, 14 insertions(+), 4 deletions(-)
diff --git a/drivers/net/bnxt/bnxt.h b/drivers/net/bnxt/bnxt.h
index ad0b18dddd..5020cd3415 100644
--- a/drivers/net/bnxt/bnxt.h
+++ b/drivers/net/bnxt/bnxt.h
@@ -525,6 +525,11 @@ 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 HWRM request timeout value */
+ uint32_t hwrm_cmd_timeout;
+
struct bnxt_link_info link_info;
struct bnxt_cos_queue_info rx_cos_queue[BNXT_COS_QUEUE_COUNT];
struct bnxt_cos_queue_info tx_cos_queue[BNXT_COS_QUEUE_COUNT];
diff --git a/drivers/net/bnxt/bnxt_hwrm.c b/drivers/net/bnxt/bnxt_hwrm.c
index a40197e929..5e3117fee9 100644
--- a/drivers/net/bnxt/bnxt_hwrm.c
+++ b/drivers/net/bnxt/bnxt_hwrm.c
@@ -25,8 +25,6 @@
#include <rte_io.h>
-#define HWRM_CMD_TIMEOUT 6000000
-#define HWRM_SHORT_CMD_TIMEOUT 50000
#define HWRM_SPEC_CODE_1_8_3 0x10803
#define HWRM_VERSION_1_9_1 0x10901
#define HWRM_VERSION_1_9_2 0x10903
@@ -105,9 +103,9 @@ static int bnxt_hwrm_send_message(struct bnxt *bp, void *msg,
/* For VER_GET command, set timeout as 50ms */
if (rte_cpu_to_le_16(req->req_type) == HWRM_VER_GET)
- timeout = HWRM_SHORT_CMD_TIMEOUT;
- else
timeout = HWRM_CMD_TIMEOUT;
+ else
+ timeout = bp->hwrm_cmd_timeout;
if (bp->flags & BNXT_FLAG_SHORT_CMD ||
msg_len > bp->max_req_len) {
@@ -969,6 +967,13 @@ int bnxt_hwrm_ver_get(struct bnxt *bp)
fw_version |= resp->hwrm_intf_upd_8b;
bp->hwrm_spec_code = fw_version;
+ /* def_req_timeout value is in milliseconds */
+ bp->hwrm_cmd_timeout = rte_le_to_cpu_16(resp->def_req_timeout);
+ /* convert timeout to usec */
+ bp->hwrm_cmd_timeout *= 1000;
+ if (!bp->hwrm_cmd_timeout)
+ bp->hwrm_cmd_timeout = HWRM_CMD_TIMEOUT;
+
if (resp->hwrm_intf_maj_8b != HWRM_VERSION_MAJOR) {
PMD_DRV_LOG(ERR, "Unsupported firmware API version\n");
rc = -EINVAL;
--
2.20.1 (Apple Git-117)
^ permalink raw reply [flat|nested] 27+ messages in thread
* [dpdk-dev] [PATCH v2 07/12] net/bnxt: reduce cleanup time during reset recovery
2019-10-10 1:41 ` [dpdk-dev] [PATCH v2 00/12] bnxt patchset with bug fixes Ajit Khaparde
` (5 preceding siblings ...)
2019-10-10 1:41 ` [dpdk-dev] [PATCH v2 06/12] net/bnxt: get the default HWRM command timeout from firmware Ajit Khaparde
@ 2019-10-10 1:41 ` Ajit Khaparde
2019-10-10 1:41 ` [dpdk-dev] [PATCH v2 08/12] net/bnxt: change msix vector to queue mapping Ajit Khaparde
` (5 subsequent siblings)
12 siblings, 0 replies; 27+ messages in thread
From: Ajit Khaparde @ 2019-10-10 1:41 UTC (permalink / raw)
To: dev; +Cc: ferruh.yigit, Rahul Gupta, stable, Kalesh Anakkur Purayil
From: Rahul Gupta <rahul.gupta@broadcom.com>
In stop_op(), don't wait for link down event's ASYNC response from FW.
Fixes: 7c9b9cebadfc ("net/bnxt: fix async link handling and update")
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: Ajit Khaparde <ajit.khaparde@broadcom.com>
---
drivers/net/bnxt/bnxt_ethdev.c | 8 ++++++--
1 file changed, 6 insertions(+), 2 deletions(-)
diff --git a/drivers/net/bnxt/bnxt_ethdev.c b/drivers/net/bnxt/bnxt_ethdev.c
index 84f7b87f31..69dafc41ff 100644
--- a/drivers/net/bnxt/bnxt_ethdev.c
+++ b/drivers/net/bnxt/bnxt_ethdev.c
@@ -967,8 +967,12 @@ static void bnxt_dev_stop_op(struct rte_eth_dev *eth_dev)
eth_dev->data->dev_link.link_status = 0;
}
bnxt_dev_set_link_down_op(eth_dev);
- /* Wait for link to be reset and the async notification to process. */
- rte_delay_ms(BNXT_LINK_WAIT_INTERVAL * 2);
+
+ /* Wait for link to be reset and the async notification to process.
+ * During reset recovery, there is no need to wait
+ */
+ if (!is_bnxt_in_error(bp))
+ rte_delay_ms(BNXT_LINK_WAIT_INTERVAL * 2);
/* Clean queue intr-vector mapping */
rte_intr_efd_disable(intr_handle);
--
2.20.1 (Apple Git-117)
^ permalink raw reply [flat|nested] 27+ messages in thread
* [dpdk-dev] [PATCH v2 08/12] net/bnxt: change msix vector to queue mapping
2019-10-10 1:41 ` [dpdk-dev] [PATCH v2 00/12] bnxt patchset with bug fixes Ajit Khaparde
` (6 preceding siblings ...)
2019-10-10 1:41 ` [dpdk-dev] [PATCH v2 07/12] net/bnxt: reduce cleanup time during reset recovery Ajit Khaparde
@ 2019-10-10 1:41 ` Ajit Khaparde
2019-10-10 1:41 ` [dpdk-dev] [PATCH v2 09/12] net/bnxt: enable interrupts after checking interface status from FW Ajit Khaparde
` (4 subsequent siblings)
12 siblings, 0 replies; 27+ messages in thread
From: Ajit Khaparde @ 2019-10-10 1:41 UTC (permalink / raw)
To: dev; +Cc: ferruh.yigit, Rahul Gupta, stable
From: Rahul Gupta <rahul.gupta@broadcom.com>
DPDK PCIe-VFIO framework configures base MSIX vector for interrupts
which is supported by other h/w. In case of bnxt, base MSIX vector
starts with the RX completion queue 0. To comply with the DPDK
framework We need to increase the map index by 1 so that RXTX
completion queues events can be delivered to appropriate event listeners
by kernel VFIO.
Fixes: bd0a14c99f65 ("net/bnxt: use dedicated CPR for async events")
Cc: stable@dpdk.org
Signed-off-by: Rahul Gupta <rahul.gupta@broadcom.com>
Reviewed-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
---
drivers/net/bnxt/bnxt.h | 3 +++
drivers/net/bnxt/bnxt_irq.h | 3 ---
drivers/net/bnxt/bnxt_ring.c | 2 +-
3 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/drivers/net/bnxt/bnxt.h b/drivers/net/bnxt/bnxt.h
index 5020cd3415..080365804c 100644
--- a/drivers/net/bnxt/bnxt.h
+++ b/drivers/net/bnxt/bnxt.h
@@ -58,6 +58,9 @@
#define BNXT_NUM_ASYNC_CPR(bp) 1
#endif
+#define BNXT_MISC_VEC_ID RTE_INTR_VEC_ZERO_OFFSET
+#define BNXT_RX_VEC_START RTE_INTR_VEC_RXTX_OFFSET
+
/* Chimp Communication Channel */
#define GRCPF_REG_CHIMP_CHANNEL_OFFSET 0x0
#define GRCPF_REG_CHIMP_COMM_TRIGGER 0x100
diff --git a/drivers/net/bnxt/bnxt_irq.h b/drivers/net/bnxt/bnxt_irq.h
index 1b56e08068..ad8a1df9ca 100644
--- a/drivers/net/bnxt/bnxt_irq.h
+++ b/drivers/net/bnxt/bnxt_irq.h
@@ -6,9 +6,6 @@
#ifndef _BNXT_IRQ_H_
#define _BNXT_IRQ_H_
-#define BNXT_MISC_VEC_ID RTE_INTR_VEC_ZERO_OFFSET
-#define BNXT_RX_VEC_START RTE_INTR_VEC_RXTX_OFFSET
-
struct bnxt_irq {
rte_intr_callback_fn handler;
unsigned int vector;
diff --git a/drivers/net/bnxt/bnxt_ring.c b/drivers/net/bnxt/bnxt_ring.c
index 886029c575..19af727635 100644
--- a/drivers/net/bnxt/bnxt_ring.c
+++ b/drivers/net/bnxt/bnxt_ring.c
@@ -406,7 +406,7 @@ static int bnxt_alloc_cmpl_ring(struct bnxt *bp, int queue_index,
{
struct bnxt_ring *cp_ring = cpr->cp_ring_struct;
uint32_t nq_ring_id = HWRM_NA_SIGNATURE;
- int cp_ring_index = queue_index + BNXT_NUM_ASYNC_CPR(bp);
+ int cp_ring_index = queue_index + BNXT_RX_VEC_START;
struct bnxt_cp_ring_info *nqr = bp->rxtx_nq_ring;
uint8_t ring_type;
int rc = 0;
--
2.20.1 (Apple Git-117)
^ permalink raw reply [flat|nested] 27+ messages in thread
* [dpdk-dev] [PATCH v2 09/12] net/bnxt: enable interrupts after checking interface status from FW
2019-10-10 1:41 ` [dpdk-dev] [PATCH v2 00/12] bnxt patchset with bug fixes Ajit Khaparde
` (7 preceding siblings ...)
2019-10-10 1:41 ` [dpdk-dev] [PATCH v2 08/12] net/bnxt: change msix vector to queue mapping Ajit Khaparde
@ 2019-10-10 1:41 ` Ajit Khaparde
2019-10-10 1:41 ` [dpdk-dev] [PATCH v2 10/12] net/bnxt: fix to handle interface change status in port start only Ajit Khaparde
` (3 subsequent siblings)
12 siblings, 0 replies; 27+ messages in thread
From: Ajit Khaparde @ 2019-10-10 1:41 UTC (permalink / raw)
To: dev; +Cc: ferruh.yigit, Kalesh AP, stable
From: Kalesh AP <kalesh-anakkur.purayil@broadcom.com>
Driver issues hwrm_if_change when the port is started. This command
returns whether the fw has undergone a reset while port was down and
driver does re-init of resources if fw has undergone a reset.
Fix to enable interrupts only after this check.
Fixes: 7c9b9cebadfc ("net/bnxt: fix async link handling and update")
Cc: stable@dpdk.org
Signed-off-by: Kalesh AP <kalesh-anakkur.purayil@broadcom.com>
Reviewed-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
---
drivers/net/bnxt/bnxt_ethdev.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/net/bnxt/bnxt_ethdev.c b/drivers/net/bnxt/bnxt_ethdev.c
index 69dafc41ff..39bc06c6c7 100644
--- a/drivers/net/bnxt/bnxt_ethdev.c
+++ b/drivers/net/bnxt/bnxt_ethdev.c
@@ -874,7 +874,6 @@ static int bnxt_dev_start_op(struct rte_eth_dev *eth_dev)
bp->rx_cp_nr_rings, RTE_ETHDEV_QUEUE_STAT_CNTRS);
}
- bnxt_enable_int(bp);
rc = bnxt_hwrm_if_change(bp, 1);
if (!rc) {
if (bp->flags & BNXT_FLAG_IF_CHANGE_HOT_FW_RESET_DONE) {
@@ -883,6 +882,7 @@ static int bnxt_dev_start_op(struct rte_eth_dev *eth_dev)
return rc;
}
}
+ bnxt_enable_int(bp);
rc = bnxt_init_chip(bp);
if (rc)
--
2.20.1 (Apple Git-117)
^ permalink raw reply [flat|nested] 27+ messages in thread
* [dpdk-dev] [PATCH v2 10/12] net/bnxt: fix to handle interface change status in port start only
2019-10-10 1:41 ` [dpdk-dev] [PATCH v2 00/12] bnxt patchset with bug fixes Ajit Khaparde
` (8 preceding siblings ...)
2019-10-10 1:41 ` [dpdk-dev] [PATCH v2 09/12] net/bnxt: enable interrupts after checking interface status from FW Ajit Khaparde
@ 2019-10-10 1:41 ` Ajit Khaparde
2019-10-10 1:41 ` [dpdk-dev] [PATCH v2 11/12] net/bnxt: fix coding style issues Ajit Khaparde
` (2 subsequent siblings)
12 siblings, 0 replies; 27+ messages in thread
From: Ajit Khaparde @ 2019-10-10 1:41 UTC (permalink / raw)
To: dev; +Cc: ferruh.yigit, Kalesh AP, stable, Santoshkumar Karanappa Rastapur
From: Kalesh AP <kalesh-anakkur.purayil@broadcom.com>
Driver issues hwrm_if_change when the port is started and stopped.
This command returns whether the fw has undergone a reset while port
was down. Fix to handle hwrm_if_change status during port start only.
Fixes: 92d6617b6e33 ("net/bnxt: inform firmware about IF state changes")
Cc: stable@dpdk.org
Signed-off-by: Kalesh AP <kalesh-anakkur.purayil@broadcom.com>
Reviewed-by: Santoshkumar Karanappa Rastapur <santosh.rastapur@broadcom.com>
Reviewed-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
Signed-off-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
---
drivers/net/bnxt/bnxt_hwrm.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/drivers/net/bnxt/bnxt_hwrm.c b/drivers/net/bnxt/bnxt_hwrm.c
index 5e3117fee9..f94fdde2b1 100644
--- a/drivers/net/bnxt/bnxt_hwrm.c
+++ b/drivers/net/bnxt/bnxt_hwrm.c
@@ -4858,6 +4858,9 @@ int bnxt_hwrm_if_change(struct bnxt *bp, bool up)
flags = rte_le_to_cpu_32(resp->flags);
HWRM_UNLOCK();
+ if (!up)
+ return 0;
+
if (flags & HWRM_FUNC_DRV_IF_CHANGE_OUTPUT_FLAGS_HOT_FW_RESET_DONE) {
PMD_DRV_LOG(INFO, "FW reset happened while port was down\n");
bp->flags |= BNXT_FLAG_IF_CHANGE_HOT_FW_RESET_DONE;
--
2.20.1 (Apple Git-117)
^ permalink raw reply [flat|nested] 27+ messages in thread
* [dpdk-dev] [PATCH v2 11/12] net/bnxt: fix coding style issues
2019-10-10 1:41 ` [dpdk-dev] [PATCH v2 00/12] bnxt patchset with bug fixes Ajit Khaparde
` (9 preceding siblings ...)
2019-10-10 1:41 ` [dpdk-dev] [PATCH v2 10/12] net/bnxt: fix to handle interface change status in port start only Ajit Khaparde
@ 2019-10-10 1:41 ` Ajit Khaparde
2019-10-10 1:41 ` [dpdk-dev] [PATCH v2 12/12] net/bnxt: remove unnecessary variable assignment Ajit Khaparde
2019-10-10 18:05 ` [dpdk-dev] [PATCH v2 00/12] bnxt patchset with bug fixes Ferruh Yigit
12 siblings, 0 replies; 27+ messages in thread
From: Ajit Khaparde @ 2019-10-10 1:41 UTC (permalink / raw)
To: dev; +Cc: ferruh.yigit, Kalesh AP, stable
From: Kalesh AP <kalesh-anakkur.purayil@broadcom.com>
- Remove unnecessary new line
- Remove unnecessary blank lines
- Align rte_* header file inclusion at one place
Fixes: 37d6161a68ba ("net/bnxt: add ring group alloc/free")
Fixes: ec77c6298301 ("net/bnxt: add stats context allocation")
Cc: stable@dpdk.org
Signed-off-by: Kalesh AP <kalesh-anakkur.purayil@broadcom.com>
Reviewed-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
Signed-off-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
---
drivers/net/bnxt/bnxt_ethdev.c | 1 -
drivers/net/bnxt/bnxt_hwrm.c | 11 +++--------
2 files changed, 3 insertions(+), 9 deletions(-)
diff --git a/drivers/net/bnxt/bnxt_ethdev.c b/drivers/net/bnxt/bnxt_ethdev.c
index 39bc06c6c7..90a97fac1b 100644
--- a/drivers/net/bnxt/bnxt_ethdev.c
+++ b/drivers/net/bnxt/bnxt_ethdev.c
@@ -3002,7 +3002,6 @@ bnxt_parse_fdir_filter(struct bnxt *bp,
return -EINVAL;
}
-
if (fdir_mode == RTE_FDIR_MODE_PERFECT_MAC_VLAN) {
rte_memcpy(filter->dst_macaddr,
fdir->input.flow.mac_vlan_flow.mac_addr.addr_bytes, 6);
diff --git a/drivers/net/bnxt/bnxt_hwrm.c b/drivers/net/bnxt/bnxt_hwrm.c
index f94fdde2b1..5b430b9415 100644
--- a/drivers/net/bnxt/bnxt_hwrm.c
+++ b/drivers/net/bnxt/bnxt_hwrm.c
@@ -11,6 +11,7 @@
#include <rte_malloc.h>
#include <rte_memzone.h>
#include <rte_version.h>
+#include <rte_io.h>
#include "bnxt.h"
#include "bnxt_filter.h"
@@ -23,8 +24,6 @@
#include "bnxt_vnic.h"
#include "hsi_struct_def_dpdk.h"
-#include <rte_io.h>
-
#define HWRM_SPEC_CODE_1_8_3 0x10803
#define HWRM_VERSION_1_9_1 0x10901
#define HWRM_VERSION_1_9_2 0x10903
@@ -1483,8 +1482,7 @@ int bnxt_hwrm_ring_grp_alloc(struct bnxt *bp, unsigned int idx)
HWRM_CHECK_RESULT();
- bp->grp_info[idx].fw_grp_id =
- rte_le_to_cpu_16(resp->ring_group_id);
+ bp->grp_info[idx].fw_grp_id = rte_le_to_cpu_16(resp->ring_group_id);
HWRM_UNLOCK();
@@ -1542,8 +1540,7 @@ int bnxt_hwrm_stat_ctx_alloc(struct bnxt *bp, struct bnxt_cp_ring_info *cpr,
req.update_period_ms = rte_cpu_to_le_32(0);
- req.stats_dma_addr =
- rte_cpu_to_le_64(cpr->hw_stats_map);
+ req.stats_dma_addr = rte_cpu_to_le_64(cpr->hw_stats_map);
rc = bnxt_hwrm_send_message(bp, &req, sizeof(req), BNXT_USE_CHIMP_MB);
@@ -3633,7 +3630,6 @@ int bnxt_hwrm_ctx_qstats(struct bnxt *bp, uint32_t cid, int idx,
stats->q_obytes[idx] += rte_le_to_cpu_64(resp->tx_bcast_bytes);
}
-
HWRM_UNLOCK();
return rc;
@@ -4218,7 +4214,6 @@ int bnxt_hwrm_set_ntuple_filter(struct bnxt *bp,
HWRM_CFA_NTUPLE_FILTER_ALLOC_INPUT_ENABLES_DST_ID;
req.dst_id = rte_cpu_to_le_16(dst_id);
-
if (filter->ip_addr_type) {
req.ip_addr_type = filter->ip_addr_type;
enables |=
--
2.20.1 (Apple Git-117)
^ permalink raw reply [flat|nested] 27+ messages in thread
* [dpdk-dev] [PATCH v2 12/12] net/bnxt: remove unnecessary variable assignment
2019-10-10 1:41 ` [dpdk-dev] [PATCH v2 00/12] bnxt patchset with bug fixes Ajit Khaparde
` (10 preceding siblings ...)
2019-10-10 1:41 ` [dpdk-dev] [PATCH v2 11/12] net/bnxt: fix coding style issues Ajit Khaparde
@ 2019-10-10 1:41 ` Ajit Khaparde
2019-10-10 18:05 ` [dpdk-dev] [PATCH v2 00/12] bnxt patchset with bug fixes Ferruh Yigit
12 siblings, 0 replies; 27+ messages in thread
From: Ajit Khaparde @ 2019-10-10 1:41 UTC (permalink / raw)
To: dev; +Cc: ferruh.yigit, Kalesh AP, stable, Santoshkumar Karanappa Rastapur
From: Kalesh AP <kalesh-anakkur.purayil@broadcom.com>
There is no need to assign return value to a temporary variable.
Instead return error directly in case of failure.
Fixes: 1fe427fd08ee ("net/bnxt: support enable/disable interrupt")
Cc: stable@dpdk.org
Signed-off-by: Kalesh AP <kalesh-anakkur.purayil@broadcom.com>
Reviewed-by: Santoshkumar Karanappa Rastapur <santosh.rastapur@broadcom.com>
Reviewed-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
Signed-off-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
---
drivers/net/bnxt/bnxt_rxq.c | 14 ++++++--------
1 file changed, 6 insertions(+), 8 deletions(-)
diff --git a/drivers/net/bnxt/bnxt_rxq.c b/drivers/net/bnxt/bnxt_rxq.c
index a46f96827c..e1ed360eff 100644
--- a/drivers/net/bnxt/bnxt_rxq.c
+++ b/drivers/net/bnxt/bnxt_rxq.c
@@ -384,10 +384,9 @@ bnxt_rx_queue_intr_enable_op(struct rte_eth_dev *eth_dev, uint16_t queue_id)
if (eth_dev->data->rx_queues) {
rxq = eth_dev->data->rx_queues[queue_id];
- if (!rxq) {
- rc = -EINVAL;
- return rc;
- }
+ if (!rxq)
+ return -EINVAL;
+
cpr = rxq->cp_ring;
B_CP_DB_REARM(cpr, cpr->cp_raw_cons);
}
@@ -408,10 +407,9 @@ bnxt_rx_queue_intr_disable_op(struct rte_eth_dev *eth_dev, uint16_t queue_id)
if (eth_dev->data->rx_queues) {
rxq = eth_dev->data->rx_queues[queue_id];
- if (!rxq) {
- rc = -EINVAL;
- return rc;
- }
+ if (!rxq)
+ return -EINVAL;
+
cpr = rxq->cp_ring;
B_CP_DB_DISARM(cpr);
}
--
2.20.1 (Apple Git-117)
^ permalink raw reply [flat|nested] 27+ messages in thread
* Re: [dpdk-dev] [PATCH v2 00/12] bnxt patchset with bug fixes
2019-10-10 1:41 ` [dpdk-dev] [PATCH v2 00/12] bnxt patchset with bug fixes Ajit Khaparde
` (11 preceding siblings ...)
2019-10-10 1:41 ` [dpdk-dev] [PATCH v2 12/12] net/bnxt: remove unnecessary variable assignment Ajit Khaparde
@ 2019-10-10 18:05 ` Ferruh Yigit
12 siblings, 0 replies; 27+ messages in thread
From: Ferruh Yigit @ 2019-10-10 18:05 UTC (permalink / raw)
To: Ajit Khaparde, dev
On 10/10/2019 2:41 AM, Ajit Khaparde wrote:
> This patch against dpdk-next-net mostly contains bug fixes
> for issues found during testing.
>
> v1->v2:
> -Split patch 09/10 into two and reworded the commit messages.
> -Rebased against latest dpdk-next-net
> -Some of the patches were missing the Fixes tag. Added it to them.
>
> Ajit Khaparde (2):
> net/bnxt: update trusted VF status only when it changes
> net/bnxt: get the default HWRM command timeout from firmware
>
> Kalesh AP (7):
> net/bnxt: fix return checks and return values
> net/bnxt: return error if setting link up fail
> net/bnxt: remove redundant header file inclusion
> net/bnxt: enable interrupts after checking interface status from FW
> net/bnxt: fix to handle interface change status in port start only
> net/bnxt: fix coding style issues
> net/bnxt: remove unnecessary variable assignment
>
> Rahul Gupta (2):
> net/bnxt: reduce cleanup time during reset recovery
> net/bnxt: change msix vector to queue mapping
>
> Santoshkumar Karanappa Rastapur (1):
> net/bnxt: free default completion ring before VF configuration
Series applied to dpdk-next-net/master, thanks.
^ permalink raw reply [flat|nested] 27+ messages in thread
end of thread, other threads:[~2019-10-10 18:05 UTC | newest]
Thread overview: 27+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-10-04 5:02 [dpdk-dev] [PATCH 00/10] bnxt patchset with bug fixes Ajit Khaparde
2019-10-04 5:02 ` [dpdk-dev] [PATCH 01/10] net/bnxt: change return value of few routines Ajit Khaparde
2019-10-04 5:02 ` [dpdk-dev] [PATCH 02/10] net/bnxt: free default completion ring before VF configuration Ajit Khaparde
2019-10-04 5:02 ` [dpdk-dev] [PATCH 03/10] net/bnxt: return error if setting link up fail Ajit Khaparde
2019-10-04 5:02 ` [dpdk-dev] [PATCH 04/10] net/bnxt: remove redundant header file inclusion Ajit Khaparde
2019-10-08 8:44 ` Ferruh Yigit
2019-10-04 5:02 ` [dpdk-dev] [PATCH 05/10] net/bnxt: update trusted VF status only when it changes Ajit Khaparde
2019-10-04 5:02 ` [dpdk-dev] [PATCH 06/10] net/bnxt: get the default HWRM command timeout from firmware Ajit Khaparde
2019-10-04 5:02 ` [dpdk-dev] [PATCH 07/10] net/bnxt: reduce cleanup time during reset recovery Ajit Khaparde
2019-10-04 5:02 ` [dpdk-dev] [PATCH 08/10] net/bnxt: change msix vector to queue mapping Ajit Khaparde
2019-10-04 5:02 ` [dpdk-dev] [PATCH 09/10] net/bnxt: fix to handle if change status in port start only Ajit Khaparde
2019-10-04 5:02 ` [dpdk-dev] [PATCH 10/10] net/bnxt: remove a useless check in validate flow routine Ajit Khaparde
2019-10-08 9:03 ` Ferruh Yigit
2019-10-10 1:41 ` [dpdk-dev] [PATCH v2 00/12] bnxt patchset with bug fixes Ajit Khaparde
2019-10-10 1:41 ` [dpdk-dev] [PATCH v2 01/12] net/bnxt: fix return checks and return values Ajit Khaparde
2019-10-10 1:41 ` [dpdk-dev] [PATCH v2 02/12] net/bnxt: free default completion ring before VF configuration Ajit Khaparde
2019-10-10 1:41 ` [dpdk-dev] [PATCH v2 03/12] net/bnxt: return error if setting link up fail Ajit Khaparde
2019-10-10 1:41 ` [dpdk-dev] [PATCH v2 04/12] net/bnxt: remove redundant header file inclusion Ajit Khaparde
2019-10-10 1:41 ` [dpdk-dev] [PATCH v2 05/12] net/bnxt: update trusted VF status only when it changes Ajit Khaparde
2019-10-10 1:41 ` [dpdk-dev] [PATCH v2 06/12] net/bnxt: get the default HWRM command timeout from firmware Ajit Khaparde
2019-10-10 1:41 ` [dpdk-dev] [PATCH v2 07/12] net/bnxt: reduce cleanup time during reset recovery Ajit Khaparde
2019-10-10 1:41 ` [dpdk-dev] [PATCH v2 08/12] net/bnxt: change msix vector to queue mapping Ajit Khaparde
2019-10-10 1:41 ` [dpdk-dev] [PATCH v2 09/12] net/bnxt: enable interrupts after checking interface status from FW Ajit Khaparde
2019-10-10 1:41 ` [dpdk-dev] [PATCH v2 10/12] net/bnxt: fix to handle interface change status in port start only Ajit Khaparde
2019-10-10 1:41 ` [dpdk-dev] [PATCH v2 11/12] net/bnxt: fix coding style issues Ajit Khaparde
2019-10-10 1:41 ` [dpdk-dev] [PATCH v2 12/12] net/bnxt: remove unnecessary variable assignment Ajit Khaparde
2019-10-10 18:05 ` [dpdk-dev] [PATCH v2 00/12] bnxt patchset with bug fixes Ferruh Yigit
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).