Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src Rump-ify ALTQ (librumpnet_altq.so)
details: https://anonhg.NetBSD.org/src/rev/52004df9c9d2
branches: trunk
changeset: 984614:52004df9c9d2
user: ozaki-r <ozaki-r%NetBSD.org@localhost>
date: Wed Jul 14 03:19:23 2021 +0000
description:
Rump-ify ALTQ (librumpnet_altq.so)
diffstat:
distrib/sets/lists/base/shl.mi | 5 +-
distrib/sets/lists/comp/mi | 6 ++-
distrib/sets/lists/comp/shl.mi | 3 +-
distrib/sets/lists/debug/mi | 3 +-
distrib/sets/lists/debug/shl.mi | 3 +-
sys/rump/include/opt/opt_rumpkernel.h | 5 +-
sys/rump/librump/rumpnet/net_stub.c | 12 ++++-
sys/rump/net/Makefile.rumpnetcomp | 8 +-
sys/rump/net/lib/libaltq/Makefile | 17 +++++++
sys/rump/net/lib/libaltq/altq_component.c | 72 +++++++++++++++++++++++++++++++
10 files changed, 122 insertions(+), 12 deletions(-)
diffs (257 lines):
diff -r 8ad2cdef36db -r 52004df9c9d2 distrib/sets/lists/base/shl.mi
--- a/distrib/sets/lists/base/shl.mi Wed Jul 14 03:16:06 2021 +0000
+++ b/distrib/sets/lists/base/shl.mi Wed Jul 14 03:19:23 2021 +0000
@@ -1,4 +1,4 @@
-# $NetBSD: shl.mi,v 1.921 2021/06/17 01:17:27 christos Exp $
+# $NetBSD: shl.mi,v 1.922 2021/07/14 03:19:23 ozaki-r Exp $
#
# Note: Don't delete entries from here - mark them as "obsolete" instead,
# unless otherwise stated below.
@@ -765,6 +765,9 @@
./usr/lib/librumpnet_agr.so base-rump-shlib rump
./usr/lib/librumpnet_agr.so.0 base-rump-shlib rump
./usr/lib/librumpnet_agr.so.0.0 base-rump-shlib rump
+./usr/lib/librumpnet_altq.so base-rump-shlib rump
+./usr/lib/librumpnet_altq.so.0 base-rump-shlib rump
+./usr/lib/librumpnet_altq.so.0.0 base-rump-shlib rump
./usr/lib/librumpnet_bpfjit.so base-rump-shlib rump,sljit
./usr/lib/librumpnet_bpfjit.so.0 base-rump-shlib rump,sljit
./usr/lib/librumpnet_bpfjit.so.0.0 base-rump-shlib rump,sljit
diff -r 8ad2cdef36db -r 52004df9c9d2 distrib/sets/lists/comp/mi
--- a/distrib/sets/lists/comp/mi Wed Jul 14 03:16:06 2021 +0000
+++ b/distrib/sets/lists/comp/mi Wed Jul 14 03:19:23 2021 +0000
@@ -1,4 +1,4 @@
-# $NetBSD: mi,v 1.2389 2021/06/17 01:17:28 christos Exp $
+# $NetBSD: mi,v 1.2390 2021/07/14 03:19:24 ozaki-r Exp $
#
# Note: don't delete entries from here - mark them as "obsolete" instead.
./etc/mtree/set.comp comp-sys-root
@@ -4011,8 +4011,12 @@
./usr/lib/librumpkern_z.a comp-c-lib rump
./usr/lib/librumpkern_z_p.a comp-c-proflib rump,profile
./usr/lib/librumpnet.a comp-c-lib compatfile,rump
+./usr/lib/librumpnet_altq.a comp-c-lib rump
+./usr/lib/librumpnet_altq_p.a comp-c-proflib rump,profile
./usr/lib/librumpnet_agr.a comp-c-lib rump
./usr/lib/librumpnet_agr_p.a comp-c-proflib rump,profile
+./usr/lib/librumpnet_altq.a comp-c-lib rump
+./usr/lib/librumpnet_altq_p.a comp-c-proflib rump,profile
./usr/lib/librumpnet_bpfjit.a comp-c-lib rump,sljit
./usr/lib/librumpnet_bpfjit_p.a comp-c-proflib rump,sljit,profile
./usr/lib/librumpnet_bridge.a comp-c-lib rump
diff -r 8ad2cdef36db -r 52004df9c9d2 distrib/sets/lists/comp/shl.mi
--- a/distrib/sets/lists/comp/shl.mi Wed Jul 14 03:16:06 2021 +0000
+++ b/distrib/sets/lists/comp/shl.mi Wed Jul 14 03:19:23 2021 +0000
@@ -1,4 +1,4 @@
-# $NetBSD: shl.mi,v 1.346 2021/05/17 04:07:41 yamaguchi Exp $
+# $NetBSD: shl.mi,v 1.347 2021/07/14 03:19:24 ozaki-r Exp $
#
# Note: don't delete entries from here - mark them as "obsolete" instead.
#
@@ -225,6 +225,7 @@
./usr/lib/librumpkern_tty_pic.a comp-c-piclib picinstall,rump
./usr/lib/librumpkern_z_pic.a comp-c-piclib picinstall,rump
./usr/lib/librumpnet_agr_pic.a comp-c-piclib picinstall,rump
+./usr/lib/librumpnet_altq_pic.a comp-c-piclib picinstall,rump
./usr/lib/librumpnet_bpfjit_pic.a comp-c-piclib picinstall,rump,sljit
./usr/lib/librumpnet_bridge_pic.a comp-c-piclib picinstall,rump
./usr/lib/librumpnet_gif_pic.a comp-c-piclib picinstall,rump
diff -r 8ad2cdef36db -r 52004df9c9d2 distrib/sets/lists/debug/mi
--- a/distrib/sets/lists/debug/mi Wed Jul 14 03:16:06 2021 +0000
+++ b/distrib/sets/lists/debug/mi Wed Jul 14 03:19:23 2021 +0000
@@ -1,4 +1,4 @@
-# $NetBSD: mi,v 1.355 2021/07/09 05:54:11 yamaguchi Exp $
+# $NetBSD: mi,v 1.356 2021/07/14 03:19:24 ozaki-r Exp $
./etc/mtree/set.debug comp-sys-root
./usr/lib comp-sys-usr compatdir
./usr/lib/i18n/libBIG5_g.a comp-c-debuglib debuglib,compatfile
@@ -215,6 +215,7 @@
./usr/lib/librumpkern_tty_g.a comp-c-debuglib debuglib,rump
./usr/lib/librumpkern_z_g.a comp-c-debuglib debuglib,rump
./usr/lib/librumpnet_agr_g.a comp-c-debuglib debuglib,rump
+./usr/lib/librumpnet_altq_g.a comp-c-debuglib debuglib,rump
./usr/lib/librumpnet_bpfjit_g.a comp-c-debuglib debuglib,rump,sljit
./usr/lib/librumpnet_bridge_g.a comp-c-debuglib debuglib,rump
./usr/lib/librumpnet_g.a comp-c-debuglib debuglib,compatfile,rump
diff -r 8ad2cdef36db -r 52004df9c9d2 distrib/sets/lists/debug/shl.mi
--- a/distrib/sets/lists/debug/shl.mi Wed Jul 14 03:16:06 2021 +0000
+++ b/distrib/sets/lists/debug/shl.mi Wed Jul 14 03:19:23 2021 +0000
@@ -1,4 +1,4 @@
-# $NetBSD: shl.mi,v 1.278 2021/06/17 01:17:28 christos Exp $
+# $NetBSD: shl.mi,v 1.279 2021/07/14 03:19:24 ozaki-r Exp $
./usr/lib/libbfd_g.a comp-c-debuglib debuglib,compatfile,binutils
./usr/libdata/debug/lib base-sys-usr debug,dynamicroot,compatdir
./usr/libdata/debug/lib/libavl.so.0.0.debug comp-zfs-debug debug,dynamicroot,zfs
@@ -269,6 +269,7 @@
./usr/libdata/debug/usr/lib/librumpkern_z.so.0.0.debug comp-rump-debug debug,rump
./usr/libdata/debug/usr/lib/librumpnet.so.0.0.debug comp-rump-debug debug,compatfile,rump
./usr/libdata/debug/usr/lib/librumpnet_agr.so.0.0.debug comp-rump-debug debug,rump
+./usr/libdata/debug/usr/lib/librumpnet_altq.so.0.0.debug comp-rump-debug debug,rump
./usr/libdata/debug/usr/lib/librumpnet_bpfjit.so.0.0.debug comp-rump-debug debug,rump,sljit
./usr/libdata/debug/usr/lib/librumpnet_bridge.so.0.0.debug comp-rump-debug debug,rump
./usr/libdata/debug/usr/lib/librumpnet_gif.so.0.0.debug comp-rump-debug debug,rump
diff -r 8ad2cdef36db -r 52004df9c9d2 sys/rump/include/opt/opt_rumpkernel.h
--- a/sys/rump/include/opt/opt_rumpkernel.h Wed Jul 14 03:16:06 2021 +0000
+++ b/sys/rump/include/opt/opt_rumpkernel.h Wed Jul 14 03:19:23 2021 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: opt_rumpkernel.h,v 1.6 2017/05/27 21:02:56 bouyer Exp $ */
+/* $NetBSD: opt_rumpkernel.h,v 1.7 2021/07/14 03:19:24 ozaki-r Exp $ */
#ifndef __NetBSD__
#define __NetBSD__
@@ -33,3 +33,6 @@
#define WSEMUL_VT100
#define PPPOE_SERVER
+
+#define ALTQ
+#define ALTQ_CBQ
diff -r 8ad2cdef36db -r 52004df9c9d2 sys/rump/librump/rumpnet/net_stub.c
--- a/sys/rump/librump/rumpnet/net_stub.c Wed Jul 14 03:16:06 2021 +0000
+++ b/sys/rump/librump/rumpnet/net_stub.c Wed Jul 14 03:19:23 2021 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: net_stub.c,v 1.42 2021/05/17 04:07:44 yamaguchi Exp $ */
+/* $NetBSD: net_stub.c,v 1.43 2021/07/14 03:19:24 ozaki-r Exp $ */
/*
* Copyright (c) 2008 Antti Kantee. All Rights Reserved.
@@ -26,7 +26,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: net_stub.c,v 1.42 2021/05/17 04:07:44 yamaguchi Exp $");
+__KERNEL_RCSID(0, "$NetBSD: net_stub.c,v 1.43 2021/07/14 03:19:24 ozaki-r Exp $");
#include <sys/mutex.h>
#include <sys/param.h>
@@ -113,6 +113,14 @@
__weak_alias(lagg_input_ethernet,rumpnet_stub);
__weak_alias(lagg_linkstate_changed,rumpnet_stub);
+/* altq */
+int (*altq_input)(struct mbuf *, int);
+__weak_alias(in6mask128,rumpnet_stub);
+__weak_alias(in6mask0,rumpnet_stub);
+__weak_alias(altq_detach,rumpnet_stub);
+__weak_alias(altq_disable,rumpnet_stub);
+__weak_alias(tbr_dequeue,rumpnet_stub);
+
struct ifnet_head ifnet_list;
struct pslist_head ifnet_pslist;
kmutex_t ifnet_mtx;
diff -r 8ad2cdef36db -r 52004df9c9d2 sys/rump/net/Makefile.rumpnetcomp
--- a/sys/rump/net/Makefile.rumpnetcomp Wed Jul 14 03:16:06 2021 +0000
+++ b/sys/rump/net/Makefile.rumpnetcomp Wed Jul 14 03:19:23 2021 +0000
@@ -1,11 +1,11 @@
-# $NetBSD: Makefile.rumpnetcomp,v 1.24 2021/05/17 04:07:44 yamaguchi Exp $
+# $NetBSD: Makefile.rumpnetcomp,v 1.25 2021/07/14 03:19:24 ozaki-r Exp $
#
.include <bsd.own.mk>
-RUMPNETCOMP= agr bridge net net80211 netbt netcan netinet netinet6 netipsec
-RUMPNETCOMP+= gif ipsec netmpls npf l2tp lagg local pppoe shmif tap tun vlan
-RUMPNETCOMP+= vether wg
+RUMPNETCOMP= agr altq bridge net net80211 netbt netcan netinet netinet6
+RUMPNETCOMP+= netipsec gif ipsec netmpls npf l2tp lagg local pppoe shmif tap
+RUMPNETCOMP+= tun vlan vether wg
.if ${MKSLJIT} != "no" || make(rumpdescribe)
RUMPNETCOMP+= bpfjit
diff -r 8ad2cdef36db -r 52004df9c9d2 sys/rump/net/lib/libaltq/Makefile
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/sys/rump/net/lib/libaltq/Makefile Wed Jul 14 03:19:23 2021 +0000
@@ -0,0 +1,17 @@
+# $NetBSD: Makefile,v 1.1 2021/07/14 03:19:24 ozaki-r Exp $
+#
+
+
+.PATH: ${.CURDIR}/../../../../altq
+
+LIB= rumpnet_altq
+COMMENT=ALTQ support
+
+SRCS+= altq_subr.c altq_conf.c
+SRCS+= altq_cbq.c altq_rmclass.c
+SRCS+= altq_component.c
+
+.include <bsd.init.mk>
+
+.include <bsd.lib.mk>
+.include <bsd.klinks.mk>
diff -r 8ad2cdef36db -r 52004df9c9d2 sys/rump/net/lib/libaltq/altq_component.c
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/sys/rump/net/lib/libaltq/altq_component.c Wed Jul 14 03:19:23 2021 +0000
@@ -0,0 +1,72 @@
+/* $NetBSD: altq_component.c,v 1.1 2021/07/14 03:19:24 ozaki-r Exp $ */
+
+/*
+ * Copyright (c) 2019 Internet Initiative Japan Inc.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS
+ * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+ * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+ * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ */
+
+#include <sys/cdefs.h>
+__KERNEL_RCSID(0, "$NetBSD: altq_component.c,v 1.1 2021/07/14 03:19:24 ozaki-r Exp $");
+
+#include <sys/param.h>
+#include <sys/stat.h>
+#include <sys/filedesc.h>
+
+#include <sys/vfs_syscalls.h>
+
+#include <net/if.h>
+
+#include <altq/altq.h>
+
+#include <rump-sys/kern.h>
+#include <rump-sys/vfs.h>
+
+static void
+create_altq_devs(void)
+{
+ extern const struct cdevsw altq_cdevsw;
+ devmajor_t bmajor = NODEVMAJOR, cmajor = NODEVMAJOR;
+ int error;
+
+ error = devsw_attach("altq", NULL, &bmajor,
+ &altq_cdevsw, &cmajor);
+ if (error != 0)
+ panic("altq devsw attach failed: %d", error);
+
+ do_sys_mkdir("/dev/altq", 0755, UIO_SYSSPACE);
+
+ error = rump_vfs_makeonedevnode(S_IFCHR, "/dev/altq/altq", cmajor, 0);
+ if (error != 0)
+ panic("cannot create altq device node: %d", error);
+
+ error = rump_vfs_makeonedevnode(S_IFCHR, "/dev/altq/cbq", cmajor, ALTQT_CBQ);
+ if (error != 0)
+ panic("cannot create altq/cbq device node: %d", error);
+}
+
+RUMP_COMPONENT(RUMP_COMPONENT_NET_IF)
+{
+
+ create_altq_devs();
+}
Home |
Main Index |
Thread Index |
Old Index