* [PATCH v2] svcrdma: add IPv6 support
@ 2016-03-16 18:41 Shirley Ma
[not found] ` <56E9A8DD.8030308-QHcLZuEGTsvQT0dZR+AlfA@public.gmane.org>
0 siblings, 1 reply; 4+ messages in thread
From: Shirley Ma @ 2016-03-16 18:41 UTC (permalink / raw)
To: Anna Schumaker, Chuck Lever, leon-2ukJVAZIZ/Y
Cc: Linux NFS Mailing List, linux-rdma
Add rdma6 option to support NFS/RDMA IPv6.
Allow both IPv4 and IPv6 to bind same port at the same time,
restricts use of the IPv6 socket to IPv6 communication.
Changes from v1:
- Check rdma_set_afonly return value (suggested by Leon Romanovsky)
Signed-off-by: Shirley Ma <shirley.ma-QHcLZuEGTsvQT0dZR+AlfA@public.gmane.org>
---
diff --git a/net/sunrpc/xprtrdma/svc_rdma_transport.c b/net/sunrpc/xprtrdma/svc_rdma_transport.c
--- a/net/sunrpc/xprtrdma/svc_rdma_transport.c
+++ b/net/sunrpc/xprtrdma/svc_rdma_transport.c
@@ -869,7 +869,7 @@ static struct svc_xprt *svc_rdma_create(struct svc_serv *serv,
int ret;
dprintk("svcrdma: Creating RDMA socket\n");
- if (sa->sa_family != AF_INET) {
+ if ((sa->sa_family != AF_INET) && (sa->sa_family != AF_INET6)) {
dprintk("svcrdma: Address family %d is not supported.\n", sa->sa_family);
return ERR_PTR(-EAFNOSUPPORT);
}
@@ -885,6 +885,16 @@ static struct svc_xprt *svc_rdma_create(struct svc_serv *serv,
goto err0;
}
+ /* Allow both IPv4 and IPv6 sockets to bind a single port
+ * at the same time.
+ */
+#if IS_ENABLED(CONFIG_IPV6)
+ ret = rdma_set_afonly(listen_id, 1);
+ if (ret) {
+ dprintk("svcrdma: rdma_set_afonly failed = %d\n", ret);
+ goto err1;
+ }
+#endif
ret = rdma_bind_addr(listen_id, sa);
if (ret) {
dprintk("svcrdma: rdma_bind_addr failed = %d\n", ret);
--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply [flat|nested] 4+ messages in thread[parent not found: <56E9A8DD.8030308-QHcLZuEGTsvQT0dZR+AlfA@public.gmane.org>]
* Re: [PATCH v2] svcrdma: add IPv6 support [not found] ` <56E9A8DD.8030308-QHcLZuEGTsvQT0dZR+AlfA@public.gmane.org> @ 2016-03-17 8:42 ` Leon Romanovsky [not found] ` <20160317084210.GE25216-2ukJVAZIZ/Y@public.gmane.org> 0 siblings, 1 reply; 4+ messages in thread From: Leon Romanovsky @ 2016-03-17 8:42 UTC (permalink / raw) To: Shirley Ma Cc: Anna Schumaker, Chuck Lever, Linux NFS Mailing List, linux-rdma On Wed, Mar 16, 2016 at 11:41:33AM -0700, Shirley Ma wrote: > Add rdma6 option to support NFS/RDMA IPv6. > Allow both IPv4 and IPv6 to bind same port at the same time, > restricts use of the IPv6 socket to IPv6 communication. > > Changes from v1: > - Check rdma_set_afonly return value (suggested by Leon Romanovsky) Looks good to me. Acked-by: Leon Romanovsky <leonro-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org> Thanks. > > Signed-off-by: Shirley Ma <shirley.ma-QHcLZuEGTsvQT0dZR+AlfA@public.gmane.org> > --- > > diff --git a/net/sunrpc/xprtrdma/svc_rdma_transport.c b/net/sunrpc/xprtrdma/svc_rdma_transport.c > --- a/net/sunrpc/xprtrdma/svc_rdma_transport.c > +++ b/net/sunrpc/xprtrdma/svc_rdma_transport.c > @@ -869,7 +869,7 @@ static struct svc_xprt *svc_rdma_create(struct svc_serv *serv, > int ret; > > dprintk("svcrdma: Creating RDMA socket\n"); > - if (sa->sa_family != AF_INET) { > + if ((sa->sa_family != AF_INET) && (sa->sa_family != AF_INET6)) { > dprintk("svcrdma: Address family %d is not supported.\n", sa->sa_family); > return ERR_PTR(-EAFNOSUPPORT); > } > @@ -885,6 +885,16 @@ static struct svc_xprt *svc_rdma_create(struct svc_serv *serv, > goto err0; > } > > + /* Allow both IPv4 and IPv6 sockets to bind a single port > + * at the same time. > + */ > +#if IS_ENABLED(CONFIG_IPV6) > + ret = rdma_set_afonly(listen_id, 1); > + if (ret) { > + dprintk("svcrdma: rdma_set_afonly failed = %d\n", ret); > + goto err1; > + } > +#endif > ret = rdma_bind_addr(listen_id, sa); > if (ret) { > dprintk("svcrdma: rdma_bind_addr failed = %d\n", ret); -- To unsubscribe from this list: send the line "unsubscribe linux-rdma" in the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org More majordomo info at http://vger.kernel.org/majordomo-info.html ^ permalink raw reply [flat|nested] 4+ messages in thread
[parent not found: <20160317084210.GE25216-2ukJVAZIZ/Y@public.gmane.org>]
* Re: [PATCH v2] svcrdma: add IPv6 support [not found] ` <20160317084210.GE25216-2ukJVAZIZ/Y@public.gmane.org> @ 2016-03-17 14:01 ` Chuck Lever [not found] ` <9D93B217-3044-4404-8EB4-6CD0DD759642-QHcLZuEGTsvQT0dZR+AlfA@public.gmane.org> 0 siblings, 1 reply; 4+ messages in thread From: Chuck Lever @ 2016-03-17 14:01 UTC (permalink / raw) To: leon-2ukJVAZIZ/Y Cc: Shirley Ma, Anna Schumaker, Linux NFS Mailing List, linux-rdma, Bruce Fields Server-side patch; cc-ing Bruce. > On Mar 17, 2016, at 4:42 AM, Leon Romanovsky <leon-2ukJVAZIZ/Y@public.gmane.org> wrote: > > On Wed, Mar 16, 2016 at 11:41:33AM -0700, Shirley Ma wrote: >> Add rdma6 option to support NFS/RDMA IPv6. >> Allow both IPv4 and IPv6 to bind same port at the same time, >> restricts use of the IPv6 socket to IPv6 communication. >> >> Changes from v1: >> - Check rdma_set_afonly return value (suggested by Leon Romanovsky) > > Looks good to me. > Acked-by: Leon Romanovsky <leonro-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org> > > Thanks. > >> >> Signed-off-by: Shirley Ma <shirley.ma-QHcLZuEGTsvQT0dZR+AlfA@public.gmane.org> >> --- >> >> diff --git a/net/sunrpc/xprtrdma/svc_rdma_transport.c b/net/sunrpc/xprtrdma/svc_rdma_transport.c >> --- a/net/sunrpc/xprtrdma/svc_rdma_transport.c >> +++ b/net/sunrpc/xprtrdma/svc_rdma_transport.c >> @@ -869,7 +869,7 @@ static struct svc_xprt *svc_rdma_create(struct svc_serv *serv, >> int ret; >> >> dprintk("svcrdma: Creating RDMA socket\n"); >> - if (sa->sa_family != AF_INET) { >> + if ((sa->sa_family != AF_INET) && (sa->sa_family != AF_INET6)) { > >> dprintk("svcrdma: Address family %d is not supported.\n", sa->sa_family); >> return ERR_PTR(-EAFNOSUPPORT); >> } >> @@ -885,6 +885,16 @@ static struct svc_xprt *svc_rdma_create(struct svc_serv *serv, >> goto err0; >> } >> >> + /* Allow both IPv4 and IPv6 sockets to bind a single port >> + * at the same time. >> + */ >> +#if IS_ENABLED(CONFIG_IPV6) >> + ret = rdma_set_afonly(listen_id, 1); >> + if (ret) { >> + dprintk("svcrdma: rdma_set_afonly failed = %d\n", ret); >> + goto err1; >> + } >> +#endif >> ret = rdma_bind_addr(listen_id, sa); >> if (ret) { >> dprintk("svcrdma: rdma_bind_addr failed = %d\n", ret); > -- > To unsubscribe from this list: send the line "unsubscribe linux-nfs" in > the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org > More majordomo info at http://vger.kernel.org/majordomo-info.html -- Chuck Lever -- To unsubscribe from this list: send the line "unsubscribe linux-rdma" in the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org More majordomo info at http://vger.kernel.org/majordomo-info.html ^ permalink raw reply [flat|nested] 4+ messages in thread
[parent not found: <9D93B217-3044-4404-8EB4-6CD0DD759642-QHcLZuEGTsvQT0dZR+AlfA@public.gmane.org>]
* [PATCH v3] svcrdma: add IPv6 support [not found] ` <9D93B217-3044-4404-8EB4-6CD0DD759642-QHcLZuEGTsvQT0dZR+AlfA@public.gmane.org> @ 2016-04-04 18:09 ` Shirley Ma 0 siblings, 0 replies; 4+ messages in thread From: Shirley Ma @ 2016-04-04 18:09 UTC (permalink / raw) To: Bruce Fields Cc: Chuck Lever, leon-2ukJVAZIZ/Y, Linux NFS Mailing List, linux-rdma Add rdma6 option to support NFS/RDMA IPv6 addressing. Allow both IPv4 and IPv6 to bind same port at the same time, restricts use of the IPv6 socket to IPv6 communication. Changes from v1: - Check rdma_set_afonly return value (suggested by Leon Romanovsky) Changes from v2: - Acked-by: Leon Romanovsky <leonro-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org> Signed-off-by: Shirley Ma <shirley.ma-QHcLZuEGTsvQT0dZR+AlfA@public.gmane.org> --- net/sunrpc/xprtrdma/svc_rdma_transport.c | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/net/sunrpc/xprtrdma/svc_rdma_transport.c b/net/sunrpc/xprtrdma/svc_rdma_transport.c index 9066896..d2680b8 100644 --- a/net/sunrpc/xprtrdma/svc_rdma_transport.c +++ b/net/sunrpc/xprtrdma/svc_rdma_transport.c @@ -789,7 +789,7 @@ static struct svc_xprt *svc_rdma_create(struct svc_serv *serv, int ret; dprintk("svcrdma: Creating RDMA socket\n"); - if (sa->sa_family != AF_INET) { + if ((sa->sa_family != AF_INET) && (sa->sa_family != AF_INET6)) { dprintk("svcrdma: Address family %d is not supported.\n", sa->sa_family); return ERR_PTR(-EAFNOSUPPORT); } @@ -805,6 +805,16 @@ static struct svc_xprt *svc_rdma_create(struct svc_serv *serv, goto err0; } + /* Allow both IPv4 and IPv6 sockets to bind a single port + * at the same time. + */ +#if IS_ENABLED(CONFIG_IPV6) + ret = rdma_set_afonly(listen_id, 1); + if (ret) { + dprintk("svcrdma: rdma_set_afonly failed = %d\n", ret); + goto err1; + } +#endif ret = rdma_bind_addr(listen_id, sa); if (ret) { dprintk("svcrdma: rdma_bind_addr failed = %d\n", ret); -- To unsubscribe from this list: send the line "unsubscribe linux-rdma" in the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org More majordomo info at http://vger.kernel.org/majordomo-info.html ^ permalink raw reply related [flat|nested] 4+ messages in thread
end of thread, other threads:[~2016-04-04 18:09 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-03-16 18:41 [PATCH v2] svcrdma: add IPv6 support Shirley Ma
[not found] ` <56E9A8DD.8030308-QHcLZuEGTsvQT0dZR+AlfA@public.gmane.org>
2016-03-17 8:42 ` Leon Romanovsky
[not found] ` <20160317084210.GE25216-2ukJVAZIZ/Y@public.gmane.org>
2016-03-17 14:01 ` Chuck Lever
[not found] ` <9D93B217-3044-4404-8EB4-6CD0DD759642-QHcLZuEGTsvQT0dZR+AlfA@public.gmane.org>
2016-04-04 18:09 ` [PATCH v3] " Shirley Ma
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox; as well as URLs for NNTP newsgroup(s).