patch 'net/bonding: prevent crash on Rx/Tx from secondary process' has been queued to stable release 25.11.3
Kevin Traynor
ktraynor at redhat.com
Tue Jul 28 17:57:04 CEST 2026
Hi,
FYI, your patch has been queued to stable release 25.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 08/01/26. 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/kevintraynor/dpdk-stable
This queued commit can be viewed at:
https://github.com/kevintraynor/dpdk-stable/commit/a207b111f00a18028ba357a505e58b56a15c3672
Thanks.
Kevin
---
>From a207b111f00a18028ba357a505e58b56a15c3672 Mon Sep 17 00:00:00 2001
From: Stephen Hemminger <stephen at networkplumber.org>
Date: Fri, 17 Apr 2026 09:32:19 -0700
Subject: [PATCH] net/bonding: prevent crash on Rx/Tx from secondary process
[ upstream commit 6d77d081d8bcf24a6203aae375b68ff070aa57d8 ]
The bonding PMD's secondary process attach path registered the
ethdev but never installed rx_pkt_burst or tx_pkt_burst, leaving
both as NULL. Any rx_burst or tx_burst call from a secondary
process therefore crashed with a NULL pointer dereference.
Fully sharing bonding state across processes would be
overly complex. Instead, install blackhole burst functions
in the secondary so the data path is safe by default. Rx returns 0
and Tx frees the mbufs and reports them as transmitted,
matching /dev/null semantics so applications do not spin
retrying. Each stub logs once at NOTICE level on first use.
Also reject bond mode changes from a secondary process.
rte_eth_bond_mode_set() is callable from secondary, and
without this guard it would overwrite the secondary's safe
burst stubs with real per-mode functions whose internal
state is not valid outside the primary, reintroducing the
crash by another path.
This keeps secondary support available for the more
common use cases of procinfo and packet capture.
Bugzilla ID: 1698
Fixes: 4852aa8f6e21 ("drivers/net: enable hotplug on secondary process")
Signed-off-by: Stephen Hemminger <stephen at networkplumber.org>
Acked-by: Bruce Richardson <bruce.richardson at intel.com>
---
drivers/net/bonding/rte_eth_bond_pmd.c | 43 +++++++++++++++++++++++++-
1 file changed, 42 insertions(+), 1 deletion(-)
diff --git a/drivers/net/bonding/rte_eth_bond_pmd.c b/drivers/net/bonding/rte_eth_bond_pmd.c
index 96725071da..3bea3bb581 100644
--- a/drivers/net/bonding/rte_eth_bond_pmd.c
+++ b/drivers/net/bonding/rte_eth_bond_pmd.c
@@ -57,4 +57,31 @@ get_vlan_offset(struct rte_ether_hdr *eth_hdr, uint16_t *proto)
}
+static uint16_t
+bond_ethdev_rx_secondary(void *queue __rte_unused,
+ struct rte_mbuf **bufs __rte_unused, uint16_t nb_pkts __rte_unused)
+{
+ static bool once = true;
+
+ if (once) {
+ /* once per process is enough of a notice */
+ RTE_BOND_LOG(ERR, "receive not supported in secondary");
+ once = false;
+ }
+ return 0;
+}
+
+static uint16_t
+bond_ethdev_tx_secondary(void *queue __rte_unused, struct rte_mbuf **bufs, uint16_t nb_pkts)
+{
+ static bool once = true;
+
+ if (once) {
+ RTE_BOND_LOG(ERR, "transmit not supported in secondary");
+ once = false;
+ }
+ rte_pktmbuf_free_bulk(bufs, nb_pkts);
+ return nb_pkts;
+}
+
static uint16_t
bond_ethdev_rx_burst(void *queue, struct rte_mbuf **bufs, uint16_t nb_pkts)
@@ -1600,4 +1627,9 @@ bond_ethdev_mode_set(struct rte_eth_dev *eth_dev, uint8_t mode)
struct bond_dev_private *internals;
+ if (rte_eal_process_type() == RTE_PROC_SECONDARY) {
+ RTE_BOND_LOG(ERR, "Setting mode in secondary not allowed");
+ return -1;
+ }
+
internals = eth_dev->data->dev_private;
@@ -3800,7 +3832,16 @@ bond_probe(struct rte_vdev_device *dev)
return -1;
}
- /* TODO: request info from primary to set up Rx and Tx */
+
eth_dev->dev_ops = &default_dev_ops;
eth_dev->device = &dev->device;
+
+ /*
+ * Propagation of bond mode would require adding
+ * MP client/server support and lots of error handling.
+ *
+ * For now just install a black hole.
+ */
+ eth_dev->tx_pkt_burst = bond_ethdev_tx_secondary;
+ eth_dev->rx_pkt_burst = bond_ethdev_rx_secondary;
rte_eth_dev_probing_finish(eth_dev);
return 0;
--
2.55.0
---
Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- - 2026-07-28 16:54:53.527771569 +0100
+++ 0094-net-bonding-prevent-crash-on-Rx-Tx-from-secondary-pr.patch 2026-07-28 16:54:50.849729148 +0100
@@ -1 +1 @@
-From 6d77d081d8bcf24a6203aae375b68ff070aa57d8 Mon Sep 17 00:00:00 2001
+From a207b111f00a18028ba357a505e58b56a15c3672 Mon Sep 17 00:00:00 2001
@@ -5,0 +6,2 @@
+[ upstream commit 6d77d081d8bcf24a6203aae375b68ff070aa57d8 ]
+
@@ -30 +31,0 @@
-Cc: stable at dpdk.org
@@ -39 +40 @@
-index 7fcb3ec7d7..8a9c329fb8 100644
+index 96725071da..3bea3bb581 100644
@@ -84 +85 @@
-@@ -3799,7 +3831,16 @@ bond_probe(struct rte_vdev_device *dev)
+@@ -3800,7 +3832,16 @@ bond_probe(struct rte_vdev_device *dev)
More information about the stable
mailing list