diff mbox series

[v3,net-next,11/12] net: dsa: tag_gswip: let DSA core deal with TX reallocation

Message ID 20201101191620.589272-12-vladimir.oltean@nxp.com (mailing list archive)
State Not Applicable
Delegated to: Netdev Maintainers
Headers show
Series Generic TX reallocation for DSA | expand

Commit Message

Vladimir Oltean Nov. 1, 2020, 7:16 p.m. UTC
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.

This one is interesting, the DSA tag is 8 bytes on RX and 4 bytes on TX.
Because DSA is unaware of asymmetrical tag lengths, the overhead/needed
headroom is declared as 8 bytes and therefore 4 bytes larger than it
needs to be. If this becomes a problem, and the GSWIP driver can't be
converted to a uniform header length, we might need to make DSA aware of
separate RX/TX overhead values.

Cc: Hauke Mehrtens <hauke@hauke-m.de>
Signed-off-by: Vladimir Oltean <vladimir.oltean@nxp.com>
---
Changes in v3:
None.

Changes in v2:
None.

 net/dsa/tag_gswip.c | 5 -----
 1 file changed, 5 deletions(-)

Comments

Florian Fainelli Nov. 2, 2020, 8:52 p.m. UTC | #1
On 11/1/2020 11:16 AM, Vladimir Oltean wrote:
> 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.
> 
> This one is interesting, the DSA tag is 8 bytes on RX and 4 bytes on TX.
> Because DSA is unaware of asymmetrical tag lengths, the overhead/needed
> headroom is declared as 8 bytes and therefore 4 bytes larger than it
> needs to be. If this becomes a problem, and the GSWIP driver can't be
> converted to a uniform header length, we might need to make DSA aware of
> separate RX/TX overhead values.
> 
> Cc: Hauke Mehrtens <hauke@hauke-m.de>
> Signed-off-by: Vladimir Oltean <vladimir.oltean@nxp.com>

Reviewed-by: Florian Fainelli <f.fainelli@gmail.com>
diff mbox series

Patch

diff --git a/net/dsa/tag_gswip.c b/net/dsa/tag_gswip.c
index 408d4af390a0..2f5bd5e338ab 100644
--- a/net/dsa/tag_gswip.c
+++ b/net/dsa/tag_gswip.c
@@ -60,13 +60,8 @@  static struct sk_buff *gswip_tag_xmit(struct sk_buff *skb,
 				      struct net_device *dev)
 {
 	struct dsa_port *dp = dsa_slave_to_port(dev);
-	int err;
 	u8 *gswip_tag;
 
-	err = skb_cow_head(skb, GSWIP_TX_HEADER_LEN);
-	if (err)
-		return NULL;
-
 	skb_push(skb, GSWIP_TX_HEADER_LEN);
 
 	gswip_tag = skb->data;