From 74ab1d4b331162defde6a9af016d8b421c4f8ea9 Mon Sep 17 00:00:00 2001 From: Mohammed Javid Date: Wed, 25 Jul 2018 15:01:38 +0530 Subject: [PATCH] net: usb: ax88179: Change to check if the packets are coming from gsb Packets from gsb are cloned packets, which has been done to optimize the dl data path. The check for cloned skb calls pskb_expand_head which gives penalty in the throughput. GSB driver data path does not consume the skb so, reallocation of skb is not necessary here. For that reason the check for all packets from gsb is introduced here. This check improves the throughput to about 150 Mbps. Change-Id: Ic1d7cc9c94605f1902ba212aac52d535d0ff84a7 Acked-by: Rishav LNU Signed-off-by: Mohammed Javid --- drivers/net/usb/ax88179_178a.c | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/drivers/net/usb/ax88179_178a.c b/drivers/net/usb/ax88179_178a.c index 8e37e1f58c4b..d78c6327f65b 100644 --- a/drivers/net/usb/ax88179_178a.c +++ b/drivers/net/usb/ax88179_178a.c @@ -1431,12 +1431,20 @@ ax88179_tx_fixup(struct usbnet *dev, struct sk_buff *skb, gfp_t flags) headroom = skb_headroom(skb) - 8; +#ifdef CONFIG_ENABLE_SFE + if (((!(skb->fast_forwarded) && skb_header_cloned(skb)) || + headroom < 0) && + pskb_expand_head(skb, headroom < 0 ? 8 : 0, 0, GFP_ATOMIC)) { + dev_kfree_skb_any(skb); + return NULL; + } +#else if ((skb_header_cloned(skb) || headroom < 0) && pskb_expand_head(skb, headroom < 0 ? 8 : 0, 0, GFP_ATOMIC)) { dev_kfree_skb_any(skb); return NULL; } - +#endif ptr = skb_push(skb, 8); put_unaligned_le32(tx_hdr1, ptr); put_unaligned_le32(tx_hdr2, ptr + 4);