Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys bump PIPSIZ from 4 to 8K like FreeBSD and provide the sa...
details: https://anonhg.NetBSD.org/src/rev/8ce96f47dbc3
branches: trunk
changeset: 322528:8ce96f47dbc3
user: christos <christos%NetBSD.org@localhost>
date: Sat May 05 19:58:08 2018 +0000
description:
bump PIPSIZ from 4 to 8K like FreeBSD and provide the same sysctls
diffstat:
sys/kern/uipc_domain.c | 5 +++--
sys/kern/uipc_usrreq.c | 49 ++++++++++++++++++++++++++++++++++++++++++++++---
sys/sys/un.h | 3 ++-
3 files changed, 51 insertions(+), 6 deletions(-)
diffs (120 lines):
diff -r 7a37b1c0b91f -r 8ce96f47dbc3 sys/kern/uipc_domain.c
--- a/sys/kern/uipc_domain.c Sat May 05 17:16:23 2018 +0000
+++ b/sys/kern/uipc_domain.c Sat May 05 19:58:08 2018 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: uipc_domain.c,v 1.102 2018/02/28 09:44:25 mrg Exp $ */
+/* $NetBSD: uipc_domain.c,v 1.103 2018/05/05 19:58:08 christos Exp $ */
/*
* Copyright (c) 1982, 1986, 1993
@@ -32,7 +32,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: uipc_domain.c,v 1.102 2018/02/28 09:44:25 mrg Exp $");
+__KERNEL_RCSID(0, "$NetBSD: uipc_domain.c,v 1.103 2018/05/05 19:58:08 christos Exp $");
#include <sys/param.h>
#include <sys/socket.h>
@@ -682,6 +682,7 @@
SYSCTL_DESCR("SOCK_DGRAM protocol control block list"),
sysctl_unpcblist, 0, NULL, 0,
CTL_NET, PF_LOCAL, SOCK_DGRAM, CTL_CREATE, CTL_EOL);
+ unp_sysctl_create(&domain_sysctllog);
}
void
diff -r 7a37b1c0b91f -r 8ce96f47dbc3 sys/kern/uipc_usrreq.c
--- a/sys/kern/uipc_usrreq.c Sat May 05 17:16:23 2018 +0000
+++ b/sys/kern/uipc_usrreq.c Sat May 05 19:58:08 2018 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: uipc_usrreq.c,v 1.184 2018/03/19 16:26:26 roy Exp $ */
+/* $NetBSD: uipc_usrreq.c,v 1.185 2018/05/05 19:58:08 christos Exp $ */
/*-
* Copyright (c) 1998, 2000, 2004, 2008, 2009 The NetBSD Foundation, Inc.
@@ -96,7 +96,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: uipc_usrreq.c,v 1.184 2018/03/19 16:26:26 roy Exp $");
+__KERNEL_RCSID(0, "$NetBSD: uipc_usrreq.c,v 1.185 2018/05/05 19:58:08 christos Exp $");
#ifdef _KERNEL_OPT
#include "opt_compat_netbsd.h"
@@ -674,7 +674,9 @@
* and don't really want to reserve the sendspace. Their recvspace should
* be large enough for at least one max-size datagram plus address.
*/
-#define PIPSIZ 4096
+#ifndef PIPSIZ
+#define PIPSIZ 8192
+#endif
u_long unpst_sendspace = PIPSIZ;
u_long unpst_recvspace = PIPSIZ;
u_long unpdg_sendspace = 2*1024; /* really max datagram size */
@@ -1965,6 +1967,47 @@
mutex_exit(&filelist_lock);
}
+void
+unp_sysctl_create(struct sysctllog **clog)
+{
+ sysctl_createv(clog, 0, NULL, NULL,
+ CTLFLAG_PERMANENT|CTLFLAG_READWRITE,
+ CTLTYPE_LONG, "sendspace",
+ SYSCTL_DESCR("Default stream send space"),
+ NULL, 0, &unpst_sendspace, 0,
+ CTL_NET, PF_LOCAL, SOCK_STREAM, CTL_CREATE, CTL_EOL);
+ sysctl_createv(clog, 0, NULL, NULL,
+ CTLFLAG_PERMANENT|CTLFLAG_READWRITE,
+ CTLTYPE_LONG, "recvspace",
+ SYSCTL_DESCR("Default stream recv space"),
+ NULL, 0, &unpst_recvspace, 0,
+ CTL_NET, PF_LOCAL, SOCK_STREAM, CTL_CREATE, CTL_EOL);
+ sysctl_createv(clog, 0, NULL, NULL,
+ CTLFLAG_PERMANENT|CTLFLAG_READWRITE,
+ CTLTYPE_LONG, "sendspace",
+ SYSCTL_DESCR("Default datagram send space"),
+ NULL, 0, &unpdg_sendspace, 0,
+ CTL_NET, PF_LOCAL, SOCK_DGRAM, CTL_CREATE, CTL_EOL);
+ sysctl_createv(clog, 0, NULL, NULL,
+ CTLFLAG_PERMANENT|CTLFLAG_READWRITE,
+ CTLTYPE_LONG, "recvspace",
+ SYSCTL_DESCR("Default datagram recv space"),
+ NULL, 0, &unpdg_recvspace, 0,
+ CTL_NET, PF_LOCAL, SOCK_DGRAM, CTL_CREATE, CTL_EOL);
+ sysctl_createv(clog, 0, NULL, NULL,
+ CTLFLAG_PERMANENT|CTLFLAG_READONLY,
+ CTLTYPE_INT, "inflight",
+ SYSCTL_DESCR("File descriptors in flight"),
+ NULL, 0, &unp_rights, 0,
+ CTL_NET, PF_LOCAL, CTL_CREATE, CTL_EOL);
+ sysctl_createv(clog, 0, NULL, NULL,
+ CTLFLAG_PERMANENT|CTLFLAG_READONLY,
+ CTLTYPE_INT, "deferred",
+ SYSCTL_DESCR("File descriptors deferred for close"),
+ NULL, 0, &unp_defer, 0,
+ CTL_NET, PF_LOCAL, CTL_CREATE, CTL_EOL);
+}
+
const struct pr_usrreqs unp_usrreqs = {
.pr_attach = unp_attach,
.pr_detach = unp_detach,
diff -r 7a37b1c0b91f -r 8ce96f47dbc3 sys/sys/un.h
--- a/sys/sys/un.h Sat May 05 17:16:23 2018 +0000
+++ b/sys/sys/un.h Sat May 05 19:58:08 2018 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: un.h,v 1.57 2016/04/06 19:45:46 roy Exp $ */
+/* $NetBSD: un.h,v 1.58 2018/05/05 19:58:08 christos Exp $ */
/*
* Copyright (c) 1982, 1986, 1993
@@ -90,6 +90,7 @@
int unp_connect2(struct socket *, struct socket *);
void unp_dispose(struct mbuf *);
int unp_externalize(struct mbuf *, struct lwp *, int);
+void unp_sysctl_create(struct sysctllog **);
#else /* !_KERNEL */
Home |
Main Index |
Thread Index |
Old Index