diff options
author | Vivien Didelot <vivien.didelot@gmail.com> | 2019-08-25 13:25:16 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2019-08-27 20:17:27 -0700 |
commit | cf360866b11901eca5317e8a5c26c3e15b7bf1f2 (patch) | |
tree | 9321d3d52b8f01ad89b9133cbb6a3ed9701f50cc /net/dsa/slave.c | |
parent | e65d45cc351ac5f1c11e6bac5669e536df753664 (diff) |
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: Vivien Didelot <vivien.didelot@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/dsa/slave.c')
-rw-r--r-- | net/dsa/slave.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/net/dsa/slave.c b/net/dsa/slave.c index 33f41178afcc..9d61d9dbf001 100644 --- a/net/dsa/slave.c +++ b/net/dsa/slave.c @@ -1082,8 +1082,11 @@ static int dsa_slave_vlan_rx_add_vid(struct net_device *dev, __be16 proto, return -EBUSY; } - /* This API only allows programming tagged, non-PVID VIDs */ - return dsa_port_vid_add(dp, vid, 0); + ret = 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, |