patch 'test: fix segment length in packet generator' has been queued to stable release 22.11.2
Xueming Li
xuemingl at nvidia.com
Sun Apr 9 17:24:46 CEST 2023
Hi,
FYI, your patch has been queued to stable release 22.11.2
Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 04/11/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://git.dpdk.org/dpdk-stable/log/?h=22.11-staging
This queued commit can be viewed at:
https://git.dpdk.org/dpdk-stable/log/?h=22.11-staging/commit/64f4cb8bcee5e0cf9db41ff606270c4fa97dff6b
Thanks.
Xueming Li <xuemingl at nvidia.com>
---
>From 64f4cb8bcee5e0cf9db41ff606270c4fa97dff6b Mon Sep 17 00:00:00 2001
From: Zhuobin Huang <zobin1999 at gmail.com>
Date: Mon, 6 Mar 2023 14:51:56 +0800
Subject: [PATCH] test: fix segment length in packet generator
Cc: Xueming Li <xuemingl at nvidia.com>
[ upstream commit b88b8af25e7cbb267584bd4c36d3615c4b20109f ]
Assign correct data length to each segments according to the given
pkt_len and nb_pkt_segs, instead of using pkt_len as the data_len
of every packet segment.
Fixes: a9c9e9698d5e ("app/test: allow to create packets of different sizes")
Signed-off-by: Zhuobin Huang <zobin1999 at gmail.com>
Reviewed-by: David Marchand <david.marchand at redhat.com>
---
.mailmap | 1 +
app/test/packet_burst_generator.c | 26 ++++++++++++++++----------
2 files changed, 17 insertions(+), 10 deletions(-)
diff --git a/.mailmap b/.mailmap
index 89fdbe2542..da2ce216a3 100644
--- a/.mailmap
+++ b/.mailmap
@@ -1573,6 +1573,7 @@ Zhipeng Lu <luzhipeng at cestc.cn>
Zhirun Yan <zhirun.yan at intel.com>
Zhiwei He <zhiwei.he at intel.com>
Zhiyong Yang <zhiyong.yang at intel.com>
+Zhuobin Huang <zobin1999 at gmail.com>
Zi Hu <huzilucky at gmail.com>
Zijie Pan <zijie.pan at 6wind.com>
Ziyang Xuan <xuanziyang2 at huawei.com>
diff --git a/app/test/packet_burst_generator.c b/app/test/packet_burst_generator.c
index 6b42b9b83b..867a88da00 100644
--- a/app/test/packet_burst_generator.c
+++ b/app/test/packet_burst_generator.c
@@ -263,11 +263,11 @@ generate_packet_burst(struct rte_mempool *mp, struct rte_mbuf **pkts_burst,
void *ip_hdr, uint8_t ipv4, struct rte_udp_hdr *udp_hdr,
int nb_pkt_per_burst, uint8_t pkt_len, uint8_t nb_pkt_segs)
{
- int i, nb_pkt = 0;
- size_t eth_hdr_size;
-
+ const uint8_t pkt_seg_data_len = pkt_len / nb_pkt_segs;
struct rte_mbuf *pkt_seg;
struct rte_mbuf *pkt;
+ size_t eth_hdr_size;
+ int i, nb_pkt = 0;
for (nb_pkt = 0; nb_pkt < nb_pkt_per_burst; nb_pkt++) {
pkt = rte_pktmbuf_alloc(mp);
@@ -278,7 +278,7 @@ nomore_mbuf:
break;
}
- pkt->data_len = pkt_len;
+ pkt->data_len = pkt_seg_data_len;
pkt_seg = pkt;
for (i = 1; i < nb_pkt_segs; i++) {
pkt_seg->next = rte_pktmbuf_alloc(mp);
@@ -288,7 +288,10 @@ nomore_mbuf:
goto nomore_mbuf;
}
pkt_seg = pkt_seg->next;
- pkt_seg->data_len = pkt_len;
+ if (i != nb_pkt_segs - 1)
+ pkt_seg->data_len = pkt_seg_data_len;
+ else
+ pkt_seg->data_len = pkt_seg_data_len + pkt_len % nb_pkt_segs;
}
pkt_seg->next = NULL; /* Last segment of packet. */
@@ -344,11 +347,11 @@ generate_packet_burst_proto(struct rte_mempool *mp,
uint8_t ipv4, uint8_t proto, void *proto_hdr,
int nb_pkt_per_burst, uint8_t pkt_len, uint8_t nb_pkt_segs)
{
- int i, nb_pkt = 0;
- size_t eth_hdr_size;
-
+ const uint8_t pkt_seg_data_len = pkt_len / nb_pkt_segs;
struct rte_mbuf *pkt_seg;
struct rte_mbuf *pkt;
+ size_t eth_hdr_size;
+ int i, nb_pkt = 0;
for (nb_pkt = 0; nb_pkt < nb_pkt_per_burst; nb_pkt++) {
pkt = rte_pktmbuf_alloc(mp);
@@ -359,7 +362,7 @@ nomore_mbuf:
break;
}
- pkt->data_len = pkt_len;
+ pkt->data_len = pkt_seg_data_len;
pkt_seg = pkt;
for (i = 1; i < nb_pkt_segs; i++) {
pkt_seg->next = rte_pktmbuf_alloc(mp);
@@ -369,7 +372,10 @@ nomore_mbuf:
goto nomore_mbuf;
}
pkt_seg = pkt_seg->next;
- pkt_seg->data_len = pkt_len;
+ if (i != nb_pkt_segs - 1)
+ pkt_seg->data_len = pkt_seg_data_len;
+ else
+ pkt_seg->data_len = pkt_seg_data_len + pkt_len % nb_pkt_segs;
}
pkt_seg->next = NULL; /* Last segment of packet. */
--
2.25.1
---
Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- - 2023-04-09 21:45:41.270341800 +0800
+++ 0098-test-fix-segment-length-in-packet-generator.patch 2023-04-09 21:45:38.719042200 +0800
@@ -1 +1 @@
-From b88b8af25e7cbb267584bd4c36d3615c4b20109f Mon Sep 17 00:00:00 2001
+From 64f4cb8bcee5e0cf9db41ff606270c4fa97dff6b Mon Sep 17 00:00:00 2001
@@ -4,0 +5,3 @@
+Cc: Xueming Li <xuemingl at nvidia.com>
+
+[ upstream commit b88b8af25e7cbb267584bd4c36d3615c4b20109f ]
@@ -20 +23 @@
-index 4018f0fc47..6a56239c3a 100644
+index 89fdbe2542..da2ce216a3 100644
@@ -23 +26 @@
-@@ -1584,6 +1584,7 @@ Zhipeng Lu <luzhipeng at cestc.cn>
+@@ -1573,6 +1573,7 @@ Zhipeng Lu <luzhipeng at cestc.cn>
More information about the stable
mailing list