i40iw: Extend port reuse support for listeners
authorShiraz Saleem <shiraz.saleem@intel.com>
Sat, 12 May 2018 12:50:30 +0000 (07:50 -0500)
committerJason Gunthorpe <jgg@mellanox.com>
Wed, 16 May 2018 19:13:20 +0000 (13:13 -0600)
commitf43c00c04bbf01be0822ef9f0281cc69b56c4e40
tree046415c5d14e9de9c0a6ead41e6203325f8bfae6
parentaec05afe641b9c10024c7e4838c0d6cd734f3565
i40iw: Extend port reuse support for listeners

If two listeners are created with different IP's but
same port, the second rdma_listen fails due to a
duplicate port entry being added from the CQP add
APBVT OP. commit f16dc0aa5ea2 ("i40iw: Add support
for port reuse on active side connections") does not
account for listener side port reuse.

Check for duplicate port before invoking the CQP command
to add APBVT entry and delete the entry only if the port
is not in use. Additionally, consolidate all port-reuse
logic into i40iw_manage_apbvt.

Fixes: f16dc0aa5ea2 ("i40iw: Add support for port reuse on active side connections")
Signed-off-by: Shiraz Saleem <shiraz.saleem@intel.com>
Signed-off-by: Jason Gunthorpe <jgg@mellanox.com>
drivers/infiniband/hw/i40iw/i40iw_cm.c
drivers/infiniband/hw/i40iw/i40iw_cm.h
drivers/infiniband/hw/i40iw/i40iw_hw.c