diff options
author | Vladimir Oltean <vladimir.oltean@nxp.com> | 2021-08-10 16:13:55 +0300 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2021-08-11 16:44:58 +0300 |
commit | 5d928ff4865641309e39e9ec8eec1022f8a0c0ac (patch) | |
tree | 7d0e8c2a82f105cfb32f73f0167456abfe1ec443 /net/dsa/tag_brcm.c | |
parent | 6bef794da6d3bd347c18e93ad33483bd8903d9fd (diff) | |
download | linux-5d928ff4865641309e39e9ec8eec1022f8a0c0ac.tar.xz |
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>
Diffstat (limited to 'net/dsa/tag_brcm.c')
-rw-r--r-- | net/dsa/tag_brcm.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/net/dsa/tag_brcm.c b/net/dsa/tag_brcm.c index c62a89bb8de3..96dbb8ee2fee 100644 --- a/net/dsa/tag_brcm.c +++ b/net/dsa/tag_brcm.c @@ -254,7 +254,7 @@ static struct sk_buff *brcm_leg_tag_rcv(struct sk_buff *skb, if (unlikely(!pskb_may_pull(skb, BRCM_LEG_PORT_ID))) return NULL; - brcm_tag = skb->data - 2; + brcm_tag = dsa_etype_header_pos_rx(skb); source_port = brcm_tag[5] & BRCM_LEG_PORT_ID; |