aboutsummaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
authorDavid S. Miller <davem@davemloft.net>2019-10-29 16:22:07 -0700
committerDavid S. Miller <davem@davemloft.net>2019-10-29 16:22:07 -0700
commitc1b5ddc112e9b3985ea26d21da6ff3460f1c258b (patch)
tree3a565c0eb4c2502a36db731acfb379882ef17a8c
parentwimax: i2400: Fix memory leak in i2400m_op_rfkill_sw_toggle (diff)
parentnet: mscc: ocelot: refuse to overwrite the port's native vlan (diff)
downloadwireguard-linux-c1b5ddc112e9b3985ea26d21da6ff3460f1c258b.tar.xz
wireguard-linux-c1b5ddc112e9b3985ea26d21da6ff3460f1c258b.zip
Merge branch 'VLAN-fixes-for-Ocelot-switch'
Vladimir Oltean says: ==================== VLAN fixes for Ocelot switch This series addresses 2 issues with vlan_filtering=1: - Untagged traffic gets dropped unless commands are run in a very specific order. - Untagged traffic starts being transmitted as tagged after adding another untagged VID on the port. Tested on NXP LS1028A-RDB board. ==================== Signed-off-by: David S. Miller <davem@davemloft.net>
-rw-r--r--drivers/net/ethernet/mscc/ocelot.c11
1 files changed, 9 insertions, 2 deletions
diff --git a/drivers/net/ethernet/mscc/ocelot.c b/drivers/net/ethernet/mscc/ocelot.c
index 4d1bce4389c7..344539c0d3aa 100644
--- a/drivers/net/ethernet/mscc/ocelot.c
+++ b/drivers/net/ethernet/mscc/ocelot.c
@@ -261,8 +261,15 @@ static int ocelot_vlan_vid_add(struct net_device *dev, u16 vid, bool pvid,
port->pvid = vid;
/* Untagged egress vlan clasification */
- if (untagged)
+ if (untagged && port->vid != vid) {
+ if (port->vid) {
+ dev_err(ocelot->dev,
+ "Port already has a native VLAN: %d\n",
+ port->vid);
+ return -EBUSY;
+ }
port->vid = vid;
+ }
ocelot_vlan_port_apply(ocelot, port);
@@ -934,7 +941,7 @@ end:
static int ocelot_vlan_rx_add_vid(struct net_device *dev, __be16 proto,
u16 vid)
{
- return ocelot_vlan_vid_add(dev, vid, false, true);
+ return ocelot_vlan_vid_add(dev, vid, false, false);
}
static int ocelot_vlan_rx_kill_vid(struct net_device *dev, __be16 proto,