diff options
author | Parav Pandit <parav@mellanox.com> | 2018-03-13 17:06:20 +0300 |
---|---|---|
committer | Jason Gunthorpe <jgg@mellanox.com> | 2018-03-16 00:17:49 +0300 |
commit | 0a5141593567fca3e1d64da756b8d1b490f6c600 (patch) | |
tree | c2e788a8d851970428ec99df61f6bbdcc0d6b767 /include/rdma | |
parent | a22af59ea9a5f9496c37bc4e4654da45a4e0ca2a (diff) | |
download | linux-0a5141593567fca3e1d64da756b8d1b490f6c600.tar.xz |
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>
Diffstat (limited to 'include/rdma')
-rw-r--r-- | include/rdma/ib_sa.h | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/include/rdma/ib_sa.h b/include/rdma/ib_sa.h index 811cfcfcbe3d..82b8e59af14a 100644 --- a/include/rdma/ib_sa.h +++ b/include/rdma/ib_sa.h @@ -590,6 +590,11 @@ static inline bool sa_path_is_roce(struct sa_path_rec *rec) (rec->rec_type == SA_PATH_REC_TYPE_ROCE_V2)); } +static inline bool sa_path_is_opa(struct sa_path_rec *rec) +{ + return (rec->rec_type == SA_PATH_REC_TYPE_OPA); +} + static inline void sa_path_set_slid(struct sa_path_rec *rec, u32 slid) { if (rec->rec_type == SA_PATH_REC_TYPE_IB) |