From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id 1022EA0583; Thu, 19 Mar 2020 14:51:24 +0100 (CET) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 038B01C02A; Thu, 19 Mar 2020 14:51:13 +0100 (CET) Received: from mellanox.co.il (mail-il-dmz.mellanox.com [193.47.165.129]) by dpdk.org (Postfix) with ESMTP id F31BF1C029 for ; Thu, 19 Mar 2020 14:51:11 +0100 (CET) Received: from Internal Mail-Server by MTLPINE2 (envelope-from viacheslavo@mellanox.com) with ESMTPS (AES256-SHA encrypted); 19 Mar 2020 15:51:11 +0200 Received: from pegasus12.mtr.labs.mlnx (pegasus12.mtr.labs.mlnx [10.210.17.40]) by labmailer.mlnx (8.13.8/8.13.8) with ESMTP id 02JDpBjH010190; Thu, 19 Mar 2020 15:51:11 +0200 Received: from pegasus12.mtr.labs.mlnx (localhost [127.0.0.1]) by pegasus12.mtr.labs.mlnx (8.14.7/8.14.7) with ESMTP id 02JDpBLa010416; Thu, 19 Mar 2020 13:51:11 GMT Received: (from viacheslavo@localhost) by pegasus12.mtr.labs.mlnx (8.14.7/8.14.7/Submit) id 02JDpA78010415; Thu, 19 Mar 2020 13:51:10 GMT X-Authentication-Warning: pegasus12.mtr.labs.mlnx: viacheslavo set sender to viacheslavo@mellanox.com using -f From: Viacheslav Ovsiienko To: dev@dpdk.org Cc: ferruh.yigit@intel.com, thomas@monjalon.net, bernard.iremonger@intel.com Date: Thu, 19 Mar 2020 13:50:51 +0000 Message-Id: <1584625851-10291-4-git-send-email-viacheslavo@mellanox.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1584625851-10291-1-git-send-email-viacheslavo@mellanox.com> References: <1561553317-16777-1-git-send-email-viacheslavo@mellanox.com> <1584625851-10291-1-git-send-email-viacheslavo@mellanox.com> Subject: [dpdk-dev] [PATCH v2 3/3] app/testpmd: qualify profiling statistics on burst size X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" 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 --- 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