Star64_linux/net/dsa
Vladimir Oltean dedd6a009f net: dsa: create a dsa_lag structure
The main purpose of this change is to create a data structure for a LAG
as seen by DSA. This is similar to what we have for bridging - we pass a
copy of this structure by value to ->port_lag_join and ->port_lag_leave.
For now we keep the lag_dev, id and a reference count in it. Future
patches will add a list of FDB entries for the LAG (these also need to
be refcounted to work properly).

The LAG structure is created using dsa_port_lag_create() and destroyed
using dsa_port_lag_destroy(), just like we have for bridging.

Because now, the dsa_lag itself is refcounted, we can simplify
dsa_lag_map() and dsa_lag_unmap(). These functions need to keep a LAG in
the dst->lags array only as long as at least one port uses it. The
refcounting logic inside those functions can be removed now - they are
called only when we should perform the operation.

dsa_lag_dev() is renamed to dsa_lag_by_id() and now returns the dsa_lag
structure instead of the lag_dev net_device.

dsa_lag_foreach_port() now takes the dsa_lag structure as argument.

dst->lags holds an array of dsa_lag structures.

dsa_lag_map() now also saves the dsa_lag->id value, so that linear
walking of dst->lags in drivers using dsa_lag_id() is no longer
necessary. They can just look at lag.id.

dsa_port_lag_id_get() is a helper, similar to dsa_port_bridge_num_get(),
which can be used by drivers to get the LAG ID assigned by DSA to a
given port.

Signed-off-by: Vladimir Oltean <vladimir.oltean@nxp.com>
Reviewed-by: Florian Fainelli <f.fainelli@gmail.com>
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
2022-02-24 21:31:43 -08:00
..
dsa.c net: dsa: mv88e6xxx: flush switchdev FDB workqueue before removing VLAN 2022-02-14 13:31:12 +00:00
dsa2.c net: dsa: create a dsa_lag structure 2022-02-24 21:31:43 -08:00
dsa_priv.h net: dsa: create a dsa_lag structure 2022-02-24 21:31:43 -08:00
Kconfig
Makefile
master.c Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net 2022-02-24 17:54:25 -08:00
port.c net: dsa: create a dsa_lag structure 2022-02-24 21:31:43 -08:00
slave.c net: dsa: create a dsa_lag structure 2022-02-24 21:31:43 -08:00
switch.c net: dsa: create a dsa_lag structure 2022-02-24 21:31:43 -08:00
tag_8021q.c net: dsa: tag_8021q: only call skb_push/skb_pull around __skb_vlan_pop 2022-02-16 20:35:35 -08:00
tag_ar9331.c
tag_brcm.c
tag_dsa.c net: dsa: create a dsa_lag structure 2022-02-24 21:31:43 -08:00
tag_gswip.c
tag_hellcreek.c
tag_ksz.c
tag_lan9303.c net: dsa: lan9303: handle hwaccel VLAN tags 2022-02-17 09:32:06 -08:00
tag_mtk.c
tag_ocelot.c
tag_ocelot_8021q.c net: dsa: tag_ocelot_8021q: calculate TX checksum in software for deferred packets 2022-02-17 14:06:51 +00:00
tag_qca.c net: dsa: tag_qca: add support for handling mgmt and MIB Ethernet packet 2022-02-02 14:43:59 +00:00
tag_rtl4_a.c
tag_rtl8_4.c
tag_sja1105.c
tag_trailer.c
tag_xrs700x.c