DPDK patches and discussions
 help / color / mirror / Atom feed
From: Ferruh Yigit <ferruh.yigit@intel.com>
To: Andrew Rybchenko <andrew.rybchenko@oktetlabs.ru>,
	Ajit Khaparde <ajit.khaparde@broadcom.com>,
	dev@dpdk.org
Cc: Qi Zhang <qi.z.zhang@intel.com>, Thomas Monjalon <thomas@monjalon.net>
Subject: Re: [dpdk-dev] [PATCH] app/testpmd: add support for forced ethernet speed
Date: Fri, 26 Feb 2021 11:21:47 +0000	[thread overview]
Message-ID: <1dbfb659-4f91-90fe-0e0c-23d49d53f03b@intel.com> (raw)
In-Reply-To: <b668982f-d778-ca8f-3f5d-f4ab9970245d@oktetlabs.ru>

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.
>>>
>>> The patch assumes full duplex setting and does not attempt to change
>>> that.
>>> So speeds like 10M, 100M are not configurable using this method.
>>>
>>> The command line to configure a forced speed of 10G:
>>> dpdk-testpmd -c 0xff  -- -i  --eth-link-speed  10000
>>>
>>> The command line to configure a forced speed of 50G:
>>> dpdk-testpmd -c 0xff  -- -i  --eth-link-speed  50000
>>>
>>> Signed-off-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
>>> ---
>>>    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(+)
>>
>> Can you also update the release notes to document the new parameter?
>>
>>>
>>> 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=0xXX: 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) {
>>
>> OK to not support "10M, 100M", not sure if anybody really uses them, but
>> what do you think checking them and return an error?
>>
>>> +    case 1000:
>>> +        speed = ETH_LINK_SPEED_1G;
>>> +        break;
>>> +    case 10000:
>>> +        speed = ETH_LINK_SPEED_10G;
>>> +        break;
>>> +    case 25000:
>>> +        speed = ETH_LINK_SPEED_25G;
>>> +        break;
>>> +    case 40000:
>>> +        speed = ETH_LINK_SPEED_40G;
>>> +        break;
>>> +    case 50000:
>>> +        speed = ETH_LINK_SPEED_50G;
>>> +        break;
>>> +    case 100000:
>>> +        speed = ETH_LINK_SPEED_100G;
>>> +        break;
>>> +    case 200000:
>>> +        speed = ETH_LINK_SPEED_200G;
>>> +        break;
>>> +    default:
>>> +        speed = ETH_LINK_SPEED_AUTONEG;
>>> +        break;
>>
>> Isn't this function to set a fixed link speed, why falling back to autoneg?
>>
>> 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.
> 

Thanks for the reminder Andrew, you have a good memory :)
For reference: 
http://inbox.dpdk.org/dev/20190507100928.pOyue5JiSaPL-NSHiueAU3HlgisgF9bYynJGpTjyvMw@z/

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?

 From 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
"

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.

  reply	other threads:[~2021-02-26 11:21 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-02-22 19:18 Ajit Khaparde
2021-02-25 18:25 ` Ferruh Yigit
2021-02-26  6:43   ` Andrew Rybchenko
2021-02-26 11:21     ` Ferruh Yigit [this message]
2021-02-26 16:18       ` Andrew Boyer
2021-03-01 12:20         ` Ferruh Yigit
2021-03-01  4:47       ` Ajit Khaparde
2021-03-12  8:45       ` Ferruh Yigit
2021-03-05  4:15   ` Ajit Khaparde
2021-03-05  4:17     ` [dpdk-dev] [PATCH v2] " Ajit Khaparde
2021-03-05 16:53       ` Ferruh Yigit
2021-03-05 19:42         ` [dpdk-dev] [PATCH v3] " Ajit Khaparde
2021-03-08 11:03           ` Ferruh Yigit
2021-02-25 18:33 ` [dpdk-dev] [PATCH] " Andrew Boyer

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1dbfb659-4f91-90fe-0e0c-23d49d53f03b@intel.com \
    --to=ferruh.yigit@intel.com \
    --cc=ajit.khaparde@broadcom.com \
    --cc=andrew.rybchenko@oktetlabs.ru \
    --cc=dev@dpdk.org \
    --cc=qi.z.zhang@intel.com \
    --cc=thomas@monjalon.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).