The NetBSD Project

CVS log for src/sys/net/lagg/if_lagg.c

[BACK] Up to [cvs.NetBSD.org] / src / sys / net / lagg

Request diff between arbitrary revisions


Default branch: MAIN


Revision 1.48 / (download) - annotate - [select for diffs], Sun Jun 26 17:55:24 2022 UTC (7 months ago) by riastradh
Branch: MAIN
CVS Tags: netbsd-10-base, netbsd-10, bouyer-sunxi-drm-base, bouyer-sunxi-drm, HEAD
Changes since 1.47: +10 -8 lines
Diff to previous 1.47 (colored)

lagg(4): Safely handle misaligned mbufs.

Optimizing for non-strict-alignment architectures -- without falling
afoul of alignment sanitizers or overeager compilers -- is left as an
exercise for the reader.

PR kern/56894

Revision 1.47 / (download) - annotate - [select for diffs], Mon Apr 4 09:59:41 2022 UTC (9 months, 3 weeks ago) by martin
Branch: MAIN
Changes since 1.46: +3 -3 lines
Diff to previous 1.46 (colored)

Avoid signed/unsigned comparision by casting the sizeof expression.

Revision 1.46 / (download) - annotate - [select for diffs], Mon Apr 4 06:10:00 2022 UTC (9 months, 3 weeks ago) by yamaguchi
Branch: MAIN
Changes since 1.45: +45 -21 lines
Diff to previous 1.45 (colored)

Move input processing of lagg(4) before ether_input
to get rid of dependence.

This implementation is similar with that of bridge(4).

Revision 1.45 / (download) - annotate - [select for diffs], Fri Apr 1 07:26:51 2022 UTC (9 months, 4 weeks ago) by yamaguchi
Branch: MAIN
Changes since 1.44: +196 -293 lines
Diff to previous 1.44 (colored)

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.

Revision 1.44 / (download) - annotate - [select for diffs], Thu Mar 31 07:59:05 2022 UTC (9 months, 4 weeks ago) by yamaguchi
Branch: MAIN
Changes since 1.43: +3 -3 lines
Diff to previous 1.43 (colored)

rename lagg_enqueue to lagg_output

NFC

Revision 1.43 / (download) - annotate - [select for diffs], Thu Mar 31 03:21:33 2022 UTC (9 months, 4 weeks ago) by yamaguchi
Branch: MAIN
Changes since 1.42: +36 -28 lines
Diff to previous 1.42 (colored)

Use ether_ioctl to change mtu of lagg(4)

Revision 1.42 / (download) - annotate - [select for diffs], Thu Mar 31 03:15:15 2022 UTC (9 months, 4 weeks ago) by yamaguchi
Branch: MAIN
Changes since 1.41: +34 -57 lines
Diff to previous 1.41 (colored)

Use addlog(4) for putting 2 messages to one line

Revision 1.41 / (download) - annotate - [select for diffs], Thu Mar 31 03:12:31 2022 UTC (9 months, 4 weeks ago) by yamaguchi
Branch: MAIN
Changes since 1.40: +2 -3 lines
Diff to previous 1.40 (colored)

Make lagg interface specified "laggproto none" able to up

Revision 1.40 / (download) - annotate - [select for diffs], Thu Mar 31 03:10:59 2022 UTC (9 months, 4 weeks ago) by yamaguchi
Branch: MAIN
Changes since 1.39: +47 -30 lines
Diff to previous 1.39 (colored)

added log when ifpromisc is failed

Revision 1.39 / (download) - annotate - [select for diffs], Thu Mar 31 03:07:05 2022 UTC (9 months, 4 weeks ago) by yamaguchi
Branch: MAIN
Changes since 1.38: +10 -4 lines
Diff to previous 1.38 (colored)

Set flags related to MTU on adding l2tp(4) to lagg(4)

Revision 1.38 / (download) - annotate - [select for diffs], Thu Mar 31 02:00:27 2022 UTC (9 months, 4 weeks ago) by yamaguchi
Branch: MAIN
Changes since 1.37: +22 -38 lines
Diff to previous 1.37 (colored)

fix coding style

Revision 1.37 / (download) - annotate - [select for diffs], Thu Mar 31 01:57:13 2022 UTC (9 months, 4 weeks ago) by yamaguchi
Branch: MAIN
Changes since 1.36: +2 -3 lines
Diff to previous 1.36 (colored)

lagg(4): remove duplicated bpf_mtap

Revision 1.36 / (download) - annotate - [select for diffs], Thu Mar 31 01:53:22 2022 UTC (9 months, 4 weeks ago) by yamaguchi
Branch: MAIN
Changes since 1.35: +3 -3 lines
Diff to previous 1.35 (colored)

Change error code to ENOBUFS on lack of buffer memory

pointed out by k-goda@IIJ

Revision 1.35 / (download) - annotate - [select for diffs], Thu Mar 31 01:49:02 2022 UTC (9 months, 4 weeks ago) by yamaguchi
Branch: MAIN
Changes since 1.34: +3 -2 lines
Diff to previous 1.34 (colored)

Fix missing freeing resource related to protocol

pointed out by k-goda@IIJ

Revision 1.34 / (download) - annotate - [select for diffs], Thu Mar 31 01:46:25 2022 UTC (9 months, 4 weeks ago) by yamaguchi
Branch: MAIN
Changes since 1.33: +19 -14 lines
Diff to previous 1.33 (colored)

Switch ifp->if_output along with configuring ifp->if_lagg

lagg_port_output stored to ifp->if_output uses ifp->if_lagg.
Therefore, ifp->if_output switches to lagg_port_output after
ifp->if_lagg is configured, and restores in reverse order.

This missing order is pointed out by k-goda@IIJ

Revision 1.33 / (download) - annotate - [select for diffs], Thu Mar 31 01:43:48 2022 UTC (9 months, 4 weeks ago) by yamaguchi
Branch: MAIN
Changes since 1.32: +6 -2 lines
Diff to previous 1.32 (colored)

Added missing NULL check

pointed out by k-goda@IIJ

Revision 1.32 / (download) - annotate - [select for diffs], Thu Mar 31 01:42:40 2022 UTC (9 months, 4 weeks ago) by yamaguchi
Branch: MAIN
Changes since 1.31: +26 -24 lines
Diff to previous 1.31 (colored)

lagg(4): commonize the error handling

Revision 1.31 / (download) - annotate - [select for diffs], Thu Mar 31 01:39:09 2022 UTC (9 months, 4 weeks ago) by yamaguchi
Branch: MAIN
Changes since 1.30: +3 -3 lines
Diff to previous 1.30 (colored)

lagg(4): fix typo

pointed out by k-goda@IIJ

Revision 1.30 / (download) - annotate - [select for diffs], Wed Jan 12 08:23:53 2022 UTC (12 months, 2 weeks ago) by yamaguchi
Branch: MAIN
Changes since 1.29: +10 -3 lines
Diff to previous 1.29 (colored)

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.

Revision 1.29 / (download) - annotate - [select for diffs], Wed Jan 12 01:21:36 2022 UTC (12 months, 2 weeks ago) by riastradh
Branch: MAIN
Changes since 1.28: +10 -6 lines
Diff to previous 1.28 (colored)

lagg(4): Need to take IFNET_LOCK around if_init.

This should really just avoid dropping IFNET_LOCK before it's done
changing the port interface's configuration, but this stop-gap change
will serve provisionally to reduce crashes until we can confirm that
there's no deadlock lurking in the time this logic drops IFNET_LOCK.

Revision 1.28 / (download) - annotate - [select for diffs], Fri Dec 31 14:25:24 2021 UTC (12 months, 4 weeks ago) by riastradh
Branch: MAIN
Changes since 1.27: +8 -8 lines
Diff to previous 1.27 (colored)

sys: Use if_init wrapper function.

Exception: Not in kern_pmf.c, for the kind of silly reason that it
avoids having kern_pmf.c refer to symbols defined only in net; this
avoids a pain in the rump.

Revision 1.27 / (download) - annotate - [select for diffs], Fri Dec 31 14:24:38 2021 UTC (12 months, 4 weeks ago) by riastradh
Branch: MAIN
Changes since 1.26: +5 -5 lines
Diff to previous 1.26 (colored)

sys: Use if_stop wrapper function.

Exception: Not in kern_pmf.c, for the kind of silly reason that it
avoids having kern_pmf.c refer to symbols defined only in net; this
avoids a pain in the rump.

Revision 1.26 / (download) - annotate - [select for diffs], Mon Nov 15 07:07:05 2021 UTC (14 months, 2 weeks ago) by yamaguchi
Branch: MAIN
Changes since 1.25: +6 -101 lines
Diff to previous 1.25 (colored)

introduced APIs to configure VLAN TAG to ethernet devices

Revision 1.25 / (download) - annotate - [select for diffs], Fri Nov 12 05:56:54 2021 UTC (14 months, 2 weeks ago) by yamaguchi
Branch: MAIN
Changes since 1.24: +5 -5 lines
Diff to previous 1.24 (colored)

Configure vlan to an added interface after setting ifnet::if_lagg

The configuration uses ioctl of the interface, and the ioctl
for port (lagg_port_ioctl) needs ifnet:::if_lagg setting.

Revision 1.24 / (download) - annotate - [select for diffs], Fri Nov 12 05:48:58 2021 UTC (14 months, 2 weeks ago) by yamaguchi
Branch: MAIN
Changes since 1.23: +99 -44 lines
Diff to previous 1.23 (colored)

lagg: Add vid to vlanid_list in ethercom

Revision 1.23 / (download) - annotate - [select for diffs], Fri Nov 12 05:40:44 2021 UTC (14 months, 2 weeks ago) by yamaguchi
Branch: MAIN
Changes since 1.22: +3 -3 lines
Diff to previous 1.22 (colored)

Fix the wrong check of interface type

 - lp->lp_iftype: original ifnet::if_type
 - lp->lp_ifp->if_type: current ifnet::if_type
    - always IFT_IEEE8023ADLAG

Revision 1.22 / (download) - annotate - [select for diffs], Fri Nov 12 05:34:45 2021 UTC (14 months, 2 weeks ago) by yamaguchi
Branch: MAIN
Changes since 1.21: +63 -2 lines
Diff to previous 1.21 (colored)

lagg: Notify the changes of capenables of interface
to child interfaces

Revision 1.21 / (download) - annotate - [select for diffs], Thu Nov 11 01:10:09 2021 UTC (14 months, 2 weeks ago) by yamaguchi
Branch: MAIN
Changes since 1.20: +30 -18 lines
Diff to previous 1.20 (colored)

lagg: Use promiscuous mode instead of if_init() to avoid panic
when the interface has no if_init()

Revision 1.20 / (download) - annotate - [select for diffs], Mon Nov 8 06:29:16 2021 UTC (14 months, 3 weeks ago) by yamaguchi
Branch: MAIN
Changes since 1.19: +2 -35 lines
Diff to previous 1.19 (colored)

remove unused ioctl command named SIOCGLAGGPORT
to get status of l2tp(4) added to lagg

NOTE:
SIOCGLAGGPORT is based on FreeBSD implementation.
And, currently, it is not used in NetBSD kernel/userland.

Revision 1.19 / (download) - annotate - [select for diffs], Mon Nov 8 06:22:16 2021 UTC (14 months, 3 weeks ago) by yamaguchi
Branch: MAIN
Changes since 1.18: +124 -8 lines
Diff to previous 1.18 (colored)

lagg: renew MAC addresses to change the value of interface type

The interface type(ifnet::if_type) is changed on adding to lagg(4)
and deleting from it.

Revision 1.18 / (download) - annotate - [select for diffs], Mon Nov 8 06:17:05 2021 UTC (14 months, 3 weeks ago) by yamaguchi
Branch: MAIN
Changes since 1.17: +9 -2 lines
Diff to previous 1.17 (colored)

Update the MAC address of all child interface
when that of lagg is changed.

Revision 1.17 / (download) - annotate - [select for diffs], Fri Oct 22 06:20:47 2021 UTC (15 months, 1 week ago) by yamaguchi
Branch: MAIN
Changes since 1.16: +36 -34 lines
Diff to previous 1.16 (colored)

lagg: change hash logic to generate the same value
when pairs of source and destination are the same

Revision 1.16 / (download) - annotate - [select for diffs], Tue Oct 19 08:02:42 2021 UTC (15 months, 1 week ago) by yamaguchi
Branch: MAIN
Changes since 1.15: +2 -3 lines
Diff to previous 1.15 (colored)

lagg: reject a vlan interface that is not configured

The vlan I/F has no MAC address used in LACP.

Revision 1.15 / (download) - annotate - [select for diffs], Tue Oct 19 07:52:33 2021 UTC (15 months, 1 week ago) by yamaguchi
Branch: MAIN
Changes since 1.14: +87 -35 lines
Diff to previous 1.14 (colored)

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.

Revision 1.14 / (download) - annotate - [select for diffs], Tue Oct 19 07:40:52 2021 UTC (15 months, 1 week ago) by yamaguchi
Branch: MAIN
Changes since 1.13: +4 -2 lines
Diff to previous 1.13 (colored)

lagg: clear I/G bitg and set G/L bit in a generated MAC address

Revision 1.13 / (download) - annotate - [select for diffs], Tue Oct 12 08:30:58 2021 UTC (15 months, 2 weeks ago) by yamaguchi
Branch: MAIN
Changes since 1.12: +29 -5 lines
Diff to previous 1.12 (colored)

Set a port interface of lagg(4) in promiscuous mode
when the lagg(4) is in promiscuous mode.

Revision 1.12 / (download) - annotate - [select for diffs], Tue Oct 12 08:26:47 2021 UTC (15 months, 2 weeks ago) by yamaguchi
Branch: MAIN
Changes since 1.11: +201 -8 lines
Diff to previous 1.11 (colored)

lagg: update capabilities of ifnet and ethercom

Commonly capabilities of all child interface are configured
to a lagg interface.

Revision 1.11 / (download) - annotate - [select for diffs], Tue Oct 5 04:17:58 2021 UTC (15 months, 3 weeks ago) by yamaguchi
Branch: MAIN
Changes since 1.10: +23 -3 lines
Diff to previous 1.10 (colored)

Drop unicast packets that are not for us
when lagg(4) is not in promisc

Revision 1.10 / (download) - annotate - [select for diffs], Thu Sep 30 04:29:17 2021 UTC (15 months, 4 weeks ago) by yamaguchi
Branch: MAIN
Changes since 1.9: +73 -23 lines
Diff to previous 1.9 (colored)

lagg: Register lagg_ifdetach to ether_ifdetach hook

Revision 1.9 / (download) - annotate - [select for diffs], Thu Sep 30 04:23:30 2021 UTC (15 months, 4 weeks ago) by yamaguchi
Branch: MAIN
Changes since 1.8: +349 -254 lines
Diff to previous 1.8 (colored)

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.

Revision 1.8 / (download) - annotate - [select for diffs], Thu Sep 30 04:20:14 2021 UTC (15 months, 4 weeks ago) by yamaguchi
Branch: MAIN
Changes since 1.7: +22 -19 lines
Diff to previous 1.7 (colored)

Fix to acquire LAGG_LOCK without psref
to remove possibility of deadlock

the deadlock maybe happened between lagg_ifdetach()
and lagg_delport()

1. lagg_ifdetach calls psref_target_acquire()
2. lagg_delport calls LAGG_LOCK()
3. lagg_ifdetach calls LAGG_LOCK()
   - wait for lagg_delport
4. lagg_delport calls psref_target_destroy()
   - wait for lagg_ifdetach

Revision 1.7 / (download) - annotate - [select for diffs], Thu Sep 30 03:39:39 2021 UTC (15 months, 4 weeks ago) by yamaguchi
Branch: MAIN
Changes since 1.6: +12 -3 lines
Diff to previous 1.6 (colored)

lagg: Register lagg_linkstate_changed to link-state change hook

Revision 1.5.2.3 / (download) - annotate - [select for diffs], Sun Aug 1 22:42:41 2021 UTC (17 months, 4 weeks ago) by thorpej
Branch: thorpej-i2c-spi-conf
Changes since 1.5.2.2: +3 -3 lines
Diff to previous 1.5.2.2 (colored) next main 1.6 (colored)

Sync with HEAD.

Revision 1.6 / (download) - annotate - [select for diffs], Tue Jul 13 09:00:26 2021 UTC (18 months, 2 weeks ago) by ozaki-r
Branch: MAIN
CVS Tags: thorpej-i2c-spi-conf2-base, thorpej-i2c-spi-conf2, thorpej-i2c-spi-conf-base, thorpej-futex2-base, thorpej-futex2, thorpej-cfargs2-base, thorpej-cfargs2
Changes since 1.5: +3 -3 lines
Diff to previous 1.5 (colored)

lagg: fix typo for ALTQ

Revision 1.5.2.2 / (download) - annotate - [select for diffs], Thu Jun 17 04:46:35 2021 UTC (19 months, 1 week ago) by thorpej
Branch: thorpej-i2c-spi-conf
Changes since 1.5.2.1: +2451 -0 lines
Diff to previous 1.5.2.1 (colored)

Sync w/ HEAD.

Revision 1.5.2.1, Wed Jun 16 00:21:19 2021 UTC (19 months, 2 weeks ago) by thorpej
Branch: thorpej-i2c-spi-conf
Changes since 1.5: +0 -2451 lines
FILE REMOVED

file if_lagg.c was added on branch thorpej-i2c-spi-conf on 2021-06-17 04:46:35 +0000

Revision 1.5 / (download) - annotate - [select for diffs], Wed Jun 16 00:21:19 2021 UTC (19 months, 2 weeks ago) by riastradh
Branch: MAIN
Branch point for: thorpej-i2c-spi-conf
Changes since 1.4: +3 -8 lines
Diff to previous 1.4 (colored)

if_attach and if_initialize cannot fail, don't test return value

These were originally made failable back in 2017 when if_initialize
allocated a softint in every interface for link state changes, so
that it could fail gracefully instead of panicking:

https://mail-index.NetBSD.org/source-changes/2017/10/23/msg089053.html

However, this spawned many seldom- or never-tested error branches,
which are risky to have around.  And that softint in every interface
has since been replaced by a single global workqueue, because link
state changes require thread context but not low latency or high
throughput:

https://mail-index.NetBSD.org/source-changes/2020/02/06/msg113759.html

So there is no longer any reason for if_initialize to fail.  (The
subroutine if_stats_init can't fail because percpu_alloc can't fail
either.)

There is a snag: the softint_establish in if_percpuq_create could
fail, potentially leading to bad consequences later on trying to use
the softint.  This change doesn't introduce any new bugs because of
the snag -- if_percpuq_attach was already broken.  However, the snag
can be better addressed without spawning error branches, either by
using a single softint or making softints less scarce.

(Separate commit will change the signatures of if_attach and
if_initialize to return void, scheduled to ride whatever is the next
convenient kernel bump.)

Patch and testing on amd64 and evbmips64-eb by maya@; commit message
soliloquy, and compile-testing on evbppc/i386/earmv7hf, by me.

Revision 1.4.2.2 / (download) - annotate - [select for diffs], Mon May 31 22:15:21 2021 UTC (19 months, 4 weeks ago) by cjep
Branch: cjep_staticlib_x
Changes since 1.4.2.1: +2456 -0 lines
Diff to previous 1.4.2.1 (colored) to branchpoint 1.4 (colored) next main 1.5 (colored)

sync with head

Revision 1.4.2.1, Mon May 24 13:42:58 2021 UTC (20 months ago) by cjep
Branch: cjep_staticlib_x
Changes since 1.4: +0 -2456 lines
FILE REMOVED

file if_lagg.c was added on branch cjep_staticlib_x on 2021-05-31 22:15:21 +0000

Revision 1.4 / (download) - annotate - [select for diffs], Mon May 24 13:42:58 2021 UTC (20 months ago) by thorpej
Branch: MAIN
CVS Tags: cjep_sun2x-base1, cjep_sun2x-base, cjep_sun2x, cjep_staticlib_x-base1
Branch point for: cjep_staticlib_x
Changes since 1.3: +4 -4 lines
Diff to previous 1.3 (colored)

Move __KERNEL_RCSID() to the traditional location.

Revision 1.3 / (download) - annotate - [select for diffs], Mon May 24 06:08:28 2021 UTC (20 months ago) by yamaguchi
Branch: MAIN
Changes since 1.2: +21 -2 lines
Diff to previous 1.2 (colored)

Added missing copyright and license notice

pointed out by thorpej@n.o., Thanks.

Revision 1.2 / (download) - annotate - [select for diffs], Wed May 19 10:20:50 2021 UTC (20 months, 1 week ago) by rillig
Branch: MAIN
Changes since 1.1: +4 -3 lines
Diff to previous 1.1 (colored)

if_lagg: fix format string incompatibility

In struct ifnet, the member if_mtu has type uint64_t, which differs from
struct ifreq, where the member ifru_mtu has type int.

Revision 1.1 / (download) - annotate - [select for diffs], Mon May 17 04:07:43 2021 UTC (20 months, 1 week ago) by yamaguchi
Branch: MAIN

Add a new link-aggregation pseudo interface named lagg(4)

 - FreeBSD's lagg(4) based implementation
 - MP-safe and MP-scalable

This form allows you to request diff's between any two revisions of a file. You may select a symbolic revision name using the selection box or you may type in a numeric name using the type-in text box.




CVSweb <webmaster@jp.NetBSD.org>