From patchwork Tue Aug 27 06:20:59 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?b?6Z2z5paH5a6+?= X-Patchwork-Id: 13778888 Received: from m16.mail.163.com (m16.mail.163.com [117.135.210.3]) by smtp.subspace.kernel.org (Postfix) with ESMTP id C15B2D51C for ; Tue, 27 Aug 2024 06:21:08 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=117.135.210.3 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1724739672; cv=none; b=piTSZOxq3NhtqlOmTMpuYr+a1irVGc8FYfhx26IPSufnfF3mZsBVReWwk/JzbM+xL2jWMA13amUjECxcFAvc4FOHgxtbty2iHUk216IuCWIvEQZJIhyJ+RtuORt9k+oOyuLFVp1B8rMieO3t1WNFS4FKorv0/EAi9ivL73QOSFU= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1724739672; c=relaxed/simple; bh=raOB06Ks/mzARgy2vk8b1tkkD8xrAQKbRyka8GUgY+8=; h=Date:From:To:Subject:Content-Type:MIME-Version:Message-ID; b=ToS0Be8SK8AIMgaQQ76ifnxdTTQyr2Ly9Z92tZIDaoPNYwC2UatlDi7Qs9rDFAzt//XLe4DNoKucy8oAiBuOIQxheCYynKrgqLuyy302uDKM+KUjPkzKeOxajOvvB49ODXW2AtBfTWIAY1mFfWj/QfRfhRYaIkhsvIAfUYNylRI= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=163.com; spf=pass smtp.mailfrom=163.com; dkim=fail (1024-bit key) header.d=163.com header.i=@163.com header.b=bLLVMHSJ reason="signature verification failed"; arc=none smtp.client-ip=117.135.210.3 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=163.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=163.com Authentication-Results: smtp.subspace.kernel.org; dkim=fail reason="signature verification failed" (1024-bit key) header.d=163.com header.i=@163.com header.b="bLLVMHSJ" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=163.com; s=s110527; h=Date:From:Subject:Content-Type:MIME-Version: Message-ID; bh=UX4g4XAZ4APZYg8N7oWhcuO4nQUr6m8ma9i5kVLQP9g=; b=b LLVMHSJHLQOgjfXWIxoLGeYDW+nd+48l12wLDp98yUQqO/L2npUshufTIrRtdUcR 3sDCBtLXlNkhiUu3zy5XoPyk6q0xqV3OYFDz83aQth5+OPB4S4uhxcvAolm7MCt4 FR5q+TPVujyAp4dn+ba52vRljIA/sojG6Tjkv0tPrY= Received: from jinwenbinxue$163.com ( [125.121.236.12] ) by ajax-webmail-wmsvr-40-103 (Coremail) ; Tue, 27 Aug 2024 14:20:59 +0800 (CST) Date: Tue, 27 Aug 2024 14:20:59 +0800 (CST) From: =?utf-8?b?6Z2z5paH5a6+?= To: linux-rdma@vger.kernel.org Subject: =?utf-8?q?=5Bbug=5D_rdma-core/librdmacm/cma=2Ec_rdma=5Fcreate=5Fqp?= =?utf-8?q?=5Fex=EF=BC=9Aadd_id-=3Ecq_refer_to_qp=5Fattr-=3Ecq=2C_when_qp=5F?= =?utf-8?q?attr-=3Ecq_is_not_NULL=2C_and_id-=3Ecq_is_NULL_?= X-Priority: 3 X-Mailer: Coremail Webmail Server Version XT5.0.14 build 20240801(9da12a7b) Copyright (c) 2002-2024 www.mailtech.cn 163com X-NTES-SC: AL_Qu2ZBvuYtk4u7yOfYukfmkwXh+87Ucaxs/wi2IRSNpp+jC3p/iQkfFhZPXXO78O0DQqWlAKNWwBA5OJeRql/fKQVqVK2wNqmdzJAxeof8223gA== Precedence: bulk X-Mailing-List: linux-rdma@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-ID: X-Coremail-Locale: zh_CN X-CM-TRANSID: _____wD3X75LcM1mNws1AA--.9190W X-CM-SenderInfo: 5mlq4vhqel05lxh6il2tof0z/1tbiUBpIQmXAmu6XgQABsG X-Coremail-Antispam: 1U5529EdanIXcx71UUUUU7vcSsGvfC2KfnxnUU== I think the following modification is more correct,  if there have something i dont know, pls tell me, thx         qp = ibv_create_qp_ex(id->verbs, attr); 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;