Skip to content

Commit 7aaa180

Browse files
committed
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 <[email protected]> Reviewed-by: Parav Pandit <[email protected]> Signed-off-by: Jason Gunthorpe <[email protected]>
1 parent df06510 commit 7aaa180

File tree

1 file changed

+24
-0
lines changed

1 file changed

+24
-0
lines changed

include/rdma/ib_cache.h

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -132,4 +132,28 @@ const struct ib_gid_attr *rdma_get_gid_attr(struct ib_device *device,
132132
u8 port_num, int index);
133133
void rdma_put_gid_attr(const struct ib_gid_attr *attr);
134134
void 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+
*/
139+
static 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+
135159
#endif /* _IB_CACHE_H */

0 commit comments

Comments
 (0)