patch 'app/dumpcap: fix handling of jumbo frames' has been queued to stable release 23.11.3
Xueming Li
xuemingl at nvidia.com
Mon Nov 11 07:27:18 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=09c32b20ec3718838ed7e0e089dc2e7104770e40
Thanks.
Xueming Li <xuemingl at nvidia.com>
---
>From 09c32b20ec3718838ed7e0e089dc2e7104770e40 Mon Sep 17 00:00:00 2001
From: Stephen Hemminger <stephen at networkplumber.org>
Date: Thu, 3 Oct 2024 15:09:03 -0700
Subject: [PATCH] app/dumpcap: fix handling of jumbo frames
Cc: Xueming Li <xuemingl at nvidia.com>
[ upstream commit 5c0f970c0d0e2a963a7a970a71cad4f4244414a5 ]
If dumpcap (in legacy pcap mode) tried to handle a large segmented
frame it would core dump because rte_pktmbuf_read() would return NULL.
Fix by using same logic as in pcap PMD.
Fixes: cbb44143be74 ("app/dumpcap: add new packet capture application")
Reported-by: Tianli Lai <laitianli at tom.com>
Signed-off-by: Stephen Hemminger <stephen at networkplumber.org>
---
app/dumpcap/main.c | 15 ++++++++++-----
1 file changed, 10 insertions(+), 5 deletions(-)
diff --git a/app/dumpcap/main.c b/app/dumpcap/main.c
index 76c7475114..213e764c2e 100644
--- a/app/dumpcap/main.c
+++ b/app/dumpcap/main.c
@@ -874,7 +874,7 @@ static ssize_t
pcap_write_packets(pcap_dumper_t *dumper,
struct rte_mbuf *pkts[], uint16_t n)
{
- uint8_t temp_data[RTE_MBUF_DEFAULT_BUF_SIZE];
+ uint8_t temp_data[RTE_ETHER_MAX_JUMBO_FRAME_LEN];
struct pcap_pkthdr header;
uint16_t i;
size_t total = 0;
@@ -883,14 +883,19 @@ pcap_write_packets(pcap_dumper_t *dumper,
for (i = 0; i < n; i++) {
struct rte_mbuf *m = pkts[i];
+ size_t len, caplen;
- header.len = rte_pktmbuf_pkt_len(m);
- header.caplen = RTE_MIN(header.len, sizeof(temp_data));
+ len = caplen = rte_pktmbuf_pkt_len(m);
+ if (unlikely(!rte_pktmbuf_is_contiguous(m) && len > sizeof(temp_data)))
+ caplen = sizeof(temp_data);
+
+ header.len = len;
+ header.caplen = caplen;
pcap_dump((u_char *)dumper, &header,
- rte_pktmbuf_read(m, 0, header.caplen, temp_data));
+ rte_pktmbuf_read(m, 0, caplen, temp_data));
- total += sizeof(header) + header.len;
+ total += sizeof(header) + caplen;
}
return total;
--
2.34.1
---
Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- - 2024-11-11 14:23:06.767246206 +0800
+++ 0032-app-dumpcap-fix-handling-of-jumbo-frames.patch 2024-11-11 14:23:05.082192840 +0800
@@ -1 +1 @@
-From 5c0f970c0d0e2a963a7a970a71cad4f4244414a5 Mon Sep 17 00:00:00 2001
+From 09c32b20ec3718838ed7e0e089dc2e7104770e40 Mon Sep 17 00:00:00 2001
@@ -4,0 +5,3 @@
+Cc: Xueming Li <xuemingl at nvidia.com>
+
+[ upstream commit 5c0f970c0d0e2a963a7a970a71cad4f4244414a5 ]
@@ -11 +13,0 @@
-Cc: stable at dpdk.org
@@ -20 +22 @@
-index 6feb8f5672..fcfaa19951 100644
+index 76c7475114..213e764c2e 100644
@@ -23 +25 @@
-@@ -902,7 +902,7 @@ static ssize_t
+@@ -874,7 +874,7 @@ static ssize_t
@@ -32 +34 @@
-@@ -911,14 +911,19 @@ pcap_write_packets(pcap_dumper_t *dumper,
+@@ -883,14 +883,19 @@ pcap_write_packets(pcap_dumper_t *dumper,
More information about the stable
mailing list