DPDK patches and discussions
 help / color / mirror / Atom feed
From: Rakesh Kudurumalla <rkudurumalla@marvell.com>
Cc: <dev@dpdk.org>, Rakesh Kudurumalla <rkudurumalla@marvell.com>,
	<stable@dpdk.org>
Subject: [dpdk-dev] [PATCH v2] test: avoid hang if queues are full and Tx fails
Date: Tue, 20 Jul 2021 22:20:52 +0530	[thread overview]
Message-ID: <20210720165052.606038-1-rkudurumalla@marvell.com> (raw)
In-Reply-To: <20210720124713.603674-1-rkudurumalla@marvell.com>

Current pmd_perf_autotest() in continuous mode tries
to enqueue MAX_TRAFFIC_BURST completely before starting
the test. Some drivers cannot accept complete
MAX_TRAFFIC_BURST even though rx+tx desc count can fit it.
This patch changes behaviour to stop enqueuing after few
retries.

Fixes: 002ade70e933 ("app/test: measure cycles per packet in Rx/Tx")
Cc: stable@dpdk.org

Signed-off-by: Rakesh Kudurumalla <rkudurumalla@marvell.com>
---
v2:
- Fixed commit message errors

 app/test/test_pmd_perf.c | 12 ++++++++++++
 1 file changed, 12 insertions(+)

diff --git a/app/test/test_pmd_perf.c b/app/test/test_pmd_perf.c
index 3a248d512c..0a95b408e8 100644
--- a/app/test/test_pmd_perf.c
+++ b/app/test/test_pmd_perf.c
@@ -456,6 +456,7 @@ main_loop(__rte_unused void *args)
 #define PACKET_SIZE 64
 #define FRAME_GAP 12
 #define MAC_PREAMBLE 8
+#define MAX_RETRY_COUNT 5
 	struct rte_mbuf *pkts_burst[MAX_PKT_BURST];
 	unsigned lcore_id;
 	unsigned i, portid, nb_rx = 0, nb_tx = 0;
@@ -463,6 +464,8 @@ main_loop(__rte_unused void *args)
 	int pkt_per_port;
 	uint64_t diff_tsc;
 	uint64_t packets_per_second, total_packets;
+	int retry_cnt = 0;
+	int free_pkt = 0;
 
 	lcore_id = rte_lcore_id();
 	conf = &lcore_conf[lcore_id];
@@ -480,10 +483,19 @@ main_loop(__rte_unused void *args)
 			nb_tx = RTE_MIN(MAX_PKT_BURST, num);
 			nb_tx = rte_eth_tx_burst(portid, 0,
 						&tx_burst[idx], nb_tx);
+			if (nb_tx == 0)
+				retry_cnt++;
 			num -= nb_tx;
 			idx += nb_tx;
+			if (retry_cnt == MAX_RETRY_COUNT) {
+				retry_cnt = 0;
+				break;
+			}
 		}
 	}
+	for (free_pkt = idx; free_pkt < (MAX_TRAFFIC_BURST*conf->nb_ports)
+			; free_pkt++)
+		rte_pktmbuf_free(tx_burst[free_pkt]);
 	printf("Total packets inject to prime ports = %u\n", idx);
 
 	packets_per_second = (link_mbps * 1000 * 1000) /
-- 
2.25.1


       reply	other threads:[~2021-07-20 16:51 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <20210720124713.603674-1-rkudurumalla@marvell.com>
2021-07-20 16:50 ` Rakesh Kudurumalla [this message]
2021-10-19 10:19   ` Rakesh Kudurumalla
2021-10-29  7:18     ` Rakesh Kudurumalla
2021-11-12 11:32   ` [dpdk-stable] " Thomas Monjalon
2021-11-22  7:59     ` [EXT] " Rakesh Kudurumalla
2021-11-22  8:58       ` Thomas Monjalon
2021-11-29  8:52         ` Rakesh Kudurumalla
2021-11-29  9:13           ` Thomas Monjalon
2021-12-13  6:40             ` Rakesh Kudurumalla
2022-01-10  9:04               ` Rakesh Kudurumalla
2022-02-01  6:30                 ` Rakesh Kudurumalla
2022-02-01  7:44                   ` Thomas Monjalon
2022-02-14  4:56                     ` Rakesh Kudurumalla
2022-05-09 10:01                       ` Rakesh Kudurumalla
2022-05-24  5:39                         ` Rakesh Kudurumalla
2022-05-25  8:02                           ` 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=20210720165052.606038-1-rkudurumalla@marvell.com \
    --to=rkudurumalla@marvell.com \
    --cc=dev@dpdk.org \
    --cc=stable@dpdk.org \
    /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).