All of lore.kernel.org
 help / color / mirror / Atom feed
* [RFC for-rc] IB/mlx4: Fix the fix for reading flow-counters
@ 2022-01-11 16:35 Håkon Bugge
  2022-01-11 16:38 ` Haakon Bugge
  0 siblings, 1 reply; 4+ messages in thread
From: Håkon Bugge @ 2022-01-11 16:35 UTC (permalink / raw)
  To: Jason Gunthorpe, Yishai Hadas, Or Gerlitz; +Cc: linux-rdma, linux-kernel

It is not logical to call iboe_process_mad() when the link-layer is
Infiniband. Nevertheless, the commit message in commit 43bfb9729ea8
("IB/mlx4: Fix use of flow-counters for process_mad") explicitly state
that iboe_process_mad() shall be called.

Without this fix, reading:

yields "Invalid argument", whereas with this commit, said counter can
be read.

Please note that mlx4_1 is a VF.

Fixes: 43bfb9729ea8 ("IB/mlx4: Fix use of flow-counters for process_mad")
Signed-off-by: Håkon Bugge <haakon.bugge@oracle.com>
---
 drivers/infiniband/hw/mlx4/mad.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/infiniband/hw/mlx4/mad.c b/drivers/infiniband/hw/mlx4/mad.c
index d13ecbd..cc83782 100644
--- a/drivers/infiniband/hw/mlx4/mad.c
+++ b/drivers/infiniband/hw/mlx4/mad.c
@@ -998,8 +998,8 @@ int mlx4_ib_process_mad(struct ib_device *ibdev, int mad_flags, u32 port_num,
 		     (in->mad_hdr.attr_id == IB_PMA_PORT_COUNTERS ||
 		      in->mad_hdr.attr_id == IB_PMA_PORT_COUNTERS_EXT ||
 		      in->mad_hdr.attr_id == IB_PMA_CLASS_PORT_INFO)))
-			return iboe_process_mad(ibdev, mad_flags, port_num,
-						in_wc, in_grh, in, out);
+			return ib_process_mad(ibdev, mad_flags, port_num,
+					      in_wc, in_grh, in, out);
 
 		return ib_process_mad(ibdev, mad_flags, port_num, in_wc, in_grh,
 				      in, out);
-- 
1.8.3.1


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [RFC for-rc] IB/mlx4: Fix the fix for reading flow-counters
  2022-01-11 16:35 [RFC for-rc] IB/mlx4: Fix the fix for reading flow-counters Håkon Bugge
@ 2022-01-11 16:38 ` Haakon Bugge
  2022-01-11 16:39   ` Haakon Bugge
  0 siblings, 1 reply; 4+ messages in thread
From: Haakon Bugge @ 2022-01-11 16:38 UTC (permalink / raw)
  To: Jason Gunthorpe, Yishai Hadas, Or Gerlitz; +Cc: OFED mailing list, linux-kernel



> On 11 Jan 2022, at 17:35, Håkon Bugge <haakon.bugge@oracle.com> wrote:
> 
> It is not logical to call iboe_process_mad() when the link-layer is
> Infiniband. Nevertheless, the commit message in commit 43bfb9729ea8
> ("IB/mlx4: Fix use of flow-counters for process_mad") explicitly state
> that iboe_process_mad() shall be called.
> 
> Without this fix, reading:

 # cat /sys/class/infiniband/mlx4_0/ports/2/counters_ext/port_xmit_data_64

(sorry, this line was of course taken as comment and was removed).


Thxs, Håkon


> 
> yields "Invalid argument", whereas with this commit, said counter can
> be read.
> 
> Please note that mlx4_1 is a VF.
> 
> Fixes: 43bfb9729ea8 ("IB/mlx4: Fix use of flow-counters for process_mad")
> Signed-off-by: Håkon Bugge <haakon.bugge@oracle.com>
> ---
> drivers/infiniband/hw/mlx4/mad.c | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/infiniband/hw/mlx4/mad.c b/drivers/infiniband/hw/mlx4/mad.c
> index d13ecbd..cc83782 100644
> --- a/drivers/infiniband/hw/mlx4/mad.c
> +++ b/drivers/infiniband/hw/mlx4/mad.c
> @@ -998,8 +998,8 @@ int mlx4_ib_process_mad(struct ib_device *ibdev, int mad_flags, u32 port_num,
> 		     (in->mad_hdr.attr_id == IB_PMA_PORT_COUNTERS ||
> 		      in->mad_hdr.attr_id == IB_PMA_PORT_COUNTERS_EXT ||
> 		      in->mad_hdr.attr_id == IB_PMA_CLASS_PORT_INFO)))
> -			return iboe_process_mad(ibdev, mad_flags, port_num,
> -						in_wc, in_grh, in, out);
> +			return ib_process_mad(ibdev, mad_flags, port_num,
> +					      in_wc, in_grh, in, out);
> 
> 		return ib_process_mad(ibdev, mad_flags, port_num, in_wc, in_grh,
> 				      in, out);
> -- 
> 1.8.3.1
> 


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [RFC for-rc] IB/mlx4: Fix the fix for reading flow-counters
  2022-01-11 16:38 ` Haakon Bugge
@ 2022-01-11 16:39   ` Haakon Bugge
  2022-01-11 18:35     ` Haakon Bugge
  0 siblings, 1 reply; 4+ messages in thread
From: Haakon Bugge @ 2022-01-11 16:39 UTC (permalink / raw)
  To: Jason Gunthorpe, Yishai Hadas, Or Gerlitz; +Cc: OFED mailing list, linux-kernel



> On 11 Jan 2022, at 17:38, Haakon Bugge <haakon.bugge@oracle.com> wrote:
> 
> 
> 
>> On 11 Jan 2022, at 17:35, Håkon Bugge <haakon.bugge@oracle.com> wrote:
>> 
>> It is not logical to call iboe_process_mad() when the link-layer is
>> Infiniband. Nevertheless, the commit message in commit 43bfb9729ea8
>> ("IB/mlx4: Fix use of flow-counters for process_mad") explicitly state
>> that iboe_process_mad() shall be called.
>> 
>> Without this fix, reading:
> 
> # cat /sys/class/infiniband/mlx4_0/ports/2/counters_ext/port_xmit_data_64

 should read:

 # cat /sys/class/infiniband/mlx4_1/ports/1/counters_ext/port_xmit_data_64


> 
> (sorry, this line was of course taken as comment and was removed).
> 
> 
> Thxs, Håkon
> 
> 
>> 
>> yields "Invalid argument", whereas with this commit, said counter can
>> be read.
>> 
>> Please note that mlx4_1 is a VF.
>> 
>> Fixes: 43bfb9729ea8 ("IB/mlx4: Fix use of flow-counters for process_mad")
>> Signed-off-by: Håkon Bugge <haakon.bugge@oracle.com>
>> ---
>> drivers/infiniband/hw/mlx4/mad.c | 4 ++--
>> 1 file changed, 2 insertions(+), 2 deletions(-)
>> 
>> diff --git a/drivers/infiniband/hw/mlx4/mad.c b/drivers/infiniband/hw/mlx4/mad.c
>> index d13ecbd..cc83782 100644
>> --- a/drivers/infiniband/hw/mlx4/mad.c
>> +++ b/drivers/infiniband/hw/mlx4/mad.c
>> @@ -998,8 +998,8 @@ int mlx4_ib_process_mad(struct ib_device *ibdev, int mad_flags, u32 port_num,
>> 		     (in->mad_hdr.attr_id == IB_PMA_PORT_COUNTERS ||
>> 		      in->mad_hdr.attr_id == IB_PMA_PORT_COUNTERS_EXT ||
>> 		      in->mad_hdr.attr_id == IB_PMA_CLASS_PORT_INFO)))
>> -			return iboe_process_mad(ibdev, mad_flags, port_num,
>> -						in_wc, in_grh, in, out);
>> +			return ib_process_mad(ibdev, mad_flags, port_num,
>> +					      in_wc, in_grh, in, out);
>> 
>> 		return ib_process_mad(ibdev, mad_flags, port_num, in_wc, in_grh,
>> 				      in, out);
>> -- 
>> 1.8.3.1


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [RFC for-rc] IB/mlx4: Fix the fix for reading flow-counters
  2022-01-11 16:39   ` Haakon Bugge
@ 2022-01-11 18:35     ` Haakon Bugge
  0 siblings, 0 replies; 4+ messages in thread
From: Haakon Bugge @ 2022-01-11 18:35 UTC (permalink / raw)
  To: Jason Gunthorpe, Yishai Hadas, Or Gerlitz; +Cc: OFED mailing list, linux-kernel



> On 11 Jan 2022, at 17:39, Haakon Bugge <haakon.bugge@oracle.com> wrote:
> 
> 
> 
>> On 11 Jan 2022, at 17:38, Haakon Bugge <haakon.bugge@oracle.com> wrote:
>> 
>> 
>> 
>>> On 11 Jan 2022, at 17:35, Håkon Bugge <haakon.bugge@oracle.com> wrote:
>>> 
>>> It is not logical to call iboe_process_mad() when the link-layer is
>>> Infiniband. Nevertheless, the commit message in commit 43bfb9729ea8
>>> ("IB/mlx4: Fix use of flow-counters for process_mad") explicitly state
>>> that iboe_process_mad() shall be called.
>>> 
>>> Without this fix, reading:
>> 
>> # cat /sys/class/infiniband/mlx4_0/ports/2/counters_ext/port_xmit_data_64
> 
> should read:
> 
> # cat /sys/class/infiniband/mlx4_1/ports/1/counters_ext/port_xmit_data_64

Pleas ignore this RFC, as it is plain wrong. Sorry for the noise.


Thxs, Håkon

> 
> 
>> 
>> (sorry, this line was of course taken as comment and was removed).
>> 
>> 
>> Thxs, Håkon
>> 
>> 
>>> 
>>> yields "Invalid argument", whereas with this commit, said counter can
>>> be read.
>>> 
>>> Please note that mlx4_1 is a VF.
>>> 
>>> Fixes: 43bfb9729ea8 ("IB/mlx4: Fix use of flow-counters for process_mad")
>>> Signed-off-by: Håkon Bugge <haakon.bugge@oracle.com>
>>> ---
>>> drivers/infiniband/hw/mlx4/mad.c | 4 ++--
>>> 1 file changed, 2 insertions(+), 2 deletions(-)
>>> 
>>> diff --git a/drivers/infiniband/hw/mlx4/mad.c b/drivers/infiniband/hw/mlx4/mad.c
>>> index d13ecbd..cc83782 100644
>>> --- a/drivers/infiniband/hw/mlx4/mad.c
>>> +++ b/drivers/infiniband/hw/mlx4/mad.c
>>> @@ -998,8 +998,8 @@ int mlx4_ib_process_mad(struct ib_device *ibdev, int mad_flags, u32 port_num,
>>> 		     (in->mad_hdr.attr_id == IB_PMA_PORT_COUNTERS ||
>>> 		      in->mad_hdr.attr_id == IB_PMA_PORT_COUNTERS_EXT ||
>>> 		      in->mad_hdr.attr_id == IB_PMA_CLASS_PORT_INFO)))
>>> -			return iboe_process_mad(ibdev, mad_flags, port_num,
>>> -						in_wc, in_grh, in, out);
>>> +			return ib_process_mad(ibdev, mad_flags, port_num,
>>> +					      in_wc, in_grh, in, out);
>>> 
>>> 		return ib_process_mad(ibdev, mad_flags, port_num, in_wc, in_grh,
>>> 				      in, out);
>>> -- 
>>> 1.8.3.1


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2022-01-11 18:35 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-01-11 16:35 [RFC for-rc] IB/mlx4: Fix the fix for reading flow-counters Håkon Bugge
2022-01-11 16:38 ` Haakon Bugge
2022-01-11 16:39   ` Haakon Bugge
2022-01-11 18:35     ` Haakon Bugge

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.