Re: [dpdk-dev] [PATCH v6] app/testpmd: fix testpmd packets dump overlapping

2021-01-08 Thread Jiawei(Jonny) Wang
ntact-Thomas Monjalon > ; Raslan Darawsheh ; > dev@dpdk.org > Subject: Re: [dpdk-dev] [PATCH v6] app/testpmd: fix testpmd packets dump > overlapping > > On Wed, 6 Jan 2021 16:13:37 +0200 > Jiawei Wang wrote: > > > + int buf_size = MAX_STRING_LEN; > > + char p

Re: [dpdk-dev] [PATCH v6] app/testpmd: fix testpmd packets dump overlapping

2021-01-08 Thread Jiawei(Jonny) Wang
ntact-Thomas Monjalon > ; Raslan Darawsheh ; > dev@dpdk.org > Subject: Re: [dpdk-dev] [PATCH v6] app/testpmd: fix testpmd packets dump > overlapping > > On Wed, 6 Jan 2021 16:13:37 +0200 > Jiawei Wang wrote: > > > +print_ether_addr(const char *what, const struct rte_ethe

Re: [dpdk-dev] [PATCH v6] app/testpmd: fix testpmd packets dump overlapping

2021-01-06 Thread Stephen Hemminger
On Wed, 6 Jan 2021 16:13:37 +0200 Jiawei Wang wrote: > + int buf_size = MAX_STRING_LEN; > + char print_buf[buf_size]; Don't use dynamic sized array if you don't have to. Various static checkers can see look for out of bounds access to fixed size array.

Re: [dpdk-dev] [PATCH v6] app/testpmd: fix testpmd packets dump overlapping

2021-01-06 Thread Stephen Hemminger
On Wed, 6 Jan 2021 16:13:37 +0200 Jiawei Wang wrote: > +print_ether_addr(const char *what, const struct rte_ether_addr *eth_addr, > + char print_buf[], int buf_size, int *cur_len) Use size_t instead of int for sizes? The length can never be negative?

[dpdk-dev] [PATCH v6] app/testpmd: fix testpmd packets dump overlapping

2021-01-06 Thread Jiawei Wang
When testpmd enabled the verbosity for the received packets, if two packets were received at the same time, for example, sampling packet and normal packet, the dump output of these packets may be overlapping due to multiple core handling the multiple queues simultaneously. The patch uses one strin