From: Andrew Lunn <andrew@lunn.ch>
To: Alexander Duyck <alexander.h.duyck@intel.com>
Cc: Andrew Lunn <andrew@lunn.ch>,
f.fainelli@gmail.com, seugene@marvell.com,
netdev@vger.kernel.org
Subject: Re: DSA and skb->protocol
Date: Mon, 15 Sep 2014 20:32:46 +0200 [thread overview]
Message-ID: <20140915183246.GG4255@lunn.ch> (raw)
In-Reply-To: <5417223D.6070408@intel.com>
> > making me think it is not actually needed to change
> > skb->protocol. When i remove this from edsa_xmit(), the warning goes
> > away and networking seems to work O.K.
> >
> > Is this the right fix? Should we remove this setting of skb->protocol
> > in the other dsa xmit functions?
> >
> > Thanks
> > Andrew
> >
>
> No, if anything they should all be using ETH_P_XDSA to indicate the
> protocol between the switch and the host network interface. When you
> triggered this issue did you by any chance change some of the settings
> on the host netdev for the switch?
This is the first time i've used DSA. I'm adding support for a new
board which has a switch. So it is not too easy for me to go backwards
and see when the WARNING started appearing.
> The fix would probably be to update skb_network_protocol so that it can
> sort out ETH_P_XDSA tags and get the Ethertype from the frame.
I'm not sure how easy getting the correct Ethertype from the frame
is. The DSA tag can go in different places, depending on what tagging
protocol is used.
For EDSA, which is what the board/switch i'm using uses, the tag is
placed between the source address and the ethertype. If the frame is
not an 802.1q, the tag is 8 bytes. If it is 802.1q the tag is 6
bytes. The first 2 bytes are an Ethertype, indicating EDSA is being
used. You need to look at byte 4 of the tag to know how long it is, in
order to find the second Ethertype in the frame, for the SDU.
Similarly DSA tagging, is either 2 bytes or 4 bytes, and you need to
look at byte 0 of the tag to determine its length. There is no
Ethertype to know that DSA is being used.
Trailer tagging is different. It places 4 bytes at the end of the
frame, applying padding for frames < 60 bytes. The Ethertype is not
touched.
Florian recently added brcm tagging. This again goes between the
Source address and the Ethertype, and does not define a valid
Ethertype.
So unless you know what tagging protocol is in use, it is very hard to
peer inside the frame to work out what the real SDU Ethertype is. So
it seems easier to just pass it in skb->protocol.
Andrew
next prev parent reply other threads:[~2014-09-15 18:39 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-09-14 15:37 DSA and skb->protocol Andrew Lunn
2014-09-15 17:08 ` Florian Fainelli
2014-09-15 17:30 ` Alexander Duyck
2014-09-15 18:32 ` Andrew Lunn [this message]
2014-09-15 19:54 ` Florian Fainelli
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=20140915183246.GG4255@lunn.ch \
--to=andrew@lunn.ch \
--cc=alexander.h.duyck@intel.com \
--cc=f.fainelli@gmail.com \
--cc=netdev@vger.kernel.org \
--cc=seugene@marvell.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).