On 8/20/2020 2:42 AM, Wei Hu (Xavier) wrote: > From: Chengchang Tang <tangchengch...@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: sta...@dpdk.org > > Signed-off-by: Chengchang Tang <tangchengch...@huawei.com> > Signed-off-by: Wei Hu (Xavier) <xavier.hu...@huawei.com> <...>