netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Russell King - ARM Linux admin <linux@armlinux.org.uk>
To: "Pali Rohár" <pali.rohar@gmail.com>
Cc: Ido Schimmel <idosch@idosch.org>,
	netdev@vger.kernel.org, Jiri Pirko <jiri@resnulli.us>,
	Ivan Vecera <ivecera@redhat.com>, Andrew Lunn <andrew@lunn.ch>,
	Vivien Didelot <vivien.didelot@gmail.com>
Subject: Re: [RFC 0/3] VLANs, DSA switches and multiple bridges
Date: Wed, 1 Jan 2020 17:30:14 +0000	[thread overview]
Message-ID: <20200101173014.GZ25745@shell.armlinux.org.uk> (raw)
In-Reply-To: <20200101011027.gpxnbq57wp6mwzjk@pali>

Hi Pali,

I've just tried this setup here:

# ip ad add 192.168.4.1/24 dev lan1
# ip li set dev lan1 up
# ip li add li lan1 name lan1.128 type vlan id 128
# ip ad add 192.168.5.1/24 dev lan1.128
# ip li set dev lan1.128 up

without lan1 being part of at Linux software bridge.  lan2..6 are
part of a software bridge that has vlan filtering disabled.

On the other end of lan1, I have another machine setup with addresses
192.168.4.2/24 on the raw network interface and 192.168.5.2/24 on vlan
128 - and it works perfectly, without issue.

This is my 5.4.0 kernel, which has a lot of patches on top of 5.4.0,
including the patch set that started this thread. The hardware is a
SolidRun Clearfog (MV88E6176 DSA switch with mvneta host ethernet).

I think the most important thing to do if you're suffering problems
like this is to monitor and analyse packets being received from the
DSA switch on the host interface:

# tcpdump -enXXi $host_dsa_interface

Here's an example ping packet received over the vlan with the above
configuration, captured from the host DSA interface (ether mac
addresses obfuscated):

        0x0000:  DDDD DDDD DDDD SSSS SSSS SSSS dada 0000  .PC.....[h:.....
                                               ^^^^^^^^^
        0x0010:  c020 0000 8100 0080 0800 4500 0054 ec40  ..........E..T.@
                 ^^^^^^^^^ ^^^^^^^^^ ^^^^
        0x0020:  4000 4001 c314 c0a8 0502 c0a8 0501 0800  @.@.............
        0x0030:  8784 0c85 0001 32c8 0c5e 0000 0000 59fc  ......2..^....Y.
        0x0040:  0c00 0000 0000 1011 1213 1415 1617 1819  ................
        0x0050:  1a1b 1c1d 1e1f 2021 2223 2425 2627 2829  .......!"#$%&'()
        0x0060:  2a2b 2c2d 2e2f 3031 3233 3435 3637       *+,-./01234567

dada 0000 c020 0000	- EDSA tag
8100 0080		- VLAN ethertype, vlan id
0800			- IPv4 ethertype, and what follows is the ipv4
			  packet.

That way it would be possible to know whether the DSA switch is
forwarding the packets, and in what manner it's forwarding them.

Another tool that I've found useful is Vivien's debugfs patch,
which seems to be way superior for understanding the Marvell DSA
switch state than any other tool out there. It's my understanding
that DaveM doesn't want that in the mainline kernel, but it's
really useful for understanding what's going on. It was key to me
discovering why vlan stuff wasn't working for me.

-- 
RMK's Patch system: https://www.armlinux.org.uk/developer/patches/
FTTC broadband for 0.8mile line in suburbia: sync at 12.1Mbps down 622kbps up
According to speedtest.net: 11.9Mbps down 500kbps up

  reply	other threads:[~2020-01-01 17:30 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-12-22 19:22 [RFC 0/3] VLANs, DSA switches and multiple bridges Russell King - ARM Linux admin
2019-12-22 19:24 ` [RFC 1/3] net: switchdev: do not propagate bridge updates across bridges Russell King
2019-12-24  8:39   ` Ido Schimmel
2019-12-25  7:41     ` Ido Schimmel
2019-12-22 19:24 ` [RFC 2/3] net: dsa: mv88e6xxx: fix duplicate vlan warning Russell King
2019-12-23 17:49   ` Florian Fainelli
2019-12-22 19:24 ` [RFC 3/3] net: dsa: mv88e6xxx: fix vlan setup Russell King
2019-12-23 18:02   ` Florian Fainelli
2019-12-24  8:30     ` Ido Schimmel
2019-12-23 11:16 ` [RFC 0/3] VLANs, DSA switches and multiple bridges Andrew Lunn
2019-12-31 16:10 ` Pali Rohár
2019-12-31 18:06   ` Ido Schimmel
2020-01-01  1:10     ` Pali Rohár
2020-01-01 17:30       ` Russell King - ARM Linux admin [this message]
2020-01-01 18:07         ` Pali Rohár
2020-01-01 18:29           ` Russell King - ARM Linux admin
2020-01-02  4:53           ` Florian Fainelli
2020-01-02 15:40             ` Pali Rohár
2020-01-02 12:54         ` Andrew Lunn

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20200101173014.GZ25745@shell.armlinux.org.uk \
    --to=linux@armlinux.org.uk \
    --cc=andrew@lunn.ch \
    --cc=idosch@idosch.org \
    --cc=ivecera@redhat.com \
    --cc=jiri@resnulli.us \
    --cc=netdev@vger.kernel.org \
    --cc=pali.rohar@gmail.com \
    --cc=vivien.didelot@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).