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 A663BA0552; Mon, 27 Jun 2022 09:54:30 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 838F9400D7; Mon, 27 Jun 2022 09:54:30 +0200 (CEST) Received: from wout2-smtp.messagingengine.com (wout2-smtp.messagingengine.com [64.147.123.25]) by mails.dpdk.org (Postfix) with ESMTP id 83396400D5 for ; Mon, 27 Jun 2022 09:54:28 +0200 (CEST) Received: from compute2.internal (compute2.nyi.internal [10.202.2.46]) by mailout.west.internal (Postfix) with ESMTP id 2DB1C3200923; Mon, 27 Jun 2022 03:54:26 -0400 (EDT) Received: from mailfrontend2 ([10.202.2.163]) by compute2.internal (MEProxy); Mon, 27 Jun 2022 03:54:27 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=monjalon.net; h= cc:cc:content-transfer-encoding:content-type:date:date:from:from :in-reply-to:in-reply-to:message-id:mime-version:references :reply-to:sender:subject:subject:to:to; s=fm2; t=1656316465; x= 1656402865; bh=mZ1ePYZux3kaXbkPY4UQ1nivFZZsoDef/Gs2sGYStmQ=; b=i Bx0NXyixPy4u2LOGTRHL8kJqmFEx4AnVOcDJXOUnTfcSOmXAdzeU+akLHf62AntR 73eDSMoBX11s86RP0ftyPgZ8F6eZCA4fbs1X/5XA5QnJmb4w7h6MpQ9Zz0Yfb6h0 G5JYcyxsgdLF/Wrlv8D2RBO+egycS5ZTyDg9WRKWskMicVsMnBsiM0c0e0QuSNtm QuOJskXo4hRNDqz5IbcnZoNiDR0CDjZLrVIDUFapbTv5O554i4nYtqvaMNVwEauH PreBDyQxgvFMKN+qTUlznLIfnvFycvRdt+gV9T6icZVhqD/CoCOxk76sns6vn+Cp eapvjaaXRDvkjR3GEEWGg== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-transfer-encoding :content-type:date:date:feedback-id:feedback-id:from:from :in-reply-to:in-reply-to:message-id:mime-version:references :reply-to:sender:subject:subject:to:to:x-me-proxy:x-me-proxy :x-me-sender:x-me-sender:x-sasl-enc; s=fm2; t=1656316465; x= 1656402865; bh=mZ1ePYZux3kaXbkPY4UQ1nivFZZsoDef/Gs2sGYStmQ=; b=J L2fFI6TlfGkx5e76eaUBFkicmFVpByOzKTOs1f1JCS2oqszBRXaqUSfNWNJcs7Ac gDVthYQhv+J1209x1d4UR5IR355yFbzKV1QJhwgIin9N3NeQv9YGSXEi2wVY8jsb z3dMc8P0DofARxa+U3+r1oyw6nREjfBz68CzlZ3cmtYALBUcqEEIxAkSdO+F2uIa wjRBXjC791AkqWyWychbZxn0WL3pcMJ/gpSriSypxCzkOj97XdcOPjCw7JVoJAph kZaLvtcP0v9et9ZOBroqmZEQRbQMGDKNDwUIPGINAt1NX1cYB5qG1Ac1UBO34lly WtI/WcpdgUP8tBm3kaoOQ== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvfedrudeggedguddvfecutefuodetggdotefrod ftvfcurfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfgh necuuegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmd enucfjughrpefhvfevufffkfgjfhgggfgtsehtufertddttddvnecuhfhrohhmpefvhhho mhgrshcuofhonhhjrghlohhnuceothhhohhmrghssehmohhnjhgrlhhonhdrnhgvtheqne cuggftrfgrthhtvghrnheptdejieeifeehtdffgfdvleetueeffeehueejgfeuteeftddt ieekgfekudehtdfgnecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmrghilh hfrhhomhepthhhohhmrghssehmohhnjhgrlhhonhdrnhgvth X-ME-Proxy: Feedback-ID: i47234305:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Mon, 27 Jun 2022 03:54:23 -0400 (EDT) From: Thomas Monjalon To: Heinrich Schuchardt Cc: David Marchand , dev@dpdk.org, Chenbo Xia , Ajit Khaparde , Rosen Xu , Stephen Hemminger , Joyce Kong , Jie Zhou , konstantin.v.ananyev@yandex.ru, ferruh.yigit@amd.com, andrew.rybchenko@oktetlabs.ru, Ajit Khaparde Subject: Re: [PATCH 1/1] test/pmd_perf: handling of unknown connection speed Date: Mon, 27 Jun 2022 09:54:21 +0200 Message-ID: <3598033.OYXXYNVTWy@thomas> In-Reply-To: <7f3fcb4e-430a-6fd6-147c-492929cafc0d@canonical.com> References: <20220511163310.50892-1-heinrich.schuchardt@canonical.com> <6192851.a9HWlOh95j@thomas> <7f3fcb4e-430a-6fd6-147c-492929cafc0d@canonical.com> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" 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 27/06/2022 09:18, Heinrich Schuchardt: > On 6/26/22 17:15, Thomas Monjalon wrote: > > 11/05/2022 18:33, Heinrich Schuchardt: > >> When running DPDK in QEMU it cannot determine the connection speed. > >> pmd_perf_autotest treats this as if the connection speed where > >> UNIT32_MAX Mbps: > >> > >> RTE>>pmd_perf_autotest > >> Start PMD RXTX cycles cost test. > >> Allocated mbuf pool on socket 0 > >> CONFIG RXD=1024 TXD=1024 > >> Performance test runs on lcore 1 socket 0 > >> Port 0 Address:52:54:00:12:34:57 > >> Port 1 Address:52:54:00:12:34:58 > >> Checking link statuses... > >> Port 0 Link up at Unknown FDX Autoneg > >> Port 1 Link up at Unknown FDX Autoneg > >> IPv4 pktlen 46 > >> UDP pktlen 26 > >> Generate 4096 packets @socket 0 > >> inject 2048 packet to port 0 > >> inject 2048 packet to port 1 > >> Total packets inject to prime ports = 4096 > >> Each port will do 6391320379464 packets per second > >> Test will stop after at least 25565281517856 packets received > >> > >> This will not allow the test to terminate in a reasonable timespan. > >> Just assume 10 Gbps in this case instead: > >> > >> ... > >> Test will stop after at least 59523808 packets received > >> > >> Signed-off-by: Heinrich Schuchardt > >> --- > >> app/test/test_pmd_perf.c | 15 +++++++++++---- > >> 1 file changed, 11 insertions(+), 4 deletions(-) > >> > >> diff --git a/app/test/test_pmd_perf.c b/app/test/test_pmd_perf.c > >> index 25611bfe9b..ee08c8aade 100644 > >> --- a/app/test/test_pmd_perf.c > >> +++ b/app/test/test_pmd_perf.c > >> @@ -486,10 +486,17 @@ main_loop(__rte_unused void *args) > >> } > >> printf("Total packets inject to prime ports = %u\n", idx); > >> > >> - packets_per_second = (link_mbps * 1000 * 1000) / > >> - ((PACKET_SIZE + FRAME_GAP + MAC_PREAMBLE) * CHAR_BIT); > >> - printf("Each port will do %"PRIu64" packets per second\n", > >> - packets_per_second); > >> + if (link_mbps != RTE_ETH_SPEED_NUM_UNKNOWN) { > >> + packets_per_second = (link_mbps * 1000 * 1000) / > >> + ((PACKET_SIZE + FRAME_GAP + MAC_PREAMBLE) * CHAR_BIT); > >> + printf("Each port will do %"PRIu64" packets per second\n", > >> + packets_per_second); > >> + total_packets = RTE_TEST_DURATION * conf->nb_ports * packets_per_second; > > Yes this line should be removed. > > > > > This is redundant with below. > > > >> + } else { > >> + /* We don't know the speed. Pretend it is 10G */ > >> + packets_per_second = ((uint64_t)RTE_ETH_SPEED_NUM_10G * 1000 * 1000) / > >> + ((PACKET_SIZE + FRAME_GAP + MAC_PREAMBLE) * CHAR_BIT); > >> + } > >> > >> total_packets = RTE_TEST_DURATION * conf->nb_ports * packets_per_second; > > > > Why not just inserting this: > > > > if (link_mbps == RTE_ETH_SPEED_NUM_UNKNOWN) > > link_mbps = RTE_ETH_SPEED_NUM_10G; > > Following your suggestion the message "Each port will do %"PRIu64" > packets per second\n" would provide misleading information to the user. > This should be avoided. OK so we can have the printf inside an "if condition": bool speed_unknown = (link_mbps == RTE_ETH_SPEED_NUM_UNKNOWN); if (speed_unknown) link_mbps = RTE_ETH_SPEED_NUM_10G; packets_per_second = ...; if (!speed_unknown) printf(...); total_packets = ...;