public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Leon Romanovsky <leonro@mellanox.com>
To: Thomas Bogendoerfer <tbogendoerfer@suse.de>
Cc: Matan Barak <matanb@mellanox.com>,
	Doug Ledford <dledford@redhat.com>,
	linux-rdma@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] IB/mlx5: give back valid speed/width even without plugged in SFP module
Date: Fri, 27 Oct 2017 22:35:06 +0300	[thread overview]
Message-ID: <20171027193506.GH16127@mtr-leonro.local> (raw)
In-Reply-To: <20171027123011.10454-1-tbogendoerfer@suse.de>

[-- Attachment #1: Type: text/plain, Size: 1582 bytes --]

On Fri, Oct 27, 2017 at 02:30:11PM +0200, Thomas Bogendoerfer wrote:
> If there is no SFP module plugged into a port of mlx5 cards
> 'cat /sys/class/infniband/mlx5_X/ports/1/rate' returns Invalid argument.
> This causes tools like 'ibstat' to malfunction. This change adjusts mlx5
> to all other RoCE/iWarp drivers, which always return valid speed/width.

Like Parav, I have mixed feelings about such change. It returns EINVAL
if nothing is connected and it is right thing to do. It is hard to call
"valid speed/width" for unconnected port.

I would like to have ibstat and other drivers fixed instead of
converting mlx5 to be wrong.

Proposed change breaks existing scripts.

Thanks

>
> Signed-off-by: Thomas Bogendoerfer <tbogendoerfer@suse.de>
> ---
>  drivers/infiniband/hw/mlx5/main.c | 5 ++++-
>  1 file changed, 4 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/infiniband/hw/mlx5/main.c b/drivers/infiniband/hw/mlx5/main.c
> index 260f8be1d0ed..4388618e3434 100644
> --- a/drivers/infiniband/hw/mlx5/main.c
> +++ b/drivers/infiniband/hw/mlx5/main.c
> @@ -246,7 +246,10 @@ static int translate_eth_proto_oper(u32 eth_proto_oper, u8 *active_speed,
>  		*active_speed = IB_SPEED_EDR;
>  		break;
>  	default:
> -		return -EINVAL;
> +		/* Unknown */
> +		*active_width = IB_WIDTH_1X;
> +		*active_speed = IB_SPEED_SDR;
> +		break;
>  	}
>
>  	return 0;
> --
> 2.12.3
>
> --
> To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

  parent reply	other threads:[~2017-10-27 19:35 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-10-27 12:30 [PATCH] IB/mlx5: give back valid speed/width even without plugged in SFP module Thomas Bogendoerfer
2017-10-27 18:32 ` Parav Pandit
2017-10-27 20:18   ` Hal Rosenstock
2017-10-27 20:33     ` Parav Pandit
2017-10-27 21:30       ` Hal Rosenstock
2017-10-27 19:35 ` Leon Romanovsky [this message]
  -- strict thread matches above, loose matches on Subject: below --
2017-10-27 20:35 Ghazale Hosseinabadi
2017-10-27 21:54 Ghazale Hosseinabadi
2017-10-27 22:52 ` Hal Rosenstock
2017-10-27 23:04   ` Ghazale Hosseinabadi
2017-10-27 23:19     ` Hal Rosenstock
2017-10-28  0:17       ` Hal Rosenstock
2017-10-28  0:29         ` Ghazale Hosseinabadi
2017-10-28  0:36       ` Ghazale Hosseinabadi
2017-10-28 10:42       ` Thomas Bogendoerfer
2017-10-28 11:59         ` Hal Rosenstock

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=20171027193506.GH16127@mtr-leonro.local \
    --to=leonro@mellanox.com \
    --cc=dledford@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-rdma@vger.kernel.org \
    --cc=matanb@mellanox.com \
    --cc=tbogendoerfer@suse.de \
    /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