patch 'net/null: fix packet copy' has been queued to stable release 23.11.5
Xueming Li
xuemingl at nvidia.com
Thu Jun 26 14:01:05 CEST 2025
Hi,
FYI, your patch has been queued to stable release 23.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 06/28/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://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=0fc340a7d8b42ba81b01e54cc00ae4fa07486349
Thanks.
Xueming Li <xuemingl at nvidia.com>
---
>From 0fc340a7d8b42ba81b01e54cc00ae4fa07486349 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
Cc: Xueming Li <xuemingl at nvidia.com>
[ 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 7c46004f1e..5b732f28be 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;
uint64_t rx_pkts;
uint64_t tx_pkts;
@@ -163,17 +163,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.34.1
---
Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- - 2025-06-26 19:59:19.599372352 +0800
+++ 0045-net-null-fix-packet-copy.patch 2025-06-26 19:59:17.386418044 +0800
@@ -1 +1 @@
-From 0ffd3bc09be5f77b26c16e501e4b4465b1bcb8da Mon Sep 17 00:00:00 2001
+From 0fc340a7d8b42ba81b01e54cc00ae4fa07486349 Mon Sep 17 00:00:00 2001
@@ -4,0 +5,3 @@
+Cc: Xueming Li <xuemingl at nvidia.com>
+
+[ upstream commit 0ffd3bc09be5f77b26c16e501e4b4465b1bcb8da ]
@@ -10 +12,0 @@
-Cc: stable at dpdk.org
@@ -18 +20 @@
-index 6764cf2ec1..966748689f 100644
+index 7c46004f1e..5b732f28be 100644
@@ -28,2 +30,2 @@
- RTE_ATOMIC(uint64_t) rx_pkts;
- RTE_ATOMIC(uint64_t) tx_pkts;
+ uint64_t rx_pkts;
+ uint64_t tx_pkts;
More information about the stable
mailing list