diff options
| author | Jakub Kicinski <kuba@kernel.org> | 2020-11-02 17:09:10 -0800 |
|---|---|---|
| committer | Jakub Kicinski <kuba@kernel.org> | 2020-11-02 17:09:10 -0800 |
| commit | 51e4082c7cb3feef822552252136228979ada719 (patch) | |
| tree | 6d2af69b39fc42949b8099688599c57556b546d8 /include | |
| parent | 802dcb434057fb22bb4f7ba26fd9b8c7615dc777 (diff) | |
| parent | 9a72068080f14a9f249507eb171df26c912757dc (diff) | |
| download | cachepc-linux-51e4082c7cb3feef822552252136228979ada719.tar.gz cachepc-linux-51e4082c7cb3feef822552252136228979ada719.zip | |
Merge branch 'vlan-improvements-for-ocelot-switch'
Vladimir Oltean says:
====================
VLAN improvements for Ocelot switch
The main reason why I started this work is that deleting the bridge mdb
entries fails when the bridge is deleted, as described here:
https://lore.kernel.org/netdev/20201015173355.564934-1-vladimir.oltean@nxp.com/
In short, that happens because the bridge mdb entries are added with a
vid of 1, but deletion is attempted with a vid of 0. So the deletion
code fails to find the mdb entries.
The solution is to make ocelot use a pvid of 0 when it is under a bridge
with vlan_filtering 0. When vlan_filtering is 1, the pvid of the bridge
is what is programmed into the hardware.
The patch series also uncovers more bugs and does some more cleanup, but
the above is the main idea behind it.
====================
Link: https://lore.kernel.org/r/20201031102916.667619-1-vladimir.oltean@nxp.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Diffstat (limited to 'include')
| -rw-r--r-- | include/soc/mscc/ocelot.h | 17 |
1 files changed, 11 insertions, 6 deletions
diff --git a/include/soc/mscc/ocelot.h b/include/soc/mscc/ocelot.h index cc126d1796be..ea1de185f2e4 100644 --- a/include/soc/mscc/ocelot.h +++ b/include/soc/mscc/ocelot.h @@ -571,18 +571,21 @@ struct ocelot_vcap_block { int pol_lpr; }; +struct ocelot_vlan { + bool valid; + u16 vid; +}; + struct ocelot_port { struct ocelot *ocelot; struct regmap *target; bool vlan_aware; - - /* Ingress default VLAN (pvid) */ - u16 pvid; - - /* Egress default VLAN (vid) */ - u16 vid; + /* VLAN that untagged frames are classified to, on ingress */ + struct ocelot_vlan pvid_vlan; + /* The VLAN ID that will be transmitted as untagged, on egress */ + struct ocelot_vlan native_vlan; u8 ptp_cmd; struct sk_buff_head tx_skbs; @@ -744,6 +747,8 @@ int ocelot_fdb_add(struct ocelot *ocelot, int port, const unsigned char *addr, u16 vid); int ocelot_fdb_del(struct ocelot *ocelot, int port, const unsigned char *addr, u16 vid); +int ocelot_vlan_prepare(struct ocelot *ocelot, int port, u16 vid, bool pvid, + bool untagged); int ocelot_vlan_add(struct ocelot *ocelot, int port, u16 vid, bool pvid, bool untagged); int ocelot_vlan_del(struct ocelot *ocelot, int port, u16 vid); |
