From patchwork Tue Jul 20 16:50:52 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Rakesh Kudurumalla X-Patchwork-Id: 96117 X-Patchwork-Delegate: thomas@monjalon.net Return-Path: X-Original-To: patchwork@inbox.dpdk.org Delivered-To: patchwork@inbox.dpdk.org Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id EF4CDA0A0C; Tue, 20 Jul 2021 18:51:27 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 7A4AB4068B; Tue, 20 Jul 2021 18:51:27 +0200 (CEST) Received: from mx0b-0016f401.pphosted.com (mx0b-0016f401.pphosted.com [67.231.156.173]) by mails.dpdk.org (Postfix) with ESMTP id 78D9740689; Tue, 20 Jul 2021 18:51:26 +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 16KGk0eN023302; Tue, 20 Jul 2021 09:51:25 -0700 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=marvell.com; h=from : to : cc : subject : date : message-id : in-reply-to : references : mime-version : content-transfer-encoding : content-type; s=pfpt0220; bh=FtZzBLjFoAtnryjox9WwMopbOFT0+6Q2aiOykPB60bQ=; b=RQ9bdOBU+81eT/8tkrQX/NAxgRTOZn/XLoV9vn5rcPXQ2V7x+6az3Hgps6dktreZT3c7 /1lqMv/mU5FjZto+25yg7kZ5QWK1R6I4Qnb/3LpOGodBFFOTUTPXCEEShL8jIM/RQEvD wPjsHXJyPwq5CAhDhh5R7AdjKhQcwpQknTiYmWwacjDZ8oiejf1LZuLFnHkhxTnLWRtF hyKXnEO1Mv6CG/7vXeOh2h0OOICwsih0ZqHldCb3tgCBVEPlccsK1tiZcYs08QBRaT6F 9v28B8jHrWbOUHymC57krRRftkI7t6baoE8uZKPu+5TqulMWWdynUPO75/aaHzpqN9bW 0A== Received: from dc5-exch01.marvell.com ([199.233.59.181]) by mx0b-0016f401.pphosted.com with ESMTP id 39wxprgy8p-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-SHA384 bits=256 verify=NOT); Tue, 20 Jul 2021 09:51:25 -0700 Received: from DC5-EXCH02.marvell.com (10.69.176.39) by DC5-EXCH01.marvell.com (10.69.176.38) with Microsoft SMTP Server (TLS) id 15.0.1497.18; Tue, 20 Jul 2021 09:51:22 -0700 Received: from maili.marvell.com (10.69.176.80) by DC5-EXCH02.marvell.com (10.69.176.39) with Microsoft SMTP Server id 15.0.1497.18 via Frontend Transport; Tue, 20 Jul 2021 09:51:23 -0700 Received: from localhost.localdomain (unknown [10.28.48.103]) by maili.marvell.com (Postfix) with ESMTP id E2A8B3F706B; Tue, 20 Jul 2021 09:51:21 -0700 (PDT) From: Rakesh Kudurumalla To: CC: , Rakesh Kudurumalla , Date: Tue, 20 Jul 2021 22:20:52 +0530 Message-ID: <20210720165052.606038-1-rkudurumalla@marvell.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210720124713.603674-1-rkudurumalla@marvell.com> References: <20210720124713.603674-1-rkudurumalla@marvell.com> MIME-Version: 1.0 X-Proofpoint-ORIG-GUID: J2r7xcjFYBXAAYCYTfPkMS1VFvQHgygw X-Proofpoint-GUID: J2r7xcjFYBXAAYCYTfPkMS1VFvQHgygw X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:6.0.391, 18.0.790 definitions=2021-07-20_12:2021-07-19, 2021-07-20 signatures=0 Subject: [dpdk-dev] [PATCH v2] test: avoid hang if queues are full and Tx fails X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 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" 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 --- 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) /