[PATCH v1 2/2] infiniband: Fix cma_id_from_event net dev missing issue

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

 



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;
 		} 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



[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