Commit c1b5ddc1 authored by David S. Miller's avatar David S. Miller

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: default avatarDavid S. Miller <davem@davemloft.net>
parents 6f3ef5c2 b9cd75e6
...@@ -261,8 +261,15 @@ static int ocelot_vlan_vid_add(struct net_device *dev, u16 vid, bool pvid, ...@@ -261,8 +261,15 @@ static int ocelot_vlan_vid_add(struct net_device *dev, u16 vid, bool pvid,
port->pvid = vid; port->pvid = vid;
/* Untagged egress vlan clasification */ /* 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; port->vid = vid;
}
ocelot_vlan_port_apply(ocelot, port); ocelot_vlan_port_apply(ocelot, port);
...@@ -934,7 +941,7 @@ static int ocelot_fdb_dump(struct sk_buff *skb, struct netlink_callback *cb, ...@@ -934,7 +941,7 @@ static int ocelot_fdb_dump(struct sk_buff *skb, struct netlink_callback *cb,
static int ocelot_vlan_rx_add_vid(struct net_device *dev, __be16 proto, static int ocelot_vlan_rx_add_vid(struct net_device *dev, __be16 proto,
u16 vid) 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, static int ocelot_vlan_rx_kill_vid(struct net_device *dev, __be16 proto,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment