提交 beb205dd 编写于 作者: K Kamal Heib 提交者: Jason Gunthorpe

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: 303ae1cd ("rdma/siw: application interface")
Link: https://lore.kernel.org/r/20200205081354.30438-1-kamalheib1@gmail.comSigned-off-by: NKamal Heib <kamalheib1@gmail.com>
Reviewed-by: NGal Pressman <galpress@amazon.com>
Reviewed-by: NBernard Metzler <bmt@zurich.ibm.com>
Signed-off-by: NJason Gunthorpe <jgg@mellanox.com>
上级 9a4b2410
...@@ -168,12 +168,12 @@ int siw_query_port(struct ib_device *base_dev, u8 port, ...@@ -168,12 +168,12 @@ int siw_query_port(struct ib_device *base_dev, u8 port,
memset(attr, 0, sizeof(*attr)); memset(attr, 0, sizeof(*attr));
attr->active_mtu = attr->max_mtu;
attr->active_speed = 2; attr->active_speed = 2;
attr->active_width = 2; attr->active_width = 2;
attr->gid_tbl_len = 1; attr->gid_tbl_len = 1;
attr->max_msg_sz = -1; attr->max_msg_sz = -1;
attr->max_mtu = ib_mtu_int_to_enum(sdev->netdev->mtu); 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 ? attr->phys_state = sdev->state == IB_PORT_ACTIVE ?
IB_PORT_PHYS_STATE_LINK_UP : IB_PORT_PHYS_STATE_DISABLED; IB_PORT_PHYS_STATE_LINK_UP : IB_PORT_PHYS_STATE_DISABLED;
attr->pkey_tbl_len = 1; attr->pkey_tbl_len = 1;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册