On Mon, Mar 6, 2023 at 7:52 AM Zhuobin Huang <zobin1...@gmail.com> wrote:
>
> 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")
> Cc: cunming.li...@intel.com
>
> Signed-off-by: Zhuobin Huang <zobin1...@gmail.com>

Reviewed-by: David Marchand <david.march...@redhat.com>

Good catch.
I am curious to know how you noticed the issue since I see no in-tree
code asking for multiseg.


For the record, to check this patch, I compiled with
-DRTE_LIBRTE_MBUF_DEBUG and a small modification:

diff --git a/app/test/test_pmd_perf.c b/app/test/test_pmd_perf.c
index ff84d251ff..5c670ff165 100644
--- a/app/test/test_pmd_perf.c
+++ b/app/test/test_pmd_perf.c
@@ -209,7 +209,7 @@ init_traffic(struct rte_mempool *mp,
        return generate_packet_burst(mp, pkts_burst, &pkt_eth_hdr,
                                     0, &pkt_ipv4_hdr, 1,
                                     &pkt_udp_hdr, burst_size,
-                                    PACKET_BURST_GEN_PKT_LEN, 1);
+                                    PACKET_BURST_GEN_PKT_LEN, 2);
 }

 static int


Before the fix:

DPDK_TEST=pmd_perf_autotest ./build-gcc/app/test/dpdk-test --no-huge
-m 2048  --vdev=net_null0 --vdev=net_null1
...
Generate 4096 packets @socket 0
inject 2048 packet to port 0
PANIC in rte_mbuf_sanity_check():
bad pkt_len


Cc: ci@ in general, we should have more tests run with debug/check
options enabled.


-- 
David Marchand

Reply via email to