Commit cf360866 authored by Vivien Didelot's avatar Vivien Didelot Committed by David S. Miller

net: dsa: do not skip -EOPNOTSUPP in dsa_port_vid_add

Currently dsa_port_vid_add returns 0 if the switch returns -EOPNOTSUPP.

This function is used in the tag_8021q.c code to offload the PVID of
ports, which would simply not work if .port_vlan_add is not supported
by the underlying switch.

Do not skip -EOPNOTSUPP in dsa_port_vid_add but only when necessary,
that is to say in dsa_slave_vlan_rx_add_vid.
Signed-off-by: default avatarVivien Didelot <vivien.didelot@gmail.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent e65d45cc
...@@ -382,8 +382,8 @@ int dsa_port_vid_add(struct dsa_port *dp, u16 vid, u16 flags) ...@@ -382,8 +382,8 @@ int dsa_port_vid_add(struct dsa_port *dp, u16 vid, u16 flags)
trans.ph_prepare = true; trans.ph_prepare = true;
err = dsa_port_vlan_add(dp, &vlan, &trans); err = dsa_port_vlan_add(dp, &vlan, &trans);
if (err == -EOPNOTSUPP) if (err)
return 0; return err;
trans.ph_prepare = false; trans.ph_prepare = false;
return dsa_port_vlan_add(dp, &vlan, &trans); return dsa_port_vlan_add(dp, &vlan, &trans);
......
...@@ -1082,8 +1082,11 @@ static int dsa_slave_vlan_rx_add_vid(struct net_device *dev, __be16 proto, ...@@ -1082,8 +1082,11 @@ static int dsa_slave_vlan_rx_add_vid(struct net_device *dev, __be16 proto,
return -EBUSY; return -EBUSY;
} }
/* This API only allows programming tagged, non-PVID VIDs */ ret = dsa_port_vid_add(dp, vid, 0);
return dsa_port_vid_add(dp, vid, 0); if (ret && ret != -EOPNOTSUPP)
return ret;
return 0;
} }
static int dsa_slave_vlan_rx_kill_vid(struct net_device *dev, __be16 proto, static int dsa_slave_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