Skip to contentSkip to conversation

RDMA/smc: Replace ib_query_gid with rdma_get_gid_attr

PATCH In review Jason Gunthorpe 2 participants 2 messages Aug 18, 2018 – Aug 22, 2018

Subsystems (4)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 RDMA/smc: Replace ib_query_gid with rdma_get_gid_attr

All RDMA ULPs should be using rdma_get_gid_attr instead of ib_query_gid. Convert SMC to use the new API.

In the process correct some confusion with gid_type - if attr->ndev is !NULL then gid_type can never be IB_GID_TYPE_IB by definition. IB_GID_TYPE_ROCE shares the same enum value and is probably what was intended here.

---
 include/rdma/ib_cache.h | 24 ---------------------
 net/smc/smc_ib.c        | 48 +++++++++++++++++++++--------------------
 2 files changed, 25 insertions(+), 47 deletions(-)

This is intended to go this merge window (ie in the next 4 days) to remove the wrong-headed __deprecated warning. If there is no objection I'll send it via the rdma tree.

Thanks,
Jason

include/rdma/ib_cache.h +0 -24
index 3e11e7cc60b745..62e990b620aaf7 100644
@@ -133,28 +133,4 @@ const struct ib_gid_attr *rdma_get_gid_attr(struct ib_device *device,
 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;
-
-	memset(attr_out, 0, sizeof(*attr_out));
-	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 */
net/smc/smc_ib.c +25 -23

71 lines not on this page · raw message

Signature · 1 line
2.18.0
#1 lore raw
Quoted 10 lines · Jason Gunthorpe

All RDMA ULPs should be using rdma_get_gid_attr instead of ib_query_gid. Convert SMC to use the new API.

In the process correct some confusion with gid_type - if attr->ndev is !NULL then gid_type can never be IB_GID_TYPE_IB by definition. IB_GID_TYPE_ROCE shares the same enum value and is probably what was intended here.

I ran a few SMC tests and the changes look good. So, no objections from our side and thank you for the patch.

Hans