Skip to contentSkip to conversation

IB/mlx4: Fix the fix for reading flow-counters

RFC In review Håkon Bugge 1 participant 4 messages Jan 11, 2022

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

RFC 1/1 IB/mlx4: Fix the fix for reading flow-counters

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")
---
 drivers/infiniband/hw/mlx4/mad.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/infiniband/hw/mlx4/mad.c +2 -2
index d13ecbd..cc83782 100644
@@ -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);
Signature · 1 line
1.8.3.1
#1 lore raw
Quoted 10 lines · Håkon Bugge

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

Quoted 30 lines

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")

---
drivers/infiniband/hw/mlx4/mad.c | 4 ++--

1 file changed, 2 insertions(+), 2 deletions(-)
drivers/infiniband/hw/mlx4/mad.c +2 -2
index d13ecbd..cc83782 100644
@@ -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);
Signature · 1 line
1.8.3.1
#2 lore raw
Quoted 8 lines · Haakon Bugge
Quoted 5 lines · Håkon Bugge
Quoted 8 lines
Quoted 6 lines

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
Quoted 36 lines

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

Thxs, Håkon

Quoted 29 lines

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")

---
drivers/infiniband/hw/mlx4/mad.c | 4 ++--

1 file changed, 2 insertions(+), 2 deletions(-)
drivers/infiniband/hw/mlx4/mad.c +2 -2
index d13ecbd..cc83782 100644
@@ -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);
Signature · 1 line
1.8.3.1
#3 lore raw
Quoted 17 lines · Haakon Bugge
Quoted 14 lines · Haakon Bugge
Quoted 10 lines · Håkon Bugge

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.

Quoted 7 lines
Quoted 3 lines
Quoted 1 line

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

Quoted 38 lines
Quoted 38 lines

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

Thxs, Håkon

Quoted 29 lines

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")

---
drivers/infiniband/hw/mlx4/mad.c | 4 ++--

1 file changed, 2 insertions(+), 2 deletions(-)
drivers/infiniband/hw/mlx4/mad.c +2 -2
index d13ecbd..cc83782 100644
@@ -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);
Signature · 1 line
1.8.3.1