Re: [PATCH rdma-next] RDMA/mana_ib: Use ib_get_eth_speed for reporting port speed
From: Konstantin Taranov
Date: Thu May 21 2026 - 06:13:24 EST
> On Wed, May 13, 2026 at 10:15:01PM +0000, Long Li wrote:
> > > From: Shiraz Saleem <shirazsaleem@xxxxxxxxxxxxx>
> > >
> > > Replace hardcoded IB_WIDTH_4X/IB_SPEED_EDR with
> ib_get_eth_speed()
> > > to report the actual link speed in mana_ib_query_port().
> > >
> > > Fixes: 4bda1d5332ec ("RDMA/mana_ib: Implement port parameters")
> > > Signed-off-by: Shiraz Saleem <shirazsaleem@xxxxxxxxxxxxx>
> > > Signed-off-by: Konstantin Taranov <kotaranov@xxxxxxxxxxxxx>
> > > ---
> > > drivers/infiniband/hw/mana/main.c | 3 +--
> > > 1 file changed, 1 insertion(+), 2 deletions(-)
> > >
> > > diff --git a/drivers/infiniband/hw/mana/main.c
> > > b/drivers/infiniband/hw/mana/main.c
> > > index d4dfbec..9af92a4 100644
> > > --- a/drivers/infiniband/hw/mana/main.c
> > > +++ b/drivers/infiniband/hw/mana/main.c
> > > @@ -633,8 +633,7 @@ int mana_ib_query_port(struct ib_device *ibdev,
> > > u32 port,
> > > props->phys_state = IB_PORT_PHYS_STATE_DISABLED;
> > > }
> > >
> > > - props->active_width = IB_WIDTH_4X;
> > > - props->active_speed = IB_SPEED_EDR;
> > > + ib_get_eth_speed(ibdev, port, &props->active_speed,
> > > +&props->active_width);
> >
> > Should it check the return value, use default values as fallback?
>
> Should it perform the check? Maybe.
>
> Should it fall back to default values? No. A failure at this stage indicates that
> the driver is fundamentally broken. This is why many drivers do not bother
> checking the return value here.
That is my understanding as well. Leon, can it be accepted as is
or should I send a v2?
Thanks
>
> Thanks
>
> >
> > Something like:
> >
> > ret = ib_get_eth_speed(ibdev, port, &props->active_speed, &props-
> >active_width);
> > if (ret) {
> > props->active_width = IB_WIDTH_4X;
> > props->active_speed = IB_SPEED_EDR;
> > }
> >