RDMA/siw: Fix setting active_mtu attribute
Subsystems (2)
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)
--- drivers/infiniband/sw/siw/siw_verbs.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/infiniband/sw/siw/siw_verbs.c +1 -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 ; 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
Quoted 17 lines · Kamal Heib
Make sure to set the
active_mtuattribute 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")Signed-off-by Kamal Heib <[email protected]>--- drivers/infiniband/sw/siw/siw_verbs.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)drivers/infiniband/sw/siw/siw_verbs.c +0
-0
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
-0attr->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 ;
-----"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 settingactive_mtuattributeMake sure to set the
active_mtuattribute 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")Signed-off-by Kamal Heib <[email protected]>---
drivers/infiniband/sw/siw/siw_verbs.c| 2 +-1 file changed, 1 insertion(+), 1 deletion(-)drivers/infiniband/sw/siw/siw_verbs.c +1
-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 ; 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.
Jason Gunthorpe
AppliedQuoted 6 lines · Kamal Heib
Make sure to set the
active_mtuattribute 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")Signed-off-by Kamal Heib <[email protected]>Reviewed-by Gal Pressman <[email protected]>Reviewed-by Bernard Metzler <[email protected]>--- 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