Re: [PATCH] IB/srpt: Add RDMA/CM support

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Thu, 2018-02-22 at 21:07 -0500, Doug Ledford wrote:
> On Thu, 2018-02-22 at 14:09 -0800, Bart Van Assche wrote:
> > +static struct rdma_cm_id *srpt_create_rdma_id(u16 rdma_cm_port)
> > +{
> > +       struct rdma_cm_id *rdma_cm_id;
> > +       struct sockaddr_in addr = { };
> > +       int ret;
> > +
> > +       rdma_cm_id = rdma_create_id(&init_net, srpt_rdma_cm_handler,
> 
>                                       ^^^^^^^^^
> > +                                   NULL, RDMA_PS_TCP, IB_QPT_RC);
> > +       if (IS_ERR(rdma_cm_id)) {
> > +               pr_err("RDMA/CM ID creation failed: %ld\n",
> > +                      PTR_ERR(rdma_cm_id));
> > +               goto out;
> > +       }
> > +
> > +       /* We will listen on any RDMA device. */
> 
>              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
> 
> The above code, and this comment, do not seem to be in agreement.  
> What happens if we have some RoCE devices on non-init_net namespaces and
> we get an incoming connect on their IP?  We're supposedly listening on
> the wildcard address, but will we see it?

If I follow the following call chain:
rdma_listen()
-> cma_ib_listen()
-> cma_req_handler()
-> cma_id_from_event()
-> cma_find_listener()
-> cma_match_net_dev()

then I see that the namespace passed to rdma_create_id() is ignored if an
RDMA ID has not been bound to a specific interface (bound_dev_if == 0).

Did I perhaps overlook something?

BTW, while reviewing the code I noticed that the comment above
srpt_rdma_cm_port_show() is incorrect so I have to repost this patch anyway.

> Otherwise, I'm generally happy with this patch now.

Thanks for the review!

Bart.


��.n��������+%������w��{.n�����{���fk��ܨ}���Ơz�j:+v�����w����ޙ��&�)ߡ�a����z�ޗ���ݢj��w�f




[Index of Archives]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Photo]     [Yosemite News]     [Yosemite Photos]     [Linux Kernel]     [Linux SCSI]     [XFree86]

  Powered by Linux