Home | History | Annotate | Download | only in lagg
History log of /src/sys/net/lagg/if_lagg_lacp.c
RevisionDateAuthorComments
 1.43  05-Apr-2024  yamaguchi lagg(4): move reply limitation to recive processing
 1.42  05-Apr-2024  yamaguchi lagg(4): set suppress at the same time with distribution state
 1.41  05-Apr-2024  yamaguchi added missing workq_wait for lacp_tick_work()
 1.40  05-Apr-2024  yamaguchi lagg(4): added check of LACP running state for safety

When LACP stops, the handler of callout do nothing
because all port is already detached from lacp.
Therefore, the added checks are just for safety.
 1.39  05-Apr-2024  yamaguchi fix missing LACP_LOCK
 1.38  05-Apr-2024  yamaguchi lagg(4): added missing pserialize_read_enter
 1.37  04-Apr-2024  yamaguchi Added comments to lagg(4)
 1.36  04-Apr-2024  yamaguchi lagg(4): move allocate memory before ioctl
 1.35  04-Apr-2024  yamaguchi Added KASSERT for LACP_LOCK
 1.34  04-Apr-2024  yamaguchi lagg(4): Use CTASSERT
 1.33  04-Apr-2024  yamaguchi lagg(4): change errno

suggested by ozaki-r@, thanks.
 1.32  04-Apr-2024  yamaguchi lagg(4): Remove unnecessary LAGG_LOCK holding while lagg_proto_detach()
to avoid deadlock in workqueue_wait due to LAGG_LOCK holding

lagg_proto_detach dose not need to hold LAGG_LOCK because only one
context can access to a detaching protocol after sc->sc_var is updated.
But it was held without any reason. And it had caused a deadlock by
holding LAGG_LOCK in caller of workqueue_wait
and waiting for the lock in worker.
 1.31  04-Apr-2024  yamaguchi lagg(4): added log on detaching a port from SELECTED state to STANDBY
 1.30  04-Apr-2024  yamaguchi lagg(4): Added LACP_READY state for logging
when a port turns SELECTED or UNSELECTED
 1.29  22-Nov-2023  yamaguchi lagg(4): Added logs about LACP processing
 1.28  22-Nov-2023  yamaguchi Set the fastest linkspeed in each physical interface to lagg(4)
 1.27  22-Nov-2023  yamaguchi Update sending interval when the partner's state is changed
 1.26  22-Nov-2023  yamaguchi Change LACPDU sending interval by TIMEOUT bit in partner's state
 1.25  10-Apr-2022  andvar branches: 1.25.4;
fix various typos in comments and output/log messages.
 1.24  04-Apr-2022  yamaguchi Fix missing m_reset_rcvif for allocated mbuf
 1.23  04-Apr-2022  yamaguchi Move input processing of lagg(4) before ether_input
to get rid of dependence.

This implementation is similar with that of bridge(4).
 1.22  01-Apr-2022  yamaguchi lagg(4): reimplement add and delete port

The IFNET_LOCK for the adding or deleting port became to
be held the whole time while the ifnet of the port is changed.
 1.21  31-Mar-2022  yamaguchi rename lagg_enqueue to lagg_output

NFC
 1.20  31-Mar-2022  yamaguchi Use addlog(4) for putting 2 messages to one line
 1.19  31-Mar-2022  yamaguchi update state of aggregator on multi-speed changing
 1.18  31-Mar-2022  yamaguchi handle LACPDU and MarkerDU in thread context

Those handler move from softint to thread context to
improve throughput in high load, because they hold LACP_LOCK.

pointed out by k-goda@IIJ
 1.17  31-Mar-2022  yamaguchi fix coding style
 1.16  31-Mar-2022  yamaguchi Added length check for safety

pointed out by k-goda@IIJ
 1.15  31-Mar-2022  yamaguchi Added missing kmem_free

pointed out by k-goda@IIJ
 1.14  31-Mar-2022  yamaguchi Added a kernel option to run LACP on a half duplex interface
 1.13  16-Jan-2022  rillig lagg: remove stray semicolon

No binary change.
 1.12  12-Jan-2022  yamaguchi Fix to call lacp_linkstate with IFNET_LOCK held

Network stack calls lacp_linkstate through lagg_port_ioctl when
doing "ifconfig up" or "ifconfig down" to an interface that is
a member of lagg(4). And IFNET_LOCK in the member interface
is held while the ioctl.
Therefore, lacp_linkstate is renamed to
lacp_linkstate_ifnet_locked, and always called with IFNET_LOCK
held. It avoids locking agains myself.
 1.11  06-Jan-2022  riastradh lagg(4): Take lock as required around if ioctl.

Note: There are some calls to SIOCADDMULTI/SIOCDELMULTI that take the
lock when they don't need it, but it's not clear it's harmful either
unless they come via a caller that holds softnet_lock.

candidate fix for
https://mail-index.netbsd.org/current-users/2021/12/31/msg041876.html

ok yamaguchi
 1.10  31-Dec-2021  riastradh sys: Use if_ioctl wrapper function.
 1.9  30-Nov-2021  yamaguchi Move net/agr/ieee8023_slowprotocols.h to net/ether_slowprotocols.h

Definitions related to slowprotocols are duplicated between
agr/ieee8023ad_slowprotocols.h and lagg/if_lagg_lacp.h
Therefore, the contents are moved to added file.

Note: currently, there are just LACP and Marker protocol,
however slowprotocols is independent of them.
 1.8  16-Nov-2021  yamaguchi Added a kernel option to set SYNC bit of LACP
while the lagg interface is in STANDBY state
 1.7  16-Nov-2021  yamaguchi Set SYNC bit of LACPDU when the interface is on STANDBY state
 1.6  19-Oct-2021  yamaguchi lagg: support l2tp(4) aggregation

- Accept "ifconfig lagg* laggport l2tp*"
- Set promiscuous mode when the added interface is l2tp*
- check IFF_UP in addition to IFF_RUNNING on
SIOCSIFFLAGS to a child interface.
 1.5  02-Oct-2021  mrg avoid set-but-unused-variable warnings.
 1.4  30-Sep-2021  yamaguchi Make a link-layer address of lagg(4) configurable by ifconfig(8)

lagg(4) uses a configured link-layer (MAC) address instead
of a random MAC address generated on creating.
The configured MAC address is copied to all child interface
and used for a system id of LACP.
 1.3  30-Jun-2021  yamaguchi lagg: fix an uninitialize variable

pointed out by tnn@n.o., thanks.
 1.2  18-May-2021  hannken branches: 1.2.2; 1.2.6;
Make this compile without DIAGNOSTIC.
 1.1  17-May-2021  yamaguchi Add a new link-aggregation pseudo interface named lagg(4)

- FreeBSD's lagg(4) based implementation
- MP-safe and MP-scalable
 1.2.6.3  01-Aug-2021  thorpej Sync with HEAD.
 1.2.6.2  17-Jun-2021  thorpej Sync w/ HEAD.
 1.2.6.1  18-May-2021  thorpej file if_lagg_lacp.c was added on branch thorpej-i2c-spi-conf on 2021-06-17 04:46:35 +0000
 1.2.2.2  31-May-2021  cjep sync with head
 1.2.2.1  18-May-2021  cjep file if_lagg_lacp.c was added on branch cjep_staticlib_x on 2021-05-31 22:15:21 +0000
 1.25.4.2  03-Oct-2024  martin Pull up following revision(s) (requested by rin in ticket #916):

sys/net/lagg/if_laggproto.c: revision 1.15
sys/net/lagg/if_lagg_lacp.c: revision 1.36
sys/net/lagg/if_laggproto.c: revision 1.16
sys/net/lagg/if_lagg_lacp.c: revision 1.37
sys/net/lagg/if_lagg_lacp.c: revision 1.38
sys/net/lagg/if_lagg_lacp.c: revision 1.39
sys/net/lagg/if_lagg.c: revision 1.54
sys/net/lagg/if_lagg.c: revision 1.55
sys/net/lagg/if_lagg.c: revision 1.59
sys/net/lagg/if_lagg.c: revision 1.70
sys/net/lagg/if_laggproto.h: revision 1.19
sys/net/lagg/if_lagg_lacp.c: revision 1.28
sys/net/lagg/if_lagg_lacp.c: revision 1.29
sys/net/lagg/if_laggproto.c: revision 1.7
sys/net/lagg/if_lagg_lacp.h: revision 1.5
sys/net/lagg/if_laggproto.c: revision 1.8
sys/net/lagg/if_laggproto.c: revision 1.9
sys/net/lagg/if_lagg_lacp.c: revision 1.40
sys/net/lagg/if_lagg_lacp.c: revision 1.41
sys/net/lagg/if_lagg_lacp.c: revision 1.42
sys/net/lagg/if_lagg_lacp.c: revision 1.43
tests/net/if_lagg/t_lagg.sh: revision 1.11
sys/net/lagg/if_lagg.c: revision 1.60
sys/net/lagg/if_lagg.c: revision 1.62
sys/net/lagg/if_lagg.c: revision 1.63
sys/net/lagg/if_lagg.c: revision 1.64
sys/net/lagg/if_laggproto.h: revision 1.20
sys/net/lagg/if_lagg.c: revision 1.65
sys/net/lagg/if_lagg.c: revision 1.66
sys/net/lagg/if_lagg.c: revision 1.67
sys/net/lagg/if_lagg_lacp.c: revision 1.30
sys/net/lagg/if_lagg.c: revision 1.68
sys/net/lagg/if_laggproto.c: revision 1.10
sys/net/lagg/if_lagg_lacp.c: revision 1.31
sys/net/lagg/if_lagg.c: revision 1.69
sys/net/lagg/if_laggproto.c: revision 1.11
sys/net/lagg/if_lagg_lacp.c: revision 1.32
sys/net/lagg/if_laggproto.c: revision 1.12
sys/net/lagg/if_lagg_lacp.c: revision 1.33
sys/net/lagg/if_laggproto.c: revision 1.13
sys/net/lagg/if_lagg_lacp.c: revision 1.34
sys/net/lagg/if_laggproto.c: revision 1.14
sys/net/lagg/if_lagg_lacp.c: revision 1.35

Set the fastest linkspeed in each physical interface to lagg(4)

lagg(4): Added logs about LACP processing

lagg(4): Fix missing IFNET_LOCK acquirement

lagg(4): update link speed when a physical interface is removed

lagg(4): fix missing update of the number of active ports

lagg(4): Added 0 length check

lagg(4): Added LACP_READY state for logging
when a port turns SELECTED or UNSELECTED

lagg(4): added log on detaching a port from SELECTED state to STANDBY
acquire LAGG_PROTO_LOCK instead of pserialize read section

lagg(4): Remove unnecessary LAGG_LOCK holding while lagg_proto_detach()
to avoid deadlock in workqueue_wait due to LAGG_LOCK holding
lagg_proto_detach dose not need to hold LAGG_LOCK because only one
context can access to a detaching protocol after sc->sc_var is updated.

But it was held without any reason. And it had caused a deadlock by
holding LAGG_LOCK in caller of workqueue_wait
and waiting for the lock in worker.
added missing LAGG_UNLOCK()

lagg(4): move comment about IFF_PROMISC
pointed out by ozaki-r@, thanks.

lagg(4): added NULL check for pfil_run_hooks
pointed out by ozaki-r@, thanks.

lagg(4): change errno
suggested by ozaki-r@, thanks.

lagg(4): increase output packets and bytes only if no error occurred
pointed out by ozaki-r@, thanks.

lagg(4): replace NULL check with KASSERT because lp_softc is always non-NULL

lagg(4): Use CTASSERT
Added KASSERT for LACP_LOCK

lagg(4): move allocate memory before ioctl
Added comments to lagg(4)

lagg(4): added __predict_true

lagg(4): added missing pserialize_read_enter
fix missing LACP_LOCK

lagg(4): added check of LACP running state for safety

When LACP stops, the handler of callout do nothing
because all port is already detached from lacp.

Therefore, the added checks are just for safety.
added missing workq_wait for lacp_tick_work()

lagg(4): set suppress at the same time with distribution state

lagg(4): remove unnecessary masking
pointed out by ozaki-r@, thanks.

lagg(4): move reply limitation to recive processing

lagg(4): release lock before pserialize_perform() if possible

lagg(4): Added vlan check

lagg(4): Fix missing destroy for list and entry

lagg(4) test: Fix typo and old comment

lagg: fill name of workqueue correctly
Found by KASSERT failure for DIAGNOSTIC kernel.
Authored by ozaki-r@.
 1.25.4.1  27-Nov-2023  martin Pull up following revision(s) (requested by yamaguchi in ticket #476):

sys/net/lagg/if_lagg.c: revision 1.52
sys/net/lagg/if_lagg.c: revision 1.53
sys/net/lagg/if_lagg_lacp.c: revision 1.26
sys/net/lagg/if_lagg_lacp.c: revision 1.27

Change LACPDU sending interval by TIMEOUT bit in partner's state

Update sending interval when the partner's state is changed

lagg(4): Fix missing pfil_run_hooks() and bpf_mtap()

Set ETHERCAP_VLAN_HWTAGGING on lagg(4)
that doesn't has physical interfaces

RSS XML Feed