patch 'net/iavf: preserve MAC address with i40e PF Linux driver' has been queued to stable release 23.11.3
Xueming Li
xuemingl at nvidia.com
Mon Nov 11 07:28:29 CET 2024
Hi,
FYI, your patch has been queued to stable release 23.11.3
Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 11/30/24. 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://git.dpdk.org/dpdk-stable/log/?h=23.11-staging
This queued commit can be viewed at:
https://git.dpdk.org/dpdk-stable/commit/?h=23.11-staging&id=819d57cd27c47941913084143eb32d1cb3a8bf20
Thanks.
Xueming Li <xuemingl at nvidia.com>
---
>From 819d57cd27c47941913084143eb32d1cb3a8bf20 Mon Sep 17 00:00:00 2001
From: David Marchand <david.marchand at redhat.com>
Date: Tue, 1 Oct 2024 11:12:54 +0200
Subject: [PATCH] net/iavf: preserve MAC address with i40e PF Linux driver
Cc: Xueming Li <xuemingl at nvidia.com>
[ upstream commit 3d42086def307be853d1e2e5b9d1e76725c3661f ]
Following two upstream Linux kernel changes (see links), the mac address
of a iavf port, serviced by a i40e PF driver, is lost when the DPDK iavf
driver probes the port again (which may be triggered at any point of a
DPDK application life, like when a reset event is triggered by the PF).
A first change results in the mac address of the VF port being reset to 0
during the VIRTCHNL_OP_GET_VF_RESOURCES query.
The i40e PF driver change is pretty obscure but the iavf Linux driver does
set VIRTCHNL_VF_OFFLOAD_USO.
Announcing such a capability in the DPDK driver does not seem to be an
issue, so do the same in DPDK to keep the legacy behavior of a fixed mac.
Then a second change in the kernel results in the VF mac address being
cleared when the VF driver remove its default mac address.
Removing (unicast or multicast) mac addresses is not done by the kernel VF
driver in general.
The reason why the DPDK driver behaves like this is undocumented
(and lost because the authors are not active anymore).
Aligning DPDK behavior to the upstream kernel driver is safer in any
case.
Link: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=fed0d9f13266
Link: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=ceb29474bbbc
Signed-off-by: David Marchand <david.marchand at redhat.com>
Acked-by: Bruce Richardson <bruce.richardson at intel.com>
---
drivers/net/iavf/iavf_ethdev.c | 22 +++++-----------------
drivers/net/iavf/iavf_vchnl.c | 1 +
2 files changed, 6 insertions(+), 17 deletions(-)
diff --git a/drivers/net/iavf/iavf_ethdev.c b/drivers/net/iavf/iavf_ethdev.c
index 1a98c7734c..9f3658c48b 100644
--- a/drivers/net/iavf/iavf_ethdev.c
+++ b/drivers/net/iavf/iavf_ethdev.c
@@ -1033,7 +1033,7 @@ iavf_dev_start(struct rte_eth_dev *dev)
if (iavf_configure_queues(adapter,
IAVF_CFG_Q_NUM_PER_BUF, index) != 0) {
PMD_DRV_LOG(ERR, "configure queues failed");
- goto err_queue;
+ goto error;
}
num_queue_pairs -= IAVF_CFG_Q_NUM_PER_BUF;
index += IAVF_CFG_Q_NUM_PER_BUF;
@@ -1041,12 +1041,12 @@ iavf_dev_start(struct rte_eth_dev *dev)
if (iavf_configure_queues(adapter, num_queue_pairs, index) != 0) {
PMD_DRV_LOG(ERR, "configure queues failed");
- goto err_queue;
+ goto error;
}
if (iavf_config_rx_queues_irqs(dev, intr_handle) != 0) {
PMD_DRV_LOG(ERR, "configure irq failed");
- goto err_queue;
+ goto error;
}
/* re-enable intr again, because efd assign may change */
if (dev->data->dev_conf.intr_conf.rxq != 0) {
@@ -1066,14 +1066,12 @@ iavf_dev_start(struct rte_eth_dev *dev)
if (iavf_start_queues(dev) != 0) {
PMD_DRV_LOG(ERR, "enable queues failed");
- goto err_mac;
+ goto error;
}
return 0;
-err_mac:
- iavf_add_del_all_mac_addr(adapter, false);
-err_queue:
+error:
return -1;
}
@@ -1102,16 +1100,6 @@ iavf_dev_stop(struct rte_eth_dev *dev)
/* Rx interrupt vector mapping free */
rte_intr_vec_list_free(intr_handle);
- /* adminq will be disabled when vf is resetting. */
- if (!vf->in_reset_recovery) {
- /* remove all mac addrs */
- iavf_add_del_all_mac_addr(adapter, false);
-
- /* remove all multicast addresses */
- iavf_add_del_mc_addr_list(adapter, vf->mc_addrs, vf->mc_addrs_num,
- false);
- }
-
iavf_stop_queues(dev);
adapter->stopped = 1;
diff --git a/drivers/net/iavf/iavf_vchnl.c b/drivers/net/iavf/iavf_vchnl.c
index 8ca104c04e..71be87845a 100644
--- a/drivers/net/iavf/iavf_vchnl.c
+++ b/drivers/net/iavf/iavf_vchnl.c
@@ -710,6 +710,7 @@ iavf_get_vf_resource(struct iavf_adapter *adapter)
VIRTCHNL_VF_OFFLOAD_ADV_RSS_PF |
VIRTCHNL_VF_OFFLOAD_FSUB_PF |
VIRTCHNL_VF_OFFLOAD_REQ_QUEUES |
+ VIRTCHNL_VF_OFFLOAD_USO |
VIRTCHNL_VF_OFFLOAD_CRC |
VIRTCHNL_VF_OFFLOAD_VLAN_V2 |
VIRTCHNL_VF_LARGE_NUM_QPAIRS |
--
2.34.1
---
Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- - 2024-11-11 14:23:09.886694643 +0800
+++ 0103-net-iavf-preserve-MAC-address-with-i40e-PF-Linux-dri.patch 2024-11-11 14:23:05.292192836 +0800
@@ -1 +1 @@
-From 3d42086def307be853d1e2e5b9d1e76725c3661f Mon Sep 17 00:00:00 2001
+From 819d57cd27c47941913084143eb32d1cb3a8bf20 Mon Sep 17 00:00:00 2001
@@ -4,0 +5,3 @@
+Cc: Xueming Li <xuemingl at nvidia.com>
+
+[ upstream commit 3d42086def307be853d1e2e5b9d1e76725c3661f ]
@@ -27,2 +29,0 @@
-Cc: stable at dpdk.org
-
@@ -40 +41 @@
-index c200f63b4f..7f80cd6258 100644
+index 1a98c7734c..9f3658c48b 100644
@@ -43 +44 @@
-@@ -1044,7 +1044,7 @@ iavf_dev_start(struct rte_eth_dev *dev)
+@@ -1033,7 +1033,7 @@ iavf_dev_start(struct rte_eth_dev *dev)
@@ -52 +53 @@
-@@ -1052,12 +1052,12 @@ iavf_dev_start(struct rte_eth_dev *dev)
+@@ -1041,12 +1041,12 @@ iavf_dev_start(struct rte_eth_dev *dev)
@@ -67 +68 @@
-@@ -1077,14 +1077,12 @@ iavf_dev_start(struct rte_eth_dev *dev)
+@@ -1066,14 +1066,12 @@ iavf_dev_start(struct rte_eth_dev *dev)
@@ -84 +85 @@
-@@ -1113,16 +1111,6 @@ iavf_dev_stop(struct rte_eth_dev *dev)
+@@ -1102,16 +1100,6 @@ iavf_dev_stop(struct rte_eth_dev *dev)
@@ -102 +103 @@
-index 69420bc9b6..065ab3594c 100644
+index 8ca104c04e..71be87845a 100644
More information about the stable
mailing list