diff options
author | Jason Gunthorpe <jgg@mellanox.com> | 2018-07-27 09:48:30 -0600 |
---|---|---|
committer | Jason Gunthorpe <jgg@mellanox.com> | 2018-07-27 10:08:34 -0600 |
commit | 7aaa1807e698f73094b78f0ef25b1a37a4409a55 (patch) | |
tree | 0c7c38ee842cc999ec1056e5794affb48f8dd31b /include/rdma | |
parent | df0651079380c5646bc0d0f3a4aa7621ef1c2b7c (diff) | |
download | linux-rt-7aaa1807e698f73094b78f0ef25b1a37a4409a55.tar.gz |
IB/cache: Restore compatibility for ib_query_gid
Code changes in smc have become so complicated this cycle that the RDMA
patches to remove ib_query_gid in smc create too complex merge conflicts.
Allow those conflicts to be resolved by using the net/smc hunks by
providing a compatibility wrapper. During the second phase of the merge
window this wrapper will be deleted and smc updated to use the new API.
Reported-by: Stephen Rothwell <sfr@canb.auug.org.au>
Reviewed-by: Parav Pandit <parav@mellanox.com>
Signed-off-by: Jason Gunthorpe <jgg@mellanox.com>
Diffstat (limited to 'include/rdma')
-rw-r--r-- | include/rdma/ib_cache.h | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/include/rdma/ib_cache.h b/include/rdma/ib_cache.h index 1108d4220276..a4ce441f36f0 100644 --- a/include/rdma/ib_cache.h +++ b/include/rdma/ib_cache.h @@ -132,4 +132,28 @@ const struct ib_gid_attr *rdma_get_gid_attr(struct ib_device *device, u8 port_num, int index); void rdma_put_gid_attr(const struct ib_gid_attr *attr); void rdma_hold_gid_attr(const struct ib_gid_attr *attr); + +/* + * This is to be removed. It only exists to make merging rdma and smc simpler. + */ +static inline __deprecated int ib_query_gid(struct ib_device *device, + u8 port_num, int index, + union ib_gid *gid, + struct ib_gid_attr *attr_out) +{ + const struct ib_gid_attr *attr; + + attr = rdma_get_gid_attr(device, port_num, index); + if (IS_ERR(attr)) + return PTR_ERR(attr); + + if (attr->ndev) + dev_hold(attr->ndev); + *attr_out = *attr; + + rdma_put_gid_attr(attr); + + return 0; +} + #endif /* _IB_CACHE_H */ |