[dpdk-dev] [PATCH v2 3/4] app/testpmd: fix packet header in txonly mode

Ferruh Yigit ferruh.yigit at intel.com
Mon Sep 14 18:23:38 CEST 2020


On 8/20/2020 2:42 AM, Wei Hu (Xavier) wrote:
> From: Chengchang Tang <tangchengchang at huawei.com>
> 
> In txonly forward mode, the packet header is fixed by the initial
> setting, including the packet length and checksum. So when the packets
> varies, this may cause a packet header error. Currently, there are two
> methods in txonly mode to randomly change the packets.
> 1. Set txsplit random and txpkts (x[,y]*), the number of segments
>    each packets will be a random value between 1 and total number of
>    segments determined by txpkts settings.
>    The step as follows:
>      a) ./testpmd -w xxx -l xx -n 4 -- -i --rxd xxxx --txd xxxx
>      b) set fwd txonly
>      c) set txsplit rand
>      d) set txpkts 2048,2048,2048,2048
>      e) start
> The nb_segs of the packets sent by testpmd will be 1~4. The real packet
> length will be 2048, 4096, 6144 and 8192. But in fact the packet length
> in ip header and udp header will be fixed by 8178 and 8158.

Although I confirm the patch fixes the ip & udp header packet size for
"txsplit=rand" config,
I am always getting actual packet size wrong, independent from
'txsplit', and it is always first segment size. Am I doing something wrong?


And not related to this patch but why setting 'txpkts' requires "--rxd
xxxx --txd xxxx" options explicitly set? If you are already there can
you also remove this restriction?

> 
> 2. Set txonly-multi-flow. the ip address will be varied to generate
>    multiple flow.
>    The step as follows:
>      a) ./testpmd -w xxx -l xx -n 4 -- -i --txonly-multi-flow
>      b) set fwd txonly
>      c) start
> The ip address of each pkts will change randomly, but since the header
> is fixed, the checksum may be a error value.

+1, I confirm fixing the checksum error.

> 
> Therefore, this patch adds a function to update the packet length and
> check sum in the pkts header when the txsplit mode is set to rand or
> multi-flow is set.
> 
> Fixes: 82010ef55e7c ("app/testpmd: make txonly mode generate multiple flows")
> Fixes: 79bec05b32b7 ("app/testpmd: add ability to split outgoing packets")
> Cc: stable at dpdk.org
> 
> Signed-off-by: Chengchang Tang <tangchengchang at huawei.com>
> Signed-off-by: Wei Hu (Xavier) <xavier.huwei at huawei.com>

<...>



More information about the dev mailing list