net: dsa: tag_dsa: let DSA core deal with TX reallocation
authorVladimir Oltean <vladimir.oltean@nxp.com>
Sun, 1 Nov 2020 19:16:18 +0000 (21:16 +0200)
committerJakub Kicinski <kuba@kernel.org>
Tue, 3 Nov 2020 01:41:16 +0000 (17:41 -0800)
Now that we have a central TX reallocation procedure that accounts for
the tagger's needed headroom in a generic way, we can remove the
skb_cow_head call.

Similar to the EtherType DSA tagger, the old Marvell tagger can
transform an 802.1Q header if present into a DSA tag, so there is no
headroom required in that case. But we are ensuring that it exists,
regardless (practically speaking, the headroom must be 4 bytes larger
than it needs to be).

Signed-off-by: Vladimir Oltean <vladimir.oltean@nxp.com>
Reviewed-by: Florian Fainelli <f.fainelli@gmail.com>
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
net/dsa/tag_dsa.c

index 0b756fae68a5ff75cc3c928236b081b1bd33b5f0..63d690a0fca6f0822500d3535d82eba7cc26f43d 100644 (file)
@@ -23,9 +23,6 @@ static struct sk_buff *dsa_xmit(struct sk_buff *skb, struct net_device *dev)
         * the ethertype field for untagged packets.
         */
        if (skb->protocol == htons(ETH_P_8021Q)) {
-               if (skb_cow_head(skb, 0) < 0)
-                       return NULL;
-
                /*
                 * Construct tagged FROM_CPU DSA tag from 802.1q tag.
                 */
@@ -41,8 +38,6 @@ static struct sk_buff *dsa_xmit(struct sk_buff *skb, struct net_device *dev)
                        dsa_header[2] &= ~0x10;
                }
        } else {
-               if (skb_cow_head(skb, DSA_HLEN) < 0)
-                       return NULL;
                skb_push(skb, DSA_HLEN);
 
                memmove(skb->data, skb->data + DSA_HLEN, 2 * ETH_ALEN);