Re: [PATCH for-next v2] IB/core: Add more speed parsing in ib_get_width_and_speed()

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Thu, Aug 3, 2023 at 11:28 PM Leon Romanovsky <leon@xxxxxxxxxx> wrote:
>
> On Wed, Aug 02, 2023 at 02:00:23AM -0700, Selvin Xavier wrote:
> > From: Kalesh AP <kalesh-anakkur.purayil@xxxxxxxxxxxx>
> >
> > When the Ethernet driver does not provide the number of lanes
> > in the __ethtool_get_link_ksettings() response, the function
> > ib_get_width_and_speed() does not take consideration of 50G,
> > 100G and 200G speeds while calculating the IB width and speed.
> > Update the width and speed for the above netdev speeds.
> >
> > Signed-off-by: Kalesh AP <kalesh-anakkur.purayil@xxxxxxxxxxxx>
> > Signed-off-by: Selvin Xavier <selvin.xavier@xxxxxxxxxxxx>
> > ---
> > v1 - v2:
> >     - Rebased the patch based on the latest changes in ib_get_width_and_speed
> >     - removed the switch case and use the existing else if check
> > ---
> >  drivers/infiniband/core/verbs.c | 11 ++++++++++-
> >  1 file changed, 10 insertions(+), 1 deletion(-)
> >
> > diff --git a/drivers/infiniband/core/verbs.c b/drivers/infiniband/core/verbs.c
> > index 25367bd..41ff559 100644
> > --- a/drivers/infiniband/core/verbs.c
> > +++ b/drivers/infiniband/core/verbs.c
> > @@ -1899,9 +1899,18 @@ static void ib_get_width_and_speed(u32 netdev_speed, u32 lanes,
> >               } else if (netdev_speed <= SPEED_40000) {
> >                       *width = IB_WIDTH_4X;
> >                       *speed = IB_SPEED_FDR10;
> > -             } else {
> > +             } else if (netdev_speed <= SPEED_50000) {
> > +                     *width = IB_WIDTH_2X;
> > +                     *speed = IB_SPEED_EDR;
> > +             } else if (netdev_speed <= SPEED_100000) {
> >                       *width = IB_WIDTH_4X;
> >                       *speed = IB_SPEED_EDR;
> > +             } else if (netdev_speed <= SPEED_200000) {
> > +                     *width = IB_WIDTH_4X;
> > +                     *speed = IB_SPEED_HDR;
>
>
> SPEED_50000, SPEED_100000 and SPEED_200000 depends on
> ClassPortInfo:CapabilityMask2.is* values.
>
> For example, SPEED_50000 can b IB_WIDTH_2X/IB_SPEED_EDR and IB_WIDTH_1X/IB_SPEED_HDR.
Agree with that.
This reporting can be achieved by the existing code, but the L2 driver
needs to report non zero values for lanes in
ethtool_ops->get_link_ksettings.
Caller of this modified function gets the speed and number of lanes
from ethtool_ops->get_link_ksettings.

In this patch we are trying to handle the case where ethtool ops
doesn't provide the lanes.  We can  default to some value so that we
dont report wrong total link speed (width * speed) for any speed more
than 40G.
>
> Thanks
>
> > +             } else {
> > +                     *width = IB_WIDTH_4X;
> > +                     *speed = IB_SPEED_NDR;
> >               }
> >
> >               return;
> > --
> > 2.5.5
> >
>
>

Attachment: smime.p7s
Description: S/MIME Cryptographic Signature


[Index of Archives]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Photo]     [Yosemite News]     [Yosemite Photos]     [Linux Kernel]     [Linux SCSI]     [XFree86]

  Powered by Linux