Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

net: dsa: felix: delete workarounds present due to SVL tag_8021q bridging

The felix driver, which also has a tagging protocol implementation based
on tag_8021q, does not care about adding the RX VLAN that is pvid on one
port on the other ports that are in the same bridge with it. It simply
doesn't need that, because in its implementation, the RX VLAN that is
pvid of a port is only used to install a TCAM rule that pushes that VLAN
ID towards the CPU port.

Now that tag_8021q no longer performs Shared VLAN Learning based
forwarding, the RX VLANs are actually segregated into two types:
standalone VLANs and VLAN-unaware bridging VLANs. Since you actually
have to call dsa_tag_8021q_bridge_join() to get a bridging VLAN from
tag_8021q, and felix does not do that because it doesn't need it, it
means that it only gets standalone port VLANs from tag_8021q. Which is
perfect because this means it can drop its workarounds that avoid the
VLANs it does not need.

Signed-off-by: Vladimir Oltean <vladimir.oltean@nxp.com>
Signed-off-by: David S. Miller <davem@davemloft.net>

authored by

Vladimir Oltean and committed by
David S. Miller
08f44db3 d27656d0

+2 -17
+2 -17
drivers/net/dsa/ocelot/felix.c
··· 33 33 struct dsa_switch *ds = felix->ds; 34 34 int key_length, upstream, err; 35 35 36 - /* We don't need to install the rxvlan into the other ports' filtering 37 - * tables, because we're just pushing the rxvlan when sending towards 38 - * the CPU 39 - */ 40 - if (!pvid) 41 - return 0; 42 - 43 36 key_length = ocelot->vcap[VCAP_ES0].keys[VCAP_ES0_IGR_PORT].length; 44 37 upstream = dsa_upstream_port(ds, port); 45 38 ··· 163 170 164 171 outer_tagging_rule = ocelot_vcap_block_find_filter_by_id(block_vcap_es0, 165 172 port, false); 166 - /* In rxvlan_add, we had the "if (!pvid) return 0" logic to avoid 167 - * installing outer tagging ES0 rules where they weren't needed. 168 - * But in rxvlan_del, the API doesn't give us the "flags" anymore, 169 - * so that forces us to be slightly sloppy here, and just assume that 170 - * if we didn't find an outer_tagging_rule it means that there was 171 - * none in the first place, i.e. rxvlan_del is called on a non-pvid 172 - * port. This is most probably true though. 173 - */ 174 173 if (!outer_tagging_rule) 175 - return 0; 174 + return -ENOENT; 176 175 177 176 return ocelot_vcap_filter_del(ocelot, outer_tagging_rule); 178 177 } ··· 186 201 untagging_rule = ocelot_vcap_block_find_filter_by_id(block_vcap_is1, 187 202 port, false); 188 203 if (!untagging_rule) 189 - return 0; 204 + return -ENOENT; 190 205 191 206 err = ocelot_vcap_filter_del(ocelot, untagging_rule); 192 207 if (err)