Skip to contentSkip to conversation

nfs: add nfs IPv6 rdma6 mount option support

PATCH In review Shirley Ma 6 participants 13 messages Mar 16, 2016 – Apr 4, 2016

Subsystems (4)
lore
Share & tools
lore

Shirley Ma

author
#0 lore raw

PATCH 1/1 nfs: add nfs IPv6 rdma6 mount option support

Add rdma6 option to support NFS/RDMA IPv6.

---

fs/nfs/super.c +6 -0
index f126828..62a55d0 100644
@@ -191,6 +191,7 @@ static const match_table_t nfs_mount_option_tokens = {
 
 enum {
 	Opt_xprt_udp, Opt_xprt_udp6, Opt_xprt_tcp, Opt_xprt_tcp6, Opt_xprt_rdma,
+	Opt_xprt_rdma6,
 
 	Opt_xprt_err
 };
@@ -201,6 +202,7 @@ static const match_table_t nfs_xprt_protocol_tokens = {
 	{ Opt_xprt_tcp, "tcp" },
 	{ Opt_xprt_tcp6, "tcp6" },
 	{ Opt_xprt_rdma, "rdma" },
+	{ Opt_xprt_rdma6, "rdma6" },
 
 	{ Opt_xprt_err, NULL }
 };
@@ -1456,6 +1458,8 @@ static int nfs_parse_mount_options(char *raw,
 				mnt->flags |= NFS_MOUNT_TCP;
 				mnt->nfs_server.protocol = XPRT_TRANSPORT_TCP;
 				break;
+			case Opt_xprt_rdma6:
+				protofamily = AF_INET6;
 			case Opt_xprt_rdma:
 				/* vector side protocols to TCP */
 				mnt->flags |= NFS_MOUNT_TCP;
@@ -1490,6 +1494,8 @@ static int nfs_parse_mount_options(char *raw,
 			case Opt_xprt_tcp:
 				mnt->mount_server.protocol = XPRT_TRANSPORT_TCP;
 				break;
+			case Opt_xprt_rdma6:
+				mountfamily = AF_INET6;
 			case Opt_xprt_rdma: /* not used for side protocols */
 			default:
 				dfprintk(MOUNT, "NFS:   unrecognized "
include/linux/sunrpc/msg_prot.h +1 -0
index 8073713..49b8433 100644
@@ -149,6 +149,7 @@ typedef __be32	rpc_fraghdr;
 #define RPCBIND_NETID_UDP	"udp"
 #define RPCBIND_NETID_TCP	"tcp"
 #define RPCBIND_NETID_RDMA	"rdma"
+#define RPCBIND_NETID_RDMA6	"rdma6"
 #define RPCBIND_NETID_SCTP	"sctp"
 #define RPCBIND_NETID_UDP6	"udp6"
 #define RPCBIND_NETID_TCP6	"tcp6"
#1 lore raw
Quoted 1 line · Shirley Ma

Add rdma6 option to support NFS/RDMA IPv6.

This is client-side: cc'ing Trond and Anna.--b.

Quoted 55 lines

---

fs/nfs/super.c +6 -0
index f126828..62a55d0 100644
@@ -191,6 +191,7 @@ static const match_table_t nfs_mount_option_tokens = {
 
 enum {
 	Opt_xprt_udp, Opt_xprt_udp6, Opt_xprt_tcp, Opt_xprt_tcp6, Opt_xprt_rdma,
+	Opt_xprt_rdma6,
 
 	Opt_xprt_err
 };
@@ -201,6 +202,7 @@ static const match_table_t nfs_xprt_protocol_tokens = {
 	{ Opt_xprt_tcp, "tcp" },
 	{ Opt_xprt_tcp6, "tcp6" },
 	{ Opt_xprt_rdma, "rdma" },
+	{ Opt_xprt_rdma6, "rdma6" },
 
 	{ Opt_xprt_err, NULL }
 };
@@ -1456,6 +1458,8 @@ static int nfs_parse_mount_options(char *raw,
 				mnt->flags |= NFS_MOUNT_TCP;
 				mnt->nfs_server.protocol = XPRT_TRANSPORT_TCP;
 				break;
+			case Opt_xprt_rdma6:
+				protofamily = AF_INET6;
 			case Opt_xprt_rdma:
 				/* vector side protocols to TCP */
 				mnt->flags |= NFS_MOUNT_TCP;
@@ -1490,6 +1494,8 @@ static int nfs_parse_mount_options(char *raw,
 			case Opt_xprt_tcp:
 				mnt->mount_server.protocol = XPRT_TRANSPORT_TCP;
 				break;
+			case Opt_xprt_rdma6:
+				mountfamily = AF_INET6;
 			case Opt_xprt_rdma: /* not used for side protocols */
 			default:
 				dfprintk(MOUNT, "NFS:   unrecognized "
include/linux/sunrpc/msg_prot.h +1 -0
index 8073713..49b8433 100644
@@ -149,6 +149,7 @@ typedef __be32	rpc_fraghdr;
 #define RPCBIND_NETID_UDP	"udp"
 #define RPCBIND_NETID_TCP	"tcp"
 #define RPCBIND_NETID_RDMA	"rdma"
+#define RPCBIND_NETID_RDMA6	"rdma6"
 #define RPCBIND_NETID_SCTP	"sctp"
 #define RPCBIND_NETID_UDP6	"udp6"
 #define RPCBIND_NETID_TCP6	"tcp6"
#2 lore raw
In reply to Shirley Ma

Hi Shirley,

Sorry for the delay in looking at this patch. Comments are below:

Quoted 3 lines · Shirley Ma

Add rdma6 option to support NFS/RDMA IPv6.

Can you add a little more to the patch description to describe when RDMA with IPv6 would be used?

Quoted 32 lines

---

fs/nfs/super.c +4 -0
index f126828..62a55d0 100644
@@ -191,6 +191,7 @@ static const match_table_t nfs_mount_option_tokens = {
 
 enum {
 	Opt_xprt_udp, Opt_xprt_udp6, Opt_xprt_tcp, Opt_xprt_tcp6, Opt_xprt_rdma,
+	Opt_xprt_rdma6,
 
 	Opt_xprt_err
 };
@@ -201,6 +202,7 @@ static const match_table_t nfs_xprt_protocol_tokens = {
 	{ Opt_xprt_tcp, "tcp" },
 	{ Opt_xprt_tcp6, "tcp6" },
 	{ Opt_xprt_rdma, "rdma" },
+	{ Opt_xprt_rdma6, "rdma6" },
 
 	{ Opt_xprt_err, NULL }
 };
@@ -1456,6 +1458,8 @@ static int nfs_parse_mount_options(char *raw,
 				mnt->flags |= NFS_MOUNT_TCP;
 				mnt->nfs_server.protocol = XPRT_TRANSPORT_TCP;
 				break;
+			case Opt_xprt_rdma6:
+				protofamily = AF_INET6;
 			case Opt_xprt_rdma:
 				/* vector side protocols to TCP */
 				mnt->flags |= NFS_MOUNT_TCP;

fs/nfs/super.c static int nfs_parse_mount_options(char *raw, · line 1499

Quoted 6 lines
fs/nfs/super.c +2 -0
@@ -1490,6 +1494,8 @@ static int nfs_parse_mount_options(char *raw,
 			case Opt_xprt_tcp:
 				mnt->mount_server.protocol = XPRT_TRANSPORT_TCP;
 				break;
+			case Opt_xprt_rdma6:
+				mountfamily = AF_INET6;
 			case Opt_xprt_rdma: /* not used for side protocols */
                                            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

Do we need to be setting mountfamily here? The comment next to Opt_xprt_rdma makes it sound like this code doesn't apply to RDMA.

include/linux/sunrpc/msg_prot.h typedef __be32 rpc_fraghdr; · line 152

Quoted 11 lines
fs/nfs/super.c +0 -0
 			default:
 				dfprintk(MOUNT, "NFS:   unrecognized "
include/linux/sunrpc/msg_prot.h +1 -0
index 8073713..49b8433 100644
@@ -149,6 +149,7 @@ typedef __be32	rpc_fraghdr;
 #define RPCBIND_NETID_UDP	"udp"
 #define RPCBIND_NETID_TCP	"tcp"
 #define RPCBIND_NETID_RDMA	"rdma"
+#define RPCBIND_NETID_RDMA6	"rdma6"

This is defined right after tcp6, so we probably don't need it twice :).

Thanks,
Anna

Quoted 9 lines
include/linux/sunrpc/msg_prot.h +0 -1
 #define RPCBIND_NETID_SCTP	"sctp"
 #define RPCBIND_NETID_UDP6	"udp6"
 #define RPCBIND_NETID_TCP6	"tcp6"
 
--

To unsubscribe from this list: send the line "unsubscribe linux-nfs" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html

#3 lore raw
Quoted 53 lines · Anna Schumaker

Hi Shirley,

Sorry for the delay in looking at this patch. Comments are below:

Quoted 3 lines · Shirley Ma

Add rdma6 option to support NFS/RDMA IPv6.

Can you add a little more to the patch description to describe when RDMA with IPv6 would be used?

Quoted 32 lines

---

fs/nfs/super.c +4 -0
index f126828..62a55d0 100644
@@ -191,6 +191,7 @@ static const match_table_t nfs_mount_option_tokens = {
 
 enum {
 	Opt_xprt_udp, Opt_xprt_udp6, Opt_xprt_tcp, Opt_xprt_tcp6, Opt_xprt_rdma,
+	Opt_xprt_rdma6,
 
 	Opt_xprt_err
 };
@@ -201,6 +202,7 @@ static const match_table_t nfs_xprt_protocol_tokens = {
 	{ Opt_xprt_tcp, "tcp" },
 	{ Opt_xprt_tcp6, "tcp6" },
 	{ Opt_xprt_rdma, "rdma" },
+	{ Opt_xprt_rdma6, "rdma6" },
 
 	{ Opt_xprt_err, NULL }
 };
@@ -1456,6 +1458,8 @@ static int nfs_parse_mount_options(char *raw,
 				mnt->flags |= NFS_MOUNT_TCP;
 				mnt->nfs_server.protocol = XPRT_TRANSPORT_TCP;
 				break;
+			case Opt_xprt_rdma6:
+				protofamily = AF_INET6;
 			case Opt_xprt_rdma:
 				/* vector side protocols to TCP */
 				mnt->flags |= NFS_MOUNT_TCP;

fs/nfs/super.c static int nfs_parse_mount_options(char *raw, · line 1499

Quoted 6 lines
fs/nfs/super.c +2 -0
@@ -1490,6 +1494,8 @@ static int nfs_parse_mount_options(char *raw,
 			case Opt_xprt_tcp:
 				mnt->mount_server.protocol = XPRT_TRANSPORT_TCP;
 				break;
+			case Opt_xprt_rdma6:
+				mountfamily = AF_INET6;
 			case Opt_xprt_rdma: /* not used for side protocols */
                                           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Quoted 1 line

Do we need to be setting mountfamily here? The comment next to Opt_xprt_rdma makes it sound like this code doesn't apply to RDMA.

I wondered this too.

But what's going on is that for NFSv3 on RDMA, when IPv6 is used for the main protocol, IPv6 needs to be used for the mount protocol as well, even though it is going over TCP.

Quoted 27 lines

include/linux/sunrpc/msg_prot.h typedef __be32 rpc_fraghdr; · line 152

Quoted 11 lines
fs/nfs/super.c +0 -0
 			default:
 				dfprintk(MOUNT, "NFS:   unrecognized "
include/linux/sunrpc/msg_prot.h +1 -0
index 8073713..49b8433 100644
@@ -149,6 +149,7 @@ typedef __be32	rpc_fraghdr;
 #define RPCBIND_NETID_UDP	"udp"
 #define RPCBIND_NETID_TCP	"tcp"
 #define RPCBIND_NETID_RDMA	"rdma"
+#define RPCBIND_NETID_RDMA6	"rdma6"

This is defined right after tcp6, so we probably don't need it twice :).

Thanks,
Anna

Quoted 9 lines
include/linux/sunrpc/msg_prot.h +0 -1
 #define RPCBIND_NETID_SCTP	"sctp"
 #define RPCBIND_NETID_UDP6	"udp6"
 #define RPCBIND_NETID_TCP6	"tcp6"
 
--

To unsubscribe from this list: send the line "unsubscribe linux-nfs" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html

Quoted 4 lines

--
To unsubscribe from this list: send the line "unsubscribe linux-nfs" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html

--
Chuck Lever

#4 lore raw
Quoted 55 lines · Chuck Lever
Quoted 53 lines · Anna Schumaker

Hi Shirley,

Sorry for the delay in looking at this patch. Comments are below:

Quoted 3 lines · Shirley Ma

Add rdma6 option to support NFS/RDMA IPv6.

Can you add a little more to the patch description to describe when RDMA with IPv6 would be used?

Quoted 32 lines

---

fs/nfs/super.c +4 -0
index f126828..62a55d0 100644
@@ -191,6 +191,7 @@ static const match_table_t nfs_mount_option_tokens = {
 
 enum {
     Opt_xprt_udp, Opt_xprt_udp6, Opt_xprt_tcp, Opt_xprt_tcp6, Opt_xprt_rdma,
+    Opt_xprt_rdma6,
 
     Opt_xprt_err
 };
@@ -201,6 +202,7 @@ static const match_table_t nfs_xprt_protocol_tokens = {
     { Opt_xprt_tcp, "tcp" },
     { Opt_xprt_tcp6, "tcp6" },
     { Opt_xprt_rdma, "rdma" },
+    { Opt_xprt_rdma6, "rdma6" },
 
     { Opt_xprt_err, NULL }
 };
@@ -1456,6 +1458,8 @@ static int nfs_parse_mount_options(char *raw,
                             mnt->flags |= NFS_MOUNT_TCP;
                             mnt->nfs_server.protocol = XPRT_TRANSPORT_TCP;
                             break;
+                    case Opt_xprt_rdma6:
+                            protofamily = AF_INET6;
                     case Opt_xprt_rdma:
                             /* vector side protocols to TCP */
                             mnt->flags |= NFS_MOUNT_TCP;

fs/nfs/super.c static int nfs_parse_mount_options(char *raw, · line 1499

Quoted 6 lines
fs/nfs/super.c +2 -0
@@ -1490,6 +1494,8 @@ static int nfs_parse_mount_options(char *raw,
                     case Opt_xprt_tcp:
                             mnt->mount_server.protocol = XPRT_TRANSPORT_TCP;
                             break;
+                    case Opt_xprt_rdma6:
+                            mountfamily = AF_INET6;
                     case Opt_xprt_rdma: /* not used for side protocols */
                                           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Quoted 1 line

Do we need to be setting mountfamily here? The comment next to Opt_xprt_rdma makes it sound like this code doesn't apply to RDMA.

Quoted 5 lines

I wondered this too.

But what's going on is that for NFSv3 on RDMA, when IPv6 is used for the main protocol, IPv6 needs to be used for the mount protocol as well, even though it is going over TCP.

It causes nfs_mount_parse_options to immediately stop further parsing and return '0' == error encountered. The mount is supposed to fail in that case.

#5 lore raw
Quoted 61 lines · Trond Myklebust
Quoted 57 lines · Chuck Lever
Quoted 53 lines · Anna Schumaker

Hi Shirley,

Sorry for the delay in looking at this patch. Comments are below:

Quoted 3 lines · Shirley Ma

Add rdma6 option to support NFS/RDMA IPv6.

Can you add a little more to the patch description to describe when RDMA with IPv6 would be used?

Quoted 32 lines

---

fs/nfs/super.c +4 -0
index f126828..62a55d0 100644
@@ -191,6 +191,7 @@ static const match_table_t nfs_mount_option_tokens = {
 
 enum {
    Opt_xprt_udp, Opt_xprt_udp6, Opt_xprt_tcp, Opt_xprt_tcp6, Opt_xprt_rdma,
+    Opt_xprt_rdma6,
 
    Opt_xprt_err
 };
@@ -201,6 +202,7 @@ static const match_table_t nfs_xprt_protocol_tokens = {
    { Opt_xprt_tcp, "tcp" },
    { Opt_xprt_tcp6, "tcp6" },
    { Opt_xprt_rdma, "rdma" },
+    { Opt_xprt_rdma6, "rdma6" },
 
    { Opt_xprt_err, NULL }
 };
@@ -1456,6 +1458,8 @@ static int nfs_parse_mount_options(char *raw,
                            mnt->flags |= NFS_MOUNT_TCP;
                            mnt->nfs_server.protocol = XPRT_TRANSPORT_TCP;
                            break;
+                    case Opt_xprt_rdma6:
+                            protofamily = AF_INET6;
                    case Opt_xprt_rdma:
                            /* vector side protocols to TCP */
                            mnt->flags |= NFS_MOUNT_TCP;

fs/nfs/super.c static int nfs_parse_mount_options(char *raw, · line 1499

Quoted 6 lines
fs/nfs/super.c +2 -0
@@ -1490,6 +1494,8 @@ static int nfs_parse_mount_options(char *raw,
                    case Opt_xprt_tcp:
                            mnt->mount_server.protocol = XPRT_TRANSPORT_TCP;
                            break;
+                    case Opt_xprt_rdma6:
+                            mountfamily = AF_INET6;
                    case Opt_xprt_rdma: /* not used for side protocols */
                                          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Quoted 1 line

Do we need to be setting mountfamily here? The comment next to Opt_xprt_rdma makes it sound like this code doesn't apply to RDMA.

I wondered this too.

Quoted 7 lines
Quoted 3 lines

But what's going on is that for NFSv3 on RDMA, when IPv6 is used for the main protocol, IPv6 needs to be used for the mount protocol as well, even though it is going over TCP.

It causes nfs_mount_parse_options to immediately stop further parsing and return '0' == error encountered. The mount is supposed to fail in that case.

Ah, a break; is needed there too.

--
Chuck Lever

#6 lore raw
Quoted 65 lines · Chuck Lever
Quoted 65 lines · Trond Myklebust
Quoted 60 lines · Chuck Lever
Quoted 53 lines · Anna Schumaker

Hi Shirley,

Sorry for the delay in looking at this patch. Comments are below:

Quoted 3 lines · Shirley Ma

Add rdma6 option to support NFS/RDMA IPv6.

Can you add a little more to the patch description to describe when RDMA with IPv6 would be used?

Quoted 32 lines

---

fs/nfs/super.c +4 -0
index f126828..62a55d0 100644
@@ -191,6 +191,7 @@ static const match_table_t nfs_mount_option_tokens = {
 
 enum {
    Opt_xprt_udp, Opt_xprt_udp6, Opt_xprt_tcp, Opt_xprt_tcp6, Opt_xprt_rdma,
+    Opt_xprt_rdma6,
 
    Opt_xprt_err
 };
@@ -201,6 +202,7 @@ static const match_table_t nfs_xprt_protocol_tokens = {
    { Opt_xprt_tcp, "tcp" },
    { Opt_xprt_tcp6, "tcp6" },
    { Opt_xprt_rdma, "rdma" },
+    { Opt_xprt_rdma6, "rdma6" },
 
    { Opt_xprt_err, NULL }
 };
@@ -1456,6 +1458,8 @@ static int nfs_parse_mount_options(char *raw,
                            mnt->flags |= NFS_MOUNT_TCP;
                            mnt->nfs_server.protocol = XPRT_TRANSPORT_TCP;
                            break;
+                    case Opt_xprt_rdma6:
+                            protofamily = AF_INET6;
                    case Opt_xprt_rdma:
                            /* vector side protocols to TCP */
                            mnt->flags |= NFS_MOUNT_TCP;

fs/nfs/super.c static int nfs_parse_mount_options(char *raw, · line 1499

Quoted 6 lines
fs/nfs/super.c +2 -0
@@ -1490,6 +1494,8 @@ static int nfs_parse_mount_options(char *raw,
                    case Opt_xprt_tcp:
                            mnt->mount_server.protocol = XPRT_TRANSPORT_TCP;
                            break;
+                    case Opt_xprt_rdma6:
+                            mountfamily = AF_INET6;
                    case Opt_xprt_rdma: /* not used for side protocols */
                                          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Quoted 1 line

Do we need to be setting mountfamily here? The comment next to Opt_xprt_rdma makes it sound like this code doesn't apply to RDMA.

I wondered this too.

But what's going on is that for NFSv3 on RDMA, when IPv6 is used for the main protocol, IPv6 needs to be used for the mount protocol as well, even though it is going over TCP.

Quoted 6 lines
Quoted 3 lines

It causes nfs_mount_parse_options to immediately stop further parsing and return '0' == error encountered. The mount is supposed to fail in that case.

Ah, a break; is needed there too.

I'm saying that makes no sense to allow "rdma6" here in the first place, since we've already banned the use of "rdma" through that same mechanism.

#7 lore raw
Quoted 73 lines · Trond Myklebust
Quoted 69 lines · Chuck Lever
Quoted 68 lines · Trond Myklebust
Quoted 55 lines · Chuck Lever
Quoted 53 lines · Anna Schumaker

Hi Shirley,

Sorry for the delay in looking at this patch. Comments are below:

Quoted 3 lines · Shirley Ma

Add rdma6 option to support NFS/RDMA IPv6.

Can you add a little more to the patch description to describe when RDMA with IPv6 would be used?

Quoted 32 lines

---

fs/nfs/super.c +4 -0
index f126828..62a55d0 100644
@@ -191,6 +191,7 @@ static const match_table_t nfs_mount_option_tokens = {
 
 enum {
   Opt_xprt_udp, Opt_xprt_udp6, Opt_xprt_tcp, Opt_xprt_tcp6, Opt_xprt_rdma,
+    Opt_xprt_rdma6,
 
   Opt_xprt_err
 };
@@ -201,6 +202,7 @@ static const match_table_t nfs_xprt_protocol_tokens = {
   { Opt_xprt_tcp, "tcp" },
   { Opt_xprt_tcp6, "tcp6" },
   { Opt_xprt_rdma, "rdma" },
+    { Opt_xprt_rdma6, "rdma6" },
 
   { Opt_xprt_err, NULL }
 };
@@ -1456,6 +1458,8 @@ static int nfs_parse_mount_options(char *raw,
                           mnt->flags |= NFS_MOUNT_TCP;
                           mnt->nfs_server.protocol = XPRT_TRANSPORT_TCP;
                           break;
+                    case Opt_xprt_rdma6:
+                            protofamily = AF_INET6;
                   case Opt_xprt_rdma:
                           /* vector side protocols to TCP */
                           mnt->flags |= NFS_MOUNT_TCP;

fs/nfs/super.c static int nfs_parse_mount_options(char *raw, · line 1499

Quoted 6 lines
fs/nfs/super.c +2 -0
@@ -1490,6 +1494,8 @@ static int nfs_parse_mount_options(char *raw,
                   case Opt_xprt_tcp:
                           mnt->mount_server.protocol = XPRT_TRANSPORT_TCP;
                           break;
+                    case Opt_xprt_rdma6:
+                            mountfamily = AF_INET6;
                   case Opt_xprt_rdma: /* not used for side protocols */
                                         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Quoted 1 line

Do we need to be setting mountfamily here? The comment next to Opt_xprt_rdma makes it sound like this code doesn't apply to RDMA.

Quoted 5 lines

I wondered this too.

But what's going on is that for NFSv3 on RDMA, when IPv6 is used for the main protocol, IPv6 needs to be used for the mount protocol as well, even though it is going over TCP.

It causes nfs_mount_parse_options to immediately stop further parsing and return '0' == error encountered. The mount is supposed to fail in that case.

Quoted 6 lines
Quoted 2 lines

Ah, a break; is needed there too.

I'm saying that makes no sense to allow "rdma6" here in the first place, since we've already banned the use of "rdma" through that same mechanism.

I see, this is the parsing logic just for "mountproto=".

This hunk should be dropped, and maybe the
"case Opt_xprt_rdma:" can be removed, too.

--
Chuck Lever

author
#8 lore raw
Quoted 76 lines · Chuck Lever
Quoted 76 lines · Trond Myklebust
Quoted 71 lines · Chuck Lever
Quoted 61 lines · Trond Myklebust
Quoted 57 lines · Chuck Lever
Quoted 53 lines · Anna Schumaker

Hi Shirley,

Sorry for the delay in looking at this patch. Comments are below:

Quoted 3 lines · Shirley Ma

Add rdma6 option to support NFS/RDMA IPv6.

Can you add a little more to the patch description to describe when RDMA with IPv6 would be used?

Quoted 32 lines

---

fs/nfs/super.c +4 -0
index f126828..62a55d0 100644
@@ -191,6 +191,7 @@ static const match_table_t nfs_mount_option_tokens = {
 
 enum {
   Opt_xprt_udp, Opt_xprt_udp6, Opt_xprt_tcp, Opt_xprt_tcp6, Opt_xprt_rdma,
+    Opt_xprt_rdma6,
 
   Opt_xprt_err
 };
@@ -201,6 +202,7 @@ static const match_table_t nfs_xprt_protocol_tokens = {
   { Opt_xprt_tcp, "tcp" },
   { Opt_xprt_tcp6, "tcp6" },
   { Opt_xprt_rdma, "rdma" },
+    { Opt_xprt_rdma6, "rdma6" },
 
   { Opt_xprt_err, NULL }
 };
@@ -1456,6 +1458,8 @@ static int nfs_parse_mount_options(char *raw,
                           mnt->flags |= NFS_MOUNT_TCP;
                           mnt->nfs_server.protocol = XPRT_TRANSPORT_TCP;
                           break;
+                    case Opt_xprt_rdma6:
+                            protofamily = AF_INET6;
                   case Opt_xprt_rdma:
                           /* vector side protocols to TCP */
                           mnt->flags |= NFS_MOUNT_TCP;

fs/nfs/super.c static int nfs_parse_mount_options(char *raw, · line 1499

Quoted 6 lines
fs/nfs/super.c +2 -0
@@ -1490,6 +1494,8 @@ static int nfs_parse_mount_options(char *raw,
                   case Opt_xprt_tcp:
                           mnt->mount_server.protocol = XPRT_TRANSPORT_TCP;
                           break;
+                    case Opt_xprt_rdma6:
+                            mountfamily = AF_INET6;
                   case Opt_xprt_rdma: /* not used for side protocols */
                                         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Quoted 1 line

Do we need to be setting mountfamily here? The comment next to Opt_xprt_rdma makes it sound like this code doesn't apply to RDMA.

I wondered this too.

Quoted 7 lines
Quoted 3 lines

But what's going on is that for NFSv3 on RDMA, when IPv6 is used for the main protocol, IPv6 needs to be used for the mount protocol as well, even though it is going over TCP.

It causes nfs_mount_parse_options to immediately stop further parsing and return '0' == error encountered. The mount is supposed to fail in that case.

Ah, a break; is needed there too.

Quoted 8 lines
Quoted 3 lines

I'm saying that makes no sense to allow "rdma6" here in the first place, since we've already banned the use of "rdma" through that same mechanism.

I see, this is the parsing logic just for "mountproto=".

This hunk should be dropped, and maybe the
"case Opt_xprt_rdma:" can be removed, too.

Thanks for the review. I will drop mountfamily option case.

Quoted 6 lines

--
Chuck Lever

author
#9 lore raw

PATCH v2 1/1 nfs: add mount proto=rdma6 option for NFS/RDMA IPv6 addressing

In reply to Anna Schumaker

RFC 5666: The "rdma" netid is to be used when IPv4 addressing is employed by the underlying transport, and "rdma6" for IPv6 addressing.
Add mount -o proto=rdma6 option to support NFS/RDMA IPv6 addressing.

Changes from v1:
- Integrated comments from Chuck Level, Anna Schumaker, Trodt Myklebust
- Add a little more to the patch description to describe NFS/RDMA IPv6 usage
- Removed duplicated rdma6 define
- Removed Opt_xprt_rdma mountfamily since this doesn't support

---

 fs/nfs/super.c | 4 ++++
 1 file changed, 4 insertions(+)
fs/nfs/super.c +4 -0
index f126828..c884155 100644
@@ -191,6 +191,7 @@ static const match_table_t nfs_mount_option_tokens = {
 
 enum {
 	Opt_xprt_udp, Opt_xprt_udp6, Opt_xprt_tcp, Opt_xprt_tcp6, Opt_xprt_rdma,
+	Opt_xprt_rdma6,
 
 	Opt_xprt_err
 };
@@ -201,6 +202,7 @@ static const match_table_t nfs_xprt_protocol_tokens = {
 	{ Opt_xprt_tcp, "tcp" },
 	{ Opt_xprt_tcp6, "tcp6" },
 	{ Opt_xprt_rdma, "rdma" },
+	{ Opt_xprt_rdma6, "rdma6" },
 
 	{ Opt_xprt_err, NULL }
 };
@@ -1456,6 +1458,8 @@ static int nfs_parse_mount_options(char *raw,
 				mnt->flags |= NFS_MOUNT_TCP;
 				mnt->nfs_server.protocol = XPRT_TRANSPORT_TCP;
 				break;
+			case Opt_xprt_rdma6:
+				protofamily = AF_INET6;
 			case Opt_xprt_rdma:
 				/* vector side protocols to TCP */
 				mnt->flags |= NFS_MOUNT_TCP;

--
To unsubscribe from this list: send the line "unsubscribe linux-nfs" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html

#10 lore raw

Re: [PATCH V2] nfs: add mount proto=rdma6 option for NFS/RDMA IPv6 addressing

Quoted 5 lines · Shirley Ma

RFC 5666: The "rdma" netid is to be used when IPv4 addressing is employed by the underlying transport, and "rdma6" for IPv6 addressing.
Add mount -o proto=rdma6 option to support NFS/RDMA IPv6 addressing.

Quoted 8 lines

Changes from v1:
- Integrated comments from Chuck Level, Anna Schumaker, Trodt Myklebust
- Add a little more to the patch description to describe NFS/RDMA IPv6 usage
- Removed duplicated rdma6 define
- Removed Opt_xprt_rdma mountfamily since this doesn't support

It will be great if you can update the Documentation too.

Thanks
--
To unsubscribe from this list: send the line "unsubscribe linux-nfs" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html

author
#11 lore raw

Re: [PATCH V2] nfs: add mount proto=rdma6 option for NFS/RDMA IPv6 addressing

Quoted 13 lines · Leon Romanovsky
Quoted 12 lines · Shirley Ma

RFC 5666: The "rdma" netid is to be used when IPv4 addressing is employed by the underlying transport, and "rdma6" for IPv6 addressing.
Add mount -o proto=rdma6 option to support NFS/RDMA IPv6 addressing.

Changes from v1:
- Integrated comments from Chuck Level, Anna Schumaker, Trodt Myklebust
- Add a little more to the patch description to describe NFS/RDMA IPv6 usage
- Removed duplicated rdma6 define
- Removed Opt_xprt_rdma mountfamily since this doesn't support

Quoted 3 lines
Quoted 1 line

It will be great if you can update the Documentation too.

Sure, I will update documentation and man page.

Quoted 2 lines

Thanks

--
To unsubscribe from this list: send the line "unsubscribe linux-nfs" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html

author
#12 lore raw

PATCH 1/1 Documentation nfs-rdma.txt: Update nfs-rdma kernel module name and add IPv6 addressing option rdma6

Update NFS/RDMA transport module name from client xprtrdma, server svcrdma to rpcrdma which supports both server and client. Add mount proto option rdma6 to use IPv6 addressing for NFS/RDMA.

---

 Documentation/filesystems/nfs/nfs-rdma.txt | 20 ++++++++++----------
 1 file changed, 10 insertions(+), 10 deletions(-)
Documentation/filesystems/nfs/nfs-rdma.txt +10 -10
index 1e65645..6101b57 100644
@@ -238,12 +238,13 @@ NFS/RDMA Setup
 
   - Start the NFS server
 
-    If the NFS/RDMA server was built as a module (CONFIG_SUNRPC_XPRT_RDMA=m in
-    kernel config), load the RDMA transport module:
+    If the NFS/RDMA was built as a module (CONFIG_SUNRPC_XPRT_RDMA=m in
+    kernel config), load the RDMA transport module which supports both client
+    and server:
 
-    $ modprobe svcrdma
+    $ modprobe rpcrdma
 
-    Regardless of how the server was built (module or built-in), start the
+    Regardless of how the rpcrdma was built (module or built-in), start the
     server:
 
     $ /etc/init.d/nfs start
@@ -258,15 +259,14 @@ NFS/RDMA Setup
 
   - On the client system
 
-    If the NFS/RDMA client was built as a module (CONFIG_SUNRPC_XPRT_RDMA=m in
-    kernel config), load the RDMA client module:
+    Regardless of how rpcrdma was built (module or built-in), use this command
+    to mount the NFS/RDMA server through IPv4 addressing:
 
-    $ modprobe xprtrdma.ko
+    $ mount -o rdma,port=20049 <IPoIB-server-name-or-IPv4-address>:/<export> /mnt
 
-    Regardless of how the client was built (module or built-in), use this
-    command to mount the NFS/RDMA server:
+    or through IPv6 addressing
 
-    $ mount -o rdma,port=20049 <IPoIB-server-name-or-address>:/<export> /mnt
+    $ mount -o rdma6,port=20049 [<IPoIB-server-name-or-IPv6-address>]:/<export> /mnt
 
     To verify that the mount is using RDMA, run "cat /proc/mounts" and check
     the "proto" field for the given mount.

--
To unsubscribe from this list: send the line "unsubscribe linux-nfs" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html