From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 6F6BFA0C48 for ; Tue, 20 Jul 2021 14:47:28 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 33BC240140; Tue, 20 Jul 2021 14:47:28 +0200 (CEST) Received: from mx0b-0016f401.pphosted.com (mx0b-0016f401.pphosted.com [67.231.156.173]) by mails.dpdk.org (Postfix) with ESMTP id 6448440140 for ; Tue, 20 Jul 2021 14:47:27 +0200 (CEST) Received: from pps.filterd (m0045851.ppops.net [127.0.0.1]) by mx0b-0016f401.pphosted.com (8.16.0.43/8.16.0.43) with SMTP id 16KCjqqH009969 for ; Tue, 20 Jul 2021 05:47:26 -0700 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=marvell.com; h=from : to : cc : subject : date : message-id : mime-version : content-transfer-encoding : content-type; s=pfpt0220; bh=TO9Piw5Q9V9jyrZAO0o1dSQbAMw8ZU4rGpl3MUTbTDw=; b=Ph/MDhgqc7ElbU4kJAhmfVOtXA6gTsCYARjAVZjbFuFzHV0WBP1m1IuAYYaszyE0udmP j+Bz7rv2Ilr/xcHyMyfIcW13i74UjU404/E0FMoMdVVrKtjakrbaV7jGoeXt8l1b5PTp dBiG/KyHy2QRvmNLFXxzdEidPJr+pcWheJTtgITsHPgNEJYi9rbrd3pVTPhrWbwZRKte qed9DixlVYXqe/BldOr7QiXBrtwzyWu+FiyF4J2BQcqzV0KV4FYlG14ywKW8ht0Zfx/9 43VtNbTh6wO6JgsEf0eE2A24CRx01aiX+i9WAlXEVXYwy4E5vCmo6aoMBO1gilrCDuyT kw== Received: from dc5-exch01.marvell.com ([199.233.59.181]) by mx0b-0016f401.pphosted.com with ESMTP id 39wxprg0p3-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-SHA384 bits=256 verify=NOT) for ; Tue, 20 Jul 2021 05:47:26 -0700 Received: from DC5-EXCH01.marvell.com (10.69.176.38) by DC5-EXCH01.marvell.com (10.69.176.38) with Microsoft SMTP Server (TLS) id 15.0.1497.18; Tue, 20 Jul 2021 05:47:24 -0700 Received: from maili.marvell.com (10.69.176.80) by DC5-EXCH01.marvell.com (10.69.176.38) with Microsoft SMTP Server id 15.0.1497.18 via Frontend Transport; Tue, 20 Jul 2021 05:47:24 -0700 Received: from localhost.localdomain (unknown [10.28.48.103]) by maili.marvell.com (Postfix) with ESMTP id 260AE3F7071; Tue, 20 Jul 2021 05:47:22 -0700 (PDT) From: Rakesh Kudurumalla To: CC: , sa_ip-toolkits-Jenkins , Nithin Kumar Dabilpuram , Jerin Jacob Kollanukkaran Date: Tue, 20 Jul 2021 18:17:13 +0530 Message-ID: <20210720124713.603674-1-rkudurumalla@marvell.com> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-Proofpoint-ORIG-GUID: ree-ReLAU4DaIn7gumGeN8wKTVCuXzHN X-Proofpoint-GUID: ree-ReLAU4DaIn7gumGeN8wKTVCuXzHN X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:6.0.391, 18.0.790 definitions=2021-07-20_07:2021-07-19, 2021-07-20 signatures=0 Subject: [dpdk-stable] [PATCH] test: avoid hang if queues are full and Tx fails X-BeenThere: stable@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: patches for DPDK stable branches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: stable-bounces@dpdk.org Sender: "stable" 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 Reviewed-on: https://sj1git1.cavium.com/c/IP/SW/dataplane/dpdk/+/55760 Tested-by: sa_ip-toolkits-Jenkins Reviewed-by: Nithin Kumar Dabilpuram Reviewed-by: Jerin Jacob Kollanukkaran --- 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