diff mbox series

[RFC,12/13] net: dsa: tag_gswip: let DSA core deal with TX reallocation

Message ID 20201017213611.2557565-13-vladimir.oltean@nxp.com
State RFC
Delegated to: David Miller
Headers show
Series Generic TX reallocation for DSA | expand

Commit Message

Vladimir Oltean Oct. 17, 2020, 9:36 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>
---
 net/dsa/tag_gswip.c | 4 ----
 1 file changed, 4 deletions(-)

Comments

Vladimir Oltean Oct. 17, 2020, 10:19 p.m. UTC | #1
On Sun, Oct 18, 2020 at 12:36:10AM +0300, Vladimir Oltean wrote:
> diff --git a/net/dsa/tag_gswip.c b/net/dsa/tag_gswip.c
> index 408d4af390a0..cde93ccb21ac 100644
> --- a/net/dsa/tag_gswip.c
> +++ b/net/dsa/tag_gswip.c
> @@ -63,10 +63,6 @@ static struct sk_buff *gswip_tag_xmit(struct sk_buff *skb,
>  	int err;

Unused variable "err" left behind, will delete.

>  	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;
> --
diff mbox series

Patch

diff --git a/net/dsa/tag_gswip.c b/net/dsa/tag_gswip.c
index 408d4af390a0..cde93ccb21ac 100644
--- a/net/dsa/tag_gswip.c
+++ b/net/dsa/tag_gswip.c
@@ -63,10 +63,6 @@  static struct sk_buff *gswip_tag_xmit(struct sk_buff *skb,
 	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;