summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJason Gunthorpe <jgg@mellanox.com>2018-07-27 11:48:30 -0400
committerJason Gunthorpe <jgg@mellanox.com>2018-07-27 12:08:34 -0400
commit7aaa1807e698f73094b78f0ef25b1a37a4409a55 (patch)
tree0c7c38ee842cc999ec1056e5794affb48f8dd31b
parentdf0651079380c5646bc0d0f3a4aa7621ef1c2b7c (diff)
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>
-rw-r--r--include/rdma/ib_cache.h24
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,
132 u8 port_num, int index); 132 u8 port_num, int index);
133void rdma_put_gid_attr(const struct ib_gid_attr *attr); 133void rdma_put_gid_attr(const struct ib_gid_attr *attr);
134void rdma_hold_gid_attr(const struct ib_gid_attr *attr); 134void rdma_hold_gid_attr(const struct ib_gid_attr *attr);
135
136/*
137 * This is to be removed. It only exists to make merging rdma and smc simpler.
138 */
139static inline __deprecated int ib_query_gid(struct ib_device *device,
140 u8 port_num, int index,
141 union ib_gid *gid,
142 struct ib_gid_attr *attr_out)
143{
144 const struct ib_gid_attr *attr;
145
146 attr = rdma_get_gid_attr(device, port_num, index);
147 if (IS_ERR(attr))
148 return PTR_ERR(attr);
149
150 if (attr->ndev)
151 dev_hold(attr->ndev);
152 *attr_out = *attr;
153
154 rdma_put_gid_attr(attr);
155
156 return 0;
157}
158
135#endif /* _IB_CACHE_H */ 159#endif /* _IB_CACHE_H */