Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1332948
| From | Vivien Didelot <vivien.didelot@savoirfairelinux.com> |
|---|---|
| Newsgroups | linux.kernel |
| Subject | [PATCH net-next 4/4] net: dsa: remove dsa_bridge_check_vlan_range |
| Date | 2016-02-12 18:20 +0100 |
| Message-ID | <r1pxW-1vA-51@gated-at.bofh.it> (permalink) |
| References | <r1pxT-1vA-3@gated-at.bofh.it> |
| Organization | linux.* mail to news gateway |
DSA drivers may support multiple bridge groups with the same hardware
VLAN. The mv88e6xxx driver which cannot yet, already has its own check
for overlapping bridges. Thus remove the check from the DSA layer.
Signed-off-by: Vivien Didelot <vivien.didelot@savoirfairelinux.com>
---
net/dsa/slave.c | 50 --------------------------------------------------
1 file changed, 50 deletions(-)
diff --git a/net/dsa/slave.c b/net/dsa/slave.c
index 755b005..bcf383c 100644
--- a/net/dsa/slave.c
+++ b/net/dsa/slave.c
@@ -201,47 +201,6 @@ out:
return 0;
}
-static int dsa_bridge_check_vlan_range(struct dsa_switch *ds,
- const struct net_device *bridge,
- u16 vid_begin, u16 vid_end)
-{
- struct dsa_slave_priv *p;
- struct net_device *dev, *vlan_br;
- DECLARE_BITMAP(members, DSA_MAX_PORTS);
- DECLARE_BITMAP(untagged, DSA_MAX_PORTS);
- u16 vid;
- int member, err;
-
- if (!ds->drv->vlan_getnext || !vid_begin)
- return -EOPNOTSUPP;
-
- vid = vid_begin - 1;
-
- do {
- err = ds->drv->vlan_getnext(ds, &vid, members, untagged);
- if (err)
- break;
-
- if (vid > vid_end)
- break;
-
- member = find_first_bit(members, DSA_MAX_PORTS);
- if (member == DSA_MAX_PORTS)
- continue;
-
- dev = ds->ports[member];
- p = netdev_priv(dev);
- vlan_br = p->bridge_dev;
- if (vlan_br == bridge)
- continue;
-
- netdev_dbg(vlan_br, "hardware VLAN %d already in use\n", vid);
- return -EOPNOTSUPP;
- } while (vid < vid_end);
-
- return err == -ENOENT ? 0 : err;
-}
-
static int dsa_slave_port_vlan_add(struct net_device *dev,
const struct switchdev_obj_port_vlan *vlan,
struct switchdev_trans *trans)
@@ -254,15 +213,6 @@ static int dsa_slave_port_vlan_add(struct net_device *dev,
if (!ds->drv->port_vlan_prepare || !ds->drv->port_vlan_add)
return -EOPNOTSUPP;
- /* If the requested port doesn't belong to the same bridge as
- * the VLAN members, fallback to software VLAN (hopefully).
- */
- err = dsa_bridge_check_vlan_range(ds, p->bridge_dev,
- vlan->vid_begin,
- vlan->vid_end);
- if (err)
- return err;
-
err = ds->drv->port_vlan_prepare(ds, p->port, vlan, trans);
if (err)
return err;
--
2.7.1
Back to linux.kernel | Previous | Next — Previous in thread | Find similar | Unroll thread
[PATCH net-next 0/4] net: dsa: pass bridge device to drivers Vivien Didelot <vivien.didelot@savoirfairelinux.com> - 2016-02-12 18:20 +0100
[PATCH net-next 2/4] net: dsa: pass bridge down to drivers Vivien Didelot <vivien.didelot@savoirfairelinux.com> - 2016-02-12 18:20 +0100
Re: [PATCH net-next 2/4] net: dsa: pass bridge down to drivers Florian Fainelli <f.fainelli@gmail.com> - 2016-02-13 19:50 +0100
[PATCH net-next 1/4] net: dsa: mv88e6xxx: add port private structure Vivien Didelot <vivien.didelot@savoirfairelinux.com> - 2016-02-12 18:20 +0100
[PATCH net-next 4/4] net: dsa: remove dsa_bridge_check_vlan_range Vivien Didelot <vivien.didelot@savoirfairelinux.com> - 2016-02-12 18:20 +0100
csiph-web