IB/cma: Allow port reuse for rdma_id
authorMoni Shoua <monis@mellanox.com>
Thu, 5 Jan 2017 14:16:36 +0000 (16:16 +0200)
committerDoug Ledford <dledford@redhat.com>
Tue, 24 Jan 2017 21:20:37 +0000 (16:20 -0500)
commit19b752a19dcec188f404a070f4d4c33607ea493b
tree604eeaf270cf8764728a5f23c8848bc6a5835ded
parent498683c6a7eec5e6ca4f8371d92061618f0827bc
IB/cma: Allow port reuse for rdma_id

When allocating a port number for binding to a rdma_id, assuming the
allocation is not for a specific port, the rule is to allow only ports
that were not in use before by any other rdma_id.

This condition is too strong to achieve the goal of a unique 5 tuple
rdma_id. Instead, we can compare current rdma_id with other rdma_id for
difference in one of destination port, source address and destination
address to allow port reuse.

Signed-off-by: Moni Shoua <monis@mellanox.com>
Signed-off-by: Leon Romanovsky <leon@kernel.org>
Acked-by: Sean Hefty <sean.hefty@intel.com>
Signed-off-by: Doug Ledford <dledford@redhat.com>
drivers/infiniband/core/cma.c