Skip to contentSkip to conversation

RDMA/siw: Fix setting active_mtu attribute

PATCH Applied Kamal Heib 4 participants 4 messages Feb 5, 2020 – Feb 11, 2020

Subsystems (2)
lore
Share & tools
lore

Kamal Heib

author
#0 lore raw

PATCH 1/1 RDMA/siw: Fix setting active_mtu attribute

Make sure to set the active_mtu attribute to avoid report the following invalid value:

$ ibv_devinfo -d siw0 | grep active_mtu
			active_mtu:		invalid MTU (0)
Fixes 303ae1cdfdf7 ("rdma/siw: application interface")
---
 drivers/infiniband/sw/siw/siw_verbs.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/infiniband/sw/siw/siw_verbs.c +1 -1
index 07e30138aaa1..73485d0da907 100644
@@ -168,12 +168,12 @@ int siw_query_port(struct ib_device *base_dev, u8 port,
 
 	memset(attr, 0, sizeof(*attr));
 
-	attr->active_mtu = attr->max_mtu;
 	attr->active_speed = 2;
 	attr->active_width = 2;
 	attr->gid_tbl_len = 1;
 	attr->max_msg_sz = -1;
 	attr->max_mtu = ib_mtu_int_to_enum(sdev->netdev->mtu);
+	attr->active_mtu = ib_mtu_int_to_enum(sdev->netdev->mtu);
 	attr->phys_state = sdev->state == IB_PORT_ACTIVE ?
 		IB_PORT_PHYS_STATE_LINK_UP : IB_PORT_PHYS_STATE_DISABLED;
 	attr->pkey_tbl_len = 1;
Signature · 1 line
2.21.1
Reviewed-by on v1 1/1
#1 lore raw
Quoted 17 lines · Kamal Heib

Make sure to set the active_mtu attribute to avoid report the following invalid value:

$ ibv_devinfo -d siw0 | grep active_mtu
			active_mtu:		invalid MTU (0)
Fixes 303ae1cdfdf7 ("rdma/siw: application interface")
---
 drivers/infiniband/sw/siw/siw_verbs.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/infiniband/sw/siw/siw_verbs.c +0 -0
index 07e30138aaa1..73485d0da907 100644

drivers/infiniband/sw/siw/siw_verbs.c int siw_query_port(struct ib_device *base_dev, u8 port, · line 172

Quoted 6 lines
drivers/infiniband/sw/siw/siw_verbs.c +0 -1
@@ -168,12 +168,12 @@ int siw_query_port(struct ib_device *base_dev, u8 port,
 
 	memset(attr, 0, sizeof(*attr));
 
-	attr->active_mtu = attr->max_mtu;
 	attr->active_speed = 2;
 	attr->active_width = 2;

Off topic: these should use ib_port_speed and ib_port_width enum.

drivers/infiniband/sw/siw/siw_verbs.c int siw_query_port(struct ib_device *base_dev, u8 port, · line 179

Quoted 8 lines
drivers/infiniband/sw/siw/siw_verbs.c +1 -0
 	attr->gid_tbl_len = 1;
 	attr->max_msg_sz = -1;
 	attr->max_mtu = ib_mtu_int_to_enum(sdev->netdev->mtu);
+	attr->active_mtu = ib_mtu_int_to_enum(sdev->netdev->mtu);
 	attr->phys_state = sdev->state == IB_PORT_ACTIVE ?
 		IB_PORT_PHYS_STATE_LINK_UP : IB_PORT_PHYS_STATE_DISABLED;
 	attr->pkey_tbl_len = 1;
Reviewed-by on v1 1/1
#2 lore raw
In reply to Kamal Heib

-----"Kamal Heib" <[email protected]> wrote: -----

Quoted 41 lines

To: [email protected]
From: "Kamal Heib" <[email protected]>
Date: 02/05/2020 09:14AM
Cc: "Doug Ledford" <[email protected]>, "Jason Gunthorpe" <[email protected]>, "Bernard Metzler" <[email protected]>, "Kamal Heib" <[email protected]>
Subject: [EXTERNAL] [PATCH for-rc] RDMA/siw: Fix setting active_mtu attribute

Make sure to set the active_mtu attribute to avoid report the following
invalid value:

$ ibv_devinfo -d siw0 | grep active_mtu
			active_mtu:		invalid MTU (0)
Fixes 303ae1cdfdf7 ("rdma/siw: application interface")

---
drivers/infiniband/sw/siw/siw_verbs.c | 2 +-

1 file changed, 1 insertion(+), 1 deletion(-)
drivers/infiniband/sw/siw/siw_verbs.c +1 -1
index 07e30138aaa1..73485d0da907 100644
@@ -168,12 +168,12 @@ int siw_query_port(struct ib_device *base_dev,
 u8 port,
 
 	memset(attr, 0, sizeof(*attr));
 
-	attr->active_mtu = attr->max_mtu;
 	attr->active_speed = 2;
 	attr->active_width = 2;
 	attr->gid_tbl_len = 1;
 	attr->max_msg_sz = -1;
 	attr->max_mtu = ib_mtu_int_to_enum(sdev->netdev->mtu);
+	attr->active_mtu = ib_mtu_int_to_enum(sdev->netdev->mtu);
 	attr->phys_state = sdev->state == IB_PORT_ACTIVE ?
 		IB_PORT_PHYS_STATE_LINK_UP : IB_PORT_PHYS_STATE_DISABLED;
Quoted 5 lines
	attr->pkey_tbl_len = 1;
Signature · 1 line
2.21.1

thanks, makes complete sense.

#3 lore raw
In reply to Kamal Heib
Quoted 6 lines · Kamal Heib

Make sure to set the active_mtu attribute to avoid report the following invalid value:

$ ibv_devinfo -d siw0 | grep active_mtu
			active_mtu:		invalid MTU (0)
Quoted 7 lines
Fixes 303ae1cdfdf7 ("rdma/siw: application interface")
---
 drivers/infiniband/sw/siw/siw_verbs.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

This isn't really rc worthy as it has always been broken

Applied to for-next, thanks

Jason