DPDK patches and discussions
 help / color / mirror / Atom feed
From: Ferruh Yigit <ferruh.yigit@amd.com>
To: Damodharam Ammepalli <damodharam.ammepalli@broadcom.com>
Cc: dev@dpdk.org, Dengdui Huang <huangdengdui@huawei.com>,
	fengchengwen@huawei.com
Subject: Re: [PATCH v2 4/4] testpmd: add support for displaying lanes capability
Date: Wed, 12 Jun 2024 21:57:00 +0100	[thread overview]
Message-ID: <b83ab1b2-6105-4f2c-b34e-7c1add26d328@amd.com> (raw)
In-Reply-To: <CAKSYD4zPoZ_bHO8cqns_JJzUbeW6yn1hi68aoGiefx07N1LTxw@mail.gmail.com>

On 6/12/2024 6:53 PM, Damodharam Ammepalli wrote:
> On Tue, Jun 11, 2024 at 4:39 PM Ferruh Yigit <ferruh.yigit@amd.com> wrote:
>>
>> On 6/2/2024 3:45 AM, Damodharam Ammepalli wrote:
>>> Add a new api support that displays the speeds and bitmap of
>>> supported lanes configuration by the ethernet controller.
>>> This patch adds support in the testpmd cli chain.
>>>
>>> Signed-off-by: Damodharam Ammepalli <damodharam.ammepalli@broadcom.com>
>>> ---
>>>  app/test-pmd/cmdline.c | 128 +++++++++++++++++++++++++++++++++++++++++
>>>  1 file changed, 128 insertions(+)
>>>
>>> diff --git a/app/test-pmd/cmdline.c b/app/test-pmd/cmdline.c
>>> index 785e5dd4de..8b0a85f632 100644
>>> --- a/app/test-pmd/cmdline.c
>>> +++ b/app/test-pmd/cmdline.c
>>> @@ -1637,6 +1637,133 @@ static cmdline_parse_inst_t cmd_config_loopback_all = {
>>>       },
>>>  };
>>>
>>> +/* *** display speed lanes per port capabilities *** */
>>> +struct cmd_show_speed_lanes_result {
>>> +     cmdline_fixed_string_t cmd_show;
>>> +     cmdline_fixed_string_t cmd_port;
>>> +     cmdline_fixed_string_t cmd_keyword;
>>> +     portid_t cmd_pid;
>>> +};
>>> +
>>> +static const char*
>>> +get_device_infos_display_speeds(uint32_t speed_capa)
>>> +{
>>> +        if (speed_capa & RTE_ETH_LINK_SPEED_10M_HD)
>>> +                return(" 10 Mbps half-duplex  ");
>>> +        if (speed_capa & RTE_ETH_LINK_SPEED_10M)
>>> +                return(" 10 Mbps full-duplex  ");
>>> +        if (speed_capa & RTE_ETH_LINK_SPEED_100M_HD)
>>> +                return(" 100 Mbps half-duplex  ");
>>> +        if (speed_capa & RTE_ETH_LINK_SPEED_100M)
>>> +                return(" 100 Mbps full-duplex  ");
>>> +        if (speed_capa & RTE_ETH_LINK_SPEED_1G)
>>> +                return(" 1 Gbps  ");
>>> +        if (speed_capa & RTE_ETH_LINK_SPEED_2_5G)
>>> +                return(" 2.5 Gbps  ");
>>> +        if (speed_capa & RTE_ETH_LINK_SPEED_5G)
>>> +                return(" 5 Gbps  ");
>>> +        if (speed_capa & RTE_ETH_LINK_SPEED_10G)
>>> +                return(" 10 Gbps  ");
>>> +        if (speed_capa & RTE_ETH_LINK_SPEED_20G)
>>> +                return(" 20 Gbps  ");
>>> +        if (speed_capa & RTE_ETH_LINK_SPEED_25G)
>>> +                return(" 25 Gbps  ");
>>> +        if (speed_capa & RTE_ETH_LINK_SPEED_40G)
>>> +                return(" 40 Gbps  ");
>>> +        if (speed_capa & RTE_ETH_LINK_SPEED_50G)
>>> +                return(" 50 Gbps  ");
>>> +        if (speed_capa & RTE_ETH_LINK_SPEED_56G)
>>> +                return(" 56 Gbps  ");
>>> +        if (speed_capa & RTE_ETH_LINK_SPEED_100G)
>>> +                return(" 100 Gbps  ");
>>> +        if (speed_capa & RTE_ETH_LINK_SPEED_200G)
>>> +                return(" 200 Gbps  ");
>>> +        if (speed_capa & RTE_ETH_LINK_SPEED_400G)
>>> +                return(" 400 Gbps  ");
>>> +
>>> +     return("Unkown");
>>> +}
>>>
>>
>> As far as I remember, there was already a function to convert speed to
>> string, can you please double check?
>>
> 
> Yes. I picked up from this. app/test-pmd/config.c:device_infos_display_speeds()
> Can I make this function
> app/test-pmd/config.c:device_infos_display_speeds() a non-static and
> declare it in testpmd.h?
> 

If we can reduce duplication, I think it make sense. Thanks.


  reply	other threads:[~2024-06-12 20:57 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-03-22 22:25 [RFC 0/2] Add support for link speed lanes Damodharam Ammepalli
2024-03-22 22:25 ` [RFC 1/2] lib/ethdev: Add link_speed lanes support into rte lib Damodharam Ammepalli
2024-03-22 22:25 ` [RFC 2/2] testpmd: Add speed lanes to testpmd config and show command Damodharam Ammepalli
2024-05-22 20:59 ` [RFC 0/2] Add support for link speed lanes Ferruh Yigit
2024-05-28 21:19   ` Damodharam Ammepalli
2024-06-02  2:45     ` [PATCH v2 0/4] " Damodharam Ammepalli
2024-06-02  2:45       ` [PATCH v2 1/4] lib/ethdev: Add link_speed lanes support into rte lib Damodharam Ammepalli
2024-06-11 23:39         ` Ferruh Yigit
2024-06-14 18:27           ` Damodharam Ammepalli
2024-06-17 20:34             ` [PATCH v3] ethdev: Add link_speed lanes support Damodharam Ammepalli
2024-06-02  2:45       ` [PATCH v2 2/4] testpmd: Add speed lanes to testpmd config and show command Damodharam Ammepalli
2024-06-11 23:39         ` Ferruh Yigit
2024-06-02  2:45       ` [PATCH v2 3/4] lib/ethdev: add support for displaying lanes capability Damodharam Ammepalli
2024-06-11 23:39         ` Ferruh Yigit
2024-06-02  2:45       ` [PATCH v2 4/4] testpmd: " Damodharam Ammepalli
2024-06-11 23:39         ` Ferruh Yigit
2024-06-12 17:53           ` Damodharam Ammepalli
2024-06-12 20:57             ` Ferruh Yigit [this message]
2024-06-11 23:38       ` [PATCH v2 0/4] Add support for link speed lanes Ferruh Yigit
2024-06-12 17:46         ` Damodharam Ammepalli

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=b83ab1b2-6105-4f2c-b34e-7c1add26d328@amd.com \
    --to=ferruh.yigit@amd.com \
    --cc=damodharam.ammepalli@broadcom.com \
    --cc=dev@dpdk.org \
    --cc=fengchengwen@huawei.com \
    --cc=huangdengdui@huawei.com \
    /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).