From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from EUR02-HE1-obe.outbound.protection.outlook.com (mail-eopbgr10114.outbound.protection.outlook.com [40.107.1.114]) by dpdk.org (Postfix) with ESMTP id 2DFE528F3; Wed, 20 Feb 2019 22:06:15 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nokia.onmicrosoft.com; s=selector1-nokia-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=12XIraCJc1W1ziA0x+tj2Kd3GRPymujRosTYRKLZVL8=; b=s/3YJhUpPMd5sxrJW9l4YP/be+b6y05iyQadV8eK9hJ3ITOlsbdWNGpL1pMqinZGDfd0Nnp69Eae+QPMxcLEQMmEnWuQMD7A45wYFOZ6Jj35++KwhdwYay03AR7DMQziQPPUWlUiUValnS5aZ7igPgmYDyw43fa8NqvCRBdOUq4= Received: from DB6PR07CA0065.eurprd07.prod.outlook.com (2603:10a6:6:2a::27) by HE1PR0701MB2841.eurprd07.prod.outlook.com (2603:10a6:3:4e::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1665.5; Wed, 20 Feb 2019 21:06:13 +0000 Received: from DB5EUR03FT016.eop-EUR03.prod.protection.outlook.com (2a01:111:f400:7e0a::207) by DB6PR07CA0065.outlook.office365.com (2603:10a6:6:2a::27) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1665.5 via Frontend Transport; Wed, 20 Feb 2019 21:06:13 +0000 Authentication-Results: spf=pass (sender IP is 131.228.2.241) smtp.mailfrom=nokia.com; intel.com; dkim=none (message not signed) header.d=none;intel.com; dmarc=pass action=none header.from=nokia.com; Received-SPF: Pass (protection.outlook.com: domain of nokia.com designates 131.228.2.241 as permitted sender) receiver=protection.outlook.com; client-ip=131.228.2.241; helo=fihe3nok0735.emea.nsn-net.net; Received: from fihe3nok0735.emea.nsn-net.net (131.228.2.241) by DB5EUR03FT016.mail.protection.outlook.com (10.152.20.141) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1643.11 via Frontend Transport; Wed, 20 Feb 2019 21:06:13 +0000 Received: from lfs-up-04.localdomain ([10.157.84.234]) by fihe3nok0735.emea.nsn-net.net (GMO) with ESMTP id x1KL6CeJ013434; Wed, 20 Feb 2019 21:06:12 GMT Received: by lfs-up-04.localdomain (Postfix, from userid 62146483) id 95D999FCC; Wed, 20 Feb 2019 23:06:12 +0200 (EET) From: Julien Meunier To: CC: , Date: Wed, 20 Feb 2019 23:06:08 +0200 Message-ID: <20190220210608.48581-1-julien.meunier@nokia.com> X-Mailer: git-send-email 2.10.2 In-Reply-To: <20190203194218.46480-1-julien.meunier@nokia.com> References: <20190203194218.46480-1-julien.meunier@nokia.com> X-EOPAttributedMessage: 0 X-MS-Office365-Filtering-HT: Tenant X-Forefront-Antispam-Report: CIP:131.228.2.241; IPV:CAL; SCL:-1; CTRY:FI; EFV:NLI; SFV:NSPM; SFS:(10019020)(376002)(346002)(136003)(39860400002)(396003)(2980300002)(3190300001)(199004)(189003)(42186006)(44832011)(86362001)(36756003)(486006)(126002)(476003)(2616005)(6916009)(2906002)(11346002)(446003)(106466001)(336012)(76176011)(26005)(52956003)(316002)(51416003)(53936002)(54906003)(106002)(16586007)(5660300002)(186003)(356004)(305945005)(4326008)(47776003)(8936002)(68736007)(50466002)(6666004)(48376002)(97736004)(50226002)(478600001)(6266002)(81166006)(1076003)(8676002)(2351001)(81156014)(26826003)(103686004)(43043002); DIR:OUT; SFP:1102; SCL:1; SRVR:HE1PR0701MB2841; H:fihe3nok0735.emea.nsn-net.net; FPR:; SPF:Pass; LANG:en; PTR:InfoDomainNonexistent; A:1; MX:1; MIME-Version: 1.0 Content-Type: text/plain X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: d789a4df-c072-4dfd-9e16-08d697773f0d X-Microsoft-Antispam: BCL:0; PCL:0; RULEID:(2390118)(7020095)(4652040)(8989299)(4534185)(4627221)(201703031133081)(201702281549075)(8990200)(5600110)(711020)(4605104)(4608103)(4709054)(2017052603328); SRVR:HE1PR0701MB2841; X-MS-TrafficTypeDiagnostic: HE1PR0701MB2841: X-Microsoft-Exchange-Diagnostics: 1; HE1PR0701MB2841; 20:85dHZbXUhXO4fxVklV9LCzn7Cc+DtrTXqK3nOrRgFE31mbTs1//4GcoP8+4S8TMjqIGXDD2M0Q7Am8WXmhedXiTTD1tT1Uo/h/LlDe2B3YohnG+ea8W4mYGhmQde2I3TYzdQYU+pQ4/GEE3HFUjK+TSzEOjnqokJtmKf+sQB2COpA4lskBvnD+5HOhDgdX7OaQA5EtDlkwlcmuN6UNynWE325dVbXbpnKSnPBMFlvvngLRwk+do4iHaYf2k4dMuDS5ymx95yN1A1sxZhEOwnaRvXkCL2vfelQDfnIB54rp7UfQh3XGzSBm8KmAvHkZ/XqTcVul0jKat5FWQY1bcwyzUaAF4K2cC+i+Yxwyu0UrlL+1D/00hndoSOx+vNv/OTkoiKPuNOlnS0UeoomgiZqh37Mjau4cocShO6c1DnIQAIQQ0QGoUhojF0Qu3xfwtX+kCCdgzIXgBH9bWsiw+5u8xQamiRh93LWA6RSxIaJMApU5ElPsP8ozdIJkITgQK7H5b/2I1jhgBt1EOMQ2Rvq6O9OhzJ/NRDLZzOIzSFMYlTQB5LWTlOEWfWC6GY5d4Cemjo8tN9pzE7qaAVftBUv53TNkBDgv9VjsqMTFWedPg= X-Microsoft-Antispam-PRVS: X-Forefront-PRVS: 0954EE4910 X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; HE1PR0701MB2841; 23:zlwcn1LLNvkWjn98d71mePwI2jWUDwCgsch8cW+?= =?us-ascii?Q?A2lzeWfJwI5dGR07eQGxkNo4iDluoMy2FnQnpo6IelT8czLxquAUntrsCbQz?= =?us-ascii?Q?Avr5WWJIKzk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= =?us-ascii?Q?Uw5GM3hM3O7VJIUQuDjqVha1PF/WIXhkf0VMfRvdVfGWMMZsihgYjIXvy6C1?= =?us-ascii?Q?/1jj3TyehnqxPr2RCOfKYLcmqgt8g+oF/Dl7kKIcdxaqURULCgIIIQkilSsP?= =?us-ascii?Q?3OQWYolyxMh2JSRIK4tws2/kd5N5b+6YRuBeBoY7j4loCrclrIbm9NOhfRZ0?= =?us-ascii?Q?Lrp3YtOWdc+maLX0DErAhN8sWmzAtdADyu6sRYDLcRqba1lXr8QcTMS0vyg?= =?us-ascii?Q?=3D=3D?= X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam-Message-Info: o8/JwymVf7TujPupuRmMogwAAyMXIR9hEz1WyIrK4Y77fODCKGHhrO77YmsARM35JZWE2ml4UVgeleFw5F2TZ32ITTgx+u7WQFBtNULYOY3+kW0nD7x9tDe8VSyBwmob747IY2C+Yn1VwPEracmZigFJqp1EqqkjdBsM0bpKmqNufPklEAVoaHadQoQ6WdpvfuTZAvy7KZR3QNvHcbye7b2QgL/Nc4pJKEDcG6ePzfU3HFIcVNfBERoSrJspiissLapYY2y7qDxSvWq2uY05OQAWm6+mmw113QnqNmVyTARI6T2EdwqJPbAtXCtcoYbqiBX4ZYKRFHBpDQeWd1u2Mhf5c5nCGCIVLPMGO1buYP1ywH+mScHlpAN6fBv0O0sUEANtn3f0IMZI6wITh47nK4LfuLrdO5+vrjbCzZG6ynE= X-OriginatorOrg: nokia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 20 Feb 2019 21:06:13.2491 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: d789a4df-c072-4dfd-9e16-08d697773f0d X-MS-Exchange-CrossTenant-Id: 5d471751-9675-428d-917b-70f44f9630b0 X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=5d471751-9675-428d-917b-70f44f9630b0; Ip=[131.228.2.241]; Helo=[fihe3nok0735.emea.nsn-net.net] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: HE1PR0701MB2841 Subject: [dpdk-dev] [PATCH v3] test/pmd_perf: fix the way to drain the port 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: , X-List-Received-Date: Wed, 20 Feb 2019 21:06:15 -0000 If the port has received less than ``pkt_per_port`` packets (for example, the port has missed some packets), the test is in an infinite loop. Instead of expecting a number of packet to receive, let the port to be drained by itself. If no more packets are received, the test can continue. Fixes: 002ade70e933 ("app/test: measure cycles per packet in Rx/Tx") Cc: stable@dpdk.org Signed-off-by: Julien Meunier --- v3: * add timeout on stop * add log details v2: * rename commit title * fix nb_free display --- test/test/test_pmd_perf.c | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/test/test/test_pmd_perf.c b/test/test/test_pmd_perf.c index f5095c8..ed8524a 100644 --- a/test/test/test_pmd_perf.c +++ b/test/test/test_pmd_perf.c @@ -493,16 +493,21 @@ main_loop(__rte_unused void *args) for (i = 0; i < conf->nb_ports; i++) { portid = conf->portlist[i]; - int nb_free = pkt_per_port; + int nb_free = 0; + uint64_t timeout = 10000; do { /* dry out */ nb_rx = rte_eth_rx_burst(portid, 0, pkts_burst, MAX_PKT_BURST); nb_tx = 0; while (nb_tx < nb_rx) rte_pktmbuf_free(pkts_burst[nb_tx++]); - nb_free -= nb_rx; - } while (nb_free != 0); - printf("free %d mbuf left in port %u\n", pkt_per_port, portid); + nb_free += nb_rx; + + if (unlikely(nb_rx == 0)) + timeout--; + } while (nb_free != pkt_per_port && timeout != 0); + printf("free %d (expected %d) mbuf left in port %u\n", nb_free, + pkt_per_port, portid); } if (count == 0) -- 2.10.2