]> git.baikalelectronics.ru Git - kernel.git/commit
Revert "RDMA/cma: Simplify rdma_resolve_addr() error flow"
authorParav Pandit <parav@mellanox.com>
Wed, 12 Feb 2020 07:26:29 +0000 (09:26 +0200)
committerJason Gunthorpe <jgg@mellanox.com>
Wed, 19 Feb 2020 18:25:52 +0000 (14:25 -0400)
commitc4d0ee29cb57f8771ff06c6950abffdfdf6cf223
treeb359ad631fb0566dae3963081aa660196b7fc7a3
parenta0dcdc4ca64230a6d4a2738a96d502ae7293732c
Revert "RDMA/cma: Simplify rdma_resolve_addr() error flow"

This reverts commit 89be1f451e514864909c5de79f42686029b1820e.

The call chain below requires the cm_id_priv's destination address to be
setup before performing rdma_bind_addr(). Otherwise source port allocation
fails as cma_port_is_unique() no longer sees the correct tuple to allow
duplicate users of the source port.

rdma_resolve_addr()
  cma_bind_addr()
    rdma_bind_addr()
      cma_get_port()
        cma_alloc_any_port()
          cma_port_is_unique() <- compared with zero daddr

This can result in false failures to connect, particularly if the source
port range is restricted.

Fixes: 89be1f451e51 ("RDMA/cma: Simplify rdma_resolve_addr() error flow")
Link: https://lore.kernel.org/r/20200212072635.682689-4-leon@kernel.org
Signed-off-by: Parav Pandit <parav@mellanox.com>
Signed-off-by: Leon Romanovsky <leonro@mellanox.com>
Signed-off-by: Jason Gunthorpe <jgg@mellanox.com>
drivers/infiniband/core/cma.c