[v3,2/9] app/testpmd: fix packet count in ieee15888 engine

Message ID 20230220183502.3348368-3-david.marchand@redhat.com (mailing list archive)
State Accepted, archived
Delegated to: Ferruh Yigit
Headers
Series Testpmd code cleanup |

Checks

Context Check Description
ci/checkpatch success coding style OK

Commit Message

David Marchand Feb. 20, 2023, 6:34 p.m. UTC
  Don't count a packet has been transmitted before it is done.

Fixes: af75078fece3 ("first public release")
Cc: stable@dpdk.org

Signed-off-by: David Marchand <david.marchand@redhat.com>
---
 app/test-pmd/ieee1588fwd.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
  

Comments

Singh, Aman Deep Feb. 24, 2023, 8:24 a.m. UTC | #1
On 2/21/2023 12:04 AM, David Marchand wrote:
> Don't count a packet has been transmitted before it is done.
>
> Fixes: af75078fece3 ("first public release")
> Cc: stable@dpdk.org
>
> Signed-off-by: David Marchand <david.marchand@redhat.com>

Acked-by: Aman Singh <aman.deep.singh@intel.com>

<snip>
  

Patch

diff --git a/app/test-pmd/ieee1588fwd.c b/app/test-pmd/ieee1588fwd.c
index fc4e2d014c..896d5ef26a 100644
--- a/app/test-pmd/ieee1588fwd.c
+++ b/app/test-pmd/ieee1588fwd.c
@@ -184,13 +184,13 @@  ieee1588_packet_fwd(struct fwd_stream *fs)
 
 	/* Forward PTP packet with hardware TX timestamp */
 	mb->ol_flags |= RTE_MBUF_F_TX_IEEE1588_TMST;
-	fs->tx_packets += 1;
 	if (rte_eth_tx_burst(fs->rx_port, fs->tx_queue, &mb, 1) == 0) {
 		printf("Port %u sent PTP packet dropped\n", fs->rx_port);
 		fs->fwd_dropped += 1;
 		rte_pktmbuf_free(mb);
 		return;
 	}
+	fs->tx_packets += 1;
 
 	/*
 	 * Check the TX timestamp.