patch 'net/bnxt: fix handling of VF configuration change' has been queued to stable release 20.11.5

luca.boccassi at gmail.com luca.boccassi at gmail.com
Fri Feb 18 13:38:00 CET 2022


Hi,

FYI, your patch has been queued to stable release 20.11.5

Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 02/20/22. So please
shout if anyone has objections.

Also note that after the patch there's a diff of the upstream commit vs the
patch applied to the branch. This will indicate if there was any rebasing
needed to apply to the stable branch. If there were code changes for rebasing
(ie: not only metadata diffs), please double check that the rebase was
correctly done.

Queued patches are on a temporary branch at:
https://github.com/bluca/dpdk-stable

This queued commit can be viewed at:
https://github.com/bluca/dpdk-stable/commit/766d7701ba0b7e9fc7722d6e8172b91cb83c09d1

Thanks.

Luca Boccassi

---
>From 766d7701ba0b7e9fc7722d6e8172b91cb83c09d1 Mon Sep 17 00:00:00 2001
From: Kalesh AP <kalesh-anakkur.purayil at broadcom.com>
Date: Tue, 4 Jan 2022 14:08:19 +0530
Subject: [PATCH] net/bnxt: fix handling of VF configuration change

[ upstream commit 6c63f3495e3563869461ec523d13cbb7fcf67d82 ]

When there is a change in the default VLAN of the VF,
FW sends the VF_CFG_CHANGE async event to the driver.
Upon receiving this async event, driver currently only queries
the FW using HWRM_FUNC_QCFG. But this is not enough.

Driver has to clean up the existing filter and recreate filters
so the FW can apply the default VLAN to the filter.

Fixes: 12213821a8a3 ("net/bnxt: register for more async events")

Signed-off-by: Kalesh AP <kalesh-anakkur.purayil at broadcom.com>
Reviewed-by: Ajit Khaparde <ajit.khaparde at broadcom.com>
Reviewed-by: Somnath Kotur <somnath.kotur at broadcom.com>
---
 drivers/net/bnxt/bnxt.h        |  3 +++
 drivers/net/bnxt/bnxt_cpr.c    | 22 ++++++++++++++++++++++
 drivers/net/bnxt/bnxt_ethdev.c | 13 +++++++------
 3 files changed, 32 insertions(+), 6 deletions(-)

diff --git a/drivers/net/bnxt/bnxt.h b/drivers/net/bnxt/bnxt.h
index 5f5bad0f1b..51044d6241 100644
--- a/drivers/net/bnxt/bnxt.h
+++ b/drivers/net/bnxt/bnxt.h
@@ -1026,6 +1026,9 @@ void bnxt_flow_cnt_alarm_cb(void *arg);
 int bnxt_flow_stats_req(struct bnxt *bp);
 int bnxt_flow_stats_cnt(struct bnxt *bp);
 uint32_t bnxt_get_speed_capabilities(struct bnxt *bp);
+int bnxt_dev_start_op(struct rte_eth_dev *eth_dev);
+int bnxt_dev_stop_op(struct rte_eth_dev *eth_dev);
+void bnxt_handle_vf_cfg_change(void *arg);
 
 int
 bnxt_filter_ctrl_op(struct rte_eth_dev *dev,
diff --git a/drivers/net/bnxt/bnxt_cpr.c b/drivers/net/bnxt/bnxt_cpr.c
index 7bfda01b2c..50c18ee6fc 100644
--- a/drivers/net/bnxt/bnxt_cpr.c
+++ b/drivers/net/bnxt/bnxt_cpr.c
@@ -91,6 +91,26 @@ bnxt_process_default_vnic_change(struct bnxt *bp,
 	bnxt_rep_dev_start_op(eth_dev);
 }
 
+void bnxt_handle_vf_cfg_change(void *arg)
+{
+	struct bnxt *bp = arg;
+	struct rte_eth_dev *eth_dev = bp->eth_dev;
+	int rc;
+
+	/* Free and recreate filters with default VLAN */
+	if (eth_dev->data->dev_started) {
+		rc = bnxt_dev_stop_op(eth_dev);
+		if (rc != 0) {
+			PMD_DRV_LOG(ERR, "Failed to stop Port:%u\n", eth_dev->data->port_id);
+			return;
+		}
+
+		rc = bnxt_dev_start_op(eth_dev);
+		if (rc != 0)
+			PMD_DRV_LOG(ERR, "Failed to start Port:%u\n", eth_dev->data->port_id);
+	}
+}
+
 /*
  * Async event handling
  */
@@ -118,6 +138,8 @@ void bnxt_handle_async_event(struct bnxt *bp,
 	case HWRM_ASYNC_EVENT_CMPL_EVENT_ID_VF_CFG_CHANGE:
 		PMD_DRV_LOG(INFO, "Async event: VF config changed\n");
 		bnxt_hwrm_func_qcfg(bp, NULL);
+		if (BNXT_VF(bp))
+			rte_eal_alarm_set(1, bnxt_handle_vf_cfg_change, (void *)bp);
 		break;
 	case HWRM_ASYNC_EVENT_CMPL_EVENT_ID_PORT_CONN_NOT_ALLOWED:
 		PMD_DRV_LOG(INFO, "Port conn async event\n");
diff --git a/drivers/net/bnxt/bnxt_ethdev.c b/drivers/net/bnxt/bnxt_ethdev.c
index cc9cf6c0ea..5fd159e2db 100644
--- a/drivers/net/bnxt/bnxt_ethdev.c
+++ b/drivers/net/bnxt/bnxt_ethdev.c
@@ -964,7 +964,7 @@ static int bnxt_dev_info_get_op(struct rte_eth_dev *eth_dev,
 		return rc;
 
 	/* MAC Specifics */
-	dev_info->max_mac_addrs = RTE_MIN(bp->max_l2_ctx, RTE_ETH_NUM_RECEIVE_MAC_ADDR);
+	dev_info->max_mac_addrs = RTE_MIN(bp->max_l2_ctx, ETH_NUM_RECEIVE_MAC_ADDR);
 	dev_info->max_hash_mac_addrs = 0;
 
 	/* PF/VF specifics */
@@ -1432,7 +1432,7 @@ static int bnxt_ptp_start(struct bnxt *bp)
 }
 
 /* Unload the driver, release resources */
-static int bnxt_dev_stop_op(struct rte_eth_dev *eth_dev)
+int bnxt_dev_stop_op(struct rte_eth_dev *eth_dev)
 {
 	struct bnxt *bp = eth_dev->data->dev_private;
 	struct rte_pci_device *pci_dev = RTE_ETH_DEV_TO_PCI(eth_dev);
@@ -1504,7 +1504,7 @@ static int bnxt_dev_stop_op(struct rte_eth_dev *eth_dev)
 	return 0;
 }
 
-static int bnxt_dev_start_op(struct rte_eth_dev *eth_dev)
+int bnxt_dev_start_op(struct rte_eth_dev *eth_dev)
 {
 	struct bnxt *bp = eth_dev->data->dev_private;
 	uint64_t rx_offloads = eth_dev->data->dev_conf.rxmode.offloads;
@@ -1626,6 +1626,7 @@ static int bnxt_dev_close_op(struct rte_eth_dev *eth_dev)
 	rte_eal_alarm_cancel(bnxt_dev_reset_and_resume, (void *)bp);
 	rte_eal_alarm_cancel(bnxt_dev_recover, (void *)bp);
 	bnxt_cancel_fc_thread(bp);
+	rte_eal_alarm_cancel(bnxt_handle_vf_cfg_change, (void *)bp);
 
 	if (eth_dev->data->dev_started)
 		ret = bnxt_dev_stop_op(eth_dev);
@@ -4781,12 +4782,12 @@ static int bnxt_alloc_stats_mem(struct bnxt *bp)
 static int bnxt_setup_mac_addr(struct rte_eth_dev *eth_dev)
 {
 	struct bnxt *bp = eth_dev->data->dev_private;
-	size_t max_mac_addr = RTE_MIN(bp->max_l2_ctx, RTE_ETH_NUM_RECEIVE_MAC_ADDR);
+	size_t max_mac_addr = RTE_MIN(bp->max_l2_ctx, ETH_NUM_RECEIVE_MAC_ADDR);
 	int rc = 0;
 
-	if (bp->max_l2_ctx > RTE_ETH_NUM_RECEIVE_MAC_ADDR)
+	if (bp->max_l2_ctx > ETH_NUM_RECEIVE_MAC_ADDR)
 		PMD_DRV_LOG(INFO, "Max number of MAC addrs supported is %d, but will be limited to %d\n",
-			    bp->max_l2_ctx, RTE_ETH_NUM_RECEIVE_MAC_ADDR);
+			    bp->max_l2_ctx, ETH_NUM_RECEIVE_MAC_ADDR);
 
 	eth_dev->data->mac_addrs = rte_zmalloc("bnxt_mac_addr_tbl",
 					       RTE_ETHER_ADDR_LEN * max_mac_addr,
-- 
2.30.2

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2022-02-18 12:37:39.332922015 +0000
+++ 0031-net-bnxt-fix-handling-of-VF-configuration-change.patch	2022-02-18 12:37:37.610790133 +0000
@@ -1 +1 @@
-From 6c63f3495e3563869461ec523d13cbb7fcf67d82 Mon Sep 17 00:00:00 2001
+From 766d7701ba0b7e9fc7722d6e8172b91cb83c09d1 Mon Sep 17 00:00:00 2001
@@ -5,0 +6,2 @@
+[ upstream commit 6c63f3495e3563869461ec523d13cbb7fcf67d82 ]
+
@@ -15 +16,0 @@
-Cc: stable at dpdk.org
@@ -22,3 +23,3 @@
- drivers/net/bnxt/bnxt_cpr.c    | 25 ++++++++++++++++++++++++-
- drivers/net/bnxt/bnxt_ethdev.c |  5 +++--
- 3 files changed, 30 insertions(+), 3 deletions(-)
+ drivers/net/bnxt/bnxt_cpr.c    | 22 ++++++++++++++++++++++
+ drivers/net/bnxt/bnxt_ethdev.c | 13 +++++++------
+ 3 files changed, 32 insertions(+), 6 deletions(-)
@@ -27 +28 @@
-index 64866de319..9c0dbc6af4 100644
+index 5f5bad0f1b..51044d6241 100644
@@ -30 +31,3 @@
-@@ -1068,5 +1068,8 @@ int bnxt_flow_stats_cnt(struct bnxt *bp);
+@@ -1026,6 +1026,9 @@ void bnxt_flow_cnt_alarm_cb(void *arg);
+ int bnxt_flow_stats_req(struct bnxt *bp);
+ int bnxt_flow_stats_cnt(struct bnxt *bp);
@@ -32,2 +34,0 @@
- int bnxt_flow_ops_get_op(struct rte_eth_dev *dev,
- 			 const struct rte_flow_ops **ops);
@@ -38 +39,2 @@
- #endif
+ int
+ bnxt_filter_ctrl_op(struct rte_eth_dev *dev,
@@ -40 +42 @@
-index 593eebfb9a..9b9285b799 100644
+index 7bfda01b2c..50c18ee6fc 100644
@@ -43,2 +45,2 @@
-@@ -107,6 +107,26 @@ static void bnxt_handle_event_error_report(struct bnxt *bp,
- 	}
+@@ -91,6 +91,26 @@ bnxt_process_default_vnic_change(struct bnxt *bp,
+ 	bnxt_rep_dev_start_op(eth_dev);
@@ -70,3 +72 @@
-@@ -138,8 +158,11 @@ void bnxt_handle_async_event(struct bnxt *bp,
- 		PMD_DRV_LOG(INFO, "Async event: PF driver unloaded\n");
- 		break;
+@@ -118,6 +138,8 @@ void bnxt_handle_async_event(struct bnxt *bp,
@@ -74,3 +74 @@
--		PMD_DRV_LOG(INFO, "Async event: VF config changed\n");
-+		PMD_DRV_LOG(INFO, "Port %u: VF config change async event\n", port_id);
-+		PMD_DRV_LOG(INFO, "event: data1 %#x data2 %#x\n", data1, data2);
+ 		PMD_DRV_LOG(INFO, "Async event: VF config changed\n");
@@ -84 +82 @@
-index cf3bd77035..999a9a5103 100644
+index cc9cf6c0ea..5fd159e2db 100644
@@ -87 +85,10 @@
-@@ -1530,7 +1530,7 @@ static int bnxt_dev_stop(struct rte_eth_dev *eth_dev)
+@@ -964,7 +964,7 @@ static int bnxt_dev_info_get_op(struct rte_eth_dev *eth_dev,
+ 		return rc;
+ 
+ 	/* MAC Specifics */
+-	dev_info->max_mac_addrs = RTE_MIN(bp->max_l2_ctx, RTE_ETH_NUM_RECEIVE_MAC_ADDR);
++	dev_info->max_mac_addrs = RTE_MIN(bp->max_l2_ctx, ETH_NUM_RECEIVE_MAC_ADDR);
+ 	dev_info->max_hash_mac_addrs = 0;
+ 
+ 	/* PF/VF specifics */
+@@ -1432,7 +1432,7 @@ static int bnxt_ptp_start(struct bnxt *bp)
@@ -95,3 +102,3 @@
- 
-@@ -1546,7 +1546,7 @@ static int bnxt_dev_stop_op(struct rte_eth_dev *eth_dev)
- 	return bnxt_dev_stop(eth_dev);
+ 	struct rte_pci_device *pci_dev = RTE_ETH_DEV_TO_PCI(eth_dev);
+@@ -1504,7 +1504,7 @@ static int bnxt_dev_stop_op(struct rte_eth_dev *eth_dev)
+ 	return 0;
@@ -105 +112 @@
-@@ -1678,6 +1678,7 @@ static int bnxt_dev_close_op(struct rte_eth_dev *eth_dev)
+@@ -1626,6 +1626,7 @@ static int bnxt_dev_close_op(struct rte_eth_dev *eth_dev)
@@ -112 +119,17 @@
- 		ret = bnxt_dev_stop(eth_dev);
+ 		ret = bnxt_dev_stop_op(eth_dev);
+@@ -4781,12 +4782,12 @@ static int bnxt_alloc_stats_mem(struct bnxt *bp)
+ static int bnxt_setup_mac_addr(struct rte_eth_dev *eth_dev)
+ {
+ 	struct bnxt *bp = eth_dev->data->dev_private;
+-	size_t max_mac_addr = RTE_MIN(bp->max_l2_ctx, RTE_ETH_NUM_RECEIVE_MAC_ADDR);
++	size_t max_mac_addr = RTE_MIN(bp->max_l2_ctx, ETH_NUM_RECEIVE_MAC_ADDR);
+ 	int rc = 0;
+ 
+-	if (bp->max_l2_ctx > RTE_ETH_NUM_RECEIVE_MAC_ADDR)
++	if (bp->max_l2_ctx > ETH_NUM_RECEIVE_MAC_ADDR)
+ 		PMD_DRV_LOG(INFO, "Max number of MAC addrs supported is %d, but will be limited to %d\n",
+-			    bp->max_l2_ctx, RTE_ETH_NUM_RECEIVE_MAC_ADDR);
++			    bp->max_l2_ctx, ETH_NUM_RECEIVE_MAC_ADDR);
+ 
+ 	eth_dev->data->mac_addrs = rte_zmalloc("bnxt_mac_addr_tbl",
+ 					       RTE_ETHER_ADDR_LEN * max_mac_addr,


More information about the stable mailing list