patch 'net/null: fix packet copy' has been queued to stable release 22.11.9
luca.boccassi at gmail.com
luca.boccassi at gmail.com
Thu Jun 12 23:06:53 CEST 2025
Hi,
FYI, your patch has been queued to stable release 22.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/14/25. 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/f9c5f0b7a3c92b78647337cccacdda29c6655e5e
Thanks.
Luca Boccassi
---
>From f9c5f0b7a3c92b78647337cccacdda29c6655e5e Mon Sep 17 00:00:00 2001
From: Stephen Hemminger <stephen at networkplumber.org>
Date: Tue, 1 Apr 2025 16:47:26 -0700
Subject: [PATCH] net/null: fix packet copy
[ upstream commit 0ffd3bc09be5f77b26c16e501e4b4465b1bcb8da ]
If doing copy on transmit, can potentially copy paste the data
in the mbuf. Change to only copy data from that segment.
Fixes: c743e50c475f ("null: new poll mode driver")
Signed-off-by: Stephen Hemminger <stephen at networkplumber.org>
---
drivers/net/null/rte_eth_null.c | 12 ++++++------
1 file changed, 6 insertions(+), 6 deletions(-)
diff --git a/drivers/net/null/rte_eth_null.c b/drivers/net/null/rte_eth_null.c
index 1fbe572bd1..6798714156 100644
--- a/drivers/net/null/rte_eth_null.c
+++ b/drivers/net/null/rte_eth_null.c
@@ -35,7 +35,7 @@ struct null_queue {
struct pmd_internals *internals;
struct rte_mempool *mb_pool;
- struct rte_mbuf *dummy_packet;
+ void *dummy_packet;
rte_atomic64_t rx_pkts;
rte_atomic64_t tx_pkts;
@@ -160,17 +160,17 @@ eth_null_tx(void *q, struct rte_mbuf **bufs, uint16_t nb_bufs)
static uint16_t
eth_null_copy_tx(void *q, struct rte_mbuf **bufs, uint16_t nb_bufs)
{
- int i;
struct null_queue *h = q;
- unsigned int packet_size;
+ unsigned int i;
if ((q == NULL) || (bufs == NULL))
return 0;
- packet_size = h->internals->packet_size;
for (i = 0; i < nb_bufs; i++) {
- rte_memcpy(h->dummy_packet, rte_pktmbuf_mtod(bufs[i], void *),
- packet_size);
+ struct rte_mbuf *m = bufs[i];
+ size_t len = RTE_MIN(h->internals->packet_size, m->data_len);
+
+ rte_memcpy(h->dummy_packet, rte_pktmbuf_mtod(m, void *), len);
rte_pktmbuf_free(bufs[i]);
}
--
2.47.2
---
Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- - 2025-06-12 22:06:25.215660175 +0100
+++ 0036-net-null-fix-packet-copy.patch 2025-06-12 22:06:23.858044384 +0100
@@ -1 +1 @@
-From 0ffd3bc09be5f77b26c16e501e4b4465b1bcb8da Mon Sep 17 00:00:00 2001
+From f9c5f0b7a3c92b78647337cccacdda29c6655e5e Mon Sep 17 00:00:00 2001
@@ -5,0 +6,2 @@
+[ upstream commit 0ffd3bc09be5f77b26c16e501e4b4465b1bcb8da ]
+
@@ -10 +11,0 @@
-Cc: stable at dpdk.org
@@ -18 +19 @@
-index 6764cf2ec1..966748689f 100644
+index 1fbe572bd1..6798714156 100644
@@ -28,3 +29,3 @@
- RTE_ATOMIC(uint64_t) rx_pkts;
- RTE_ATOMIC(uint64_t) tx_pkts;
-@@ -163,17 +163,17 @@ eth_null_tx(void *q, struct rte_mbuf **bufs, uint16_t nb_bufs)
+ rte_atomic64_t rx_pkts;
+ rte_atomic64_t tx_pkts;
+@@ -160,17 +160,17 @@ eth_null_tx(void *q, struct rte_mbuf **bufs, uint16_t nb_bufs)
More information about the stable
mailing list