patch 'net/bonding: fix startup when NUMA is not supported' has been queued to stable release 20.11.9

luca.boccassi at gmail.com luca.boccassi at gmail.com
Wed Jun 28 16:10:32 CEST 2023


Hi,

FYI, your patch has been queued to stable release 20.11.9

Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 06/30/23. 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/c012d925d9e5e581cb1a8a7bd8c622c4fcdca79d

Thanks.

Luca Boccassi

---
>From c012d925d9e5e581cb1a8a7bd8c622c4fcdca79d Mon Sep 17 00:00:00 2001
From: Zerun Fu <zerun.fu at corigine.com>
Date: Fri, 16 Jun 2023 15:20:34 +0800
Subject: [PATCH] net/bonding: fix startup when NUMA is not supported

[ upstream commit 85e6be63dfa8bff9c42ab0b4dea6fcbba7d680b2 ]

After the mainline Linux kernel commit
"fe205d984e7730f4d21f6f8ebc60f0698404ac31" (ACPI: Remove side effect
of partly creating a node in acpi_map_pxm_to_online_node) by
Jonathan Cameron. When the system does not support NUMA architecture,
the "socket_id" is expected to be -1. The valid "socket_id" in
BOND PMD is greater than or equal to zero. So it will cause an error
when DPDK checks the validity of the "socket_id" when starting the
bond. This commit can fix this bug.

Fixes: f294e04851fd ("net/bonding: fix socket ID check")

Signed-off-by: Zerun Fu <zerun.fu at corigine.com>
Reviewed-by: Peng Zhang <peng.zhang at corigine.com>
Reviewed-by: Chaoyong He <chaoyong.he at corigine.com>
Reviewed-by: Long Wu <long.wu at corigine.com>
Acked-by: Min Hu (Connor) <humin29 at huawei.com>
---
 drivers/net/bonding/rte_eth_bond_args.c | 6 ++++++
 drivers/net/bonding/rte_eth_bond_pmd.c  | 6 +++---
 2 files changed, 9 insertions(+), 3 deletions(-)

diff --git a/drivers/net/bonding/rte_eth_bond_args.c b/drivers/net/bonding/rte_eth_bond_args.c
index 764b1b8c8e..1b27e0f779 100644
--- a/drivers/net/bonding/rte_eth_bond_args.c
+++ b/drivers/net/bonding/rte_eth_bond_args.c
@@ -211,6 +211,12 @@ bond_ethdev_parse_socket_id_kvarg(const char *key __rte_unused,
 	if (*endptr != 0 || errno != 0)
 		return -1;
 
+	/* SOCKET_ID_ANY also consider a valid socket id */
+	if ((int8_t)socket_id == SOCKET_ID_ANY) {
+		*(int *)extra_args = SOCKET_ID_ANY;
+		return 0;
+	}
+
 	/* validate socket id value */
 	if (socket_id >= 0 && socket_id < RTE_MAX_NUMA_NODES) {
 		*(int *)extra_args = (int)socket_id;
diff --git a/drivers/net/bonding/rte_eth_bond_pmd.c b/drivers/net/bonding/rte_eth_bond_pmd.c
index 164a1d1575..3dcdae72b6 100644
--- a/drivers/net/bonding/rte_eth_bond_pmd.c
+++ b/drivers/net/bonding/rte_eth_bond_pmd.c
@@ -3306,7 +3306,7 @@ static int
 bond_alloc(struct rte_vdev_device *dev, uint8_t mode)
 {
 	const char *name = rte_vdev_device_name(dev);
-	uint8_t socket_id = dev->device.numa_node;
+	int socket_id = dev->device.numa_node;
 	struct bond_dev_private *internals = NULL;
 	struct rte_eth_dev *eth_dev = NULL;
 	uint32_t vlan_filter_bmp_size;
@@ -3506,7 +3506,7 @@ bond_probe(struct rte_vdev_device *dev)
 	port_id = bond_alloc(dev, bonding_mode);
 	if (port_id < 0) {
 		RTE_BOND_LOG(ERR, "Failed to create socket %s in mode %u on "
-				"socket %u.",	name, bonding_mode, socket_id);
+				"socket %d.",	name, bonding_mode, socket_id);
 		goto parse_error;
 	}
 	internals = rte_eth_devices[port_id].data->dev_private;
@@ -3531,7 +3531,7 @@ bond_probe(struct rte_vdev_device *dev)
 
 	rte_eth_dev_probing_finish(&rte_eth_devices[port_id]);
 	RTE_BOND_LOG(INFO, "Create bonded device %s on port %d in mode %u on "
-			"socket %u.",	name, port_id, bonding_mode, socket_id);
+			"socket %d.",	name, port_id, bonding_mode, socket_id);
 	return 0;
 
 parse_error:
-- 
2.39.2

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2023-06-28 11:40:08.414268209 +0100
+++ 0008-net-bonding-fix-startup-when-NUMA-is-not-supported.patch	2023-06-28 11:40:08.048027340 +0100
@@ -1 +1 @@
-From 85e6be63dfa8bff9c42ab0b4dea6fcbba7d680b2 Mon Sep 17 00:00:00 2001
+From c012d925d9e5e581cb1a8a7bd8c622c4fcdca79d Mon Sep 17 00:00:00 2001
@@ -5,0 +6,2 @@
+[ upstream commit 85e6be63dfa8bff9c42ab0b4dea6fcbba7d680b2 ]
+
@@ -16 +17,0 @@
-Cc: stable at dpdk.org
@@ -29 +30 @@
-index 6553166f5c..c137efd55f 100644
+index 764b1b8c8e..1b27e0f779 100644
@@ -32 +33 @@
-@@ -212,6 +212,12 @@ bond_ethdev_parse_socket_id_kvarg(const char *key __rte_unused,
+@@ -211,6 +211,12 @@ bond_ethdev_parse_socket_id_kvarg(const char *key __rte_unused,
@@ -46 +47 @@
-index f0c4f7d26b..73205f78f4 100644
+index 164a1d1575..3dcdae72b6 100644
@@ -49 +50 @@
-@@ -3604,7 +3604,7 @@ static int
+@@ -3306,7 +3306,7 @@ static int
@@ -58 +59 @@
-@@ -3806,7 +3806,7 @@ bond_probe(struct rte_vdev_device *dev)
+@@ -3506,7 +3506,7 @@ bond_probe(struct rte_vdev_device *dev)
@@ -67 +68 @@
-@@ -3831,7 +3831,7 @@ bond_probe(struct rte_vdev_device *dev)
+@@ -3531,7 +3531,7 @@ bond_probe(struct rte_vdev_device *dev)


More information about the stable mailing list