public inbox for linux-rdma@vger.kernel.org
 help / color / mirror / Atom feed
* [bug] rdma-core/librdmacm/cma.c rdma_create_qp_ex:add id->cq refer to qp_attr->cq, when qp_attr->cq is not NULL, and id->cq is NULL 
@ 2024-08-27  6:20 靳文宾
  2024-08-28  0:51 ` Zhijian Li (Fujitsu)
  0 siblings, 1 reply; 5+ messages in thread
From: 靳文宾 @ 2024-08-27  6:20 UTC (permalink / raw)
  To: linux-rdma






I think the following modification is more correct, 
if there have something i dont know, pls tell me, thx





diff --git a/librdmacm/cma.c b/librdmacm/cma.c
index 7b924bd0d..9e71ba858 100644
--- a/librdmacm/cma.c
+++ b/librdmacm/cma.c
@@ -1654,10 +1654,20 @@ int rdma_create_qp_ex(struct rdma_cm_id *id,
        if (ret)
                return ret;


-       if (!attr->send_cq)
+       if (!attr->send_cq) {
                attr->send_cq = id->send_cq;
-       if (!attr->recv_cq)
+       } else {
+               if (!id->recv_cq)
+                       id->recv_cq = attr->recv_cq;
+       }
+       if (!attr->recv_cq) {
                attr->recv_cq = id->recv_cq;
+       } else {
+               if (!id->recv_cq)
+                       id->recv_cq = attr->recv_cq;
+       }
+
+       
        if (id->srq && !attr->srq)
                attr->srq = id->srq;
        qp = ibv_create_qp_ex(id->verbs, attr);






^ permalink raw reply related	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2024-09-02  7:00 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-08-27  6:20 [bug] rdma-core/librdmacm/cma.c rdma_create_qp_ex:add id->cq refer to qp_attr->cq, when qp_attr->cq is not NULL, and id->cq is NULL 靳文宾
2024-08-28  0:51 ` Zhijian Li (Fujitsu)
2024-08-29  9:08   ` Leon Romanovsky
2024-08-29 12:04   ` [bug] rdma-core/librdmacm/cma.c rdma_create_qp_exï¼add " Zhu Yanjun
2024-09-02  7:00     ` Leon Romanovsky

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox