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 B1868A0557; Mon, 27 Jun 2022 09:18:08 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 4A8C4400D7; Mon, 27 Jun 2022 09:18:08 +0200 (CEST) Received: from smtp-relay-internal-0.canonical.com (smtp-relay-internal-0.canonical.com [185.125.188.122]) by mails.dpdk.org (Postfix) with ESMTP id 0C80B400D5 for ; Mon, 27 Jun 2022 09:18:07 +0200 (CEST) Received: from mail-wm1-f71.google.com (mail-wm1-f71.google.com [209.85.128.71]) (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-internal-0.canonical.com (Postfix) with ESMTPS id 17B323FD78 for ; Mon, 27 Jun 2022 07:18:05 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=canonical.com; s=20210705; t=1656314286; bh=T2d9lvBo2rsZUAtZsNDH24nFGL1X5laelXhlTEFoe+4=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=AISPL4VrvkKmi5vOAgzUo6AMa73gbo87+vZhZlJvjLvs6/HOxBv9Aatgvxux1Iv73 JfH6wfmPY5/17qdUWKXMD8lA8Dx52/8thm11rLN81sLn/4t69EvlHqkpLfNVyCVHez Ali2aY0mFXRexDiPhT92ePyFDt7HuyVDBonQ0E3/S2vzVzysXwpinTCpiLrcufkgJW hwx8Kqz4fzpS0HZT+rLMkqAZQCfaB3W68nnMh0dKy7DC163wQWBLjeaGY0ErdsHTE5 NfnM3r1w2CC11e3+wXmhuo6tQXXeWF/C/BX1uKmmSXqD1KP0T3PRznAIRuOCcUpZ7B LGOb7Slpukj+g== Received: by mail-wm1-f71.google.com with SMTP id j20-20020a05600c1c1400b0039c747a1e5aso5176719wms.9 for ; Mon, 27 Jun 2022 00:18:05 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:message-id:date:mime-version:user-agent:subject :content-language:to:cc:references:from:in-reply-to :content-transfer-encoding; bh=T2d9lvBo2rsZUAtZsNDH24nFGL1X5laelXhlTEFoe+4=; b=6Tjijb8X67P+TlyY7agBNVRlQ0hwzFk92j95mdP0gaValUKtNIkiaqh5Xln6ueijV5 3RYF7fdAx4bLdW3RwbPoKX81HBd/q0nr9MAq9fZtz4x6BjJyBwGioCpGvxT6W91XwSt7 YfJt/pUnqa20FZs9zDe6l1F1L78wmGIDkCNnEV2NipuM56Auv7RqxY664AITB+7T5Yy+ SaszqWqXCMw7C93LlqnqCbNkMGl79Z9U9oR18dmFDylVNBuEiVrpJUdtrONLHNQx2Pao 8BKWBjC1CpSzLOHHYA8MN6nkv5eqNMspD0gWURmIetvJvFLQFNlhnIIHYFCmkZsXIwwJ tjzQ== X-Gm-Message-State: AJIora+Wan+8vFQSoJc37nJgMtWWlxeE6ANxFXV9keAZpjS6oLOPb+eD tCjJ4juz4ucQthMhKEP3GHck4CBNwtssB+wSxTA43849d8pId/y/lS3FBRYqpDarZtr9P7dRYFJ kE55/aVqDAVdWxKagHShv X-Received: by 2002:a05:600c:2246:b0:3a0:4d14:e9ca with SMTP id a6-20020a05600c224600b003a04d14e9camr1052360wmm.25.1656314285104; Mon, 27 Jun 2022 00:18:05 -0700 (PDT) X-Google-Smtp-Source: AGRyM1tOHmniInnm2dO2cIM8UkBulqavKAB3gVCxyWK1CvPf4eWFzs19EYec1zi7QDXAfattPH+fhA== X-Received: by 2002:a05:600c:2246:b0:3a0:4d14:e9ca with SMTP id a6-20020a05600c224600b003a04d14e9camr1052324wmm.25.1656314284845; Mon, 27 Jun 2022 00:18:04 -0700 (PDT) Received: from [192.168.123.67] (ip-062-143-094-109.um16.pools.vodafone-ip.de. [62.143.94.109]) by smtp.gmail.com with ESMTPSA id ay14-20020a5d6f0e000000b0021b91ec8f6esm9499124wrb.67.2022.06.27.00.18.03 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 27 Jun 2022 00:18:04 -0700 (PDT) Message-ID: <7f3fcb4e-430a-6fd6-147c-492929cafc0d@canonical.com> Date: Mon, 27 Jun 2022 09:18:02 +0200 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.11.0 Subject: Re: [PATCH 1/1] test/pmd_perf: handling of unknown connection speed Content-Language: en-US To: Thomas Monjalon 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 References: <20220511163310.50892-1-heinrich.schuchardt@canonical.com> <6192851.a9HWlOh95j@thomas> From: Heinrich Schuchardt In-Reply-To: <6192851.a9HWlOh95j@thomas> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit 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 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. Best regards Heinrich