Commit 9315bf18 authored by Matan Barak's avatar Matan Barak Committed by Greg Kroah-Hartman

IB/cma: Fix RDMA port validation for iWarp

commit 64936773 upstream.

cma_validate_port wrongly assumed that Ethernet devices are RoCE
devices and thus their ndev should be matched in the GID table.
This broke the iWarp support. Fixing that matching the ndev only if
we work on a RoCE port.

Cc: <stable@vger.kernel.org> # 4.4.x-
Fixes: abae1b71 ('IB/cma: cma_validate_port should verify the port
		     and netdevice')
Reported-by: default avatarHariprasad Shenai <hariprasad@chelsio.com>
Tested-by: default avatarHariprasad Shenai <hariprasad@chelsio.com>
Signed-off-by: default avatarMatan Barak <matanb@mellanox.com>
Reviewed-by: default avatarSteve Wise <swise@opengridcomputing.com>
Signed-off-by: default avatarDoug Ledford <dledford@redhat.com>
Signed-off-by: default avatarSteve Wise <swise@opengridcomputing.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 996c5912
...@@ -453,7 +453,7 @@ static inline int cma_validate_port(struct ib_device *device, u8 port, ...@@ -453,7 +453,7 @@ static inline int cma_validate_port(struct ib_device *device, u8 port,
if ((dev_type != ARPHRD_INFINIBAND) && rdma_protocol_ib(device, port)) if ((dev_type != ARPHRD_INFINIBAND) && rdma_protocol_ib(device, port))
return ret; return ret;
if (dev_type == ARPHRD_ETHER) if (dev_type == ARPHRD_ETHER && rdma_protocol_roce(device, port))
ndev = dev_get_by_index(&init_net, bound_if_index); ndev = dev_get_by_index(&init_net, bound_if_index);
ret = ib_find_cached_gid_by_port(device, gid, port, ndev, NULL); ret = ib_find_cached_gid_by_port(device, gid, port, ndev, NULL);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment