From patchwork Wed May 23 22:15:08 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Niklas Cassel X-Patchwork-Id: 136679 Delivered-To: patch@linaro.org Received: by 2002:a2e:9706:0:0:0:0:0 with SMTP id r6-v6csp1437119lji; Wed, 23 May 2018 15:15:32 -0700 (PDT) X-Google-Smtp-Source: AB8JxZpGdKAzf/1m+YZhBFpN+i6XlmHRFWFHcVCJNt6NoUmn+EBHLCWMAfphw9yJqkfH6VKNsg+F X-Received: by 2002:a17:902:da4:: with SMTP id 33-v6mr4604823plv.169.1527113731920; Wed, 23 May 2018 15:15:31 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1527113731; cv=none; d=google.com; s=arc-20160816; b=XVRrqW2SfnrX8/x3ZJPmWw3q8WBNJdvq6UZwWS5MZ6b4Pu7JcPuTNGAe9yQChK1J2q uuar36IJQgqtliT9VNIlcgzNCPAe91htgHiqzZAs39xMTZwClrWYMCFujfwCtWIXXv1b hNolv5FobhPvIxeCweCfVqt3KYS7iqTd3dqFQuPs1jrkCkViSFyNy249UT9kMnYu/jFq 3+9l1+KnL/F2em8ljcP9Gur1Ff+uxPYOyQov532dS4WU2pm/Uw/6VAFaQC5XoehszTi2 0HflZQeZlgBoRzbzRezuEd41kVe7cOZz5r/IMme1S1qHQOn3XPmoG/IkDxbgOZerokYG 2eTg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:cc:to:from :dkim-signature:arc-authentication-results; bh=9h0EFRWo8VAjkvQnIbf8nuzTYFUQ3nt1sGIqh05z5r4=; b=RzsGojnkjAs/8OKaSlskaMw3ENhAUe1rTZLeXja2w7WYgIP46X7ve7lvmyQCgRQCi2 I8yUFM8wr/FT1E0Q1ITCVy+/FuolRQLe88kzOshIDzqgj/SBUion4ibuHVEErLUAK5YX l8Edovo1opotl1D3JpmOakYtiGCNoHx1yZAH3rH9G1VJK5ZamApXbUlGPTQF5X7R4lur G1OQg5sj3tX7X3LpNxveHHZ2VSTtVNNlDTAMAXy25w8wE4H6HS5P6eOXjkhO0G4Bz2u/ AEw9BsfFSXWJQmoDi5Jh0c0WKfpvwY5jh797r5R+hSbHlr0jbW1TK69PjCmj//3tcu1I 0tiw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=CyUg+w1b; spf=pass (google.com: best guess record for domain of linux-wireless-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-wireless-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id l13-v6si3105882pga.589.2018.05.23.15.15.31; Wed, 23 May 2018 15:15:31 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-wireless-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=CyUg+w1b; spf=pass (google.com: best guess record for domain of linux-wireless-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-wireless-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S934512AbeEWWPa (ORCPT + 3 others); Wed, 23 May 2018 18:15:30 -0400 Received: from mail-wr0-f195.google.com ([209.85.128.195]:45209 "EHLO mail-wr0-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S934575AbeEWWP1 (ORCPT ); Wed, 23 May 2018 18:15:27 -0400 Received: by mail-wr0-f195.google.com with SMTP id w3-v6so21486290wrl.12 for ; Wed, 23 May 2018 15:15:27 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id; bh=9h0EFRWo8VAjkvQnIbf8nuzTYFUQ3nt1sGIqh05z5r4=; b=CyUg+w1b3cVCIHVVTb3q1c+angWE02VPYNG3+98oK04jLkMo0sEb/YEb2UMhD3v53z fEidMvtyz6QQK4uxkoaLa5vT3uCdBtfUH8bjq6DJe4Zpy8Ruf6J32TecfdLNUHA321QI PQYPAgVWXFvqlsQlWC9rzPqW3NGU4g2jKYats= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=9h0EFRWo8VAjkvQnIbf8nuzTYFUQ3nt1sGIqh05z5r4=; b=VJ45J2dsGwIWq+uG2J4Vxi4G5KfEGfl70zVrm9PP/mpgU2BcQBosQRbohzSpmu4NSN QPDGNgraxO/EI+YBQkrrVJebMk6xSbzPX2Bc11Pbo4g9xh7B5aQ2Afp+jfOTnqjRKHoD ZXDi0sjstcwTftk/yReXHVUgSQPpGhX+SYPTm5NUdT+knRSCWJM2ug/vgy0tkkYFRYAX 9odkbMK/v9phGJZhweEVbhQDFqM5PRGfjY5sZkfTCgPoNbfojfIWQUmNyWSxInD3CBet W+4UAFBmaLlL9ggkW1/qSwmknbU/Fx7N+SaTSaba0wQQeqh9uiXbbwPQAJf87moBLm2P H5dg== X-Gm-Message-State: ALKqPwdtN2OxsLFAFPgICZO9FXtJO4n/PUzcNt2DkJjUZI1lJwgKEpOf pSSloiNNPwZaQE3vkzI2eBvPRw== X-Received: by 2002:a19:9f8e:: with SMTP id i136-v6mr2693369lfe.5.1527113726427; Wed, 23 May 2018 15:15:26 -0700 (PDT) Received: from localhost.lan (h-229-118.A785.priv.bahnhof.se. [5.150.229.118]) by smtp.gmail.com with ESMTPSA id a19-v6sm4705949lfi.86.2018.05.23.15.15.25 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Wed, 23 May 2018 15:15:25 -0700 (PDT) From: Niklas Cassel To: Kalle Valo , "David S. Miller" Cc: Niklas Cassel , ath10k@lists.infradead.org, linux-wireless@vger.kernel.org, netdev@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH v3] ath10k: transmit queued frames after processing rx packets Date: Thu, 24 May 2018 00:15:08 +0200 Message-Id: <20180523221508.26391-1-niklas.cassel@linaro.org> X-Mailer: git-send-email 2.17.0 Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org When running iperf on ath10k SDIO, TX can stop working: iperf -c 192.168.1.1 -i 1 -t 20 -w 10K [ 3] 0.0- 1.0 sec 2.00 MBytes 16.8 Mbits/sec [ 3] 1.0- 2.0 sec 3.12 MBytes 26.2 Mbits/sec [ 3] 2.0- 3.0 sec 3.25 MBytes 27.3 Mbits/sec [ 3] 3.0- 4.0 sec 655 KBytes 5.36 Mbits/sec [ 3] 4.0- 5.0 sec 0.00 Bytes 0.00 bits/sec [ 3] 5.0- 6.0 sec 0.00 Bytes 0.00 bits/sec [ 3] 6.0- 7.0 sec 0.00 Bytes 0.00 bits/sec [ 3] 7.0- 8.0 sec 0.00 Bytes 0.00 bits/sec [ 3] 8.0- 9.0 sec 0.00 Bytes 0.00 bits/sec [ 3] 9.0-10.0 sec 0.00 Bytes 0.00 bits/sec [ 3] 0.0-10.3 sec 9.01 MBytes 7.32 Mbits/sec There are frames in the ieee80211_txq and there are frames that have been removed from from this queue, but haven't yet been sent on the wire (num_pending_tx). When num_pending_tx reaches max_num_pending_tx, we will stop the queues by calling ieee80211_stop_queues(). As frames that have previously been sent for transmission (num_pending_tx) are completed, we will decrease num_pending_tx and wake the queues by calling ieee80211_wake_queue(). ieee80211_wake_queue() does not call wake_tx_queue, so we might still have frames in the queue at this point. While the queues were stopped, the socket buffer might have filled up, and in order for user space to write more, we need to free the frames in the queue, since they are accounted to the socket. In order to free them, we first need to transmit them. This problem cannot be reproduced on low-latency devices, e.g. pci, since they call ath10k_mac_tx_push_pending() from ath10k_htt_txrx_compl_task(). ath10k_htt_txrx_compl_task() is not called on high-latency devices. Fix the problem by calling ath10k_mac_tx_push_pending(), after processing rx packets, just like for low-latency devices, also in the SDIO case. Since we are calling ath10k_mac_tx_push_pending() directly, we also need to export it. Signed-off-by: Niklas Cassel --- Changes since V2: Moved ath10k_mac_tx_push_pending() call to ath10k_sdio_irq_handler(). drivers/net/wireless/ath/ath10k/mac.c | 1 + drivers/net/wireless/ath/ath10k/sdio.c | 3 +++ 2 files changed, 4 insertions(+) -- 2.17.0 diff --git a/drivers/net/wireless/ath/ath10k/mac.c b/drivers/net/wireless/ath/ath10k/mac.c index 487a7a7380fd..bfcd9705ed54 100644 --- a/drivers/net/wireless/ath/ath10k/mac.c +++ b/drivers/net/wireless/ath/ath10k/mac.c @@ -4038,6 +4038,7 @@ void ath10k_mac_tx_push_pending(struct ath10k *ar) rcu_read_unlock(); spin_unlock_bh(&ar->txqs_lock); } +EXPORT_SYMBOL(ath10k_mac_tx_push_pending); /************/ /* Scanning */ diff --git a/drivers/net/wireless/ath/ath10k/sdio.c b/drivers/net/wireless/ath/ath10k/sdio.c index d612ce8c9cff..2856c75f9011 100644 --- a/drivers/net/wireless/ath/ath10k/sdio.c +++ b/drivers/net/wireless/ath/ath10k/sdio.c @@ -30,6 +30,7 @@ #include "debug.h" #include "hif.h" #include "htc.h" +#include "mac.h" #include "targaddrs.h" #include "trace.h" #include "sdio.h" @@ -1342,6 +1343,8 @@ static void ath10k_sdio_irq_handler(struct sdio_func *func) break; } while (time_before(jiffies, timeout) && !done); + ath10k_mac_tx_push_pending(ar); + sdio_claim_host(ar_sdio->func); if (ret && ret != -ECANCELED)