Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys/net Move sysctl_pktq_{maxlen, count} to pktqueue.c and ma...
details: https://anonhg.NetBSD.org/src/rev/9be4fd699731
branches: trunk
changeset: 329971:9be4fd699731
user: ozaki-r <ozaki-r%NetBSD.org@localhost>
date: Mon Jun 16 00:40:10 2014 +0000
description:
Move sysctl_pktq_{maxlen,count} to pktqueue.c and make them global
They will be used by bridge.
ok rmind@
diffstat:
sys/net/if.c | 27 ++-------------------------
sys/net/if.h | 4 +++-
sys/net/pktqueue.c | 27 +++++++++++++++++++++++++--
sys/net/pktqueue.h | 7 ++++++-
4 files changed, 36 insertions(+), 29 deletions(-)
diffs (139 lines):
diff -r 67f8642f95cf -r 9be4fd699731 sys/net/if.c
--- a/sys/net/if.c Mon Jun 16 00:33:39 2014 +0000
+++ b/sys/net/if.c Mon Jun 16 00:40:10 2014 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: if.c,v 1.281 2014/06/13 13:54:08 rmind Exp $ */
+/* $NetBSD: if.c,v 1.282 2014/06/16 00:40:10 ozaki-r Exp $ */
/*-
* Copyright (c) 1999, 2000, 2001, 2008 The NetBSD Foundation, Inc.
@@ -90,7 +90,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: if.c,v 1.281 2014/06/13 13:54:08 rmind Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if.c,v 1.282 2014/06/16 00:40:10 ozaki-r Exp $");
#include "opt_inet.h"
@@ -2343,29 +2343,6 @@
#if defined(INET) || defined(INET6)
-static int
-sysctl_pktq_maxlen(SYSCTLFN_ARGS, pktqueue_t *pq)
-{
- u_int nmaxlen = pktq_get_count(pq, PKTQ_MAXLEN);
- struct sysctlnode node = *rnode;
- int error;
-
- node.sysctl_data = &nmaxlen;
- error = sysctl_lookup(SYSCTLFN_CALL(&node));
- if (error || newp == NULL)
- return error;
- return pktq_set_maxlen(pq, nmaxlen);
-}
-
-static int
-sysctl_pktq_count(SYSCTLFN_ARGS, pktqueue_t *pq, u_int count_id)
-{
- int count = pktq_get_count(pq, count_id);
- struct sysctlnode node = *rnode;
- node.sysctl_data = &count;
- return sysctl_lookup(SYSCTLFN_CALL(&node));
-}
-
#define SYSCTL_NET_PKTQ(q, cn, c) \
static int \
sysctl_net_##q##_##cn(SYSCTLFN_ARGS) \
diff -r 67f8642f95cf -r 9be4fd699731 sys/net/if.h
--- a/sys/net/if.h Mon Jun 16 00:33:39 2014 +0000
+++ b/sys/net/if.h Mon Jun 16 00:40:10 2014 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: if.h,v 1.165 2014/05/18 00:33:20 rmind Exp $ */
+/* $NetBSD: if.h,v 1.166 2014/06/16 00:40:10 ozaki-r Exp $ */
/*-
* Copyright (c) 1999, 2000, 2001 The NetBSD Foundation, Inc.
@@ -79,8 +79,10 @@
#include <sys/socket.h>
#include <sys/queue.h>
+
#include <net/dlt.h>
#include <net/pfil.h>
+#include <net/pktqueue.h>
/*
* Always include ALTQ glue here -- we use the ALTQ interface queue
diff -r 67f8642f95cf -r 9be4fd699731 sys/net/pktqueue.c
--- a/sys/net/pktqueue.c Mon Jun 16 00:33:39 2014 +0000
+++ b/sys/net/pktqueue.c Mon Jun 16 00:40:10 2014 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: pktqueue.c,v 1.5 2014/06/16 00:33:39 ozaki-r Exp $ */
+/* $NetBSD: pktqueue.c,v 1.6 2014/06/16 00:40:10 ozaki-r Exp $ */
/*-
* Copyright (c) 2014 The NetBSD Foundation, Inc.
@@ -36,7 +36,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: pktqueue.c,v 1.5 2014/06/16 00:33:39 ozaki-r Exp $");
+__KERNEL_RCSID(0, "$NetBSD: pktqueue.c,v 1.6 2014/06/16 00:40:10 ozaki-r Exp $");
#include <sys/param.h>
#include <sys/types.h>
@@ -361,3 +361,26 @@
kmem_free(qs, slotbytes);
return 0;
}
+
+int
+sysctl_pktq_maxlen(SYSCTLFN_ARGS, pktqueue_t *pq)
+{
+ u_int nmaxlen = pktq_get_count(pq, PKTQ_MAXLEN);
+ struct sysctlnode node = *rnode;
+ int error;
+
+ node.sysctl_data = &nmaxlen;
+ error = sysctl_lookup(SYSCTLFN_CALL(&node));
+ if (error || newp == NULL)
+ return error;
+ return pktq_set_maxlen(pq, nmaxlen);
+}
+
+int
+sysctl_pktq_count(SYSCTLFN_ARGS, pktqueue_t *pq, u_int count_id)
+{
+ int count = pktq_get_count(pq, count_id);
+ struct sysctlnode node = *rnode;
+ node.sysctl_data = &count;
+ return sysctl_lookup(SYSCTLFN_CALL(&node));
+}
diff -r 67f8642f95cf -r 9be4fd699731 sys/net/pktqueue.h
--- a/sys/net/pktqueue.h Mon Jun 16 00:33:39 2014 +0000
+++ b/sys/net/pktqueue.h Mon Jun 16 00:40:10 2014 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: pktqueue.h,v 1.3 2014/06/16 00:33:39 ozaki-r Exp $ */
+/* $NetBSD: pktqueue.h,v 1.4 2014/06/16 00:40:10 ozaki-r Exp $ */
/*-
* Copyright (c) 2014 The NetBSD Foundation, Inc.
@@ -36,6 +36,8 @@
#error "not supposed to be exposed to userland."
#endif
+#include <sys/sysctl.h>
+
struct mbuf;
typedef struct pktqueue pktqueue_t;
@@ -54,4 +56,7 @@
uint32_t pktq_rps_hash(const struct mbuf *);
uint64_t pktq_get_count(pktqueue_t *, pktq_count_t);
+int sysctl_pktq_maxlen(SYSCTLFN_PROTO, pktqueue_t *);
+int sysctl_pktq_count(SYSCTLFN_PROTO, pktqueue_t *, u_int);
+
#endif
Home |
Main Index |
Thread Index |
Old Index