Received: by 2002:ac0:a582:0:0:0:0:0 with SMTP id m2-v6csp1328511imm; Tue, 2 Oct 2018 06:36:22 -0700 (PDT) X-Google-Smtp-Source: ACcGV60HYIJJVY2JrZV3oa9LIerYHym44MuyRoeYuUwh9fAC4IqEguQEsRqxw2qjDWPJkAfjlVDW X-Received: by 2002:a17:902:7e0f:: with SMTP id b15-v6mr16628306plm.246.1538487382758; Tue, 02 Oct 2018 06:36:22 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1538487382; cv=none; d=google.com; s=arc-20160816; b=oDiZXk8YbxNLdGZxEpEWl8GyjVjPet2JNTo2z9IzzTJwBlYvlnmy3rzkTMvXui750x OIOsI12lpTvZdoNNPps8IiR7aro+jr00q2jXzuCfWKFLfZmaAddqcwNdPzGgSK/VWFnW xriwi04vgdsmnZKw8k39K4K6ULAyo+oNzdPj89aaQDbgDUbIoUIaFTiO7rtOEgC/ojY9 Esq1QTrS+lLzrlBe0Ij+KhfQ4cVXKteheA1SB6ERwE0bQc5P56Dl2Ow/3P1x8/Sq7lxR m73qoA6AJylGJRE940VO+bLKIrNULfhuk25wzr5ytRAm3nL2FeOyQa1zCkp9B1k3B8dm fwIg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from; bh=FOmtM9xYoeK6sU029zFwpOs74KZ9eieD0tW0zNco96o=; b=DoBY04kehs8DVahNdPwbg7le0V4S9/+GKdvkDOpqSdvcBxslo956jd0VGcqaTrjw/h 0xg6Ph9jHUD9QY6qKB/QV81vG+IqkPjgJEOIJ0a4dnsf0ItBpWdaO5J65GgiuOjIaWsa CTG7ccsdiSG1wI9ZPlZjKSW/BLMSTYQ5afPr3veXTc9k+SI6uhE43vCZB3qhFMYqCF/I SzuDrNzJ12RQ5SAwhaSi5YoFAJAgXQgjwrKFIwXH9icWsMNE+W1HojdSaD9APQMRYEgp Kg5UUgPQYL3U9+18VcarBqWYNsrM+Q+qER5YSp8Uwb3qnpkKn2Aq4viSVJ6cGuqFBtYU 63Pw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id m11-v6si16539890pla.45.2018.10.02.06.36.07; Tue, 02 Oct 2018 06:36:22 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732187AbeJBURb (ORCPT + 99 others); Tue, 2 Oct 2018 16:17:31 -0400 Received: from mail.linuxfoundation.org ([140.211.169.12]:35206 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1732152AbeJBURa (ORCPT ); Tue, 2 Oct 2018 16:17:30 -0400 Received: from localhost (24-104-73-23-ip-static.hfc.comcastbusiness.net [24.104.73.23]) by mail.linuxfoundation.org (Postfix) with ESMTPSA id 736D5BF0; Tue, 2 Oct 2018 13:34:06 +0000 (UTC) From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Niklas Cassel , Kalle Valo , Sasha Levin Subject: [PATCH 4.14 061/137] ath10k: transmit queued frames after processing rx packets Date: Tue, 2 Oct 2018 06:24:22 -0700 Message-Id: <20181002132502.809024666@linuxfoundation.org> X-Mailer: git-send-email 2.19.0 In-Reply-To: <20181002132458.446916963@linuxfoundation.org> References: <20181002132458.446916963@linuxfoundation.org> User-Agent: quilt/0.65 X-stable: review MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 4.14-stable review patch. If anyone has any objections, please let me know. ------------------ From: Niklas Cassel [ Upstream commit 3f04950f32d5d592ab4fcaecac2178558a6f7437 ] 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 Signed-off-by: Kalle Valo Signed-off-by: Sasha Levin Signed-off-by: Greg Kroah-Hartman --- drivers/net/wireless/ath/ath10k/mac.c | 1 + drivers/net/wireless/ath/ath10k/sdio.c | 3 +++ 2 files changed, 4 insertions(+) --- a/drivers/net/wireless/ath/ath10k/mac.c +++ b/drivers/net/wireless/ath/ath10k/mac.c @@ -4015,6 +4015,7 @@ void ath10k_mac_tx_push_pending(struct a rcu_read_unlock(); spin_unlock_bh(&ar->txqs_lock); } +EXPORT_SYMBOL(ath10k_mac_tx_push_pending); /************/ /* Scanning */ --- 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" @@ -1346,6 +1347,8 @@ static void ath10k_sdio_irq_handler(stru break; } while (time_before(jiffies, timeout) && !done); + ath10k_mac_tx_push_pending(ar); + sdio_claim_host(ar_sdio->func); if (ret && ret != -ECANCELED)