Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1244237 > unrolled thread
| Started by | Vivien Didelot <vivien.didelot@savoirfairelinux.com> |
|---|---|
| First post | 2015-10-12 00:10 +0200 |
| Last post | 2015-10-15 15:00 +0200 |
| Articles | 11 — 5 participants |
Back to article view | Back to linux.kernel
[PATCH net-next 0/4] net: dsa: mv88e6xxx: fix hardware bridging Vivien Didelot <vivien.didelot@savoirfairelinux.com> - 2015-10-12 00:10 +0200
[PATCH net-next 3/4] net: dsa: do not warn unsupported bridge ops Vivien Didelot <vivien.didelot@savoirfairelinux.com> - 2015-10-12 00:20 +0200
[PATCH net-next 1/4] net: dsa: mv88e6xxx: bridges do not need an FID Vivien Didelot <vivien.didelot@savoirfairelinux.com> - 2015-10-12 00:20 +0200
Re: [PATCH net-next 0/4] net: dsa: mv88e6xxx: fix hardware bridging David Miller <davem@davemloft.net> - 2015-10-13 13:20 +0200
Re: [PATCH net-next 0/4] net: dsa: mv88e6xxx: fix hardware bridging Andrew Lunn <andrew@lunn.ch> - 2015-10-15 00:50 +0200
Re: [PATCH net-next 0/4] net: dsa: mv88e6xxx: fix hardware bridging Vivien Didelot <vivien.didelot@savoirfairelinux.com> - 2015-10-15 03:40 +0200
Re: [PATCH net-next 0/4] net: dsa: mv88e6xxx: fix hardware bridging Florian Fainelli <f.fainelli@gmail.com> - 2015-10-15 03:50 +0200
Re: [PATCH net-next 0/4] net: dsa: mv88e6xxx: fix hardware bridging Vivien Didelot <vivien.didelot@savoirfairelinux.com> - 2015-10-15 14:50 +0200
Re: [PATCH net-next 0/4] net: dsa: mv88e6xxx: fix hardware bridging Andrew Lunn <andrew@lunn.ch> - 2015-10-15 05:00 +0200
Re: [PATCH net-next 0/4] net: dsa: mv88e6xxx: fix hardware bridging Guenter Roeck <linux@roeck-us.net> - 2015-10-15 05:20 +0200
Re: [PATCH net-next 0/4] net: dsa: mv88e6xxx: fix hardware bridging Vivien Didelot <vivien.didelot@savoirfairelinux.com> - 2015-10-15 15:00 +0200
| From | Vivien Didelot <vivien.didelot@savoirfairelinux.com> |
|---|---|
| Date | 2015-10-12 00:10 +0200 |
| Subject | [PATCH net-next 0/4] net: dsa: mv88e6xxx: fix hardware bridging |
| Message-ID | <qiwYy-4Eo-7@gated-at.bofh.it> |
DSA and its drivers currently hook the NETDEV_CHANGEUPPER net_device event in order to configure the VLAN map of every port. This VLAN map is a feature of these switch chips to hardcode and restrict which output ports a given input port can egress frames to. A Linux bridge is a simple untagged VLAN propagated by the bridge code itself. With a proper 802.1Q support, a driver does not need this hook anymore, and will simply program the related VLAN object. This patchset improves the hardware bridging code in the mv88e6xxx driver with a strict 802.1Q mode. Ideally, the equivalent must be done for Broadcom Starfighter 2 and Rocker, before completely getting rid of this hook. Vivien Didelot (4): net: dsa: mv88e6xxx: bridges do not need an FID net: dsa: mv88e6xxx: do not support per-port FID net: dsa: do not warn unsupported bridge ops net: dsa: mv88e6xxx: fix hardware bridging drivers/net/dsa/mv88e6171.c | 2 - drivers/net/dsa/mv88e6352.c | 2 - drivers/net/dsa/mv88e6xxx.c | 215 ++++++-------------------------------------- drivers/net/dsa/mv88e6xxx.h | 8 -- net/dsa/slave.c | 2 +- 5 files changed, 26 insertions(+), 203 deletions(-) -- 2.6.0 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
[toc] | [next] | [standalone]
| From | Vivien Didelot <vivien.didelot@savoirfairelinux.com> |
|---|---|
| Date | 2015-10-12 00:20 +0200 |
| Subject | [PATCH net-next 3/4] net: dsa: do not warn unsupported bridge ops |
| Message-ID | <qix8e-4PI-5@gated-at.bofh.it> |
| In reply to | #1244237 |
A DSA driver may not provide the port_join_bridge and port_leave_bridge functions, so don't warn in such case. Signed-off-by: Vivien Didelot <vivien.didelot@savoirfairelinux.com> --- net/dsa/slave.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/net/dsa/slave.c b/net/dsa/slave.c index bb2bd3b..43d7342 100644 --- a/net/dsa/slave.c +++ b/net/dsa/slave.c @@ -1276,7 +1276,7 @@ int dsa_slave_netdevice_event(struct notifier_block *unused, goto out; err = dsa_slave_master_changed(dev); - if (err) + if (err && err != -EOPNOTSUPP) netdev_warn(dev, "failed to reflect master change\n"); break; -- 2.6.0 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
[toc] | [prev] | [next] | [standalone]
| From | Vivien Didelot <vivien.didelot@savoirfairelinux.com> |
|---|---|
| Date | 2015-10-12 00:20 +0200 |
| Subject | [PATCH net-next 1/4] net: dsa: mv88e6xxx: bridges do not need an FID |
| Message-ID | <qix8f-4PI-21@gated-at.bofh.it> |
| In reply to | #1244237 |
With 88E6352 and similar switch chips, each port has a map to restrict
which output port this input port can egress frames to.
The current driver code implements hardware bridging using this feature,
and assigns to a bridge group the FID of its first member.
Now that 802.1Q is fully implemented in this driver, a Linux bridge
which is a simple untagged VLAN, already gets its own FID.
This patch gets rid of the per-bridge FID and explicits the usage of the
port based VLAN map feature.
Signed-off-by: Vivien Didelot <vivien.didelot@savoirfairelinux.com>
---
drivers/net/dsa/mv88e6xxx.c | 157 +++++++++++---------------------------------
drivers/net/dsa/mv88e6xxx.h | 1 -
2 files changed, 40 insertions(+), 118 deletions(-)
diff --git a/drivers/net/dsa/mv88e6xxx.c b/drivers/net/dsa/mv88e6xxx.c
index e381bfc..254f9bb 100644
--- a/drivers/net/dsa/mv88e6xxx.c
+++ b/drivers/net/dsa/mv88e6xxx.c
@@ -1046,11 +1046,6 @@ static int _mv88e6xxx_atu_flush(struct dsa_switch *ds, u16 fid, bool static_too)
return _mv88e6xxx_atu_flush_move(ds, &entry, static_too);
}
-static int _mv88e6xxx_flush_fid(struct dsa_switch *ds, int fid)
-{
- return _mv88e6xxx_atu_flush(ds, fid, false);
-}
-
static int _mv88e6xxx_atu_move(struct dsa_switch *ds, u16 fid, int from_port,
int to_port, bool static_too)
{
@@ -1112,130 +1107,56 @@ abort:
return ret;
}
-/* Must be called with smi lock held */
-static int _mv88e6xxx_update_port_config(struct dsa_switch *ds, int port)
+static int _mv88e6xxx_port_vlan_map_set(struct dsa_switch *ds, int port,
+ u16 output_ports)
{
struct mv88e6xxx_priv_state *ps = ds_to_priv(ds);
- u8 fid = ps->fid[port];
- u16 reg = fid << 12;
+ const u16 mask = (1 << ps->num_ports) - 1;
+ int reg;
- if (dsa_is_cpu_port(ds, port))
- reg |= ds->phys_port_mask;
- else
- reg |= (ps->bridge_mask[fid] |
- (1 << dsa_upstream_port(ds))) & ~(1 << port);
+ reg = _mv88e6xxx_reg_read(ds, REG_PORT(port), PORT_BASE_VLAN);
+ if (reg < 0)
+ return reg;
+
+ reg &= ~mask;
+ reg |= output_ports & mask;
return _mv88e6xxx_reg_write(ds, REG_PORT(port), PORT_BASE_VLAN, reg);
}
-/* Must be called with smi lock held */
-static int _mv88e6xxx_update_bridge_config(struct dsa_switch *ds, int fid)
-{
- struct mv88e6xxx_priv_state *ps = ds_to_priv(ds);
- int port;
- u32 mask;
- int ret;
-
- mask = ds->phys_port_mask;
- while (mask) {
- port = __ffs(mask);
- mask &= ~(1 << port);
- if (ps->fid[port] != fid)
- continue;
-
- ret = _mv88e6xxx_update_port_config(ds, port);
- if (ret)
- return ret;
- }
-
- return _mv88e6xxx_flush_fid(ds, fid);
-}
-
/* Bridge handling functions */
+static int mv88e6xxx_map_bridge(struct dsa_switch *ds, u16 members)
+{
+ struct mv88e6xxx_priv_state *ps = ds_to_priv(ds);
+ const unsigned long output = members | BIT(dsa_upstream_port(ds));
+ int port, err = 0;
+
+ mutex_lock(&ps->smi_mutex);
+
+ for_each_set_bit(port, &output, ps->num_ports) {
+ if (dsa_is_cpu_port(ds, port))
+ continue;
+
+ err = _mv88e6xxx_port_vlan_map_set(ds, port, output & ~port);
+ if (err)
+ break;
+ }
+
+ mutex_unlock(&ps->smi_mutex);
+
+ return err;
+}
+
+
int mv88e6xxx_join_bridge(struct dsa_switch *ds, int port, u32 br_port_mask)
{
- struct mv88e6xxx_priv_state *ps = ds_to_priv(ds);
- int ret = 0;
- u32 nmask;
- int fid;
-
- /* If the bridge group is not empty, join that group.
- * Otherwise create a new group.
- */
- fid = ps->fid[port];
- nmask = br_port_mask & ~(1 << port);
- if (nmask)
- fid = ps->fid[__ffs(nmask)];
-
- nmask = ps->bridge_mask[fid] | (1 << port);
- if (nmask != br_port_mask) {
- netdev_err(ds->ports[port],
- "join: Bridge port mask mismatch fid=%d mask=0x%x expected 0x%x\n",
- fid, br_port_mask, nmask);
- return -EINVAL;
- }
-
- mutex_lock(&ps->smi_mutex);
-
- ps->bridge_mask[fid] = br_port_mask;
-
- if (fid != ps->fid[port]) {
- clear_bit(ps->fid[port], ps->fid_bitmap);
- ps->fid[port] = fid;
- ret = _mv88e6xxx_update_bridge_config(ds, fid);
- }
-
- mutex_unlock(&ps->smi_mutex);
-
- return ret;
+ return mv88e6xxx_map_bridge(ds, br_port_mask);
}
int mv88e6xxx_leave_bridge(struct dsa_switch *ds, int port, u32 br_port_mask)
{
- struct mv88e6xxx_priv_state *ps = ds_to_priv(ds);
- u8 fid, newfid;
- int ret;
-
- fid = ps->fid[port];
-
- if (ps->bridge_mask[fid] != br_port_mask) {
- netdev_err(ds->ports[port],
- "leave: Bridge port mask mismatch fid=%d mask=0x%x expected 0x%x\n",
- fid, br_port_mask, ps->bridge_mask[fid]);
- return -EINVAL;
- }
-
- /* If the port was the last port of a bridge, we are done.
- * Otherwise assign a new fid to the port, and fix up
- * the bridge configuration.
- */
- if (br_port_mask == (1 << port))
- return 0;
-
- mutex_lock(&ps->smi_mutex);
-
- newfid = find_next_zero_bit(ps->fid_bitmap, VLAN_N_VID, 1);
- if (unlikely(newfid > ps->num_ports)) {
- netdev_err(ds->ports[port], "all first %d FIDs are used\n",
- ps->num_ports);
- ret = -ENOSPC;
- goto unlock;
- }
-
- ps->fid[port] = newfid;
- set_bit(newfid, ps->fid_bitmap);
- ps->bridge_mask[fid] &= ~(1 << port);
- ps->bridge_mask[newfid] = 1 << port;
-
- ret = _mv88e6xxx_update_bridge_config(ds, fid);
- if (!ret)
- ret = _mv88e6xxx_update_bridge_config(ds, newfid);
-
-unlock:
- mutex_unlock(&ps->smi_mutex);
-
- return ret;
+ return mv88e6xxx_map_bridge(ds, br_port_mask & ~port);
}
int mv88e6xxx_port_stp_update(struct dsa_switch *ds, int port, u8 state)
@@ -2233,10 +2154,12 @@ static int mv88e6xxx_setup_port(struct dsa_switch *ds, int port)
ps->fid[port] = fid;
set_bit(fid, ps->fid_bitmap);
- if (!dsa_is_cpu_port(ds, port))
- ps->bridge_mask[fid] = 1 << port;
+ if (dsa_is_cpu_port(ds, port))
+ reg = BIT(ps->num_ports) - 1;
+ else
+ reg = BIT(dsa_upstream_port(ds));
- ret = _mv88e6xxx_update_port_config(ds, port);
+ ret = _mv88e6xxx_port_vlan_map_set(ds, port, reg & ~port);
if (ret)
goto abort;
diff --git a/drivers/net/dsa/mv88e6xxx.h b/drivers/net/dsa/mv88e6xxx.h
index 1347a73..716f692 100644
--- a/drivers/net/dsa/mv88e6xxx.h
+++ b/drivers/net/dsa/mv88e6xxx.h
@@ -411,7 +411,6 @@ struct mv88e6xxx_priv_state {
DECLARE_BITMAP(fid_bitmap, VLAN_N_VID); /* FIDs 1 to 4095 available */
u16 fid[DSA_MAX_PORTS]; /* per (non-bridged) port FID */
- u16 bridge_mask[DSA_MAX_PORTS]; /* br groups (indexed by FID) */
unsigned long port_state_update_mask;
u8 port_state[DSA_MAX_PORTS];
--
2.6.0
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
[toc] | [prev] | [next] | [standalone]
| From | David Miller <davem@davemloft.net> |
|---|---|
| Date | 2015-10-13 13:20 +0200 |
| Message-ID | <qj5MC-4UT-31@gated-at.bofh.it> |
| In reply to | #1244237 |
From: Vivien Didelot <vivien.didelot@savoirfairelinux.com> Date: Sun, 11 Oct 2015 18:08:34 -0400 > DSA and its drivers currently hook the NETDEV_CHANGEUPPER net_device event in > order to configure the VLAN map of every port. > > This VLAN map is a feature of these switch chips to hardcode and restrict which > output ports a given input port can egress frames to. > > A Linux bridge is a simple untagged VLAN propagated by the bridge code itself. > With a proper 802.1Q support, a driver does not need this hook anymore, and > will simply program the related VLAN object. > > This patchset improves the hardware bridging code in the mv88e6xxx driver with > a strict 802.1Q mode. > > Ideally, the equivalent must be done for Broadcom Starfighter 2 and Rocker, > before completely getting rid of this hook. Series applied, thanks Vivien. -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
[toc] | [prev] | [next] | [standalone]
| From | Andrew Lunn <andrew@lunn.ch> |
|---|---|
| Date | 2015-10-15 00:50 +0200 |
| Message-ID | <qjD1V-4gA-23@gated-at.bofh.it> |
| In reply to | #1244237 |
On Sun, Oct 11, 2015 at 06:08:34PM -0400, Vivien Didelot wrote: > DSA and its drivers currently hook the NETDEV_CHANGEUPPER net_device event in > order to configure the VLAN map of every port. > > This VLAN map is a feature of these switch chips to hardcode and restrict which > output ports a given input port can egress frames to. > > A Linux bridge is a simple untagged VLAN propagated by the bridge code itself. > With a proper 802.1Q support, a driver does not need this hook anymore, and > will simply program the related VLAN object. > > This patchset improves the hardware bridging code in the mv88e6xxx driver with > a strict 802.1Q mode. Hi Vivien I just tested this as part of net-next/master, and found a problem.... If i do: ip link set lan0 up ip addr add 192.168.10.2/24 dev lan0 It will not ping. Looking in sys/kernel/debug/dsa0/stats i see broadcast packets, probably ARP, being received at the port. But they are not being forwarded out the CPU port. If however i do brctl addbr br0 brctl addif br0 lan0 ip addr add 192.168.10.2/24 dev br0 ip link set br0 up i can ping. So it looks like we are too restrictive by default. You should be able to use interfaces as they are, without a bridge. Andrew -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
[toc] | [prev] | [next] | [standalone]
| From | Vivien Didelot <vivien.didelot@savoirfairelinux.com> |
|---|---|
| Date | 2015-10-15 03:40 +0200 |
| Message-ID | <qjFGp-8dL-1@gated-at.bofh.it> |
| In reply to | #1247237 |
On Oct. Thursday 15 (42) 12:46 AM, Andrew Lunn wrote: > On Sun, Oct 11, 2015 at 06:08:34PM -0400, Vivien Didelot wrote: > > DSA and its drivers currently hook the NETDEV_CHANGEUPPER net_device event in > > order to configure the VLAN map of every port. > > > > This VLAN map is a feature of these switch chips to hardcode and restrict which > > output ports a given input port can egress frames to. > > > > A Linux bridge is a simple untagged VLAN propagated by the bridge code itself. > > With a proper 802.1Q support, a driver does not need this hook anymore, and > > will simply program the related VLAN object. > > > > This patchset improves the hardware bridging code in the mv88e6xxx driver with > > a strict 802.1Q mode. > > Hi Vivien > > I just tested this as part of net-next/master, and found a problem.... > > If i do: > > ip link set lan0 up > ip addr add 192.168.10.2/24 dev lan0 > > It will not ping. Looking in sys/kernel/debug/dsa0/stats i see > broadcast packets, probably ARP, being received at the port. > But they are not being forwarded out the CPU port. > > If however i do > > brctl addbr br0 > brctl addif br0 lan0 > ip addr add 192.168.10.2/24 dev br0 > ip link set br0 up > > i can ping. > > So it looks like we are too restrictive by default. You should be able > to use interfaces as they are, without a bridge. Correct, if the ports are not in a VLAN by default, they cannot talk. If you want to, I think the special VLAN 0 can be used for that purpose. IIRC, in a given configuration, Linux add the interfaces (thus programs the hardware) with VLAN 0. I'm not sure when, maybe when the .ndo_vlan_rx_add_vid is implemented, I need to give it a shot. Otherwise, I can send you a patch configuring the VLAN 0 on switch setup if this is the behavior we want. Thanks, -v -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
[toc] | [prev] | [next] | [standalone]
| From | Florian Fainelli <f.fainelli@gmail.com> |
|---|---|
| Date | 2015-10-15 03:50 +0200 |
| Message-ID | <qjFQ5-8p4-13@gated-at.bofh.it> |
| In reply to | #1247290 |
On 14/10/15 18:28, Vivien Didelot wrote: > On Oct. Thursday 15 (42) 12:46 AM, Andrew Lunn wrote: >> On Sun, Oct 11, 2015 at 06:08:34PM -0400, Vivien Didelot wrote: >>> DSA and its drivers currently hook the NETDEV_CHANGEUPPER net_device event in >>> order to configure the VLAN map of every port. >>> >>> This VLAN map is a feature of these switch chips to hardcode and restrict which >>> output ports a given input port can egress frames to. >>> >>> A Linux bridge is a simple untagged VLAN propagated by the bridge code itself. >>> With a proper 802.1Q support, a driver does not need this hook anymore, and >>> will simply program the related VLAN object. >>> >>> This patchset improves the hardware bridging code in the mv88e6xxx driver with >>> a strict 802.1Q mode. >> >> Hi Vivien >> >> I just tested this as part of net-next/master, and found a problem.... >> >> If i do: >> >> ip link set lan0 up >> ip addr add 192.168.10.2/24 dev lan0 >> >> It will not ping. Looking in sys/kernel/debug/dsa0/stats i see >> broadcast packets, probably ARP, being received at the port. >> But they are not being forwarded out the CPU port. >> >> If however i do >> >> brctl addbr br0 >> brctl addif br0 lan0 >> ip addr add 192.168.10.2/24 dev br0 >> ip link set br0 up >> >> i can ping. >> >> So it looks like we are too restrictive by default. You should be able >> to use interfaces as they are, without a bridge. > > Correct, if the ports are not in a VLAN by default, they cannot talk. The expectation for DSA devices, if no bridge device is configured is to have each port be able to talk to the CPU port only, but this has to work out of the box. > > If you want to, I think the special VLAN 0 can be used for that purpose. > IIRC, in a given configuration, Linux add the interfaces (thus programs > the hardware) with VLAN 0. I'm not sure when, maybe when the > .ndo_vlan_rx_add_vid is implemented, I need to give it a shot. But if you do that, won't that put all DSA ports into VLAN 0? Would not that break isolation between each ports as expected for a DSA switch? > > Otherwise, I can send you a patch configuring the VLAN 0 on switch > setup if this is the behavior we want. > > Thanks, > -v > -- Florian -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
[toc] | [prev] | [next] | [standalone]
| From | Vivien Didelot <vivien.didelot@savoirfairelinux.com> |
|---|---|
| Date | 2015-10-15 14:50 +0200 |
| Message-ID | <qjQ8N-6Gn-1@gated-at.bofh.it> |
| In reply to | #1247309 |
On Oct. Wednesday 14 (42) 06:44 PM, Florian Fainelli wrote: > On 14/10/15 18:28, Vivien Didelot wrote: > > On Oct. Thursday 15 (42) 12:46 AM, Andrew Lunn wrote: > >> On Sun, Oct 11, 2015 at 06:08:34PM -0400, Vivien Didelot wrote: > >>> DSA and its drivers currently hook the NETDEV_CHANGEUPPER net_device event in > >>> order to configure the VLAN map of every port. > >>> > >>> This VLAN map is a feature of these switch chips to hardcode and restrict which > >>> output ports a given input port can egress frames to. > >>> > >>> A Linux bridge is a simple untagged VLAN propagated by the bridge code itself. > >>> With a proper 802.1Q support, a driver does not need this hook anymore, and > >>> will simply program the related VLAN object. > >>> > >>> This patchset improves the hardware bridging code in the mv88e6xxx driver with > >>> a strict 802.1Q mode. > >> > >> Hi Vivien > >> > >> I just tested this as part of net-next/master, and found a problem.... > >> > >> If i do: > >> > >> ip link set lan0 up > >> ip addr add 192.168.10.2/24 dev lan0 > >> > >> It will not ping. Looking in sys/kernel/debug/dsa0/stats i see > >> broadcast packets, probably ARP, being received at the port. > >> But they are not being forwarded out the CPU port. > >> > >> If however i do > >> > >> brctl addbr br0 > >> brctl addif br0 lan0 > >> ip addr add 192.168.10.2/24 dev br0 > >> ip link set br0 up > >> > >> i can ping. > >> > >> So it looks like we are too restrictive by default. You should be able > >> to use interfaces as they are, without a bridge. > > > > Correct, if the ports are not in a VLAN by default, they cannot talk. > > The expectation for DSA devices, if no bridge device is configured is to > have each port be able to talk to the CPU port only, but this has to > work out of the box. OK, I might have forgotten this requirement. I also just noticed that you mentioned it in Documentation/networking/dsa/dsa.txt. Thanks for the reminder. > > > > If you want to, I think the special VLAN 0 can be used for that > > purpose. IIRC, in a given configuration, Linux add the interfaces > > (thus programs the hardware) with VLAN 0. I'm not sure when, maybe > > when the .ndo_vlan_rx_add_vid is implemented, I need to give it a > > shot. > > But if you do that, won't that put all DSA ports into VLAN 0? Would > not that break isolation between each ports as expected for a DSA > switch? You're correct, then VLAN 0 is not an option. I have something else in mind, fix coming soon. > > > > Otherwise, I can send you a patch configuring the VLAN 0 on switch > > setup if this is the behavior we want. Thanks, -v -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
[toc] | [prev] | [next] | [standalone]
| From | Andrew Lunn <andrew@lunn.ch> |
|---|---|
| Date | 2015-10-15 05:00 +0200 |
| Message-ID | <qjGVQ-1zi-7@gated-at.bofh.it> |
| In reply to | #1247290 |
On Wed, Oct 14, 2015 at 09:28:55PM -0400, Vivien Didelot wrote:
> On Oct. Thursday 15 (42) 12:46 AM, Andrew Lunn wrote:
> > On Sun, Oct 11, 2015 at 06:08:34PM -0400, Vivien Didelot wrote:
> > > DSA and its drivers currently hook the NETDEV_CHANGEUPPER net_device event in
> > > order to configure the VLAN map of every port.
> > >
> > > This VLAN map is a feature of these switch chips to hardcode and restrict which
> > > output ports a given input port can egress frames to.
> > >
> > > A Linux bridge is a simple untagged VLAN propagated by the bridge code itself.
> > > With a proper 802.1Q support, a driver does not need this hook anymore, and
> > > will simply program the related VLAN object.
> > >
> > > This patchset improves the hardware bridging code in the mv88e6xxx driver with
> > > a strict 802.1Q mode.
> >
> > Hi Vivien
> >
> > I just tested this as part of net-next/master, and found a problem....
> >
> > If i do:
> >
> > ip link set lan0 up
> > ip addr add 192.168.10.2/24 dev lan0
> >
> > It will not ping. Looking in sys/kernel/debug/dsa0/stats i see
> > broadcast packets, probably ARP, being received at the port.
> > But they are not being forwarded out the CPU port.
> >
> > If however i do
> >
> > brctl addbr br0
> > brctl addif br0 lan0
> > ip addr add 192.168.10.2/24 dev br0
> > ip link set br0 up
> >
> > i can ping.
> >
> > So it looks like we are too restrictive by default. You should be able
> > to use interfaces as they are, without a bridge.
>
> Correct, if the ports are not in a VLAN by default, they cannot talk.
Hi Vivien
This is a regression. Ports of the switch should work like normal
Linux interfaces. And up until now, they did. This patchset changed
that.
As Florian pointed out, these interfaces are separated from each
other. So you need something like a bridge per port by default, which
then gets removed and replaced when a port is added to a Linux bridge.
We also need to take care of VLANs. When the port is not a member of a
linux bridge, i expect all VLAN tagged frames to be received, as well
as untagged frames. This is normal Linux behaviour. But i never got
around to testing this with DSA.
Andrew
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
[toc] | [prev] | [next] | [standalone]
| From | Guenter Roeck <linux@roeck-us.net> |
|---|---|
| Date | 2015-10-15 05:20 +0200 |
| Message-ID | <qjHfb-2cF-1@gated-at.bofh.it> |
| In reply to | #1247361 |
On 10/14/2015 07:52 PM, Andrew Lunn wrote: > On Wed, Oct 14, 2015 at 09:28:55PM -0400, Vivien Didelot wrote: >> On Oct. Thursday 15 (42) 12:46 AM, Andrew Lunn wrote: >>> On Sun, Oct 11, 2015 at 06:08:34PM -0400, Vivien Didelot wrote: >>>> DSA and its drivers currently hook the NETDEV_CHANGEUPPER net_device event in >>>> order to configure the VLAN map of every port. >>>> >>>> This VLAN map is a feature of these switch chips to hardcode and restrict which >>>> output ports a given input port can egress frames to. >>>> >>>> A Linux bridge is a simple untagged VLAN propagated by the bridge code itself. >>>> With a proper 802.1Q support, a driver does not need this hook anymore, and >>>> will simply program the related VLAN object. >>>> >>>> This patchset improves the hardware bridging code in the mv88e6xxx driver with >>>> a strict 802.1Q mode. >>> >>> Hi Vivien >>> >>> I just tested this as part of net-next/master, and found a problem.... >>> >>> If i do: >>> >>> ip link set lan0 up >>> ip addr add 192.168.10.2/24 dev lan0 >>> >>> It will not ping. Looking in sys/kernel/debug/dsa0/stats i see >>> broadcast packets, probably ARP, being received at the port. >>> But they are not being forwarded out the CPU port. >>> >>> If however i do >>> >>> brctl addbr br0 >>> brctl addif br0 lan0 >>> ip addr add 192.168.10.2/24 dev br0 >>> ip link set br0 up >>> >>> i can ping. >>> >>> So it looks like we are too restrictive by default. You should be able >>> to use interfaces as they are, without a bridge. >> >> Correct, if the ports are not in a VLAN by default, they cannot talk. > > Hi Vivien > > This is a regression. Ports of the switch should work like normal > Linux interfaces. And up until now, they did. This patchset changed > that. > > As Florian pointed out, these interfaces are separated from each > other. So you need something like a bridge per port by default, which > then gets removed and replaced when a port is added to a Linux bridge. > > We also need to take care of VLANs. When the port is not a member of a > linux bridge, i expect all VLAN tagged frames to be received, as well > as untagged frames. This is normal Linux behaviour. But i never got > around to testing this with DSA. > There was a reason for the original code. I had wondered how it is now supposed to work. Guess this exchange explains it. Looking forward to see how it is going to be fixed, and too bad I don't have time to be more involved. Guenter -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
[toc] | [prev] | [next] | [standalone]
| From | Vivien Didelot <vivien.didelot@savoirfairelinux.com> |
|---|---|
| Date | 2015-10-15 15:00 +0200 |
| Message-ID | <qjQiu-6RK-15@gated-at.bofh.it> |
| In reply to | #1247361 |
On Oct. Thursday 15 (42) 04:52 AM, Andrew Lunn wrote: > On Wed, Oct 14, 2015 at 09:28:55PM -0400, Vivien Didelot wrote: > > On Oct. Thursday 15 (42) 12:46 AM, Andrew Lunn wrote: > > > On Sun, Oct 11, 2015 at 06:08:34PM -0400, Vivien Didelot wrote: > > > > DSA and its drivers currently hook the NETDEV_CHANGEUPPER net_device event in > > > > order to configure the VLAN map of every port. > > > > > > > > This VLAN map is a feature of these switch chips to hardcode and restrict which > > > > output ports a given input port can egress frames to. > > > > > > > > A Linux bridge is a simple untagged VLAN propagated by the bridge code itself. > > > > With a proper 802.1Q support, a driver does not need this hook anymore, and > > > > will simply program the related VLAN object. > > > > > > > > This patchset improves the hardware bridging code in the mv88e6xxx driver with > > > > a strict 802.1Q mode. > > > > > > Hi Vivien > > > > > > I just tested this as part of net-next/master, and found a problem.... > > > > > > If i do: > > > > > > ip link set lan0 up > > > ip addr add 192.168.10.2/24 dev lan0 > > > > > > It will not ping. Looking in sys/kernel/debug/dsa0/stats i see > > > broadcast packets, probably ARP, being received at the port. > > > But they are not being forwarded out the CPU port. > > > > > > If however i do > > > > > > brctl addbr br0 > > > brctl addif br0 lan0 > > > ip addr add 192.168.10.2/24 dev br0 > > > ip link set br0 up > > > > > > i can ping. > > > > > > So it looks like we are too restrictive by default. You should be able > > > to use interfaces as they are, without a bridge. > > > > Correct, if the ports are not in a VLAN by default, they cannot talk. > > Hi Vivien > > This is a regression. Ports of the switch should work like normal > Linux interfaces. And up until now, they did. This patchset changed > that. > > As Florian pointed out, these interfaces are separated from each > other. So you need something like a bridge per port by default, which > then gets removed and replaced when a port is added to a Linux bridge. I'll fix this regression and try the exact same example you provided. > We also need to take care of VLANs. When the port is not a member of a > linux bridge, i expect all VLAN tagged frames to be received, as well > as untagged frames. This is normal Linux behaviour. But i never got > around to testing this with DSA. Thanks for testing, -v -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
[toc] | [prev] | [standalone]
Back to top | Article view | linux.kernel
csiph-web