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 EBF0AA034F; Fri, 26 Feb 2021 17:18:19 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 205E3407FF; Fri, 26 Feb 2021 17:18:19 +0100 (CET) Received: from mail-pg1-f169.google.com (mail-pg1-f169.google.com [209.85.215.169]) by mails.dpdk.org (Postfix) with ESMTP id 1E41B40692 for ; Fri, 26 Feb 2021 17:18:18 +0100 (CET) Received: by mail-pg1-f169.google.com with SMTP id o38so6474915pgm.9 for ; Fri, 26 Feb 2021 08:18:18 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=pensando.io; s=google; h=mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=uxDKEPiEm8fD8eUrPqsSWzieOm6UFZGyuOLSl8/W+L0=; b=wZ8I+q9yx8LexuDgsl54n3D0jJkIDhS5r7KFLu28JicJ+lNgr/PTVAdrRRmBwXwQpJ FLaOp4b1BJbrzbMj9kWhodhMKB9ugRzlXREevy+xTutm9p+XskvADJztT5yFcBc4z6+8 pqCi9MiXy6sDDNJhu/HehB2OAfmMIyrp1sRSOVSyESZUbpqs4BA/pdFqQDjbJGI8MRGT isjRBkXHlA67lKpwHfhECsch8A+P/XmF0z5jzckN5lq/BXSRoA4yYeWcebYfIXB/XJQj NfRPAj99liF7N41SFTss1C+5dIjqiMG1n1fo3O9xUftU5FZD7DuC8qQmYjqzO3eLRxyK Evgw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=uxDKEPiEm8fD8eUrPqsSWzieOm6UFZGyuOLSl8/W+L0=; b=F2KJPEc7Sugt/g18xx0iiKcJJAM2P0alFxj2/nv2B6KJBzumkGM6c+Kl9JCwlEjz7e hTBr4hiqJd+Z643bCzCa2Wd04Xvbhv5ZavJ/PitF8qr5KEqVo2N74xo+zF2R369DedKy FyAL1IL6sbO8s10r7Cfs1zUidnV/+bYlu3/+KscJDqMrh4OWgFAkEFsOsN7q4fv/JAO7 r7O7ZUdTLkqXmJeWwZuwcRU6/zPvav737frlCmczVnAAJnlKS8vXCFw8mtwBQFZPTBxs ACDywLPv2g659uulOhZMmXyNyK7WDiobuxZPwvkbZfIs9VA6grrMTbqbKHJaILEIaU9u DlvA== X-Gm-Message-State: AOAM530wo1x+1T9gJdlMLv2nty1MwLJq/WcvkChvuqoVjTh8bXHdtHLa TB0CmefX/wpn7grsiT7zwoqg8Q== X-Google-Smtp-Source: ABdhPJxX0u0EiePTDxJ5VQxg5CKUbEa63o6FXY/q6sHEmEvV+AocRQiKUVUpqQtnfPZnKn1gL/LPJQ== X-Received: by 2002:a65:520d:: with SMTP id o13mr3546744pgp.57.1614356297277; Fri, 26 Feb 2021 08:18:17 -0800 (PST) Received: from ?IPv6:2600:1700:6b0:fde0:d8d2:ba61:b22a:4219? ([2600:1700:6b0:fde0:d8d2:ba61:b22a:4219]) by smtp.gmail.com with ESMTPSA id t16sm9653680pfe.165.2021.02.26.08.18.15 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Fri, 26 Feb 2021 08:18:16 -0800 (PST) Content-Type: text/plain; charset=utf-8 Mime-Version: 1.0 (Mac OS X Mail 13.4 \(3608.120.23.2.4\)) From: Andrew Boyer In-Reply-To: <1dbfb659-4f91-90fe-0e0c-23d49d53f03b@intel.com> Date: Fri, 26 Feb 2021 11:18:14 -0500 Cc: Andrew Rybchenko , Ajit Khaparde , dev@dpdk.org, Qi Zhang , Thomas Monjalon Content-Transfer-Encoding: quoted-printable Message-Id: References: <20210222191824.40230-1-ajit.khaparde@broadcom.com> <3a90da98-da41-70fb-2b6b-99e68c260b62@intel.com> <1dbfb659-4f91-90fe-0e0c-23d49d53f03b@intel.com> To: Ferruh Yigit X-Mailer: Apple Mail (2.3608.120.23.2.4) Subject: Re: [dpdk-dev] [PATCH] app/testpmd: add support for forced ethernet speed 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 Sender: "dev" > On Feb 26, 2021, at 6:21 AM, Ferruh Yigit = wrote: >=20 > On 2/26/2021 6:43 AM, Andrew Rybchenko wrote: >> On 2/25/21 9:25 PM, Ferruh Yigit wrote: >>> On 2/22/2021 7:18 PM, Ajit Khaparde wrote: >>>> Add support for forced ethernet speed setting. >>>> Currently testpmd tries to configure the Ethernet port in autoneg = mode. >>>> It is not possible to set the Ethernet port to a specific speed = while >>>> starting testpmd. In some cases capability to configure a forced = speed >>>> for the Ethernet port during initialization may be necessary. This = patch >>>> tries to add this support. >>>>=20 >>>> The patch assumes full duplex setting and does not attempt to = change >>>> that. >>>> So speeds like 10M, 100M are not configurable using this method. >>>>=20 >>>> The command line to configure a forced speed of 10G: >>>> dpdk-testpmd -c 0xff -- -i --eth-link-speed 10000 >>>>=20 >>>> The command line to configure a forced speed of 50G: >>>> dpdk-testpmd -c 0xff -- -i --eth-link-speed 50000 >>>>=20 >>>> Signed-off-by: Ajit Khaparde >>>> --- >>>> app/test-pmd/parameters.c | 42 = +++++++++++++++++++++++++++ >>>> app/test-pmd/testpmd.c | 4 +++ >>>> app/test-pmd/testpmd.h | 1 + >>>> doc/guides/testpmd_app_ug/run_app.rst | 11 +++++++ >>>> 4 files changed, 58 insertions(+) >>>=20 >>> Can you also update the release notes to document the new parameter? >>>=20 >>>>=20 >>>> diff --git a/app/test-pmd/parameters.c b/app/test-pmd/parameters.c >>>> index c8acd5d1b7..e10f7d38fb 100644 >>>> --- a/app/test-pmd/parameters.c >>>> +++ b/app/test-pmd/parameters.c >>>> @@ -224,6 +224,7 @@ usage(char* progname) >>>> printf(" --hairpin-mode=3D0xXX: bitmask set the hairpin port >>>> mode.\n " >>>> " 0x10 - explicit Tx rule, 0x02 - hairpin ports = paired\n" >>>> " 0x01 - hairpin ports loop, 0x00 - hairpin port >>>> self\n"); >>>> + printf(" --eth-link-speed: forced link speed.\n"); >>>> } >>>> #ifdef RTE_LIB_CMDLINE >>>> @@ -485,6 +486,41 @@ parse_event_printing_config(const char = *optarg, >>>> int enable) >>>> return 0; >>>> } >>>> +static int >>>> +parse_link_speed(int n) >>>> +{ >>>> + uint32_t speed; >>>> + >>>> + switch (n) { >>>=20 >>> OK to not support "10M, 100M", not sure if anybody really uses them, = but >>> what do you think checking them and return an error? >>>=20 >>>> + case 1000: >>>> + speed =3D ETH_LINK_SPEED_1G; >>>> + break; >>>> + case 10000: >>>> + speed =3D ETH_LINK_SPEED_10G; >>>> + break; >>>> + case 25000: >>>> + speed =3D ETH_LINK_SPEED_25G; >>>> + break; >>>> + case 40000: >>>> + speed =3D ETH_LINK_SPEED_40G; >>>> + break; >>>> + case 50000: >>>> + speed =3D ETH_LINK_SPEED_50G; >>>> + break; >>>> + case 100000: >>>> + speed =3D ETH_LINK_SPEED_100G; >>>> + break; >>>> + case 200000: >>>> + speed =3D ETH_LINK_SPEED_200G; >>>> + break; >>>> + default: >>>> + speed =3D ETH_LINK_SPEED_AUTONEG; >>>> + break; >>>=20 >>> Isn't this function to set a fixed link speed, why falling back to = autoneg? >>>=20 >>> Also shouldn't this function set 'ETH_LINK_SPEED_FIXED' too? >> It should. Previous time I've tried to fix corresponding >> bug in CLI commands, it ended up with rollback because >> of Intel drivers do not handle it correctly. >> See "app/testpmd: set fixed flag for exact link speed" and >> corresponding revert. >=20 > Thanks for the reminder Andrew, you have a good memory :) > For reference: = http://inbox.dpdk.org/dev/20190507100928.pOyue5JiSaPL-NSHiueAU3HlgisgF9bYy= nJGpTjyvMw@z/ >=20 > It seems that patch reverted with the pressure of the release, what do = you think applying it again while we have enough time to fix the PMDs = before release? >=20 > =46rom previous discussions, long term actions listed as: > " > 1) Implement 'fixed' link speed support in the missing drivers. > 2) Send a new version of the testpmd patch with a "fixed" argument, so = that we > can support all three above > " >=20 > Not sure having (2) explicitly is required, we have already "auto" = speed, not having it implies the fixed speed. > So we can just re-apply your old patch. Please also see the message I sent back in November: = http://inbox.dpdk.org/dev/F041DE53-0ABF-4A0A-974A-16167967ABD5@pensando.io= / I added the FIXED flag to fix my local tree and found that it causes = intermittent failures in link_bonding_autotest. (In version 20.02, = haven=E2=80=99t tested in latest branch.) -Other Andrew