]> git.baikalelectronics.ru Git - kernel.git/commit
IB/cma: cma_match_net_dev needs to take into account port_num
authorMatan Barak <matanb@mellanox.com>
Mon, 21 Dec 2015 15:01:24 +0000 (17:01 +0200)
committerDoug Ledford <dledford@redhat.com>
Wed, 23 Dec 2015 04:22:50 +0000 (23:22 -0500)
commitd22d9598bdc88f9dfeb89b7689f7c3975455617f
treeeeec07c777beba0743798ba1951df9c70092da17
parent96dc0c975c2131705bd3c7ccefc357ac6ed82e3b
IB/cma: cma_match_net_dev needs to take into account port_num

Previously, cma_match_net_dev called cma_protocol_roce which
tried to verify that the IB device uses RoCE protocol. However,
if rdma_id wasn't bound to a port, then the check would occur
against the first port of the device without regard to whether
that port was even of the same type as the type of port the
incoming packet was received on.

Fix this by passing the port of the request and only checking
against the same port of the device.

Reported-by: Or Gerlitz <gerlitz.or@gmail.com>
Fixes: b7aba0130ec3 ('IB/cma: Accept connection without a valid netdev on RoCE')
Signed-off-by: Matan Barak <matanb@mellanox.com>
Signed-off-by: Doug Ledford <dledford@redhat.com>
drivers/infiniband/core/cma.c