IB/core: Refactor ib_init_ah_attr_from_path() for RoCE
authorParav Pandit <parav@mellanox.com>
Tue, 13 Mar 2018 14:06:20 +0000 (16:06 +0200)
committerJason Gunthorpe <jgg@mellanox.com>
Thu, 15 Mar 2018 21:17:49 +0000 (15:17 -0600)
commit0a5141593567fca3e1d64da756b8d1b490f6c600
treec2e788a8d851970428ec99df61f6bbdcc0d6b767
parenta22af59ea9a5f9496c37bc4e4654da45a4e0ca2a
IB/core: Refactor ib_init_ah_attr_from_path() for RoCE

Resolving route for RoCE for a path record is needed only for the
received CM requests.
Therefore,
(a) ib_init_ah_attr_from_path() is refactored first to isolate the
code of resolving route.
(b) Setting dlid, path bits is not needed for RoCE.

Additionally ah attribute initialization is done from the path record
entry, so it is better to refer to path record entry type for
different link layer instead of ah attribute type while initializing
ah attribute itself.

Signed-off-by: Parav Pandit <parav@mellanox.com>
Signed-off-by: Leon Romanovsky <leon@kernel.org>
Signed-off-by: Jason Gunthorpe <jgg@mellanox.com>
drivers/infiniband/core/sa_query.c
include/rdma/ib_sa.h