Received: by 2002:ac0:a594:0:0:0:0:0 with SMTP id m20-v6csp1049284imm; Wed, 23 May 2018 09:27:28 -0700 (PDT) X-Google-Smtp-Source: AB8JxZpBtdLpR5k4CDO3dHPQKRFCjj1MBronUUM3OxhNQFXjN0H6OwvIjUmy3xSesqOdA5Q1QbKa X-Received: by 2002:a17:902:524:: with SMTP id 33-v6mr3670101plf.25.1527092848669; Wed, 23 May 2018 09:27:28 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1527092848; cv=none; d=google.com; s=arc-20160816; b=STbaedIJkCQob9chwOAP4tQTJFcnvV1bvfe4n+tJUkAWDCGnWQV8IAMjAVlHFQ+adG 4tthjZwvR2eORhRHdlXPVOOOpF0tJfCJ9qHRTNCS58yXksnn+znl2SFv5iq7uKaQ8u6V ouUrDp/lA6fcQCTGAbnnHJIk2Vv4+lwiXFViSAvRS2jhEfQuXjYotE9eqEUMFZ0VMyEa QqQpsiqHOMErIme6OTfgSY9hTI/XFuGo5az4PUBZ/zVSE1g2Efoh3VlHOIu32U3dr/0o qm+5OPJVVlJ9bQEeTHd1uSjRrVeot1MQmoKK0E7DTKPglQ6OQKalD3VO3IldWm0dO++y pDWA== 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 :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject:dkim-signature :arc-authentication-results; bh=BS/Tz/8Pp2QcNz/RjTtdpu2WW0dLlB2nt1TOMnMxqNc=; b=QpsDDFCyentMsgSC6Hv97if0YxkGCXtqwASA38+BOr0lKEiGPIAgSXtiEiUTZipItx 7Za7JbjIRYLbXp1HVdRCg8ldc3pwTuTrBA2TxgzJu8cc640jWbo0Pe6j0XV8TboHwr2C V3DttfYunRAHPEDmwu7aDuo2+YWsMP94BGpckvQ7MnYJVXpufOD3X60CbNRjtcKgRyMV 49DJ0LEhoOMF7NyQAACBrajSQmzG5fj/un689bcYlQ+AKp1u/LmTqHdfZ1j6IaP3KALn 0SEAz+YZSM7eBQMnKWgxrmiILg/VKiBaGd7/WAp5+X8MIU0cpwrzT1CqmWSrGET84rJt cong== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=CmkUeLrp; 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; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 64-v6si18773815plk.137.2018.05.23.09.27.09; Wed, 23 May 2018 09:27:28 -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; dkim=pass header.i=@gmail.com header.s=20161025 header.b=CmkUeLrp; 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; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754795AbeEWQ1A (ORCPT + 99 others); Wed, 23 May 2018 12:27:00 -0400 Received: from mail-wr0-f193.google.com ([209.85.128.193]:37266 "EHLO mail-wr0-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754739AbeEWQ0u (ORCPT ); Wed, 23 May 2018 12:26:50 -0400 Received: by mail-wr0-f193.google.com with SMTP id i12-v6so14434182wrc.4; Wed, 23 May 2018 09:26:49 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=subject:to:cc:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-language:content-transfer-encoding; bh=BS/Tz/8Pp2QcNz/RjTtdpu2WW0dLlB2nt1TOMnMxqNc=; b=CmkUeLrpf524Gh8aDy8Zl6RC9Wey+u0uw4PL1xwekLc8geFv1LuQYIv9BTpdfS8Msi RP7Tp1DFk9I7ZmBBiEiPv+2pF/eNjPfZ/BgkDjonxKpDXjW6hrBjENNda2RSywjAU1cl KeB2pZD24jE4JAaQEUEk5BSbCj/NAQs9BWdME8UyErm2wC0n6o8HpLNcWJkM2uQp8AOG qFc9lctVYutaQFJ9K9VR+5XnZnq2vuDS8r8Zf3sMhnBMkBSIoPTjo4+rWAmmnAJaqnXE dcqudL3lF5WaYrGqzpxDEtBNJbucCr1kDnziyX9XYSnXr9GCaoILWcmHZB5yQQFl8xXQ cn9A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=BS/Tz/8Pp2QcNz/RjTtdpu2WW0dLlB2nt1TOMnMxqNc=; b=fkr+WAmlksU5mpRWeHBNYDgjzPlcx24+RQe7DPU6uTiXnFMIvITUnuJh/blAW3EAYg mMtcqnBKQbBlOk72OtYgMFfDuiqMj0roU+NPtItzjCCzALlDLrqaY+3aX7cSMyhAzO2V p960YNzkPOCvMubxWT2+XHzGXCRyZLCI82oxXZHBBHNf1tsa2OmGrFahdEkuDJ079yGd 5duxPzPVCM2AaRA+2M8eQPlNqgULRkrsJdIUcSMHAX17pEuV7Z1Y6HRL0dbAvzQrEE82 VvdfJbyVcfS9XM0k/xFkeAHcCLkfOnREdwiB+cgBwrzRq9HHEXXvyPX5+W2Di6J8KZwJ OBSA== X-Gm-Message-State: ALKqPwdQCUtr2JpPRpAciLHCfZksKT7PvDkF73zEaty56QQoi7sseZAD TTBXk5Jlvdkgb53DWqDIgbrEIhDyo2Q= X-Received: by 2002:a19:d253:: with SMTP id j80-v6mr2111308lfg.88.1527092808654; Wed, 23 May 2018 09:26:48 -0700 (PDT) Received: from [192.168.1.244] (90-227-62-61-no75.tbcn.telia.com. [90.227.62.61]) by smtp.gmail.com with ESMTPSA id p5-v6sm3554427ljh.3.2018.05.23.09.26.47 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 23 May 2018 09:26:48 -0700 (PDT) Subject: Re: [PATCH v2] ath10k: transmit queued frames after waking queues To: Niklas Cassel , Rajkumar Manoharan Cc: Kalle Valo , "David S. Miller" , ath10k@lists.infradead.org, linux-wireless@vger.kernel.org, netdev@vger.kernel.org, linux-kernel@vger.kernel.org, linux-wireless-owner@vger.kernel.org References: <20180521204359.23884-1-niklas.cassel@linaro.org> <8195be7603a8cd659d25a9c3d898b891@codeaurora.org> <20180522211521.GA26123@localhost.localdomain> From: Erik Stromdahl Message-ID: Date: Wed, 23 May 2018 18:25:49 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.7.0 MIME-Version: 1.0 In-Reply-To: <20180522211521.GA26123@localhost.localdomain> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 05/22/2018 11:15 PM, Niklas Cassel wrote: >> >> Earlier we observed performance issues in calling push_pending from each >> tx completion. IMHO this change may introduce the same problem again. > > I prefer functional TX over performance issues, > but I agree that it is unfortunate that SDIO doesn't use > ath10k_htt_txrx_compl_task(). > Erik, is there a reason for this? The reason is that the SDIO code has been derived mainly from qcacld and ath6kl and they don't implement napi. ath10k_htt_txrx_compl_task is currently only called from the napi poll function, and the sdio bus driver doesn't have such a function. > > Perhaps it would be possible to call ath10k_mac_tx_push_pending() > from the equivalent to ath10k_htt_txrx_compl_task(), > but from SDIO's point of view. An equivalent for SDIO would most likely be *ath10k_htt_htc_t2h_msg_handler* or any of the other functions called from this function. *ath10k_txrx_tx_unref* is actually called from *ath10k_htt_htc_t2h_msg_handler*, so that function could be viewed as an equivalent. If the call should be added in the bus driver (sdio.c) it should most likely be placed in *ath10k_sdio_mbox_rx_process_packets* if (!pkt->trailer_only) { ep->ep_ops.ep_rx_complete(ar_sdio->ar, pkt->skb); ath10k_mac_tx_push_pending(ar_sdio->ar); } else { kfree_skb(pkt->skb) } The above call would of course result in lot's of calls to *ath10k_mac_tx_push_pending* Adding a htt_num_pending check here wouldn't look nice. The HL RX path differs from the LL path in that the t2h_msg_handler returns false indicating that it has consumed the skb. This is because it is the HL RX indication handler that delivers the skb's to mac80211. Another solution could be to add an *else-statement* as a part of the *if (release)* in *ath10k_htt_htc_t2h_msg_handler*, where *ath10k_mac_tx_push_pending* could be called. Something like this perhaps: /* Free the indication buffer */ if (release) dev_kfree_skb_any(skb); else if (!ar->htt.num_pending_tx) ath10k_mac_tx_push_pending(ar); I think I prefer your original patch though. > > Another solution might be to change so that we only call > ath10k_mac_tx_push_pending() from ath10k_txrx_tx_unref() > if (htt->num_pending_tx == 0). That should decrease the number > of calls to ath10k_mac_tx_push_pending(), while still avoiding > a "TX deadlock" scenario for SDIO. Just out of curiosity, where did the limit of 3 come from? If it works with a limit of 0, I think it should be used instead. Another intersting thing that I stumbled upon when looking into the code (while writing this email) is the *wake_up(&htt->empty_tx_wq);* For some reason I have considered it not to be applicable for HL devices. The queue is waited for in the flush op (*ath10k_flush*). I am unsure what it is used for, but I don't think it affects the TX deadlock scenario. -- Erik