diff mbox

net: dsa: fix mv88e6xxx switches

Message ID 20160123204416.GC10826@n2100.arm.linux.org.uk
State RFC, archived
Delegated to: David Miller
Headers show

Commit Message

Russell King - ARM Linux Jan. 23, 2016, 8:44 p.m. UTC
On Sat, Jan 23, 2016 at 09:16:47PM +0100, Andrew Lunn wrote:
> On Sat, Jan 23, 2016 at 07:48:57PM +0000, Russell King - ARM Linux wrote:
> > On Sat, Jan 23, 2016 at 08:37:05PM +0100, Andrew Lunn wrote:
> > > I'm testing on a 6172. But 6172 and 6176 are both in the same family
> > > 6352, and share the same driver.
> > 
> > Hmm, can't be that then.
> > 
> > > So you initially have lan1 in an bridge. I don't.
> 
> Running tcpdump on the device i'm trying to ping, there are ARP
> requests and replies. But the replies are never received by the
> target, arp -a shows <incomplete>.
> 
> Looking at the stats counters in debugfs, the packets are counted in
> in_unicast, but also sw_in_filtered.
> 
> Port 0 is lan0 and port 5 is the cpu port.
> 
> root@370-rd:/sys/kernel/debug/dsa0# cat regs
>     GLOBAL GLOBAL2 SERDES   0    1    2    3    4    5    6  
>  0:  c874       0    1940  1d0f 1d0f 1d0f 1d0f 100f  e07    6 
>  1:   fa0       0     149     3    3    3    3    3 c03e    3 
>  2:   fa0    ffff     141     0    0    0    0    0    0    0 
>  3:     0    ffff     ea1  1721 1721 1721 1721 1721 1721 1721 
>  4:  6000     258     1e0   433  433  433  433  433 373f  433 
>  5:  3000      ff       0     0    0    0    0    0    0    0 
>  6:   fa0    1f0f       4    7f   7e   7d   7c   7b   7a   79 
>  7:  3331    707f    2001     0  fa1  fa2  fa3  fa4    0  fa6 

This shows port 0 is on vlan 0, but it should default to vlan 1 when
no vlans are configured.  The patch below should at least allow some
diagnosis of what's being requested, and when.

Comments

Andrew Lunn Jan. 23, 2016, 10:12 p.m. UTC | #1
> This shows port 0 is on vlan 0, but it should default to vlan 1 when
> no vlans are configured.  The patch below should at least allow some
> diagnosis of what's being requested, and when.
> 
> diff --git a/drivers/net/dsa/mv88e6xxx.c b/drivers/net/dsa/mv88e6xxx.c
> index a43354ed0607..8a9cf67eb16d 100644
> --- a/drivers/net/dsa/mv88e6xxx.c
> +++ b/drivers/net/dsa/mv88e6xxx.c
> @@ -1511,6 +1511,9 @@ int mv88e6xxx_port_vlan_add(struct dsa_switch *ds, int port,
>  	u16 vid;
>  	int err = 0;
>  
> +	printk("%s: port %d vid %u-%u flags %x\n",
> +		__func__, port, vlan->vid_begin, vlan->vid_end, vlan->flags);
> +

Hi Russell

Never called.

So i guess we have a kernel configuration difference.

I don't have CONFIG_BRIDGE_VLAN_FILTERING.

But DSA should not rely on this option for correct operation.

  Andrew
Andrew Lunn Jan. 23, 2016, 10:23 p.m. UTC | #2
On Sat, Jan 23, 2016 at 11:12:32PM +0100, Andrew Lunn wrote:
> > This shows port 0 is on vlan 0, but it should default to vlan 1 when
> > no vlans are configured.  The patch below should at least allow some
> > diagnosis of what's being requested, and when.
> > 
> > diff --git a/drivers/net/dsa/mv88e6xxx.c b/drivers/net/dsa/mv88e6xxx.c
> > index a43354ed0607..8a9cf67eb16d 100644
> > --- a/drivers/net/dsa/mv88e6xxx.c
> > +++ b/drivers/net/dsa/mv88e6xxx.c
> > @@ -1511,6 +1511,9 @@ int mv88e6xxx_port_vlan_add(struct dsa_switch *ds, int port,
> >  	u16 vid;
> >  	int err = 0;
> >  
> > +	printk("%s: port %d vid %u-%u flags %x\n",
> > +		__func__, port, vlan->vid_begin, vlan->vid_end, vlan->flags);
> > +
> 
> Hi Russell
> 
> Never called.
> 
> So i guess we have a kernel configuration difference.
> 
> I don't have CONFIG_BRIDGE_VLAN_FILTERING.

Yep, confirmed. When i enable this option, and VLAN_8021Q which it
depends on, i then have a working bridge.

	Andrew
Russell King - ARM Linux Jan. 23, 2016, 11:31 p.m. UTC | #3
On Sat, Jan 23, 2016 at 11:23:26PM +0100, Andrew Lunn wrote:
> On Sat, Jan 23, 2016 at 11:12:32PM +0100, Andrew Lunn wrote:
> > Hi Russell
> > 
> > Never called.
> > 
> > So i guess we have a kernel configuration difference.
> > 
> > I don't have CONFIG_BRIDGE_VLAN_FILTERING.
> 
> Yep, confirmed. When i enable this option, and VLAN_8021Q which it
> depends on, i then have a working bridge.

It sounds like Vivien urgently needs to do some extra work to fix
the patches that created all this broken-ness, or we need to ask
davem to revert back to a known good working state.
Vivien Didelot Jan. 24, 2016, 6:01 a.m. UTC | #4
Hi Russell,

Russell King - ARM Linux <linux@arm.linux.org.uk> writes:

> On Sat, Jan 23, 2016 at 11:23:26PM +0100, Andrew Lunn wrote:
>> On Sat, Jan 23, 2016 at 11:12:32PM +0100, Andrew Lunn wrote:
>> > Hi Russell
>> > 
>> > Never called.
>> > 
>> > So i guess we have a kernel configuration difference.
>> > 
>> > I don't have CONFIG_BRIDGE_VLAN_FILTERING.
>> 
>> Yep, confirmed. When i enable this option, and VLAN_8021Q which it
>> depends on, i then have a working bridge.
>
> It sounds like Vivien urgently needs to do some extra work to fix
> the patches that created all this broken-ness, or we need to ask
> davem to revert back to a known good working state.

Indeed hardware bridging currently relies on 802.1Q and VLAN filtering
enabled. I will work on this asap.

Thanks,
-v
diff mbox

Patch

diff --git a/drivers/net/dsa/mv88e6xxx.c b/drivers/net/dsa/mv88e6xxx.c
index a43354ed0607..8a9cf67eb16d 100644
--- a/drivers/net/dsa/mv88e6xxx.c
+++ b/drivers/net/dsa/mv88e6xxx.c
@@ -1511,6 +1511,9 @@  int mv88e6xxx_port_vlan_add(struct dsa_switch *ds, int port,
 	u16 vid;
 	int err = 0;
 
+	printk("%s: port %d vid %u-%u flags %x\n",
+		__func__, port, vlan->vid_begin, vlan->vid_end, vlan->flags);
+
 	mutex_lock(&ps->smi_mutex);
 
 	for (vid = vlan->vid_begin; vid <= vlan->vid_end; ++vid) {