All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v1] RDMA/core: Handle ARPHRD_NONE devices for iWARP
@ 2023-06-07 19:43 Chuck Lever
  2023-06-08 15:30 ` Chuck Lever III
  2023-06-09 20:49 ` Tom Talpey
  0 siblings, 2 replies; 13+ messages in thread
From: Chuck Lever @ 2023-06-07 19:43 UTC (permalink / raw)
  To: jgg, BMT; +Cc: Chuck Lever, tom, linux-rdma

From: Chuck Lever <chuck.lever@oracle.com>

We would like to enable the use of siw on top of a VPN that is
constructed and managed via a tun device. That hasn't worked up
until now because ARPHRD_NONE devices (such as tun devices) have
no GID for the RDMA/core to look up.

But it turns out that the egress device has already been picked for
us. addr_handler() just has to do the right thing with it.

Tested with siw and qedr, both initiator and target.

Suggested-by: Jason Gunthorpe <jgg@nvidia.com>
Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
---
 drivers/infiniband/core/cma.c |    3 +++
 1 file changed, 3 insertions(+)

This of course needs broader testing, but it seems to work, and it's
a little nicer than "if (dev_type == ARPHRD_NONE)".

One thing I discovered is that the NFS/RDMA server implementation
does not deal at all with more than one RDMA device on the system.
I will address that with an ib_client; SunRPC patches forthcoming.

diff --git a/drivers/infiniband/core/cma.c b/drivers/infiniband/core/cma.c
index 56e568fcd32b..c9a2bdb49e3c 100644
--- a/drivers/infiniband/core/cma.c
+++ b/drivers/infiniband/core/cma.c
@@ -694,6 +694,9 @@ cma_validate_port(struct ib_device *device, u32 port,
 	if (!rdma_dev_access_netns(device, id_priv->id.route.addr.dev_addr.net))
 		return ERR_PTR(-ENODEV);
 
+	if (rdma_protocol_iwarp(device, port))
+		return rdma_get_gid_attr(device, port, 0);
+
 	if ((dev_type == ARPHRD_INFINIBAND) && !rdma_protocol_ib(device, port))
 		return ERR_PTR(-ENODEV);
 



^ permalink raw reply related	[flat|nested] 13+ messages in thread

end of thread, other threads:[~2023-06-12  2:33 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-06-07 19:43 [PATCH v1] RDMA/core: Handle ARPHRD_NONE devices for iWARP Chuck Lever
2023-06-08 15:30 ` Chuck Lever III
2023-06-09 20:49 ` Tom Talpey
2023-06-10  0:04   ` Zhu Yanjun
2023-06-10 16:43     ` Chuck Lever III
2023-06-11  0:27       ` Zhu Yanjun
2023-06-10 12:05   ` Jason Gunthorpe
2023-06-10 16:38     ` Tom Talpey
2023-06-10 17:11       ` Chuck Lever III
2023-06-11  1:08       ` Jason Gunthorpe
2023-06-11  0:33     ` Zhu Yanjun
2023-06-12  0:19     ` Chuck Lever III
2023-06-12  2:33       ` Zhu Yanjun

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.