> -----Original Message----- > From: Qingmin Liu [mailto:calmarrow@xxxxxxxxx] > Sent: Monday, May 14, 2018 6:11 PM > To: Doug Ledford <dledford@xxxxxxxxxx> > Cc: Jason Gunthorpe <jgg@xxxxxxxx>; Parav Pandit <parav@xxxxxxxxxxxx>; > Scott Branden <scott.branden@xxxxxxxxxxxx>; Ray Jui > <ray.jui@xxxxxxxxxxxx>; linux-rdma@xxxxxxxxxxxxxxx; Qingmin Liu > <qingmin.liu@xxxxxxxxxxxx> > Subject: [PATCH v1 2/2] infiniband: Fix cma_id_from_event net dev missing issue > > For RDMA, cma_id_from_event cannot find network namespace in container. > Realize it with get_netdev from request. > > Signed-off-by: Qingmin Liu <qingmin.liu@xxxxxxxxxxxx> > --- > drivers/infiniband/core/cma.c | 12 +++++++++--- > 1 file changed, 9 insertions(+), 3 deletions(-) > > diff --git a/drivers/infiniband/core/cma.c b/drivers/infiniband/core/cma.c index > 6b0e629ff97d..f71d8f420c1f 100644 > --- a/drivers/infiniband/core/cma.c > +++ b/drivers/infiniband/core/cma.c > @@ -1472,9 +1472,15 @@ static struct rdma_id_private > *cma_id_from_event(struct ib_cm_id *cm_id, > /* Assuming the protocol is AF_IB */ > *net_dev = NULL; > } else if (rdma_protocol_roce(req.device, req.port)) { > - /* TODO find the net dev matching the request > parameters > - * through the RoCE GID table */ > - *net_dev = NULL; > + /* > + * find the net dev matching the request parameters > + * through get_netdev > + */ > + if (req.device->get_netdev) > + *net_dev = req.device->get_netdev(req.device, > + req.port); > + else > + *net_dev = NULL; As I explained in the gid reference count series [1], ib_cm_event will be extended for UD and RC for RoCE which will provide the referenced gid attribute. This will be used for RoCE to establish the netdev identify which works with multiple netdev and not just netdev. [1] https://www.spinics.net/lists/linux-rdma/msg64663.html > } else { > return ERR_CAST(*net_dev); > } > -- > 2.7.4 -- To unsubscribe from this list: send the line "unsubscribe linux-rdma" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html