Message ID | 20190203194218.46480-1-julien.meunier@nokia.com (mailing list archive) |
---|---|
State | Changes Requested, archived |
Delegated to: | Ferruh Yigit |
Headers |
Return-Path: <dev-bounces@dpdk.org> X-Original-To: patchwork@dpdk.org Delivered-To: patchwork@dpdk.org Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 7CC4D1B142; Sun, 3 Feb 2019 20:42:35 +0100 (CET) Received: from EUR02-VE1-obe.outbound.protection.outlook.com (mail-eopbgr20125.outbound.protection.outlook.com [40.107.2.125]) by dpdk.org (Postfix) with ESMTP id D8AD15911; Sun, 3 Feb 2019 20:42:33 +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=3mXshkMeAHNzrOrplbFfOh7HHIzqo/fqeW9yzBjvPo4=; b=OGISiK4vtlvlF2Mk70YpCQx7jjOhxsXVut7f0NxOef1x/x8Jakjnr6uO0/4subkfmgnJZcckdp/O0g387DAqgavUdqPOLGI+yEKw1R463C2G1Uanq7ze2fcWg5skMGOlBpKK4uy/SkKNzvQkqN3LhzmOdizv6zMGzUkkR/aQWIE= Received: from VI1PR07CA0203.eurprd07.prod.outlook.com (2603:10a6:802:3f::27) by DB6PR0701MB2837.eurprd07.prod.outlook.com (2603:10a6:4:71::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1601.8; Sun, 3 Feb 2019 19:42:32 +0000 Received: from DB5EUR03FT009.eop-EUR03.prod.protection.outlook.com (2a01:111:f400:7e0a::202) by VI1PR07CA0203.outlook.office365.com (2603:10a6:802:3f::27) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1601.11 via Frontend Transport; Sun, 3 Feb 2019 19:42:32 +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 DB5EUR03FT009.mail.protection.outlook.com (10.152.20.117) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1580.17 via Frontend Transport; Sun, 3 Feb 2019 19:42:32 +0000 Received: from lfs-up-04.localdomain ([10.157.84.234]) by fihe3nok0735.emea.nsn-net.net (GMO) with ESMTP id x13JgUSK027495; Sun, 3 Feb 2019 19:42:31 GMT Received: by lfs-up-04.localdomain (Postfix, from userid 62146483) id 3F76735A4; Sun, 3 Feb 2019 21:42:30 +0200 (EET) From: Julien Meunier <julien.meunier@nokia.com> To: <dev@dpdk.org> CC: <stable@dpdk.org>, <cunming.liang@intel.com>, <ferruh.yigit@intel.com> Date: Sun, 3 Feb 2019 21:42:18 +0200 Message-ID: <20190203194218.46480-1-julien.meunier@nokia.com> X-Mailer: git-send-email 2.10.2 In-Reply-To: <20190102155535.29488-1-julien.meunier@nokia.com> References: <20190102155535.29488-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)(136003)(376002)(346002)(396003)(39860400002)(2980300002)(3190300001)(189003)(199004)(446003)(126002)(44832011)(50226002)(2616005)(11346002)(316002)(486006)(476003)(36756003)(1076003)(186003)(26005)(68736007)(47776003)(2906002)(81156014)(305945005)(81166006)(8936002)(86362001)(8676002)(4326008)(6916009)(50466002)(6666004)(103686004)(356004)(76176011)(48376002)(54906003)(6266002)(16586007)(51416003)(42186006)(336012)(52956003)(106002)(26826003)(106466001)(53936002)(97736004)(478600001)(2351001)(43043002); DIR:OUT; SFP:1102; SCL:1; SRVR:DB6PR0701MB2837; H:fihe3nok0735.emea.nsn-net.net; FPR:; SPF:Pass; LANG:en; PTR:InfoDomainNonexistent; MX:1; A:1; X-Microsoft-Exchange-Diagnostics: 1; DB5EUR03FT009; 1:a5YIl2e7a9Qnq3nkmUsN/smKYFZLf7PuvCOwlX1viDdUt8YwyP8JH2vKxHwnXdGo795+CGhcRiSa9eCgUxjhnkGztNmdWTzr5nmXek62qZq2g35UI80IhrqZkzEmTSYSpEbtWy0ytgUqlLq8Z6JaVQ== MIME-Version: 1.0 Content-Type: text/plain X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 071e99ff-71be-4a1b-5db8-08d68a0fbd2e X-Microsoft-Antispam: BCL:0; PCL:0; RULEID:(2390118)(7020095)(4652040)(8989299)(4534185)(4627221)(201703031133081)(201702281549075)(8990200)(5600110)(711020)(4605077)(4608076)(4709027)(2017052603328); SRVR:DB6PR0701MB2837; X-Microsoft-Exchange-Diagnostics: 1; DB6PR0701MB2837; 3:ke7aYiPjcSnEC9jFxjrduArvgQVP83mG5IZ/2veo2Wm0kSycmT3dZBZYYl1PxxLPQPnYhxL3vwa2MwTeIZZiktU04Xt6Xs/2sFDFPiWt6nxEYeVOEdWqFli7rtzxxuOft53gQ2I1p1PWAqEYejDcEm42olvxukdcuFfRiaYD3XaBwEMlJEkD/xTdz97gYsgtE6CSrbE0MtL/FY1RPZAs51BbxdU21c4bLrcmf4sl9sHLTJYuuRAonPStmzJkMB4cxdACkVcuyGmgd7Yxjk/eHcPN+f78pgVwvriiBTJvrUVT7NZIYZZ4e57w2hKKYAgb/+XA7iXD332PfKzEUtEoFpUI1IybnEWNghn0Cd5hQLw834Vl0krgm39Utb1NtqOr; 25:npVi8aIzZ3Gz0Ej3wXTPQwDksN6VSjtunvn68HgA9scCw5X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G4uSMmEgKGVaxlS6duKlvk+a8qAC21MmAAFrNgNL0gR8qGj63+q+H1XO/T3ooVX5fFWlYn+9gChgaIy6u3pptZv2krchLk+6NdDYD9xVZucBwQfbT3twUE4UX+FV5uBBxecoTq7O0= X-Microsoft-Antispam-PRVS: <DB6PR0701MB2837C789CC9899B058948445856C0@DB6PR0701MB2837.eurprd07.prod.outlook.com> X-Microsoft-Exchange-Diagnostics: 1; DB6PR0701MB2837; 4:S/ainPxPtaLXvkqUV3zz+TXEJ/4ehkkLNYsPm25wcz9zrxsMmBRYcYy4cX1U0+NmloVG7jPVQwkvWEv55/E4brGCHOMBIP5uC+KcDrrWLBpwJquJEImPPt3gRYUjVVQnq4ZaItxT+2Op2ayKi6240/KNIe5h8JUKZ4c4v1w+Mo6TBjfaE0YLVp5yTpZ58ZTQgY5QT4HLxg/6Pj/5jxqjETrfBME9eZv8ELljv8aNU4OJkIKtI6ogGu6CyOcH+ZUjSCjOS2pHnAKx+W8igBSejAu0toQKI9wCf1ZNc9wNOxcuNIlfuARJ0HjPjf2VbEFA X-Forefront-PRVS: 0937FB07C5 X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; DB6PR0701MB2837; 23:K5C4hm5gu2dBDwaQ66m8nCwB3Wdeb7I92+p5GkM?= aL/o5Gmq1DLWkdD/wfOAHrUMPOXLFcc9OCVhFUrTM/bqN9w/kY+OmryNsIcDobM34YPHd9jjsCnnSfDZIlMkFXKPIVdGN8kJkCFUlNVCPTmY4iNpX3FfQ6A0m2G2Cb7wa2/Ti2C9XpoO+jn5lmK7RheblAaP4zPcn/ZgnIESEv6xT8VabEqSu5zfrQ8rG06LMICXSwaV2OTkPzMfN8asyNHXokjXHJW4FVFzCDAhrOaul6xg606M+ivs88bza+c7KDInNvAI6uY5SFUhfzAZBNmFqwdEYnIh7tdelTf78WCEneR40UGpdq/kr6RF1AtqqwPHHowVUXjRHeIYdfi4SOnKJYQJwJvkpNOXr96ll8ihKQ83vOL0U3CMydGDlj0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enant-OriginalArrivalTime: 03 Feb 2019 19:42:32.0801 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 071e99ff-71be-4a1b-5db8-08d68a0fbd2e 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: DB6PR0701MB2837 Subject: [dpdk-dev] [PATCH v2] 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 <dev.dpdk.org> List-Unsubscribe: <https://mails.dpdk.org/options/dev>, <mailto:dev-request@dpdk.org?subject=unsubscribe> List-Archive: <http://mails.dpdk.org/archives/dev/> List-Post: <mailto:dev@dpdk.org> List-Help: <mailto:dev-request@dpdk.org?subject=help> List-Subscribe: <https://mails.dpdk.org/listinfo/dev>, <mailto:dev-request@dpdk.org?subject=subscribe> Errors-To: dev-bounces@dpdk.org Sender: "dev" <dev-bounces@dpdk.org> |
Series |
[v2] test/pmd_perf: fix the way to drain the port
|
|
Checks
Context | Check | Description |
---|---|---|
ci/checkpatch | success | coding style OK |
ci/mellanox-Performance-Testing | success | Performance Testing PASS |
ci/intel-Performance-Testing | success | Performance Testing PASS |
ci/Intel-compilation | success | Compilation OK |
Commit Message
Julien Meunier
Feb. 3, 2019, 7:42 p.m. UTC
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 <julien.meunier@nokia.com>
---
v2:
* rename commit title
* fix nb_free display
---
test/test/test_pmd_perf.c | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
Comments
On 2/3/2019 7:42 PM, Julien Meunier wrote: > 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 <julien.meunier@nokia.com> > --- > v2: > * rename commit title > * fix nb_free display > --- > test/test/test_pmd_perf.c | 8 ++++---- > 1 file changed, 4 insertions(+), 4 deletions(-) > > diff --git a/test/test/test_pmd_perf.c b/test/test/test_pmd_perf.c > index f5095c8..c7e2df3 100644 > --- a/test/test/test_pmd_perf.c > +++ b/test/test/test_pmd_perf.c > @@ -493,16 +493,16 @@ 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; > 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; > + } while (nb_rx != 0); > + printf("free %d mbuf left in port %u\n", nb_free, portid); In the test logic there is an expectation that 'pkt_per_port' packets will be received. We are losing that intention here with this update. What do you think updating the log to include it, like: "free %d (expected %d) mbuf left in port %u\n", nb_free, pkt_per_port, portid
Hi, Sorry for the delay. Inline reply. On 07/02/2019 13:28, Ferruh Yigit wrote: > On 2/3/2019 7:42 PM, Julien Meunier wrote: >> 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 <julien.meunier@nokia.com> >> --- >> v2: >> * rename commit title >> * fix nb_free display >> --- >> test/test/test_pmd_perf.c | 8 ++++---- >> 1 file changed, 4 insertions(+), 4 deletions(-) >> >> diff --git a/test/test/test_pmd_perf.c b/test/test/test_pmd_perf.c >> index f5095c8..c7e2df3 100644 >> --- a/test/test/test_pmd_perf.c >> +++ b/test/test/test_pmd_perf.c >> @@ -493,16 +493,16 @@ 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; >> 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; >> + } while (nb_rx != 0); >> + printf("free %d mbuf left in port %u\n", nb_free, portid); > > > In the test logic there is an expectation that 'pkt_per_port' packets will be > received. > We are losing that intention here with this update. What do you think updating > the log to include it, like: > "free %d (expected %d) mbuf left in port %u\n", nb_free, pkt_per_port, portid > OK. But, after thinking, I should add a little timeout in order to drain the port during N cycles (like it was already done in the function poll_burst - timeout), just to be sure that all packets are dequeued. I will upload a new patch today. Best regards, Julien Meunier
On 2/18/2019 11:25 AM, Meunier, Julien (Nokia - FR/Paris-Saclay) wrote: > Hi, > > Sorry for the delay. Inline reply. > > On 07/02/2019 13:28, Ferruh Yigit wrote: >> On 2/3/2019 7:42 PM, Julien Meunier wrote: >>> 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 <julien.meunier@nokia.com> >>> --- >>> v2: >>> * rename commit title >>> * fix nb_free display >>> --- >>> test/test/test_pmd_perf.c | 8 ++++---- >>> 1 file changed, 4 insertions(+), 4 deletions(-) >>> >>> diff --git a/test/test/test_pmd_perf.c b/test/test/test_pmd_perf.c >>> index f5095c8..c7e2df3 100644 >>> --- a/test/test/test_pmd_perf.c >>> +++ b/test/test/test_pmd_perf.c >>> @@ -493,16 +493,16 @@ 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; >>> 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; >>> + } while (nb_rx != 0); >>> + printf("free %d mbuf left in port %u\n", nb_free, portid); >> >> >> In the test logic there is an expectation that 'pkt_per_port' packets will be >> received. >> We are losing that intention here with this update. What do you think updating >> the log to include it, like: >> "free %d (expected %d) mbuf left in port %u\n", nb_free, pkt_per_port, portid >> > > OK. But, after thinking, I should add a little timeout in order to drain > the port during N cycles (like it was already done in the function > poll_burst - timeout), just to be sure that all packets are dequeued. Not sure if we need this, at this stage all packets should be in device Rx queue, can rte_eth_rx_burst() return 0 when there are packets waiting in the queue? Anyway, this is after measurement done, and to free to the packets, so adding a timeout (retry) mechanism won't hurt if you prefer to add this. Thanks, ferruh > > I will upload a new patch today. > > Best regards, > Julien Meunier >
diff --git a/test/test/test_pmd_perf.c b/test/test/test_pmd_perf.c index f5095c8..c7e2df3 100644 --- a/test/test/test_pmd_perf.c +++ b/test/test/test_pmd_perf.c @@ -493,16 +493,16 @@ 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; 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; + } while (nb_rx != 0); + printf("free %d mbuf left in port %u\n", nb_free, portid); } if (count == 0)