[PATCH v2 rdma-core 1/5] libhns: Add debug log for lock-free mode

Currently there is no way to observe whether the lock-free mode is configured from the driver's perspective. Add debug log for this. Signed-off-by: Junxian Huang <huangjunxian6@hisilicon.com> --- providers/hns/hns_roce_u_verbs.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/providers/hns/hns_roce_u_verbs.c b/providers/hns/hns_roce_u_verbs.c index 6fc8ece32..ae60955ba 100644 --- a/providers/hns/hns_roce_u_verbs.c +++ b/providers/hns/hns_roce_u_verbs.c @@ -177,6 +177,7 @@ err: struct ibv_pd *hns_roce_u_alloc_pad(struct ibv_context *context, struct ibv_parent_domain_init_attr *attr) { + struct hns_roce_pd *protection_domain; struct hns_roce_pad *pad; if (ibv_check_alloc_parent_domain(attr)) @@ -193,12 +194,16 @@ struct ibv_pd *hns_roce_u_alloc_pad(struct ibv_context *context, return NULL; } + protection_domain = to_hr_pd(attr->pd); if (attr->td) { pad->td = to_hr_td(attr->td); atomic_fetch_add(&pad->td->refcount, 1); + verbs_debug(verbs_get_ctx(context), + "set PAD(0x%x) to lock-free mode.\n", + protection_domain->pdn); } - pad->pd.protection_domain = to_hr_pd(attr->pd); + pad->pd.protection_domain = protection_domain; atomic_fetch_add(&pad->pd.protection_domain->refcount, 1); atomic_init(&pad->pd.refcount, 1); -- 2.33.0
participants (1)
-
Junxian Huang