From 2c7b39ecfb0c015cf7a29780190aec121c135f4b Mon Sep 17 00:00:00 2001 From: Wright Feng Date: Mon, 1 Jan 2018 20:12:54 -0600 Subject: [PATCH 030/296] non-upstream: calling skb_orphan before sending skb to SDIO bus Linux 3.6 introduces TSQ which has a per socket threshold for TCP Tx packet to reduce latency. In fcmode 1/2, host driver enqueues skb in hanger and TCP doesn't push new skb frees until host frees the skb when receiving fwstatus event. So using skb_orphan before sending skb to bus will make the skb removing the ownership of socket. With this patch, we got better throughput in fcmode 1/2. We only call skb_orphan when Linux version is less than 4.16.0. Tested 43455 TCP throughput in 20 MHz bandwidth with/without this patch. fcmode 0: 59.5 / 59.6 (Mbps) fcmode 1: 59.3 / 23.4 (Mbps) fcmode 2: 59.6 / 21.5 (Mbps) Signed-off-by: Wright Feng Signed-off-by: Chi-hsien Lin --- drivers/net/wireless/broadcom/brcm80211/brcmfmac/sdio.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/sdio.c b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/sdio.c index ab55b6fb6cdd..e407376b7fd7 100644 --- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/sdio.c +++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/sdio.c @@ -3,6 +3,7 @@ * Copyright (c) 2010 Broadcom Corporation */ +#include #include #include #include @@ -2370,6 +2371,9 @@ static uint brcmf_sdio_sendfromq(struct brcmf_sdio *bus, uint maxframes) &prec_out); if (pkt == NULL) break; +#if (LINUX_VERSION_CODE < KERNEL_VERSION(4, 16, 0)) + skb_orphan(pkt); +#endif __skb_queue_tail(&pktq, pkt); } spin_unlock_bh(&bus->txq_lock); -- 2.25.1