* [PATCH rdma-core] libibumad/umad.c: In get_port, ignore sysfs rate file errors
@ 2017-10-31 12:14 Hal Rosenstock
[not found] ` <f4ae658c-0e2a-c264-e0b6-f1ed639237eb-LDSdmyG8hGV8YrgS2mwiifqBs+8SCbDb@public.gmane.org>
0 siblings, 1 reply; 4+ messages in thread
From: Hal Rosenstock @ 2017-10-31 12:14 UTC (permalink / raw)
To: linux-rdma-u79uwXL29TY76Z2rM5mHXA; +Cc: Ghazale Hosseinabadi
This can cause ibpanic in ibstat when width is not set properly
as can occur when QSPF is not plugged into port.
ibpanic: [7851] main: stat of IB device 'mlx5_1' failed: Invalid argument
It's caused by kernel sysfs.c:show_rate returning -EINVAL
and that error being treated as failure in umad.c:get_port.
With this change, Rate is displayed as 0 with ibstat for this scenario.
Signed-off-by: Hal Rosenstock <hal-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>
---
libibumad/umad.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/libibumad/umad.c b/libibumad/umad.c
index 535256e..dcb2c68 100644
--- a/libibumad/umad.c
+++ b/libibumad/umad.c
@@ -150,8 +150,7 @@ static int get_port(const char *ca_name, const char *dir, int portnum, umad_port
goto clean;
if (sys_read_uint(port_dir, SYS_PORT_PHY_STATE, &port->phys_state) < 0)
goto clean;
- if (sys_read_uint(port_dir, SYS_PORT_RATE, &port->rate) < 0)
- goto clean;
+ sys_read_uint(port_dir, SYS_PORT_RATE, &port->rate);
if (sys_read_uint(port_dir, SYS_PORT_CAPMASK, &capmask) < 0)
goto clean;
--
2.8.4
--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply related [flat|nested] 4+ messages in thread
* RE: [PATCH rdma-core] libibumad/umad.c: In get_port, ignore sysfs rate file errors
[not found] ` <f4ae658c-0e2a-c264-e0b6-f1ed639237eb-LDSdmyG8hGV8YrgS2mwiifqBs+8SCbDb@public.gmane.org>
@ 2017-10-31 13:59 ` Parav Pandit
2017-10-31 17:21 ` Leon Romanovsky
2017-10-31 18:09 ` Ghazale Hosseinabadi
2 siblings, 0 replies; 4+ messages in thread
From: Parav Pandit @ 2017-10-31 13:59 UTC (permalink / raw)
To: Hal Rosenstock, linux-rdma-u79uwXL29TY76Z2rM5mHXA; +Cc: Ghazale Hosseinabadi
> -----Original Message-----
> From: linux-rdma-owner@vger.kernel.org [mailto:linux-rdma-
> owner@vger.kernel.org] On Behalf Of Hal Rosenstock
> Sent: Tuesday, October 31, 2017 7:15 AM
> To: linux-rdma@vger.kernel.org
> Cc: Ghazale Hosseinabadi <ghazale.hosseinabadi@oracle.com>
> Subject: [PATCH rdma-core] libibumad/umad.c: In get_port, ignore sysfs rate file
> errors
>
>
> This can cause ibpanic in ibstat when width is not set properly as can occur when
> QSPF is not plugged into port.
>
> ibpanic: [7851] main: stat of IB device 'mlx5_1' failed: Invalid argument
>
> It's caused by kernel sysfs.c:show_rate returning -EINVAL and that error being
> treated as failure in umad.c:get_port.
> With this change, Rate is displayed as 0 with ibstat for this scenario.
>
> Signed-off-by: Hal Rosenstock <hal@mellanox.com>
> ---
> libibumad/umad.c | 3 +--
> 1 file changed, 1 insertion(+), 2 deletions(-)
>
> diff --git a/libibumad/umad.c b/libibumad/umad.c index 535256e..dcb2c68
> 100644
> --- a/libibumad/umad.c
> +++ b/libibumad/umad.c
> @@ -150,8 +150,7 @@ static int get_port(const char *ca_name, const char
> *dir, int portnum, umad_port
> goto clean;
> if (sys_read_uint(port_dir, SYS_PORT_PHY_STATE, &port->phys_state) <
> 0)
> goto clean;
> - if (sys_read_uint(port_dir, SYS_PORT_RATE, &port->rate) < 0)
> - goto clean;
> + sys_read_uint(port_dir, SYS_PORT_RATE, &port->rate);
> if (sys_read_uint(port_dir, SYS_PORT_CAPMASK, &capmask) < 0)
> goto clean;
>
Looks good to me.
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH rdma-core] libibumad/umad.c: In get_port, ignore sysfs rate file errors
[not found] ` <f4ae658c-0e2a-c264-e0b6-f1ed639237eb-LDSdmyG8hGV8YrgS2mwiifqBs+8SCbDb@public.gmane.org>
2017-10-31 13:59 ` Parav Pandit
@ 2017-10-31 17:21 ` Leon Romanovsky
2017-10-31 18:09 ` Ghazale Hosseinabadi
2 siblings, 0 replies; 4+ messages in thread
From: Leon Romanovsky @ 2017-10-31 17:21 UTC (permalink / raw)
To: Hal Rosenstock; +Cc: linux-rdma-u79uwXL29TY76Z2rM5mHXA, Ghazale Hosseinabadi
[-- Attachment #1: Type: text/plain, Size: 643 bytes --]
On Tue, Oct 31, 2017 at 08:14:58AM -0400, Hal Rosenstock wrote:
>
> This can cause ibpanic in ibstat when width is not set properly
> as can occur when QSPF is not plugged into port.
>
> ibpanic: [7851] main: stat of IB device 'mlx5_1' failed: Invalid argument
>
> It's caused by kernel sysfs.c:show_rate returning -EINVAL
> and that error being treated as failure in umad.c:get_port.
> With this change, Rate is displayed as 0 with ibstat for this scenario.
>
> Signed-off-by: Hal Rosenstock <hal-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>
> ---
> libibumad/umad.c | 3 +--
> 1 file changed, 1 insertion(+), 2 deletions(-)
>
Thanks, applied.
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH rdma-core] libibumad/umad.c: In get_port, ignore sysfs rate file errors
[not found] ` <f4ae658c-0e2a-c264-e0b6-f1ed639237eb-LDSdmyG8hGV8YrgS2mwiifqBs+8SCbDb@public.gmane.org>
2017-10-31 13:59 ` Parav Pandit
2017-10-31 17:21 ` Leon Romanovsky
@ 2017-10-31 18:09 ` Ghazale Hosseinabadi
2 siblings, 0 replies; 4+ messages in thread
From: Ghazale Hosseinabadi @ 2017-10-31 18:09 UTC (permalink / raw)
To: Hal Rosenstock, linux-rdma-u79uwXL29TY76Z2rM5mHXA
On 10/31/2017 05:14 AM, Hal Rosenstock wrote:
> This can cause ibpanic in ibstat when width is not set properly
> as can occur when QSPF is not plugged into port.
>
> ibpanic: [7851] main: stat of IB device 'mlx5_1' failed: Invalid argument
>
> It's caused by kernel sysfs.c:show_rate returning -EINVAL
> and that error being treated as failure in umad.c:get_port.
> With this change, Rate is displayed as 0 with ibstat for this scenario.
>
> Signed-off-by: Hal Rosenstock <hal-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>
Tested by: Ghazale Hosseinabadi <ghazale.hosseinabadi-QHcLZuEGTsvQT0dZR+AlfA@public.gmane.org>
> ---
> libibumad/umad.c | 3 +--
> 1 file changed, 1 insertion(+), 2 deletions(-)
>
> diff --git a/libibumad/umad.c b/libibumad/umad.c
> index 535256e..dcb2c68 100644
> --- a/libibumad/umad.c
> +++ b/libibumad/umad.c
> @@ -150,8 +150,7 @@ static int get_port(const char *ca_name, const char *dir, int portnum, umad_port
> goto clean;
> if (sys_read_uint(port_dir, SYS_PORT_PHY_STATE, &port->phys_state) < 0)
> goto clean;
> - if (sys_read_uint(port_dir, SYS_PORT_RATE, &port->rate) < 0)
> - goto clean;
> + sys_read_uint(port_dir, SYS_PORT_RATE, &port->rate);
> if (sys_read_uint(port_dir, SYS_PORT_CAPMASK, &capmask) < 0)
> goto clean;
>
--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2017-10-31 18:09 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-10-31 12:14 [PATCH rdma-core] libibumad/umad.c: In get_port, ignore sysfs rate file errors Hal Rosenstock
[not found] ` <f4ae658c-0e2a-c264-e0b6-f1ed639237eb-LDSdmyG8hGV8YrgS2mwiifqBs+8SCbDb@public.gmane.org>
2017-10-31 13:59 ` Parav Pandit
2017-10-31 17:21 ` Leon Romanovsky
2017-10-31 18:09 ` Ghazale Hosseinabadi
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.