aboutsummaryrefslogtreecommitdiff
path: root/sys/net/if_ethersubr.c
diff options
context:
space:
mode:
authorAndrew Thompson <thompsa@FreeBSD.org>2007-04-10 00:27:25 +0000
committerAndrew Thompson <thompsa@FreeBSD.org>2007-04-10 00:27:25 +0000
commitb47888cebab427ce710262f2b515c709c4f29efb (patch)
tree474c91da17bd5f3ae59c9c4351d9aafe27da1c11 /sys/net/if_ethersubr.c
parent60dd8da7752f1d9182a9bc363e7aeb938a97db5c (diff)
downloadsrc-b47888cebab427ce710262f2b515c709c4f29efb.tar.gz
src-b47888cebab427ce710262f2b515c709c4f29efb.zip
Add the trunk(4) driver for providing link aggregation, failover and fault
tolerance. This driver allows aggregation of multiple network interfaces as one virtual interface using a number of different protocols/algorithms. failover - Sends traffic through the secondary port if the master becomes inactive. fec - Supports Cisco Fast EtherChannel. lacp - Supports the IEEE 802.3ad Link Aggregation Control Protocol (LACP) and the Marker Protocol. loadbalance - Static loadbalancing using an outgoing hash. roundrobin - Distributes outgoing traffic using a round-robin scheduler through all active ports. This code was obtained from OpenBSD and this also includes 802.3ad LACP support from agr(4) in NetBSD.
Notes
Notes: svn path=/head/; revision=168561
Diffstat (limited to 'sys/net/if_ethersubr.c')
-rw-r--r--sys/net/if_ethersubr.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/sys/net/if_ethersubr.c b/sys/net/if_ethersubr.c
index 3c9cc8e769af..0ebdc569bc4f 100644
--- a/sys/net/if_ethersubr.c
+++ b/sys/net/if_ethersubr.c
@@ -113,6 +113,9 @@ int (*bridge_output_p)(struct ifnet *, struct mbuf *,
struct sockaddr *, struct rtentry *);
void (*bridge_dn_p)(struct mbuf *, struct ifnet *);
+/* if_trunk(4) support */
+struct mbuf *(*trunk_input_p)(struct ifnet *, struct mbuf *);
+
static const u_char etherbroadcastaddr[ETHER_ADDR_LEN] =
{ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff };
@@ -602,6 +605,17 @@ ether_input(struct ifnet *ifp, struct mbuf *m)
return;
}
+ /* Handle input from a trunk(4) port */
+ if (ifp->if_type == IFT_IEEE8023ADLAG) {
+ KASSERT(trunk_input_p != NULL,
+ ("%s: if_trunk not loaded!", __func__));
+ m = (*trunk_input_p)(ifp, m);
+ if (m != NULL)
+ ifp = m->m_pkthdr.rcvif;
+ else
+ return;
+ }
+
/*
* If the hardware did not process an 802.1Q tag, do this now,
* to allow 802.1P priority frames to be passed to the main input