From: Leon Romanovsky <leon@kernel.org>
To: Long Li <longli@microsoft.com>
Cc: Konstantin Taranov <kotaranov@linux.microsoft.com>,
Konstantin Taranov <kotaranov@microsoft.com>,
Shiraz Saleem <shirazsaleem@microsoft.com>,
"jgg@ziepe.ca" <jgg@ziepe.ca>,
"linux-rdma@vger.kernel.org" <linux-rdma@vger.kernel.org>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH rdma-next] RDMA/mana_ib: Use ib_get_eth_speed for reporting port speed
Date: Sun, 17 May 2026 14:07:01 +0300 [thread overview]
Message-ID: <20260517110701.GD33515@unreal> (raw)
In-Reply-To: <SA1PR21MB66831B2B066734B6228C866BCE062@SA1PR21MB6683.namprd21.prod.outlook.com>
On Wed, May 13, 2026 at 10:15:01PM +0000, Long Li wrote:
> > From: Shiraz Saleem <shirazsaleem@microsoft.com>
> >
> > 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@microsoft.com>
> > Signed-off-by: Konstantin Taranov <kotaranov@microsoft.com>
> > ---
> > 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.
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;
> }
>
next prev parent reply other threads:[~2026-05-17 11:07 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-05-12 9:40 [PATCH rdma-next] RDMA/mana_ib: Use ib_get_eth_speed for reporting port speed Konstantin Taranov
2026-05-13 22:15 ` Long Li
2026-05-17 11:07 ` Leon Romanovsky [this message]
2026-05-21 9:40 ` Konstantin Taranov
2026-05-24 20:29 ` Jason Gunthorpe
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=20260517110701.GD33515@unreal \
--to=leon@kernel.org \
--cc=jgg@ziepe.ca \
--cc=kotaranov@linux.microsoft.com \
--cc=kotaranov@microsoft.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-rdma@vger.kernel.org \
--cc=longli@microsoft.com \
--cc=shirazsaleem@microsoft.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.