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 A35D2A0032; Wed, 11 May 2022 18:33:16 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 46EE8406B4; Wed, 11 May 2022 18:33:16 +0200 (CEST) Received: from smtp-relay-canonical-1.canonical.com (smtp-relay-canonical-1.canonical.com [185.125.188.121]) by mails.dpdk.org (Postfix) with ESMTP id 01E7440042 for ; Wed, 11 May 2022 18:33:14 +0200 (CEST) Received: from workstation5.fritz.box (ip-062-143-094-109.um16.pools.vodafone-ip.de [62.143.94.109]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by smtp-relay-canonical-1.canonical.com (Postfix) with ESMTPSA id 5BE5B3FF5F; Wed, 11 May 2022 16:33:14 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=canonical.com; s=20210705; t=1652286794; bh=BmfufhKaKUHeGYHdWiaXlUCuFwVcAGPMX1Yw6/3LIkM=; h=From:To:Cc:Subject:Date:Message-Id:MIME-Version; b=Im2LvoGA7eZclrqX9/sdy8egAawZz8ZImuCxsCYfCt9lgf32C2g1CduRafVM+7uQP CeywTC/lD7jpolzcSECjVUgC+0zzeAU7PNs82ctotWGouHk0oyeH7D1LXZWm3qlix2 Q8dRwVk16Z0elZTk33tpdJwoeEJu/FjmJgsuP5CaBg/NHvXi08yY2bacQW6YP2UY4a FHaHccxaTSawpRX3qK5B9o64j9+CNVcQV8Rw4Famj4/G6Drr+Kkw4cB3IJzqRa5SLC ElbaGEtPh0LrX0ZKXqxKMINuJ6g7UL3s5Lni0Ll88yTQqCMon6jJ4RNNVHS70xLBD8 lZe2zdlq/3nIA== From: Heinrich Schuchardt To: Thomas Monjalon , David Marchand Cc: Ferruh Yigit , Chenbo Xia , Konstantin Ananyev , Ajit Khaparde , Rosen Xu , Stephen Hemminger , Joyce Kong , Jie Zhou , dev@dpdk.org, Heinrich Schuchardt Subject: [PATCH 1/1] test/pmd_perf: handling of unknown connection speed Date: Wed, 11 May 2022 18:33:10 +0200 Message-Id: <20220511163310.50892-1-heinrich.schuchardt@canonical.com> X-Mailer: git-send-email 2.34.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 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 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; + } 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; printf("Test will stop after at least %"PRIu64" packets received\n", -- 2.34.1