summaryrefslogtreecommitdiffstats
path: root/net/dsa/tag_dsa.c
diff options
context:
space:
mode:
authorVladimir Oltean <vladimir.oltean@nxp.com>2021-08-10 16:13:56 +0300
committerDavid S. Miller <davem@davemloft.net>2021-08-11 14:44:58 +0100
commita72808b65834e99534f6c5c7134c201c72fe92aa (patch)
tree86986d9a367b3af440a2567c6294769ffd49eeb0 /net/dsa/tag_dsa.c
parent5d928ff4865641309e39e9ec8eec1022f8a0c0ac (diff)
downloadlinux-a72808b65834e99534f6c5c7134c201c72fe92aa.tar.gz
linux-a72808b65834e99534f6c5c7134c201c72fe92aa.tar.bz2
linux-a72808b65834e99534f6c5c7134c201c72fe92aa.zip
net: dsa: create a helper for locating EtherType DSA headers on TX
Create a similar helper for locating the offset to the DSA header relative to skb->data, and make the existing EtherType header taggers to use it. 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_dsa.c')
-rw-r--r--net/dsa/tag_dsa.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/net/dsa/tag_dsa.c b/net/dsa/tag_dsa.c
index 2eeabab27078..77d0ce89ab77 100644
--- a/net/dsa/tag_dsa.c
+++ b/net/dsa/tag_dsa.c
@@ -170,7 +170,7 @@ static struct sk_buff *dsa_xmit_ll(struct sk_buff *skb, struct net_device *dev,
}
/* Construct tagged DSA tag from 802.1Q tag. */
- dsa_header = skb->data + 2 * ETH_ALEN + extra;
+ dsa_header = dsa_etype_header_pos_tx(skb) + extra;
dsa_header[0] = (cmd << 6) | 0x20 | tag_dev;
dsa_header[1] = tag_port << 3;
@@ -184,7 +184,7 @@ static struct sk_buff *dsa_xmit_ll(struct sk_buff *skb, struct net_device *dev,
dsa_alloc_etype_header(skb, DSA_HLEN + extra);
/* Construct untagged DSA tag. */
- dsa_header = skb->data + 2 * ETH_ALEN + extra;
+ dsa_header = dsa_etype_header_pos_tx(skb) + extra;
dsa_header[0] = (cmd << 6) | tag_dev;
dsa_header[1] = tag_port << 3;
@@ -360,7 +360,7 @@ static struct sk_buff *edsa_xmit(struct sk_buff *skb, struct net_device *dev)
if (!skb)
return NULL;
- edsa_header = skb->data + 2 * ETH_ALEN;
+ edsa_header = dsa_etype_header_pos_tx(skb);
edsa_header[0] = (ETH_P_EDSA >> 8) & 0xff;
edsa_header[1] = ETH_P_EDSA & 0xff;
edsa_header[2] = 0x00;