On 1/2/2019 3:55 PM, Julien Meunier wrote:
> If the port has received less than ``pkt_per_port`` packets (for
> example, the port has missed some packets), the test is in an infinite
> loop.
> 
> Instead of expecting a number of packet to receive, let the port to be
> drained by itself. If no more packets are received, the test can
> continue.

This looks like fixing the test_pmd_perf test case, which can stuck into endless
loop without this patch, and since there will be already a new version for below
comment, can you please update the patch title to describe the fix, like

test/pmd_perf: fix ....


> 
> Fixes: 002ade70e933 ("app/test: measure cycles per packet in Rx/Tx")
> Cc: sta...@dpdk.org
> 
> Signed-off-by: Julien Meunier <julien.meun...@nokia.com>
> ---
>  test/test/test_pmd_perf.c | 6 +++---
>  1 file changed, 3 insertions(+), 3 deletions(-)
> 
> diff --git a/test/test/test_pmd_perf.c b/test/test/test_pmd_perf.c
> index f5095c8..286e09d 100644
> --- a/test/test/test_pmd_perf.c
> +++ b/test/test/test_pmd_perf.c
> @@ -493,15 +493,15 @@ main_loop(__rte_unused void *args)
>  
>       for (i = 0; i < conf->nb_ports; i++) {
>               portid = conf->portlist[i];
> -             int nb_free = pkt_per_port;
> +             int nb_free = 0;

'nb_free' is not more used or required, it can be removed completely I think.

>               do { /* dry out */
>                       nb_rx = rte_eth_rx_burst(portid, 0,
>                                                pkts_burst, MAX_PKT_BURST);
>                       nb_tx = 0;
>                       while (nb_tx < nb_rx)
>                               rte_pktmbuf_free(pkts_burst[nb_tx++]);
> -                     nb_free -= nb_rx;
> -             } while (nb_free != 0);
> +                     nb_free += nb_rx;
> +             } while (nb_rx != 0);

Isn't there already something wrong with this logic? It assumes after test done
device still has 'pkt_per_port' packets in its queues, it tries to receive and
free them, but:

nb_free = pkt_per_port = MAX_TRAFFIC_BURST = 2048
RTE_TEST_RX_DESC_DEFAULT = RTE_TEST_TX_DESC_DEFAULT = 1024

When device queue length is 1024, how it can be holding 2048 packets? So it
can't exit from this loop. Since this should be working, what am I missing?

But overall, this stage is after the test done and for cleanup, I think your
suggestion is reasonable, only please check above 'nb_free' comment.

Thanks,
ferruh

Reply via email to