From: Leon Romanovsky <leon@kernel.org>
To: Selvin Xavier <selvin.xavier@broadcom.com>
Cc: jgg@ziepe.ca, linux-rdma@vger.kernel.org,
andrew.gospodarek@broadcom.com,
Kalesh AP <kalesh-anakkur.purayil@broadcom.com>
Subject: Re: [PATCH for-next v2] IB/core: Add more speed parsing in ib_get_width_and_speed()
Date: Thu, 3 Aug 2023 20:58:42 +0300 [thread overview]
Message-ID: <20230803175842.GF53714@unreal> (raw)
In-Reply-To: <1690966823-8159-1-git-send-email-selvin.xavier@broadcom.com>
On Wed, Aug 02, 2023 at 02:00:23AM -0700, Selvin Xavier wrote:
> From: Kalesh AP <kalesh-anakkur.purayil@broadcom.com>
>
> 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@broadcom.com>
> Signed-off-by: Selvin Xavier <selvin.xavier@broadcom.com>
> ---
> 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.
Thanks
> + } else {
> + *width = IB_WIDTH_4X;
> + *speed = IB_SPEED_NDR;
> }
>
> return;
> --
> 2.5.5
>
next prev parent reply other threads:[~2023-08-03 17:58 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-08-02 9:00 [PATCH for-next v2] IB/core: Add more speed parsing in ib_get_width_and_speed() Selvin Xavier
2023-08-03 17:58 ` Leon Romanovsky [this message]
2023-08-04 4:13 ` Selvin Xavier
2023-08-07 13:52 ` Leon Romanovsky
2023-08-09 8:54 ` Selvin Xavier
2023-08-09 9:06 ` Leon Romanovsky
2023-08-09 18:11 ` Jason Gunthorpe
2023-08-13 8:01 ` Leon Romanovsky
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=20230803175842.GF53714@unreal \
--to=leon@kernel.org \
--cc=andrew.gospodarek@broadcom.com \
--cc=jgg@ziepe.ca \
--cc=kalesh-anakkur.purayil@broadcom.com \
--cc=linux-rdma@vger.kernel.org \
--cc=selvin.xavier@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 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.