Skip to contentSkip to conversation

knfsd: map null socket to SOCK_STREAM in svc_max_payload

RFC PATCH In review Tom Tucker 2 participants 5 messages May 18, 2007

Subsystems (3)
lore
Share & tools
lore

Tom Tucker

author
#0 lore raw

RFC PATCH 4/15 knfsd: map null socket to SOCK_STREAM in svc_max_payload

The svc_max_payload function looks into the sk_sock structure to determine what the reported max payload should be. For RDMA, there is no socket. This change effectively maps a NULL sk_sock to SOCK_STREAM.

---

 net/sunrpc/svc.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
net/sunrpc/svc.c +1 -1
index 9fec17d..b343db8 100644
@@ -1024,7 +1024,7 @@ u32 svc_max_payload(const struct svc_rqs
 {
 	int max = RPCSVC_MAXPAYLOAD_TCP;
 
-	if (rqstp->rq_sock->sk_sock->type == SOCK_DGRAM)
+	if (rqstp->rq_sock->sk_sock && rqstp->rq_sock->sk_sock->type == SOCK_DGRAM)
 		max = RPCSVC_MAXPAYLOAD_UDP;
 	if (rqstp->rq_server->sv_max_payload < max)
 		max = rqstp->rq_server->sv_max_payload;

-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
_______________________________________________
NFS maillist - [email protected]
https://lists.sourceforge.net/lists/listinfo/nfs

#1 lore raw
Quoted 16 lines · Tom Tucker

The svc_max_payload function looks into the sk_sock structure to determine what the reported max payload should be. For RDMA, there is no socket. This change effectively maps a NULL sk_sock to SOCK_STREAM.

---

 net/sunrpc/svc.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
net/sunrpc/svc.c +0 -0
index 9fec17d..b343db8 100644

net/sunrpc/svc.c u32 svc_max_payload(const struct svc_rqs · line 1030

Quoted 8 lines
net/sunrpc/svc.c +1 -1
@@ -1024,7 +1024,7 @@ u32 svc_max_payload(const struct svc_rqs
 {
 	int max = RPCSVC_MAXPAYLOAD_TCP;
 
-	if (rqstp->rq_sock->sk_sock->type == SOCK_DGRAM)
+	if (rqstp->rq_sock->sk_sock && rqstp->rq_sock->sk_sock->type == SOCK_DGRAM)
 		max = RPCSVC_MAXPAYLOAD_UDP;
 	if (rqstp->rq_server->sv_max_payload < max)
 		max = rqstp->rq_server->sv_max_payload;

Don't you want to use Greg's sko_max_payload() (or whatever it ends up being) for this?

--b.

-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
_______________________________________________
NFS maillist - [email protected]
https://lists.sourceforge.net/lists/listinfo/nfs

author
#2 lore raw
Quoted 20 lines · J. Bruce Fields
Quoted 19 lines · Tom Tucker

The svc_max_payload function looks into the sk_sock structure to determine what the reported max payload should be. For RDMA, there is no socket. This change effectively maps a NULL sk_sock to SOCK_STREAM.

---

 net/sunrpc/svc.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
net/sunrpc/svc.c +0 -0
index 9fec17d..b343db8 100644
@@ -1024,7 +1024,7 @@ u32 svc_max_payload(const struct svc_rqs
 {
 	int max = RPCSVC_MAXPAYLOAD_TCP;
 
Quoted 8 lines

net/sunrpc/svc.c u32 svc_max_payload(const struct svc_rqs · line 1030

Quoted 5 lines
net/sunrpc/svc.c +1 -1
-	if (rqstp->rq_sock->sk_sock->type == SOCK_DGRAM)
+	if (rqstp->rq_sock->sk_sock && rqstp->rq_sock->sk_sock->type == SOCK_DGRAM)
 		max = RPCSVC_MAXPAYLOAD_UDP;
 	if (rqstp->rq_server->sv_max_payload < max)
 		max = rqstp->rq_server->sv_max_payload;

Don't you want to use Greg's sko_max_payload() (or whatever it ends up being) for this?

Yes, however, we don't know what it's going to end up being yet and I'd like to get this code reviewed, so I can work the issues in parallel. BTW, the current transport switch (before the mods) is up and running in several locations.

Quoted 2 lines

--b.

-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
_______________________________________________
NFS maillist - [email protected]
https://lists.sourceforge.net/lists/listinfo/nfs

#3 lore raw
Quoted 2 lines · Tom Tucker

Yes, however, we don't know what it's going to end up being yet and I'd like to get this code reviewed, so I can work the issues in parallel.

Sure.

But I guess some questions will be easiest to answer when the two are completely integrated.

Quoted 2 lines

BTW, the current transport switch (before the mods) is up and running in several locations.

OK!

--b.

-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
_______________________________________________
NFS maillist - [email protected]
https://lists.sourceforge.net/lists/listinfo/nfs

author
#4 lore raw
Quoted 8 lines · J. Bruce Fields
Quoted 2 lines · Tom Tucker

Yes, however, we don't know what it's going to end up being yet and I'd like to get this code reviewed, so I can work the issues in parallel.

Sure.

But I guess some questions will be easiest to answer when the two are completely integrated.

I also think by considering the two together, you can get a better understanding of what's actually needed.

Quoted 7 lines
Quoted 3 lines

BTW, the current transport switch (before the mods) is up and running in several locations.

OK!

--b.

-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
_______________________________________________
NFS maillist - [email protected]
https://lists.sourceforge.net/lists/listinfo/nfs