diff mbox series

[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

Message ID f819f8c.52ce.191927ea67c.Coremail.jinwenbinxue@163.com (mailing list archive)
State Not Applicable
Headers show
Series [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 | expand

Commit Message

靳文宾 Aug. 27, 2024, 6:20 a.m. UTC
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);

Comments

Li Zhijian Aug. 28, 2024, 12:51 a.m. UTC | #1
Not related to your modification,

In general,
- Please report a bug with more details, such as how to reproduce, your expectations and what's the impact, etc...
- Please follow the patch submit instruction[1] or a PR if you want to submit a patch to the communities.

[1] https://docs.kernel.org/process/submitting-patches.html


On 27/08/2024 14:20, 靳文宾 wrote:
> 
> 
> 
> 
> 
> 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);
> 
> 
> 
> 
>
Leon Romanovsky Aug. 29, 2024, 9:08 a.m. UTC | #2
On Wed, Aug 28, 2024 at 12:51:30AM +0000, Zhijian Li (Fujitsu) wrote:
> Not related to your modification,
> 
> In general,
> - Please report a bug with more details, such as how to reproduce, your expectations and what's the impact, etc...
> - Please follow the patch submit instruction[1] or a PR if you want to submit a patch to the communities.
> 
> [1] https://docs.kernel.org/process/submitting-patches.html

+1

Thanks

> 
> 
> On 27/08/2024 14:20, 靳文宾 wrote:
> > 
> > 
> > 
> > 
> > 
> > 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);
> > 
> > 
> > 
> > 
> >
Zhu Yanjun Aug. 29, 2024, 12:04 p.m. UTC | #3
在 2024/8/28 8:51, Zhijian Li (Fujitsu) 写道:
> Not related to your modification,
> 
> In general,
> - Please report a bug with more details, such as how to reproduce, your expectations and what's the impact, etc...
> - Please follow the patch submit instruction[1] or a PR if you want to submit a patch to the communities.
> 
> [1] https://docs.kernel.org/process/submitting-patches.html

It seems a rdma-core problem. Not sure if it is reasonable to use the 
above link.

Zhu Yanjun

> 
> 
> On 27/08/2024 14:20, 靳文宾 wrote:
>>
>>
>>
>>
>>
>> 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);
>>
>>
>>
>>
Leon Romanovsky Sept. 2, 2024, 7 a.m. UTC | #4
On Thu, Aug 29, 2024 at 08:04:55PM +0800, Zhu Yanjun wrote:
> 在 2024/8/28 8:51, Zhijian Li (Fujitsu) 写道:
> > Not related to your modification,
> > 
> > In general,
> > - Please report a bug with more details, such as how to reproduce, your expectations and what's the impact, etc...
> > - Please follow the patch submit instruction[1] or a PR if you want to submit a patch to the communities.
> > 
> > [1] https://docs.kernel.org/process/submitting-patches.html
> 
> It seems a rdma-core problem. Not sure if it is reasonable to use the above
> link.

It is, https://github.com/linux-rdma/rdma-core/blob/master/Documentation/contributing.md
# Contributing to rdma-core

rdma-core is a userspace project for a Linux kernel interface and follows many
of the same expectations as contributing to the Linux kernel:

 - One change per patch

   Carefully describe your change in the commit message and break up work into
   appropriate reviewable commits.

   Refer to [Linux Kernel Submitting Patches](https://github.com/torvalds/linux/blob/master/Documentation/process/submitting-patches.rst)
   for general information.

 - Developer Certificate of Origin 'Signed-off-by' lines

   Include a Signed-off-by line to indicate your submission is suitable
   licensed and you have the legal authority to make this submission
   and accept the [DCO](#developers-certificate-of-origin-11)

 - Broadly follow the [Linux Kernel coding style](https://github.com/torvalds/linux/blob/master/Documentation/process/coding-style.rst)

As in the Linux Kernel, commits that are fixing bugs should be marked with a
Fixes: line to help backporting.

....

> 
> Zhu Yanjun
> 
> > 
> > 
> > On 27/08/2024 14:20, 靳文宾 wrote:
> > > 
> > > 
> > > 
> > > 
> > > 
> > > 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);
> > > 
> > > 
> > > 
> > > 
> 
>
diff mbox series

Patch

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;