diff options
author | David Gwynne <dlg@cvs.openbsd.org> | 2019-07-03 10:19:46 +0000 |
---|---|---|
committer | David Gwynne <dlg@cvs.openbsd.org> | 2019-07-03 10:19:46 +0000 |
commit | 87c3a1805d44c7fd2ec53e30d48e7cab484fb230 (patch) | |
tree | 15d796d4fdbd9ba2d21c74deb8e7c2622b662756 /sys/kern | |
parent | 25b99591ca6494fe4f2212b73d92e1aa0dc6bc85 (diff) |
add the kernel side of net.link.ifrxq.pressure_return and pressure_drop
these values are used as the backpressure thresholds in the interface
rx q processing code. theyre being exposed as tunables to userland
while we are figuring out what the best values for them are.
ok visa@ deraadt@
Diffstat (limited to 'sys/kern')
-rw-r--r-- | sys/kern/uipc_domain.c | 36 |
1 files changed, 35 insertions, 1 deletions
diff --git a/sys/kern/uipc_domain.c b/sys/kern/uipc_domain.c index fafd5da50c7..8cb2c77dc60 100644 --- a/sys/kern/uipc_domain.c +++ b/sys/kern/uipc_domain.c @@ -1,4 +1,4 @@ -/* $OpenBSD: uipc_domain.c,v 1.56 2018/06/23 14:38:59 denis Exp $ */ +/* $OpenBSD: uipc_domain.c,v 1.57 2019/07/03 10:19:45 dlg Exp $ */ /* $NetBSD: uipc_domain.c,v 1.14 1996/02/09 19:00:44 christos Exp $ */ /* @@ -159,6 +159,37 @@ pffindproto(int family, int protocol, int type) return (maybe); } +static int +net_link_sysctl(int *name, u_int namelen, void *oldp, size_t *oldlenp, + void *newp, size_t newlen) +{ + int node; + int error; + + /* + * All sysctl names at this level are nonterminal. + */ + if (namelen < 2) + return (EISDIR); /* overloaded */ + node = name[0]; + + namelen--; + name++; + + switch (node) { + case NET_LINK_IFRXQ: + error = net_ifiq_sysctl(name, namelen, oldp, oldlenp, + newp, newlen); + break; + + default: + error = ENOPROTOOPT; + break; + } + + return (error); +} + int net_sysctl(int *name, u_int namelen, void *oldp, size_t *oldlenp, void *newp, size_t newlen, struct proc *p) @@ -178,6 +209,9 @@ net_sysctl(int *name, u_int namelen, void *oldp, size_t *oldlenp, void *newp, if (family == PF_UNSPEC) return (0); + if (family == PF_LINK) + return (net_link_sysctl(name + 1, namelen - 1, oldp, oldlenp, + newp, newlen)); #if NBPFILTER > 0 if (family == PF_BPF) return (bpf_sysctl(name + 1, namelen - 1, oldp, oldlenp, |