aboutsummaryrefslogtreecommitdiffstats
path: root/include/net/dsa.h
diff options
context:
space:
mode:
authorDavid S. Miller <[email protected]>2021-03-18 23:24:06 +0000
committerDavid S. Miller <[email protected]>2021-03-18 23:24:06 +0000
commitd7417ee918582504076ec1a74dfcd5fe1f55696c (patch)
treee0e8d1fdd9057a55b413cb637f53e6a2f1b6d1eb /include/net/dsa.h
parentMerge branch 'ipa-32bit' (diff)
parentnet: dsa: mv88e6xxx: Offload bridge broadcast flooding flag (diff)
downloadkernel-d7417ee918582504076ec1a74dfcd5fe1f55696c.tar.gz
kernel-d7417ee918582504076ec1a74dfcd5fe1f55696c.zip
Merge branch 'mv88e6xxx-offload-bridge-flags'
Tobias Waldekranz says: ==================== net: dsa: mv88e6xxx: Offload bridge port flags Add support for offloading learning and broadcast flooding flags. With this in place, mv88e6xx supports offloading of all bridge port flags that are currently supported by the bridge. Broadcast flooding is somewhat awkward to control as there is no per-port bit for this like there is for unknown unicast and unknown multicast. Instead we have to update the ATU entry for the broadcast address for all currently used FIDs. v2 -> v3: - Only return a netdev from dsa_port_to_bridge_port if the port is currently bridged (Vladimir & Florian) v1 -> v2: - Ensure that mv88e6xxx_vtu_get handles VID 0 (Vladimir) - Fixed off-by-one in mv88e6xxx_port_set_assoc_vector (Vladimir) - Fast age all entries on port when disabling learning (Vladimir) - Correctly detect bridge flags on LAG ports (Vladimir) ==================== Signed-off-by: David S. Miller <[email protected]>
Diffstat (limited to 'include/net/dsa.h')
-rw-r--r--include/net/dsa.h14
1 files changed, 14 insertions, 0 deletions
diff --git a/include/net/dsa.h b/include/net/dsa.h
index dac303edd33d..57b2c49f72f4 100644
--- a/include/net/dsa.h
+++ b/include/net/dsa.h
@@ -493,6 +493,20 @@ static inline bool dsa_port_is_vlan_filtering(const struct dsa_port *dp)
return dp->vlan_filtering;
}
+static inline
+struct net_device *dsa_port_to_bridge_port(const struct dsa_port *dp)
+{
+ if (!dp->bridge_dev)
+ return NULL;
+
+ if (dp->lag_dev)
+ return dp->lag_dev;
+ else if (dp->hsr_dev)
+ return dp->hsr_dev;
+
+ return dp->slave;
+}
+
typedef int dsa_fdb_dump_cb_t(const unsigned char *addr, u16 vid,
bool is_static, void *data);
struct dsa_switch_ops {