DPDK patches and discussions
 help / color / mirror / Atom feed
From: Damodharam Ammepalli <damodharam.ammepalli@broadcom.com>
To: Ferruh Yigit <ferruh.yigit@amd.com>
Cc: huangdengdui <huangdengdui@huawei.com>,
	dev@dpdk.org, ajit.khaparde@broadcom.com,
	kalesh-anakkur.purayil@broadcom.com
Subject: Re: [PATCH v3] ethdev: Add link_speed lanes support
Date: Mon, 8 Jul 2024 13:35:35 -0700	[thread overview]
Message-ID: <CAKSYD4yiEfj1B9O-dtWCbqK1f_0_sUKgNx0Q-2W-GLkcwfLpAg@mail.gmail.com> (raw)
In-Reply-To: <9822cf6d-7c96-4e44-a210-88838b89b286@amd.com>

On Fri, Jul 5, 2024 at 10:33 AM Ferruh Yigit <ferruh.yigit@amd.com> wrote:
>
> On 6/26/2024 3:19 AM, huangdengdui wrote:
> >
> > On 2024/6/26 5:07, Damodharam Ammepalli wrote:
> >> On Wed, Jun 19, 2024 at 8:23 PM huangdengdui <huangdengdui@huawei.com> wrote:
> >>>
> >>> Hi Damodharam
> >>> Here are some suggestions. See below.
> >>>
> >> Thank you for the review.
> >>
> >>> On 2024/6/18 4:34, Damodharam Ammepalli wrote:
> >>>> Update the eth_dev_ops structure with new function vectors
> >>>> to get, get capabilities and set ethernet link speed lanes.
> >>>> Update the testpmd to provide required config and information
> >>>> display infrastructure.
> >>>>
> >>>> The supporting ethernet controller driver will register callbacks
> >>>> to avail link speed lanes config and get services. This lanes
> >>>> configuration is applicable only when the nic is forced to fixed
> >>>> speeds. In Autonegiation mode, the hardware automatically
> >>>> negotiates the number of lanes.
> >>>>
> >>>
> >>>
> >>>> +
> >>>>  /* *** configure txq/rxq, txd/rxd *** */
> >>>>  struct cmd_config_rx_tx {
> >>>>       cmdline_fixed_string_t port;
> >>>> @@ -13238,6 +13459,9 @@ static cmdline_parse_ctx_t builtin_ctx[] = {
> >>>>       (cmdline_parse_inst_t *)&cmd_set_port_setup_on,
> >
> > cut
> >
> >>>>
> >>>> @@ -993,7 +1022,7 @@ port_summary_display(portid_t port_id)
> >>>>       if (ret != 0)
> >>>>               return;
> >>>>
> >>>> -     printf("%-4d " RTE_ETHER_ADDR_PRT_FMT " %-12s %-14s %-8s %s\n",
> >>>> +     printf("%-4d " RTE_ETHER_ADDR_PRT_FMT " %-12s %-14s %-8s %-8s\n",
> >>>
> >>> Does the lanes need to be printed?
> >> Ferruh in the previous comment, asked not to print.
> >>
> >
> > OK
> >
> >>>
> >>>>               port_id, RTE_ETHER_ADDR_BYTES(&mac_addr), name,
> >>>>               dev_info.driver_name, (link.link_status) ? ("up") : ("down"),
> >>>>               rte_eth_link_speed_to_str(link.link_speed));
> >>>> @@ -7244,3 +7273,35 @@ show_mcast_macs(portid_t port_id)
> >>>>               printf("  %s\n", buf);
> >>>>       }
> >>>>  }
> >>>> +
> >>>> +int
> >>>> +parse_speed_lanes(uint32_t lane, uint32_t *speed_lane)
> >>>> +{
> >>>> +     uint8_t i;
> >>>> +
> >>>> +     for (i = 0; i < RTE_DIM(speed_lane_name); i++) {
> >>>> +             if (speed_lane_name[i].value == lane) {
> >>>> +                     *speed_lane = lane;
> >>>> +                     return 0;
> >>>> +             }
> >>>> +     }
> >>>> +     return -1;
> >>>> +}
> >>>> +
> >
> > cut
> >
> >>>>
> >>>> +/**
> >>>> + * This enum indicates the possible link speed lanes of an ethdev port.
> >>>> + */
> >>>> +enum rte_eth_speed_lanes {
> >>>> +     RTE_ETH_SPEED_LANE_NOLANE = 0,  /**< speed lanes unsupported mode or default */
> >>>> +     RTE_ETH_SPEED_LANE_1,           /**< Link speed lane  1 */
> >>>> +     RTE_ETH_SPEED_LANE_2,           /**< Link speed lanes 2 */
> >>>> +     RTE_ETH_SPEED_LANE_4,           /**< Link speed lanes 4 */
> >>>> +     RTE_ETH_SPEED_LANE_8,           /**< Link speed lanes 8 */
> >>>> +     RTE_ETH_SPEED_LANE_MAX,
> >>>> +};
> >>>
> >>> Is it better to make the index equal to the lanes num?
> >>> enum rte_eth_speed_lanes {
> >>>         RTE_ETH_SPEED_LANE_NOLANE = 0,      /**< speed lanes unsupported mode or default */
> >>>         RTE_ETH_SPEED_LANE_1 = 1,           /**< Link speed lane  1 */
> >>>         RTE_ETH_SPEED_LANE_2 = 2,           /**< Link speed lanes 2 */
> >>>         RTE_ETH_SPEED_LANE_4 = 4,           /**< Link speed lanes 4 */
> >>>         RTE_ETH_SPEED_LANE_8 = 8,           /**< Link speed lanes 8 */
> >>>         RTE_ETH_SPEED_LANE_MAX,
> >>> };
> >>>
> >> I followed the existing enums code convention in rtelib. Your point
> >> makes sense too.
> >>
> >
> > I looked at the other enum code in the lib. There are many similar code styles.
> > Make the index meaningful to avoid conversion. For example, the parse_speed_lanes() function in this patch
> >
> >>> In addition, when lanes = 0, is it better to define it as Unknown?
> >>> If default lanes can return 0 lanes, The active lanes are different for each NIC,
> >>> users may be confused.
> >>>
> >> Ack. Are you proposing a new enum RTE_ETH_SPEED_LANE_UKNOWN or rename
> >> RTE_ETH_SPEED_LANE_NOLANE?
> >>
> >
> > I suggest changing the name to RTE_ETH_SPEED_LANE_UKNOWN,
> > Also change the comment to describe it as an unknown lane.
> >
> > This prevents the driver from always returning lanes=0
> > even if the driver knows the number of active lanes.
> >
> >>>> +
> >>>> +/* Translate from link speed lanes to speed lanes capa */
> >>>> +#define RTE_ETH_SPEED_LANES_TO_CAPA(x) RTE_BIT32(x)
> >>>> +
> >>>> +/* This macro indicates link speed lanes capa mask */
> >>>> +#define RTE_ETH_SPEED_LANES_CAPA_MASK(x) RTE_BIT32(RTE_ETH_SPEED_ ## x)
> >>>> +
> >>>> +/* A structure used to get and set lanes capabilities per link speed */
> >>>> +struct rte_eth_speed_lanes_capa {
> >>>> +     uint32_t speed;
> >>>> +     uint32_t capa;
> >>>> +};
> >>>> +
> >
> > cut
> >
> >>>> +__rte_experimental
> >>>> +int rte_eth_speed_lanes_set(uint16_t port_id, uint32_t speed_lanes_capa);
> >>>> +
> >>>
> >>> Is it better to name 'speed_lanes'?
> >> Are you proposing to rename to rte_speed_lanes_set() function name or
> >> rename variable "speed_lanes_capa" name ?
> >>
> >
> > rename variable "speed_lanes_capa" name
> >
>
> Hi Damodharam,
>
> I was hoping to get this feature for -rc2, as outstanding comments are
> not very big, if it can be possible to get new version in next few days
> we can proceed with it for this release, otherwise can wait for next
> release.
>
> Btw, other issue is testing this new feature, as it is not supported by
> many vendors, I expect this test case not included in many test plans.
> And because of the HW dependency adding unit test won't be sufficient.
> At least for the short term, can we rely Broadcom and Huawei to test it
> with the first version this feature is merged?
>
> And I am not sure about what can be the long term solution, any
> suggestion is welcome. My concern is as number of this kind of features
> are increasing, dpdk is becoming more fragile.
>
>
>
Hi Ferruh,
Yes, I will push a new patch with review comments addressed in a day.
Sure, Broadcom will test it and provide the feedback. Infact, I am unit testing
internally with the brcm driver for every revision of the patch that is pushed.

Thanks
Damo

-- 
This electronic communication and the information and any files transmitted 
with it, or attached to it, are confidential and are intended solely for 
the use of the individual or entity to whom it is addressed and may contain 
information that is confidential, legally privileged, protected by privacy 
laws, or otherwise restricted from disclosure to anyone else. If you are 
not the intended recipient or the person responsible for delivering the 
e-mail to the intended recipient, you are hereby notified that any use, 
copying, distributing, dissemination, forwarding, printing, or copying of 
this e-mail is strictly prohibited. If you received this e-mail in error, 
please return the e-mail to the sender, delete it from your computer, and 
destroy any printed copy of it.

  reply	other threads:[~2024-07-08 20:35 UTC|newest]

Thread overview: 33+ 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-20  3:23               ` huangdengdui
2024-06-25 21:07                 ` Damodharam Ammepalli
2024-06-26  2:19                   ` huangdengdui
2024-07-05 17:33                     ` Ferruh Yigit
2024-07-08 20:35                       ` Damodharam Ammepalli [this message]
2024-07-08 23:22                         ` [PATCH v4] " Damodharam Ammepalli
2024-07-08 23:34                           ` Ajit Khaparde
2024-07-09 11:10                           ` Ferruh Yigit
2024-07-09 21:20                             ` Damodharam Ammepalli
2024-07-10  9:05                               ` Ferruh Yigit
2024-09-04  2:43                                 ` Damodharam Ammepalli
2024-07-05 17:35               ` [PATCH v3] " Ferruh Yigit
2024-07-08 20:31                 ` 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
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=CAKSYD4yiEfj1B9O-dtWCbqK1f_0_sUKgNx0Q-2W-GLkcwfLpAg@mail.gmail.com \
    --to=damodharam.ammepalli@broadcom.com \
    --cc=ajit.khaparde@broadcom.com \
    --cc=dev@dpdk.org \
    --cc=ferruh.yigit@amd.com \
    --cc=huangdengdui@huawei.com \
    --cc=kalesh-anakkur.purayil@broadcom.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).