From 11057bb00f9f3b774ef74c31ebed91a17cb02a2b Mon Sep 17 00:00:00 2001 From: mohans Date: Fri, 12 Oct 2007 03:56:27 +0000 Subject: [PATCH] Set the NFS server sockbuf high watermarks to the system defaults (up form 32KB). The low highwatermark setting caused UDP fullsock request drops, throttling thruput greatly. Reported by: Kris Kennaway Approved by: re@ (Ken Smith) --- sys/kern/uipc_sockbuf.c | 4 ++-- sys/nfsserver/nfs_syscalls.c | 7 +++---- 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/sys/kern/uipc_sockbuf.c b/sys/kern/uipc_sockbuf.c index 1b1e27158094..e1fc34106819 100644 --- a/sys/kern/uipc_sockbuf.c +++ b/sys/kern/uipc_sockbuf.c @@ -60,8 +60,8 @@ void (*aio_swake)(struct socket *, struct sockbuf *); */ u_long sb_max = SB_MAX; -static u_long sb_max_adj = - SB_MAX * MCLBYTES / (MSIZE + MCLBYTES); /* adjusted sb_max */ +u_long sb_max_adj = + SB_MAX * MCLBYTES / (MSIZE + MCLBYTES); /* adjusted sb_max */ static u_long sb_efficiency = 8; /* parameter for sbreserve() */ diff --git a/sys/nfsserver/nfs_syscalls.c b/sys/nfsserver/nfs_syscalls.c index aea9cc4df243..3043fcd4766a 100644 --- a/sys/nfsserver/nfs_syscalls.c +++ b/sys/nfsserver/nfs_syscalls.c @@ -100,6 +100,8 @@ static int nfssvc_addsock(struct file *, struct sockaddr *, static void nfsrv_zapsock(struct nfssvc_sock *slp); static int nfssvc_nfsd(struct thread *); +extern u_long sb_max_adj; + /* * NFS server system calls */ @@ -206,10 +208,7 @@ nfssvc_addsock(struct file *fp, struct sockaddr *mynam, struct thread *td) } } #endif - if (so->so_type == SOCK_STREAM) - siz = NFS_MAXPACKET + sizeof (u_long); - else - siz = NFS_MAXPACKET; + siz = sb_max_adj; error = soreserve(so, siz, siz); if (error) { if (mynam != NULL)