]> git.baikalelectronics.ru Git - kernel.git/commit
net: dsa: create a helper for locating EtherType DSA headers on RX
authorVladimir Oltean <vladimir.oltean@nxp.com>
Tue, 10 Aug 2021 13:13:55 +0000 (16:13 +0300)
committerDavid S. Miller <davem@davemloft.net>
Wed, 11 Aug 2021 13:44:58 +0000 (14:44 +0100)
commitf2377d1db59e4843223eac7b485971cdc1c4b7ce
tree7d0e8c2a82f105cfb32f73f0167456abfe1ec443
parent56148383ca8a79b8335fd3f499011b12ed8bb8b6
net: dsa: create a helper for locating EtherType DSA headers on RX

It seems that protocol tagging driver writers are always surprised about
the formula they use to reach their EtherType header on RX, which
becomes apparent from the fact that there are comments in multiple
drivers that mention the same information.

Create a helper that returns a void pointer to skb->data - 2, as well as
centralize the explanation why that is the case.

Signed-off-by: Vladimir Oltean <vladimir.oltean@nxp.com>
Reviewed-by: Florian Fainelli <f.fainelli@gmail.com>
Reviewed-by: Andrew Lunn <andrew@lunn.ch>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/dsa/dsa_priv.h
net/dsa/tag_brcm.c
net/dsa/tag_dsa.c
net/dsa/tag_lan9303.c
net/dsa/tag_mtk.c
net/dsa/tag_qca.c
net/dsa/tag_rtl4_a.c
net/dsa/tag_sja1105.c