Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/tests/net/if_lagg Add a new link-aggregation pseudo interfac...
details: https://anonhg.NetBSD.org/src/rev/0706c8089b7d
branches: trunk
changeset: 1021205:0706c8089b7d
user: yamaguchi <yamaguchi%NetBSD.org@localhost>
date: Mon May 17 04:07:41 2021 +0000
description:
Add a new link-aggregation pseudo interface named lagg(4)
- FreeBSD's lagg(4) based implementation
- MP-safe and MP-scalable
diffstat:
distrib/sets/lists/base/shl.mi | 5 +-
distrib/sets/lists/comp/mi | 5 +-
distrib/sets/lists/comp/shl.mi | 3 +-
distrib/sets/lists/debug/mi | 3 +-
distrib/sets/lists/debug/module.mi | 4 +-
distrib/sets/lists/debug/shl.mi | 3 +-
distrib/sets/lists/man/mi | 5 +-
distrib/sets/lists/modules/mi | 4 +-
distrib/sets/lists/tests/mi | 6 +-
etc/mtree/NetBSD.dist.tests | 3 +-
sbin/ifconfig/Makefile.common | 4 +-
sbin/ifconfig/lagg.c | 676 +++++++
share/man/man4/Makefile | 4 +-
share/man/man4/lagg.4 | 200 ++
sys/arch/amd64/conf/GENERIC | 5 +-
sys/arch/i386/conf/GENERIC | 5 +-
sys/conf/files | 3 +-
sys/modules/Makefile | 3 +-
sys/modules/if_lagg/Makefile | 20 +
sys/modules/if_lagg/lagg.ioconf | 7 +
sys/net/Makefile | 4 +-
sys/net/files.net | 3 +-
sys/net/if.c | 14 +-
sys/net/if.h | 3 +-
sys/net/if_ethersubr.c | 23 +-
sys/net/lagg/Makefile | 8 +
sys/net/lagg/files.lagg | 7 +
sys/net/lagg/if_lagg.c | 2436 ++++++++++++++++++++++++++
sys/net/lagg/if_lagg.h | 149 +
sys/net/lagg/if_lagg_lacp.c | 2621 +++++++++++++++++++++++++++++
sys/net/lagg/if_lagg_lacp.h | 142 +
sys/net/lagg/if_laggproto.c | 647 +++++++
sys/net/lagg/if_laggproto.h | 289 +++
sys/net/lagg/if_laggvar.h | 13 +
sys/netinet6/in6_ifattach.c | 5 +-
sys/rump/include/opt/lagg.h | 3 +
sys/rump/librump/rumpnet/net_stub.c | 9 +-
sys/rump/net/Makefile.rumpnetcomp | 6 +-
sys/rump/net/lib/liblagg/LAGG.ioconf | 7 +
sys/rump/net/lib/liblagg/Makefile | 22 +
sys/rump/net/lib/liblagg/lagg_component.c | 43 +
tests/net/Makefile | 7 +-
tests/net/if_lagg/Makefile | 12 +
tests/net/if_lagg/t_lagg.sh | 1060 +++++++++++
44 files changed, 8463 insertions(+), 38 deletions(-)
diffs (truncated from 9018 to 300 lines):
diff -r 3cf9bba683d9 -r 0706c8089b7d distrib/sets/lists/base/shl.mi
--- a/distrib/sets/lists/base/shl.mi Mon May 17 04:01:57 2021 +0000
+++ b/distrib/sets/lists/base/shl.mi Mon May 17 04:07:41 2021 +0000
@@ -1,4 +1,4 @@
-# $NetBSD: shl.mi,v 1.919 2021/04/29 17:27:54 christos Exp $
+# $NetBSD: shl.mi,v 1.920 2021/05/17 04:07:41 yamaguchi Exp $
#
# Note: Don't delete entries from here - mark them as "obsolete" instead,
# unless otherwise stated below.
@@ -780,6 +780,9 @@
./usr/lib/librumpnet_l2tp.so base-rump-shlib rump
./usr/lib/librumpnet_l2tp.so.0 base-rump-shlib rump
./usr/lib/librumpnet_l2tp.so.0.0 base-rump-shlib rump
+./usr/lib/librumpnet_lagg.so base-rump-shlib rump
+./usr/lib/librumpnet_lagg.so.0 base-rump-shlib rump
+./usr/lib/librumpnet_lagg.so.0.0 base-rump-shlib rump
./usr/lib/librumpnet_local.so base-rump-shlib rump
./usr/lib/librumpnet_local.so.0 base-rump-shlib rump
./usr/lib/librumpnet_local.so.0.0 base-rump-shlib rump
diff -r 3cf9bba683d9 -r 0706c8089b7d distrib/sets/lists/comp/mi
--- a/distrib/sets/lists/comp/mi Mon May 17 04:01:57 2021 +0000
+++ b/distrib/sets/lists/comp/mi Mon May 17 04:07:41 2021 +0000
@@ -1,4 +1,4 @@
-# $NetBSD: mi,v 1.2386 2021/05/03 11:07:55 simonb Exp $
+# $NetBSD: mi,v 1.2387 2021/05/17 04:07:41 yamaguchi Exp $
#
# Note: don't delete entries from here - mark them as "obsolete" instead.
./etc/mtree/set.comp comp-sys-root
@@ -2468,6 +2468,7 @@
./usr/include/net/if_ieee80211.h comp-obsolete obsolete
./usr/include/net/if_ipsec.h comp-c-include
./usr/include/net/if_l2tp.h comp-c-include
+./usr/include/net/if_lagg.h comp-c-include
./usr/include/net/if_llc.h comp-c-include
./usr/include/net/if_media.h comp-c-include
./usr/include/net/if_mpls.h comp-c-include
@@ -3924,6 +3925,8 @@
./usr/lib/librumpnet_ipsec_p.a comp-c-proflib rump,profile
./usr/lib/librumpnet_l2tp.a comp-c-lib rump
./usr/lib/librumpnet_l2tp_p.a comp-c-proflib rump,profile
+./usr/lib/librumpnet_lagg.a comp-c-lib rump
+./usr/lib/librumpnet_lagg_p.a comp-c-proflib rump,profile
./usr/lib/librumpnet_local.a comp-c-lib rump
./usr/lib/librumpnet_local_p.a comp-c-proflib rump,profile
./usr/lib/librumpnet_net.a comp-c-lib rump
diff -r 3cf9bba683d9 -r 0706c8089b7d distrib/sets/lists/comp/shl.mi
--- a/distrib/sets/lists/comp/shl.mi Mon May 17 04:01:57 2021 +0000
+++ b/distrib/sets/lists/comp/shl.mi Mon May 17 04:07:41 2021 +0000
@@ -1,4 +1,4 @@
-# $NetBSD: shl.mi,v 1.345 2021/04/12 02:09:00 mrg Exp $
+# $NetBSD: shl.mi,v 1.346 2021/05/17 04:07:41 yamaguchi Exp $
#
# Note: don't delete entries from here - mark them as "obsolete" instead.
#
@@ -230,6 +230,7 @@
./usr/lib/librumpnet_gif_pic.a comp-c-piclib picinstall,rump
./usr/lib/librumpnet_ipsec_pic.a comp-c-piclib picinstall,rump
./usr/lib/librumpnet_l2tp_pic.a comp-c-piclib picinstall,rump
+./usr/lib/librumpnet_lagg_pic.a comp-c-piclib picinstall,rump
./usr/lib/librumpnet_local_pic.a comp-c-piclib picinstall,rump
./usr/lib/librumpnet_net80211_pic.a comp-c-piclib picinstall,rump
./usr/lib/librumpnet_net_pic.a comp-c-piclib picinstall,rump
diff -r 3cf9bba683d9 -r 0706c8089b7d distrib/sets/lists/debug/mi
--- a/distrib/sets/lists/debug/mi Mon May 17 04:01:57 2021 +0000
+++ b/distrib/sets/lists/debug/mi Mon May 17 04:07:41 2021 +0000
@@ -1,4 +1,4 @@
-# $NetBSD: mi,v 1.352 2021/05/08 09:23:37 rin Exp $
+# $NetBSD: mi,v 1.353 2021/05/17 04:07:41 yamaguchi 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
@@ -221,6 +221,7 @@
./usr/lib/librumpnet_gif_g.a comp-c-debuglib debuglib,rump
./usr/lib/librumpnet_ipsec_g.a comp-c-debuglib debuglib,rump
./usr/lib/librumpnet_l2tp_g.a comp-c-debuglib debuglib,rump
+./usr/lib/librumpnet_lagg_g.a comp-c-debuglib debuglib,rump
./usr/lib/librumpnet_local_g.a comp-c-debuglib debuglib,rump
./usr/lib/librumpnet_net80211_g.a comp-c-debuglib debuglib,rump
./usr/lib/librumpnet_net_g.a comp-c-debuglib debuglib,rump
diff -r 3cf9bba683d9 -r 0706c8089b7d distrib/sets/lists/debug/module.mi
--- a/distrib/sets/lists/debug/module.mi Mon May 17 04:01:57 2021 +0000
+++ b/distrib/sets/lists/debug/module.mi Mon May 17 04:07:41 2021 +0000
@@ -1,4 +1,4 @@
-# $NetBSD: module.mi,v 1.8 2021/03/25 21:37:10 nia Exp $
+# $NetBSD: module.mi,v 1.9 2021/05/17 04:07:42 yamaguchi Exp $
./usr/libdata/debug/@MODULEDIR@ modules-base-kernel kmod,debug
./usr/libdata/debug/@MODULEDIR@/accf_dataready modules-base-kernel kmod,debug
./usr/libdata/debug/@MODULEDIR@/accf_dataready/accf_dataready.kmod.debug modules-base-kernel kmod,debug
@@ -186,6 +186,8 @@
./usr/libdata/debug/@MODULEDIR@/if_kue/if_kue.kmod.debug modules-base-kernel kmod,debug
./usr/libdata/debug/@MODULEDIR@/if_l2tp modules-base-kernel kmod,debug
./usr/libdata/debug/@MODULEDIR@/if_l2tp/if_l2tp.kmod.debug modules-base-kernel kmod,debug
+./usr/libdata/debug/@MODULEDIR@/if_lagg modules-base-kernel kmod,debug
+./usr/libdata/debug/@MODULEDIR@/if_lagg/if_lagg.kmod.debug modules-base-kernel kmod,debug
./usr/libdata/debug/@MODULEDIR@/if_loop modules-base-kernel kmod,debug
./usr/libdata/debug/@MODULEDIR@/if_loop/if_loop.kmod.debug modules-base-kernel kmod,debug
./usr/libdata/debug/@MODULEDIR@/if_mpls modules-base-kernel kmod,debug
diff -r 3cf9bba683d9 -r 0706c8089b7d distrib/sets/lists/debug/shl.mi
--- a/distrib/sets/lists/debug/shl.mi Mon May 17 04:01:57 2021 +0000
+++ b/distrib/sets/lists/debug/shl.mi Mon May 17 04:07:41 2021 +0000
@@ -1,4 +1,4 @@
-# $NetBSD: shl.mi,v 1.276 2021/04/29 17:27:54 christos Exp $
+# $NetBSD: shl.mi,v 1.277 2021/05/17 04:07:42 yamaguchi 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
@@ -274,6 +274,7 @@
./usr/libdata/debug/usr/lib/librumpnet_gif.so.0.0.debug comp-rump-debug debug,rump
./usr/libdata/debug/usr/lib/librumpnet_ipsec.so.0.0.debug comp-rump-debug debug,rump
./usr/libdata/debug/usr/lib/librumpnet_l2tp.so.0.0.debug comp-rump-debug debug,rump
+./usr/libdata/debug/usr/lib/librumpnet_lagg.so.0.0.debug comp-rump-debug debug,rump
./usr/libdata/debug/usr/lib/librumpnet_local.so.0.0.debug comp-rump-debug debug,rump
./usr/libdata/debug/usr/lib/librumpnet_net.so.0.0.debug comp-rump-debug debug,rump
./usr/libdata/debug/usr/lib/librumpnet_net80211.so.0.0.debug comp-rump-debug debug,rump
diff -r 3cf9bba683d9 -r 0706c8089b7d distrib/sets/lists/man/mi
--- a/distrib/sets/lists/man/mi Mon May 17 04:01:57 2021 +0000
+++ b/distrib/sets/lists/man/mi Mon May 17 04:07:41 2021 +0000
@@ -1,4 +1,4 @@
-# $NetBSD: mi,v 1.1719 2021/05/07 21:51:21 nia Exp $
+# $NetBSD: mi,v 1.1720 2021/05/17 04:07:42 yamaguchi Exp $
#
# Note: don't delete entries from here - mark them as "obsolete" instead.
#
@@ -1413,6 +1413,7 @@
./usr/share/man/cat4/kttcp.0 man-sys-catman .cat
./usr/share/man/cat4/kue.0 man-sys-catman .cat
./usr/share/man/cat4/l2tp.0 man-sys-catman .cat
+./usr/share/man/cat4/lagg.0 man-sys-catman .cat
./usr/share/man/cat4/lc.0 man-sys-catman .cat
./usr/share/man/cat4/ld.0 man-sys-catman .cat
./usr/share/man/cat4/le.0 man-sys-catman .cat
@@ -4610,6 +4611,7 @@
./usr/share/man/html4/kttcp.html man-sys-htmlman html
./usr/share/man/html4/kue.html man-sys-htmlman html
./usr/share/man/html4/l2tp.html man-sys-htmlman html
+./usr/share/man/html4/lagg.html man-sys-htmlman html
./usr/share/man/html4/lc.html man-sys-htmlman html
./usr/share/man/html4/ld.html man-sys-htmlman html
./usr/share/man/html4/le.html man-sys-htmlman html
@@ -7648,6 +7650,7 @@
./usr/share/man/man4/kttcp.4 man-sys-man .man
./usr/share/man/man4/kue.4 man-sys-man .man
./usr/share/man/man4/l2tp.4 man-sys-man .man
+./usr/share/man/man4/lagg.4 man-sys-man .man
./usr/share/man/man4/lc.4 man-sys-man .man
./usr/share/man/man4/ld.4 man-sys-man .man
./usr/share/man/man4/le.4 man-sys-man .man
diff -r 3cf9bba683d9 -r 0706c8089b7d distrib/sets/lists/modules/mi
--- a/distrib/sets/lists/modules/mi Mon May 17 04:01:57 2021 +0000
+++ b/distrib/sets/lists/modules/mi Mon May 17 04:07:41 2021 +0000
@@ -1,4 +1,4 @@
-# $NetBSD: mi,v 1.143 2021/03/25 09:49:00 nia Exp $
+# $NetBSD: mi,v 1.144 2021/05/17 04:07:42 yamaguchi Exp $
#
# Note: don't delete entries from here - mark them as "obsolete" instead.
#
@@ -209,6 +209,8 @@
./@MODULEDIR@/if_kue/if_kue.kmod modules-base-kernel kmod
./@MODULEDIR@/if_l2tp modules-base-kernel kmod
./@MODULEDIR@/if_l2tp/if_l2tp.kmod modules-base-kernel kmod
+./@MODULEDIR@/if_lagg modules-base-kernel kmod
+./@MODULEDIR@/if_lagg/if_lagg.kmod modules-base-kernel kmod
./@MODULEDIR@/if_loop modules-base-kernel kmod
./@MODULEDIR@/if_loop/if_loop.kmod modules-base-kernel kmod
./@MODULEDIR@/if_mpls modules-base-kernel kmod
diff -r 3cf9bba683d9 -r 0706c8089b7d distrib/sets/lists/tests/mi
--- a/distrib/sets/lists/tests/mi Mon May 17 04:01:57 2021 +0000
+++ b/distrib/sets/lists/tests/mi Mon May 17 04:07:41 2021 +0000
@@ -1,4 +1,4 @@
-# $NetBSD: mi,v 1.1052 2021/05/16 11:11:36 rillig Exp $
+# $NetBSD: mi,v 1.1053 2021/05/17 04:07:42 yamaguchi Exp $
#
# Note: don't delete entries from here - mark them as "obsolete" instead.
#
@@ -4106,6 +4106,10 @@
./usr/tests/net/if_l2tp/Atffile tests-net-tests atf,rump
./usr/tests/net/if_l2tp/Kyuafile tests-net-tests atf,rump,kyua
./usr/tests/net/if_l2tp/t_l2tp tests-net-tests atf,rump
+./usr/tests/net/if_lagg tests-net-tests compattestfile,atf
+./usr/tests/net/if_lagg/Atffile tests-net-tests atf,rump
+./usr/tests/net/if_lagg/Kyuafile tests-net-tests atf,rump,kyua
+./usr/tests/net/if_lagg/t_lagg tests-net-tests atf,rump
./usr/tests/net/if_loop tests-net-tests compattestfile,atf
./usr/tests/net/if_loop/Atffile tests-net-tests atf,rump
./usr/tests/net/if_loop/Kyuafile tests-net-tests atf,rump,kyua
diff -r 3cf9bba683d9 -r 0706c8089b7d etc/mtree/NetBSD.dist.tests
--- a/etc/mtree/NetBSD.dist.tests Mon May 17 04:01:57 2021 +0000
+++ b/etc/mtree/NetBSD.dist.tests Mon May 17 04:07:41 2021 +0000
@@ -1,4 +1,4 @@
-# $NetBSD: NetBSD.dist.tests,v 1.183 2020/12/12 02:50:26 pgoyette Exp $
+# $NetBSD: NetBSD.dist.tests,v 1.184 2021/05/17 04:07:42 yamaguchi Exp $
./usr/libdata/debug/usr/tests
./usr/libdata/debug/usr/tests/atf
@@ -358,6 +358,7 @@
./usr/tests/net/if_gif
./usr/tests/net/if_ipsec
./usr/tests/net/if_l2tp
+./usr/tests/net/if_lagg
./usr/tests/net/if_loop
./usr/tests/net/if_pppoe
./usr/tests/net/if_tap
diff -r 3cf9bba683d9 -r 0706c8089b7d sbin/ifconfig/Makefile.common
--- a/sbin/ifconfig/Makefile.common Mon May 17 04:01:57 2021 +0000
+++ b/sbin/ifconfig/Makefile.common Mon May 17 04:07:41 2021 +0000
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile.common,v 1.6 2021/03/01 16:47:48 martin Exp $
+# $NetBSD: Makefile.common,v 1.7 2021/05/17 04:07:42 yamaguchi Exp $
# shared stuff with src/distrib/utils/x_ifconfig for install media.
# stuff not required by install media should be into Makefile.
@@ -17,5 +17,5 @@
SRCS+= ieee80211.c
.endif
.ifndef SMALLPROG
-SRCS+= agr.c l2tp.c
+SRCS+= agr.c l2tp.c lagg.c
.endif
diff -r 3cf9bba683d9 -r 0706c8089b7d sbin/ifconfig/lagg.c
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/sbin/ifconfig/lagg.c Mon May 17 04:07:41 2021 +0000
@@ -0,0 +1,676 @@
+/* $NetBSD: lagg.c,v 1.1 2021/05/17 04:07:42 yamaguchi Exp $ */
+
+/*
+ * Copyright (c) 2021 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 NETBSD FOUNDATION, INC. AND CONTRIBUTORS
+ * ``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 FOUNDATION 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>
+#if !defined(lint)
+__RCSID("$NetBSD: lagg.c,v 1.1 2021/05/17 04:07:42 yamaguchi Exp $");
+#endif /* !defined(lint) */
+
+#include <sys/param.h>
+
+#include <sys/ioctl.h>
+
+#include <net/if.h>
+#include <net/if_ether.h>
+#include <net/if_lagg.h>
+
+#include <ctype.h>
+#include <err.h>
+#include <errno.h>
+#include <string.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <util.h>
+
+#include "env.h"
+#include "extern.h"
+#include "util.h"
+
+static status_func_t status;
+static usage_func_t usage;
+static cmdloop_branch_t branch;
+
+static void lagg_constructor(void) __attribute__((constructor));
+static void lagg_status(prop_dictionary_t, prop_dictionary_t);
+static void lagg_usage(prop_dictionary_t);
+
+static int setlaggproto(prop_dictionary_t, prop_dictionary_t);
+static int setlaggport(prop_dictionary_t, prop_dictionary_t);
+static int setlagglacp(prop_dictionary_t, prop_dictionary_t);
+static int setlagglacpmaxports(prop_dictionary_t, prop_dictionary_t);
+static int setlaggfail(prop_dictionary_t, prop_dictionary_t);
+static void lagg_status_proto(lagg_proto, struct laggreqproto *);
+static void lagg_status_port(lagg_proto, struct laggreqport *);
+
+#ifdef LAGG_DEBUG
+static const bool lagg_debug = true;
+#else
+static const bool lagg_debug = false;
+#endif
+
+#define LAGG_RETRY_MAX 10
+
+static const char *laggprotostr[LAGG_PROTO_MAX] = {
Home |
Main Index |
Thread Index |
Old Index