DPDK patches and discussions
 help / color / mirror / Atom feed
From: Viacheslav Ovsiienko <viacheslavo@mellanox.com>
To: dev@dpdk.org
Cc: ferruh.yigit@intel.com, thomas@monjalon.net, bernard.iremonger@intel.com
Subject: [dpdk-dev] [PATCH v2 3/3] app/testpmd: qualify profiling statistics on burst size
Date: Thu, 19 Mar 2020 13:50:51 +0000	[thread overview]
Message-ID: <1584625851-10291-4-git-send-email-viacheslavo@mellanox.com> (raw)
In-Reply-To: <1584625851-10291-1-git-send-email-viacheslavo@mellanox.com>

The execution time of rx/tx burst routine depends on the burst size.
It would be meaningful to research this dependency, the patch
provides an extra profiling data per rx/tx burst size.

Signed-off-by: Viacheslav Ovsiienko <viacheslavo@mellanox.com>
---
 app/test-pmd/csumonly.c   | 11 +++++++----
 app/test-pmd/flowgen.c    | 11 +++++++----
 app/test-pmd/icmpecho.c   | 12 ++++++++----
 app/test-pmd/iofwd.c      | 11 +++++++----
 app/test-pmd/macfwd.c     | 11 +++++++----
 app/test-pmd/macswap.c    | 11 +++++++----
 app/test-pmd/rxonly.c     |  2 +-
 app/test-pmd/softnicfwd.c | 11 +++++++----
 app/test-pmd/testpmd.c    | 31 ++++++++++++++++++++++++-------
 app/test-pmd/testpmd.h    | 26 ++++++++++++++++++++++----
 app/test-pmd/txonly.c     |  9 ++++++---
 11 files changed, 103 insertions(+), 43 deletions(-)

diff --git a/app/test-pmd/csumonly.c b/app/test-pmd/csumonly.c
index 4104737..c966892 100644
--- a/app/test-pmd/csumonly.c
+++ b/app/test-pmd/csumonly.c
@@ -797,7 +797,7 @@ struct simple_gre_hdr {
 	TEST_PMD_CORE_CYC_RX_START(start_rx_tsc);
 	nb_rx = rte_eth_rx_burst(fs->rx_port, fs->rx_queue, pkts_burst,
 				 nb_pkt_per_burst);
-	TEST_PMD_CORE_CYC_RX_ADD(fs, start_rx_tsc);
+	TEST_PMD_CORE_CYC_RX_ADD(fs, start_rx_tsc, nb_rx);
 	if (unlikely(nb_rx == 0))
 		return;
 #ifdef RTE_TEST_PMD_RECORD_BURST_STATS
@@ -1067,7 +1067,7 @@ struct simple_gre_hdr {
 	TEST_PMD_CORE_CYC_TX_START(start_tx_tsc);
 	nb_tx = rte_eth_tx_burst(fs->tx_port, fs->tx_queue, tx_pkts_burst,
 			nb_prep);
-	TEST_PMD_CORE_CYC_TX_ADD(fs, start_tx_tsc);
+	TEST_PMD_CORE_CYC_TX_ADD(fs, start_tx_tsc, nb_tx);
 
 	/*
 	 * Retry if necessary
@@ -1075,11 +1075,14 @@ struct simple_gre_hdr {
 	if (unlikely(nb_tx < nb_rx) && fs->retry_enabled) {
 		retry = 0;
 		while (nb_tx < nb_rx && retry++ < burst_tx_retry_num) {
+			uint16_t nb_rt;
+
 			rte_delay_us(burst_tx_delay_time);
 			TEST_PMD_CORE_CYC_TX_START(start_tx_tsc);
-			nb_tx += rte_eth_tx_burst(fs->tx_port, fs->tx_queue,
+			nb_rt = rte_eth_tx_burst(fs->tx_port, fs->tx_queue,
 					&tx_pkts_burst[nb_tx], nb_rx - nb_tx);
-			TEST_PMD_CORE_CYC_TX_ADD(fs, start_tx_tsc);
+			nb_tx += nb_rt;
+			TEST_PMD_CORE_CYC_TX_ADD(fs, start_tx_tsc, nb_rt);
 		}
 	}
 	fs->tx_packets += nb_tx;
diff --git a/app/test-pmd/flowgen.c b/app/test-pmd/flowgen.c
index 51e87b0..9189e7b 100644
--- a/app/test-pmd/flowgen.c
+++ b/app/test-pmd/flowgen.c
@@ -107,7 +107,7 @@
 	TEST_PMD_CORE_CYC_RX_START(start_rx_tsc);
 	nb_rx = rte_eth_rx_burst(fs->rx_port, fs->rx_queue, pkts_burst,
 				 nb_pkt_per_burst);
-	TEST_PMD_CORE_CYC_RX_ADD(fs, start_rx_tsc);
+	TEST_PMD_CORE_CYC_RX_ADD(fs, start_rx_tsc, nb_rx);
 	fs->rx_packets += nb_rx;
 
 	for (i = 0; i < nb_rx; i++)
@@ -179,18 +179,21 @@
 
 	TEST_PMD_CORE_CYC_TX_START(start_tx_tsc);
 	nb_tx = rte_eth_tx_burst(fs->tx_port, fs->tx_queue, pkts_burst, nb_pkt);
-	TEST_PMD_CORE_CYC_TX_ADD(fs, start_tx_tsc);
+	TEST_PMD_CORE_CYC_TX_ADD(fs, start_tx_tsc, nb_tx);
 	/*
 	 * Retry if necessary
 	 */
 	if (unlikely(nb_tx < nb_rx) && fs->retry_enabled) {
 		retry = 0;
 		while (nb_tx < nb_rx && retry++ < burst_tx_retry_num) {
+			uint16_t nb_rt;
+
 			rte_delay_us(burst_tx_delay_time);
 			TEST_PMD_CORE_CYC_TX_START(start_tx_tsc);
-			nb_tx += rte_eth_tx_burst(fs->tx_port, fs->tx_queue,
+			nb_rt = rte_eth_tx_burst(fs->tx_port, fs->tx_queue,
 					&pkts_burst[nb_tx], nb_rx - nb_tx);
-			TEST_PMD_CORE_CYC_TX_ADD(fs, start_tx_tsc);
+			nb_tx += nb_rt;
+			TEST_PMD_CORE_CYC_TX_ADD(fs, start_tx_tsc, nb_rt);
 		}
 	}
 	fs->tx_packets += nb_tx;
diff --git a/app/test-pmd/icmpecho.c b/app/test-pmd/icmpecho.c
index 8843183..0c8a8af 100644
--- a/app/test-pmd/icmpecho.c
+++ b/app/test-pmd/icmpecho.c
@@ -304,7 +304,7 @@
 	TEST_PMD_CORE_CYC_RX_START(start_rx_tsc);
 	nb_rx = rte_eth_rx_burst(fs->rx_port, fs->rx_queue, pkts_burst,
 				 nb_pkt_per_burst);
-	TEST_PMD_CORE_CYC_RX_ADD(fs, start_rx_tsc);
+	TEST_PMD_CORE_CYC_RX_ADD(fs, start_rx_tsc, nb_rx);
 	if (unlikely(nb_rx == 0))
 		return;
 
@@ -492,7 +492,7 @@
 		TEST_PMD_CORE_CYC_TX_START(start_tx_tsc);
 		nb_tx = rte_eth_tx_burst(fs->tx_port, fs->tx_queue, pkts_burst,
 					 nb_replies);
-		TEST_PMD_CORE_CYC_TX_ADD(fs, start_tx_tsc);
+		TEST_PMD_CORE_CYC_TX_ADD(fs, start_tx_tsc, nb_tx);
 		/*
 		 * Retry if necessary
 		 */
@@ -500,13 +500,17 @@
 			retry = 0;
 			while (nb_tx < nb_replies &&
 					retry++ < burst_tx_retry_num) {
+				uint16_t nb_rt;
+
 				rte_delay_us(burst_tx_delay_time);
 				TEST_PMD_CORE_CYC_TX_START(start_tx_tsc);
-				nb_tx += rte_eth_tx_burst(fs->tx_port,
+				nb_rt = rte_eth_tx_burst(fs->tx_port,
 						fs->tx_queue,
 						&pkts_burst[nb_tx],
 						nb_replies - nb_tx);
-				TEST_PMD_CORE_CYC_TX_ADD(fs, start_tx_tsc);
+				nb_tx += nb_rt;
+				TEST_PMD_CORE_CYC_TX_ADD(fs, start_tx_tsc,
+							 nb_rt);
 			}
 		}
 		fs->tx_packets += nb_tx;
diff --git a/app/test-pmd/iofwd.c b/app/test-pmd/iofwd.c
index 9ff6531..b05ed02 100644
--- a/app/test-pmd/iofwd.c
+++ b/app/test-pmd/iofwd.c
@@ -62,7 +62,7 @@
 	TEST_PMD_CORE_CYC_RX_START(start_rx_tsc);
 	nb_rx = rte_eth_rx_burst(fs->rx_port, fs->rx_queue,
 			pkts_burst, nb_pkt_per_burst);
-	TEST_PMD_CORE_CYC_RX_ADD(fs, start_rx_tsc);
+	TEST_PMD_CORE_CYC_RX_ADD(fs, start_rx_tsc, nb_rx);
 	if (unlikely(nb_rx == 0))
 		return;
 	fs->rx_packets += nb_rx;
@@ -73,18 +73,21 @@
 	TEST_PMD_CORE_CYC_TX_START(start_tx_tsc);
 	nb_tx = rte_eth_tx_burst(fs->tx_port, fs->tx_queue,
 			pkts_burst, nb_rx);
-	TEST_PMD_CORE_CYC_TX_ADD(fs, start_tx_tsc);
+	TEST_PMD_CORE_CYC_TX_ADD(fs, start_tx_tsc, nb_tx);
 	/*
 	 * Retry if necessary
 	 */
 	if (unlikely(nb_tx < nb_rx) && fs->retry_enabled) {
 		retry = 0;
 		while (nb_tx < nb_rx && retry++ < burst_tx_retry_num) {
+			uint16_t nb_rt;
+
 			rte_delay_us(burst_tx_delay_time);
 			TEST_PMD_CORE_CYC_TX_START(start_tx_tsc);
-			nb_tx += rte_eth_tx_burst(fs->tx_port, fs->tx_queue,
+			nb_rt = rte_eth_tx_burst(fs->tx_port, fs->tx_queue,
 					&pkts_burst[nb_tx], nb_rx - nb_tx);
-			TEST_PMD_CORE_CYC_TX_ADD(fs, start_tx_tsc);
+			nb_tx += nb_rt;
+			TEST_PMD_CORE_CYC_TX_ADD(fs, start_tx_tsc, nb_rt);
 		}
 	}
 	fs->tx_packets += nb_tx;
diff --git a/app/test-pmd/macfwd.c b/app/test-pmd/macfwd.c
index f4a213e..a4aae0c 100644
--- a/app/test-pmd/macfwd.c
+++ b/app/test-pmd/macfwd.c
@@ -67,7 +67,7 @@
 	TEST_PMD_CORE_CYC_RX_START(start_rx_tsc);
 	nb_rx = rte_eth_rx_burst(fs->rx_port, fs->rx_queue, pkts_burst,
 				 nb_pkt_per_burst);
-	TEST_PMD_CORE_CYC_RX_ADD(fs, start_tx_tsc);
+	TEST_PMD_CORE_CYC_RX_ADD(fs, start_tx_tsc, nb_rx);
 	if (unlikely(nb_rx == 0))
 		return;
 
@@ -102,18 +102,21 @@
 	}
 	TEST_PMD_CORE_CYC_TX_START(start_tx_tsc);
 	nb_tx = rte_eth_tx_burst(fs->tx_port, fs->tx_queue, pkts_burst, nb_rx);
-	TEST_PMD_CORE_CYC_TX_ADD(fs, start_tx_tsc);
+	TEST_PMD_CORE_CYC_TX_ADD(fs, start_tx_tsc, nb_tx);
 	/*
 	 * Retry if necessary
 	 */
 	if (unlikely(nb_tx < nb_rx) && fs->retry_enabled) {
 		retry = 0;
 		while (nb_tx < nb_rx && retry++ < burst_tx_retry_num) {
+			uint16_t nb_rt;
+
 			rte_delay_us(burst_tx_delay_time);
 			TEST_PMD_CORE_CYC_TX_START(start_tx_tsc);
-			nb_tx += rte_eth_tx_burst(fs->tx_port, fs->tx_queue,
+			nb_rt = rte_eth_tx_burst(fs->tx_port, fs->tx_queue,
 					&pkts_burst[nb_tx], nb_rx - nb_tx);
-			TEST_PMD_CORE_CYC_TX_ADD(fs, start_tx_tsc);
+			nb_tx += nb_rt;
+			TEST_PMD_CORE_CYC_TX_ADD(fs, start_tx_tsc, nb_rt);
 		}
 	}
 
diff --git a/app/test-pmd/macswap.c b/app/test-pmd/macswap.c
index 5cb3133..57628ba 100644
--- a/app/test-pmd/macswap.c
+++ b/app/test-pmd/macswap.c
@@ -68,7 +68,7 @@
 	TEST_PMD_CORE_CYC_RX_START(start_rx_tsc);
 	nb_rx = rte_eth_rx_burst(fs->rx_port, fs->rx_queue, pkts_burst,
 				 nb_pkt_per_burst);
-	TEST_PMD_CORE_CYC_RX_ADD(fs, start_rx_tsc);
+	TEST_PMD_CORE_CYC_RX_ADD(fs, start_rx_tsc, nb_rx);
 	if (unlikely(nb_rx == 0))
 		return;
 
@@ -82,18 +82,21 @@
 
 	TEST_PMD_CORE_CYC_TX_START(start_tx_tsc);
 	nb_tx = rte_eth_tx_burst(fs->tx_port, fs->tx_queue, pkts_burst, nb_rx);
-	TEST_PMD_CORE_CYC_TX_ADD(fs, start_tx_tsc);
+	TEST_PMD_CORE_CYC_TX_ADD(fs, start_tx_tsc, nb_tx);
 	/*
 	 * Retry if necessary
 	 */
 	if (unlikely(nb_tx < nb_rx) && fs->retry_enabled) {
 		retry = 0;
 		while (nb_tx < nb_rx && retry++ < burst_tx_retry_num) {
+			uint16_t nb_rt;
+
 			rte_delay_us(burst_tx_delay_time);
 			TEST_PMD_CORE_CYC_TX_START(start_tx_tsc);
-			nb_tx += rte_eth_tx_burst(fs->tx_port, fs->tx_queue,
+			nb_rt = rte_eth_tx_burst(fs->tx_port, fs->tx_queue,
 					&pkts_burst[nb_tx], nb_rx - nb_tx);
-			TEST_PMD_CORE_CYC_TX_ADD(fs, start_tx_tsc);
+			nb_tx += nb_rt;
+			TEST_PMD_CORE_CYC_TX_ADD(fs, start_tx_tsc, nb_rt);
 		}
 	}
 	fs->tx_packets += nb_tx;
diff --git a/app/test-pmd/rxonly.c b/app/test-pmd/rxonly.c
index 2820d7f..ee79e7b 100644
--- a/app/test-pmd/rxonly.c
+++ b/app/test-pmd/rxonly.c
@@ -60,7 +60,7 @@
 	TEST_PMD_CORE_CYC_RX_START(start_rx_tsc);
 	nb_rx = rte_eth_rx_burst(fs->rx_port, fs->rx_queue, pkts_burst,
 				 nb_pkt_per_burst);
-	TEST_PMD_CORE_CYC_RX_ADD(fs, start_rx_tsc);
+	TEST_PMD_CORE_CYC_RX_ADD(fs, start_rx_tsc, nb_rx);
 	if (unlikely(nb_rx == 0))
 		return;
 
diff --git a/app/test-pmd/softnicfwd.c b/app/test-pmd/softnicfwd.c
index b78f2ce..793677d 100644
--- a/app/test-pmd/softnicfwd.c
+++ b/app/test-pmd/softnicfwd.c
@@ -96,7 +96,7 @@ struct tm_hierarchy {
 	TEST_PMD_CORE_CYC_RX_START(start_rx_tsc);
 	nb_rx = rte_eth_rx_burst(fs->rx_port, fs->rx_queue,
 			pkts_burst, nb_pkt_per_burst);
-	TEST_PMD_CORE_CYC_RX_ADD(fs, start_rx_tsc);
+	TEST_PMD_CORE_CYC_RX_ADD(fs, start_rx_tsc, nb_rx);
 	fs->rx_packets += nb_rx;
 
 #ifdef RTE_TEST_PMD_RECORD_BURST_STATS
@@ -106,17 +106,20 @@ struct tm_hierarchy {
 	TEST_PMD_CORE_CYC_TX_START(start_tx_tsc);
 	nb_tx = rte_eth_tx_burst(fs->tx_port, fs->tx_queue,
 			pkts_burst, nb_rx);
-	TEST_PMD_CORE_CYC_TX_ADD(fs, start_tx_tsc);
+	TEST_PMD_CORE_CYC_TX_ADD(fs, start_tx_tsc, nb_tx);
 
 	/* Retry if necessary */
 	if (unlikely(nb_tx < nb_rx) && fs->retry_enabled) {
 		retry = 0;
 		while (nb_tx < nb_rx && retry++ < burst_tx_retry_num) {
+			uint16_t nb_rt;
+
 			rte_delay_us(burst_tx_delay_time);
 			TEST_PMD_CORE_CYC_TX_START(start_tx_tsc);
-			nb_tx += rte_eth_tx_burst(fs->tx_port, fs->tx_queue,
+			nb_rt = rte_eth_tx_burst(fs->tx_port, fs->tx_queue,
 					&pkts_burst[nb_tx], nb_rx - nb_tx);
-			TEST_PMD_CORE_CYC_TX_ADD(fs, start_tx_tsc);
+			nb_tx += nb_rt;
+			TEST_PMD_CORE_CYC_TX_ADD(fs, start_tx_tsc, nb_rt);
 		}
 	}
 	fs->tx_packets += nb_tx;
diff --git a/app/test-pmd/testpmd.c b/app/test-pmd/testpmd.c
index b195880..1d4b55b 100644
--- a/app/test-pmd/testpmd.c
+++ b/app/test-pmd/testpmd.c
@@ -1515,7 +1515,7 @@ struct extmem_param {
 
 #ifdef RTE_TEST_PMD_RECORD_BURST_STATS
 static void
-pkt_burst_stats_display(const char *rx_tx, struct pkt_burst_stats *pbs)
+pkt_burst_stats_display(int nrx_tx, struct pkt_burst_stats *pbs)
 {
 	unsigned int total_burst;
 	unsigned int nb_burst;
@@ -1549,8 +1549,8 @@ struct extmem_param {
 	if (total_burst == 0)
 		return;
 	burst_percent[0] = (burst_stats[0] * 100) / total_burst;
-	printf("  %s-bursts : %u [%d%% of %d pkts", rx_tx, total_burst,
-	       burst_percent[0], (int) pktnb_stats[0]);
+	printf("  %s-bursts : %u [%d%% of %d pkts", nrx_tx ? "TX" : "RX",
+	       total_burst, burst_percent[0], (int) pktnb_stats[0]);
 	if (burst_stats[0] == total_burst) {
 		printf("]\n");
 		return;
@@ -1568,6 +1568,23 @@ struct extmem_param {
 	}
 	printf(" + %d%% of %d pkts + %d%% of others]\n",
 	       burst_percent[1], (int) pktnb_stats[1], burst_percent[2]);
+#ifdef RTE_TEST_PMD_RECORD_CORE_CYCLES
+	if (!(fwdprof_flags & (nrx_tx ? RECORD_CORE_CYCLES_TX
+				      : RECORD_CORE_CYCLES_RX)))
+		return;
+	for (nb_pkt = 0; nb_pkt < MAX_PKT_BURST; nb_pkt++) {
+		nb_burst = nrx_tx ? pbs->pkt_retry_spread[nb_pkt]
+				  : pbs->pkt_burst_spread[nb_pkt];
+		if (nb_burst == 0)
+			continue;
+		printf("  CPU cycles/%u packet burst=%u (total cycles="
+		       "%"PRIu64" / total %s bursts=%u)\n",
+		       (unsigned int)nb_pkt,
+		       (unsigned int)(pbs->pkt_ticks_spread[nb_pkt] / nb_burst),
+		       pbs->pkt_ticks_spread[nb_pkt],
+		       nrx_tx ? "TX" : "RX", nb_burst);
+	}
+#endif
 }
 #endif /* RTE_TEST_PMD_RECORD_BURST_STATS */
 
@@ -1601,8 +1618,8 @@ struct extmem_param {
 	}
 
 #ifdef RTE_TEST_PMD_RECORD_BURST_STATS
-	pkt_burst_stats_display("RX", &fs->rx_burst_stats);
-	pkt_burst_stats_display("TX", &fs->tx_burst_stats);
+	pkt_burst_stats_display(false, &fs->rx_burst_stats);
+	pkt_burst_stats_display(true, &fs->tx_burst_stats);
 #endif
 }
 
@@ -1742,10 +1759,10 @@ struct extmem_param {
 
 #ifdef RTE_TEST_PMD_RECORD_BURST_STATS
 		if (ports_stats[pt_id].rx_stream)
-			pkt_burst_stats_display("RX",
+			pkt_burst_stats_display(false,
 				&ports_stats[pt_id].rx_stream->rx_burst_stats);
 		if (ports_stats[pt_id].tx_stream)
-			pkt_burst_stats_display("TX",
+			pkt_burst_stats_display(true,
 				&ports_stats[pt_id].tx_stream->tx_burst_stats);
 #endif
 
diff --git a/app/test-pmd/testpmd.h b/app/test-pmd/testpmd.h
index 6177a50..90eb0ef 100644
--- a/app/test-pmd/testpmd.h
+++ b/app/test-pmd/testpmd.h
@@ -89,6 +89,10 @@ enum {
  */
 struct pkt_burst_stats {
 	unsigned int pkt_burst_spread[MAX_PKT_BURST];
+#ifdef RTE_TEST_PMD_RECORD_CORE_CYCLES
+	unsigned int pkt_retry_spread[MAX_PKT_BURST];
+	uint64_t pkt_ticks_spread[MAX_PKT_BURST];
+#endif
 };
 #endif
 
@@ -340,21 +344,35 @@ struct queue_stats_mappings {
 {if (fwdprof_flags & RECORD_CORE_CYCLES_FWD) \
 {uint64_t tsc = rte_rdtsc(); tsc -= (s); fs->core_cycles += tsc; } }
 
-#define TEST_PMD_CORE_CYC_TX_ADD(fs, s) \
+#ifdef RTE_TEST_PMD_RECORD_BURST_STATS
+#define TEST_PMD_CORE_CYC_TX_ADD(fs, s, np) \
+{if (fwdprof_flags & RECORD_CORE_CYCLES_TX) \
+{uint64_t tsc = rte_rdtsc(); tsc -= (s); fs->core_tx_cycles += tsc; \
+fs->tx_burst_stats.pkt_ticks_spread[np] += tsc; \
+fs->tx_burst_stats.pkt_retry_spread[np]++; } }
+
+#define TEST_PMD_CORE_CYC_RX_ADD(fs, s, np) \
+{if (fwdprof_flags & RECORD_CORE_CYCLES_RX) \
+{uint64_t tsc = rte_rdtsc(); tsc -= (s); fs->core_rx_cycles += tsc; \
+fs->rx_burst_stats.pkt_ticks_spread[np] += tsc; } }
+
+#else /* RTE_TEST_PMD_RECORD_BURST_STATS */
+#define TEST_PMD_CORE_CYC_TX_ADD(fs, s, np) \
 {if (fwdprof_flags & RECORD_CORE_CYCLES_TX) \
 {uint64_t tsc = rte_rdtsc(); tsc -= (s); fs->core_tx_cycles += tsc; } }
 
-#define TEST_PMD_CORE_CYC_RX_ADD(fs, s) \
+#define TEST_PMD_CORE_CYC_RX_ADD(fs, s, np) \
 {if (fwdprof_flags & RECORD_CORE_CYCLES_RX) \
 {uint64_t tsc = rte_rdtsc(); tsc -= (s); fs->core_rx_cycles += tsc; } }
+#endif /* RTE_TEST_PMD_RECORD_BURST_STATS */
 
 #else
 /* No profiling statistics is configured. */
 #define TEST_PMD_CORE_CYC_TX_START(a)
 #define TEST_PMD_CORE_CYC_RX_START(a)
 #define TEST_PMD_CORE_CYC_FWD_ADD(fs, s)
-#define TEST_PMD_CORE_CYC_TX_ADD(fs, s)
-#define TEST_PMD_CORE_CYC_RX_ADD(fs, s)
+#define TEST_PMD_CORE_CYC_TX_ADD(fs, s, np)
+#define TEST_PMD_CORE_CYC_RX_ADD(fs, s, np)
 #endif /* RTE_TEST_PMD_RECORD_CORE_CYCLES */
 
 /* globals used for configuration */
diff --git a/app/test-pmd/txonly.c b/app/test-pmd/txonly.c
index 8ff7410..593044e 100644
--- a/app/test-pmd/txonly.c
+++ b/app/test-pmd/txonly.c
@@ -299,18 +299,21 @@
 
 	TEST_PMD_CORE_CYC_TX_START(start_tx_tsc);
 	nb_tx = rte_eth_tx_burst(fs->tx_port, fs->tx_queue, pkts_burst, nb_pkt);
-	TEST_PMD_CORE_CYC_TX_ADD(fs, start_tx_tsc);
+	TEST_PMD_CORE_CYC_TX_ADD(fs, start_tx_tsc, nb_tx);
 	/*
 	 * Retry if necessary
 	 */
 	if (unlikely(nb_tx < nb_pkt) && fs->retry_enabled) {
 		retry = 0;
 		while (nb_tx < nb_pkt && retry++ < burst_tx_retry_num) {
+			uint16_t nb_rt;
+
 			rte_delay_us(burst_tx_delay_time);
 			TEST_PMD_CORE_CYC_TX_START(start_tx_tsc);
-			nb_tx += rte_eth_tx_burst(fs->tx_port, fs->tx_queue,
+			nb_rt = rte_eth_tx_burst(fs->tx_port, fs->tx_queue,
 					&pkts_burst[nb_tx], nb_pkt - nb_tx);
-			TEST_PMD_CORE_CYC_TX_ADD(fs, start_tx_tsc);
+			nb_tx += nb_rt;
+			TEST_PMD_CORE_CYC_TX_ADD(fs, start_tx_tsc, nb_rt);
 		}
 	}
 	fs->tx_packets += nb_tx;
-- 
1.8.3.1


  parent reply	other threads:[~2020-03-19 13:51 UTC|newest]

Thread overview: 29+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-06-26 12:48 [dpdk-dev] [PATCH] app/testpmd: add profiling for Rx/Tx burst routines Viacheslav Ovsiienko
2019-06-26 12:57 ` Bruce Richardson
2019-06-26 13:19   ` Slava Ovsiienko
2019-06-26 13:21     ` Bruce Richardson
2019-06-27  4:48       ` Slava Ovsiienko
2019-06-28 13:45         ` Iremonger, Bernard
2019-06-28 14:20           ` Bruce Richardson
2019-07-01  4:57             ` Slava Ovsiienko
2019-07-01  8:15               ` Bruce Richardson
2019-09-30 12:32                 ` Yigit, Ferruh
2020-03-19 13:50 ` [dpdk-dev] [PATCH v2 0/3] app/testpmd: qualify Rx/Tx profiling data on burst size Viacheslav Ovsiienko
2020-03-19 13:50   ` [dpdk-dev] [PATCH v2 1/3] app/testpmd: add profiling flags set command Viacheslav Ovsiienko
2020-04-02 11:15     ` Thomas Monjalon
2020-04-09 11:56     ` Ferruh Yigit
2020-04-13  7:56       ` Slava Ovsiienko
2020-04-13 12:23         ` Thomas Monjalon
2020-04-14  9:07         ` Ferruh Yigit
2020-03-19 13:50   ` [dpdk-dev] [PATCH v2 2/3] app/testpmd: gather Rx and Tx routines profiling Viacheslav Ovsiienko
2020-04-02 11:20     ` Thomas Monjalon
2020-04-02 11:23       ` Slava Ovsiienko
2020-03-19 13:50   ` Viacheslav Ovsiienko [this message]
2020-03-20  6:13     ` [dpdk-dev] [PATCH v2 3/3] app/testpmd: qualify profiling statistics on burst size Jerin Jacob
2020-04-09 11:46       ` Ferruh Yigit
2020-04-09 12:49         ` Jerin Jacob
2020-03-20 16:03     ` Andrzej Ostruszka
2020-04-02 11:21     ` Thomas Monjalon
2020-04-09 12:03     ` Ferruh Yigit
2020-04-09 12:09       ` Thomas Monjalon
2020-04-02 11:13   ` [dpdk-dev] [PATCH v2 0/3] app/testpmd: qualify Rx/Tx profiling data " Thomas Monjalon

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1584625851-10291-4-git-send-email-viacheslavo@mellanox.com \
    --to=viacheslavo@mellanox.com \
    --cc=bernard.iremonger@intel.com \
    --cc=dev@dpdk.org \
    --cc=ferruh.yigit@intel.com \
    --cc=thomas@monjalon.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).