Skip to content

Commit

Permalink
IB/cache: Restore compatibility for ib_query_gid
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Jason Gunthorpe committed Jul 27, 2018
1 parent df06510 commit 7aaa180
Showing 1 changed file with 24 additions and 0 deletions.
24 changes: 24 additions & 0 deletions include/rdma/ib_cache.h
Original file line number Diff line number Diff line change
Expand Up @@ -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 */

0 comments on commit 7aaa180

Please sign in to comment.