From: Zhihong Wang Date: Fri, 13 Aug 2021 08:05:45 +0000 (+0800) Subject: app/testpmd: fix Tx retry in flowgen engine X-Git-Url: http://git.droids-corp.org/?a=commitdiff_plain;h=ea275674a0c65dad334c8ab55ddd1d5a7e243af6;p=dpdk.git app/testpmd: fix Tx retry in flowgen engine Fix tx_pkt number in tx retry logic. Fixes: bf56fce1fb45 ("app/testpmd: add retry option") Cc: stable@dpdk.org Signed-off-by: Zhihong Wang Acked-by: Xiaoyun Li --- diff --git a/app/test-pmd/flowgen.c b/app/test-pmd/flowgen.c index 3bf6e1ce97..f2e6255c36 100644 --- a/app/test-pmd/flowgen.c +++ b/app/test-pmd/flowgen.c @@ -192,12 +192,12 @@ pkt_burst_flow_gen(struct fwd_stream *fs) /* * Retry if necessary */ - if (unlikely(nb_tx < nb_rx) && fs->retry_enabled) { + if (unlikely(nb_tx < nb_pkt) && fs->retry_enabled) { retry = 0; - while (nb_tx < nb_rx && retry++ < burst_tx_retry_num) { + while (nb_tx < nb_pkt && retry++ < burst_tx_retry_num) { rte_delay_us(burst_tx_delay_time); nb_tx += rte_eth_tx_burst(fs->tx_port, fs->tx_queue, - &pkts_burst[nb_tx], nb_rx - nb_tx); + &pkts_burst[nb_tx], nb_pkt - nb_tx); } } fs->tx_packets += nb_tx;