RDMA/core: Simplify gid type check in cma_acquire_dev()
authorParav Pandit <parav@mellanox.com>
Sun, 29 Jul 2018 08:53:15 +0000 (11:53 +0300)
committerJason Gunthorpe <jgg@mellanox.com>
Tue, 31 Jul 2018 02:49:04 +0000 (20:49 -0600)
commit79d684f026473c344ce32708687f16b2bd12aff4
tree7aec2ef7fc481d434891a8f5c8271a99d71c6940
parent7582df826734bad71522b442b8977e3dee63a77a
RDMA/core: Simplify gid type check in cma_acquire_dev()

cma_add_one() initializes the default GID regardless of device type.
listen_id is bound to a device and an IP address, its GID type is
initialized by cma_acquire_dev().

Therefore a valid default GID type is always available, it is not needed
to check port type during cma_acquire_dev().

Initialize gid type of a cm id when the cm_id is created instead of
doing conditional checks during cma_acquire_dev() and trying to
initialize to 0 during _cma_attach_to_dev().

Signed-off-by: Parav Pandit <parav@mellanox.com>
Reviewed-by: Daniel Jurgens <danielj@mellanox.com>
Signed-off-by: Leon Romanovsky <leonro@mellanox.com>
Signed-off-by: Jason Gunthorpe <jgg@mellanox.com>
drivers/infiniband/core/cma.c