diff options
author | Tony Lindgren <tony@atomide.com> | 2021-10-06 07:55:44 +0300 |
---|---|---|
committer | Tony Lindgren <tony@atomide.com> | 2021-10-06 07:55:44 +0300 |
commit | e700ac213a0f793fb4f83098413303e3dd080892 (patch) | |
tree | 52130e5a24ec9ea55b2f81899b8a45bed0f17f7c /net/dsa/tag_qca.c | |
parent | e879f855e590b40fe3c79f2fbd8f65ca3c724120 (diff) | |
parent | b232537074fcaf0c2837abbb217429c097bb7598 (diff) | |
download | linux-e700ac213a0f793fb4f83098413303e3dd080892.tar.gz linux-e700ac213a0f793fb4f83098413303e3dd080892.tar.bz2 linux-e700ac213a0f793fb4f83098413303e3dd080892.zip |
Merge branch 'pruss-fix' into fixes
Merge in a fix for pruss reset issue caused by enabling pruss for am335x.
Diffstat (limited to 'net/dsa/tag_qca.c')
-rw-r--r-- | net/dsa/tag_qca.c | 16 |
1 files changed, 5 insertions, 11 deletions
diff --git a/net/dsa/tag_qca.c b/net/dsa/tag_qca.c index 693bda013065..1ea9401b8ace 100644 --- a/net/dsa/tag_qca.c +++ b/net/dsa/tag_qca.c @@ -36,8 +36,8 @@ static struct sk_buff *qca_tag_xmit(struct sk_buff *skb, struct net_device *dev) skb_push(skb, QCA_HDR_LEN); - memmove(skb->data, skb->data + QCA_HDR_LEN, 2 * ETH_ALEN); - phdr = (__be16 *)(skb->data + 2 * ETH_ALEN); + dsa_alloc_etype_header(skb, QCA_HDR_LEN); + phdr = dsa_etype_header_pos_tx(skb); /* Set the version field, and set destination port information */ hdr = QCA_HDR_VERSION << QCA_HDR_XMIT_VERSION_S | @@ -48,8 +48,7 @@ static struct sk_buff *qca_tag_xmit(struct sk_buff *skb, struct net_device *dev) return skb; } -static struct sk_buff *qca_tag_rcv(struct sk_buff *skb, struct net_device *dev, - struct packet_type *pt) +static struct sk_buff *qca_tag_rcv(struct sk_buff *skb, struct net_device *dev) { u8 ver; u16 hdr; @@ -59,11 +58,7 @@ static struct sk_buff *qca_tag_rcv(struct sk_buff *skb, struct net_device *dev, if (unlikely(!pskb_may_pull(skb, QCA_HDR_LEN))) return NULL; - /* The QCA header is added by the switch between src addr and Ethertype - * At this point, skb->data points to ethertype so header should be - * right before - */ - phdr = (__be16 *)(skb->data - 2); + phdr = dsa_etype_header_pos_rx(skb); hdr = ntohs(*phdr); /* Make sure the version is correct */ @@ -73,8 +68,7 @@ static struct sk_buff *qca_tag_rcv(struct sk_buff *skb, struct net_device *dev, /* Remove QCA tag and recalculate checksum */ skb_pull_rcsum(skb, QCA_HDR_LEN); - memmove(skb->data - ETH_HLEN, skb->data - ETH_HLEN - QCA_HDR_LEN, - ETH_HLEN - QCA_HDR_LEN); + dsa_strip_etype_header(skb, QCA_HDR_LEN); /* Get source port information */ port = (hdr & QCA_HDR_RECV_SOURCE_PORT_MASK); |