]> 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)
commit69f3cb81849aa4b030827d8afbf0e68bd501b473
treeeeec07c777beba0743798ba1951df9c70092da17
parentf91f739d19016a515438b210e80177b8defea504
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: 2d655f779422 ('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