aboutsummaryrefslogtreecommitdiffstats
path: root/include/net/dsa.h
diff options
context:
space:
mode:
authorVladimir Oltean <vladimir.oltean@nxp.com>2021-08-19 20:55:00 +0300
committerDavid S. Miller <davem@davemloft.net>2021-08-23 11:52:31 +0100
commitf5e165e72b29d908214e554ef57f67790ba95934 (patch)
treee74566f4048f4548c985f2cc4b19b2e10cca4e1a /include/net/dsa.h
parentRevert "sfc: falcon: Read VPD with pci_vpd_alloc()" (diff)
downloadlinux-dev-f5e165e72b29d908214e554ef57f67790ba95934.tar.xz
linux-dev-f5e165e72b29d908214e554ef57f67790ba95934.zip
net: dsa: track unique bridge numbers across all DSA switch trees
Right now, cross-tree bridging setups work somewhat by mistake. In the case of cross-tree bridging with sja1105, all switch instances need to agree upon a common VLAN ID for forwarding a packet that belongs to a certain bridging domain. With TX forwarding offload, the VLAN ID is the bridge VLAN for VLAN-aware bridging, and the tag_8021q TX forwarding offload VID (a VLAN which has non-zero VBID bits) for VLAN-unaware bridging. The VBID for VLAN-unaware bridging is derived from the dp->bridge_num value calculated by DSA independently for each switch tree. If ports from one tree join one bridge, and ports from another tree join another bridge, DSA will assign them the same bridge_num, even though the bridges are different. If cross-tree bridging is supported, this is an issue. Modify DSA to calculate the bridge_num globally across all switch trees. This has the implication for a driver that the dp->bridge_num value that DSA will assign to its ports might not be contiguous, if there are boards with multiple DSA drivers instantiated. Additionally, all bridge_num values eat up towards each switch's ds->num_fwd_offloading_bridges maximum, which is potentially unfortunate, and can be seen as a limitation introduced by this patch. However, that is the lesser evil for now. Signed-off-by: Vladimir Oltean <vladimir.oltean@nxp.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'include/net/dsa.h')
-rw-r--r--include/net/dsa.h8
1 files changed, 3 insertions, 5 deletions
diff --git a/include/net/dsa.h b/include/net/dsa.h
index 0c2cba45fa79..c7ea0f61056f 100644
--- a/include/net/dsa.h
+++ b/include/net/dsa.h
@@ -155,9 +155,6 @@ struct dsa_switch_tree {
/* Track the largest switch index within a tree */
unsigned int last_switch;
-
- /* Track the bridges with forwarding offload enabled */
- unsigned long fwd_offloading_bridges;
};
#define dsa_lags_foreach_id(_id, _dst) \
@@ -411,8 +408,9 @@ struct dsa_switch {
unsigned int num_lag_ids;
/* Drivers that support bridge forwarding offload should set this to
- * the maximum number of bridges spanning the same switch tree that can
- * be offloaded.
+ * the maximum number of bridges spanning the same switch tree (or all
+ * trees, in the case of cross-tree bridging support) that can be
+ * offloaded.
*/
unsigned int num_fwd_offloading_bridges;