From patchwork Fri Jun 15 12:04:23 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Erik Stromdahl X-Patchwork-Id: 10466285 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 3440960384 for ; Fri, 15 Jun 2018 12:06:44 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 2713428D8C for ; Fri, 15 Jun 2018 12:06:44 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 1A8B428D8E; Fri, 15 Jun 2018 12:06:44 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.9 required=2.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, DKIM_VALID, FREEMAIL_FROM, MAILING_LIST_MULTI autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 0BE9A28D8D for ; Fri, 15 Jun 2018 12:06:43 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:MIME-Version:Cc:List-Subscribe: List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id:References: In-Reply-To:Message-Id:Date:Subject:To:From:Reply-To:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Owner; bh=2qRvPemxuY1IK+KCKSBNzfSc2MVoU3Otdx94CgOgazI=; b=Nr5w8PLwibJevPDyn/xr/0obuH XDX5rpzjGawCHBGIacgotFLNLs8merQqOnxwVudHQDrjB8VZuxguuFdayICuSlt1X/ImQjyk0bH90 gqBVdIStljzX7dzaywu9ox05o5W6dLRe9jEIB7ru8VmVrfK2jOk1VfsR3tsCtxDL3vPVNipIeQq1Y 5YMIxcWcKoI1se0P7KII37OOH3Aa8y/aL4VpkussZEN5FYQm/HzBYzoe3vBlR+JUZDStbIDETANYz 7Y2LitsyabebcMRitCU4NRifZ8VKTEp8TW9Hec2TLJY9xvscYVKRoIXR2XmKRMHyD5oK1zmPsfvB4 mQScp38g==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1fTnUz-0004hF-Fj; Fri, 15 Jun 2018 12:06:37 +0000 Received: from mail-lf0-x244.google.com ([2a00:1450:4010:c07::244]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1fTnUw-0004ee-Lu for ath10k@lists.infradead.org; Fri, 15 Jun 2018 12:06:36 +0000 Received: by mail-lf0-x244.google.com with SMTP id d24-v6so14281399lfa.8 for ; Fri, 15 Jun 2018 05:06:25 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=9d8rn1W+VyYzJs4RrhP6/1+7cNExA9Si8ZUjFUy07Vo=; b=o5pQblCqk0Z/XXA6KvkBKjTt/YcIX3B14gHQlzQA2jOlsOTHMjcJW9XseGpRCNeFvv xEjcXGud0O7hLOGUWtlMtkMykdSEBU/gD5kwOJE0JKRTjvnvGP1b8DsbzLkEqRnzxONZ nnk5/zh4PzAMY2Si0ax7ozMbFO3Mhk0y1kY15VDSluSR7PrTfxAgXjvNT6fgitxOo5DK 6bECZUi69iUztKFXkgEEHF6NHhuDCNzxM1cHTU8sKW7+e3+JSy6HrvXqJMw+O18AIWzD /TBagQd/iT53gRafoijE5cLppaKOGNJ5TmLnrwWfho0MJjeWXgMGYoB9gclkkpyPsps/ BPkw== 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:in-reply-to :references; bh=9d8rn1W+VyYzJs4RrhP6/1+7cNExA9Si8ZUjFUy07Vo=; b=NxV/SCUEjstgX8V0CDR7VLzTAA1IdpW0TJ8iuD/UDzbQOmppCNdIs2tuyaY4g5q91c DOg+DwLCxfxLkBYyBldLjCYOQuNFv3Ruy1hXU2nawe3R8lYBTangg9KbssJT+/2sJkrr WIhIcrlVaPczgCj+hUrpniaXIl1OKhY8TdvVY06EEtd3bBKbjnPhYwSoTKFJeMTMcBVh 7Iji8AzRrDSV+vnNhx0wqy/ngciiIASPePsRdsDepjpPWhY0gg7BuzrmLq8ytLhtNSoD kPOpYcemXoglOcjeN4j1pie087N4G7Wck7ZzqTpLi38jhEt1ANIGtg62XOwKvgHAshOZ QNTA== X-Gm-Message-State: APt69E0TeRjlUj4Y7bQKmUVvFjL2WrpBsOF2AkN2hvDUsp9yYCnm83wk ek358MN6tLeGvWCuDbu3IqvqsQ== X-Google-Smtp-Source: ADUXVKKUrcuyMZnLKmFv3yqY4mwnLtCZJYq8Mqq+BtySDYrblRBpEqEhqaaumiwlN4OI/sh2Il0ZnQ== X-Received: by 2002:a19:d898:: with SMTP id r24-v6mr965462lfi.7.1529064383579; Fri, 15 Jun 2018 05:06:23 -0700 (PDT) Received: from localhost.localdomain (90-227-62-61-no75.tbcn.telia.com. [90.227.62.61]) by smtp.gmail.com with ESMTPSA id x15-v6sm1470210lfe.39.2018.06.15.05.06.22 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 15 Jun 2018 05:06:23 -0700 (PDT) From: Erik Stromdahl To: kvalo@qca.qualcomm.com, linux-wireless@vger.kernel.org, ath10k@lists.infradead.org Subject: [PATCH 2/2] ath10k: replace hardcoded constant with define Date: Fri, 15 Jun 2018 14:04:23 +0200 Message-Id: <20180615120423.4963-2-erik.stromdahl@gmail.com> X-Mailer: git-send-email 2.17.0 In-Reply-To: <20180615120423.4963-1-erik.stromdahl@gmail.com> References: <20180615120423.4963-1-erik.stromdahl@gmail.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20180615_050634_727548_20D10A72 X-CRM114-Status: GOOD ( 13.89 ) X-BeenThere: ath10k@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Erik Stromdahl MIME-Version: 1.0 Sender: "ath10k" Errors-To: ath10k-bounces+patchwork-ath10k=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP The hardcoded values used in ath10k_mac_tx_push_pending and ath10k_mac_op_wake_tx_queue set an upper limit of how many packets that can be consumed from the TX queue. HTC_HOST_MAX_MSG_PER_TX_BUNDLE is a proper name for this constant, as the value effectively limits the number of messages that can be consumed in one step. Thus, the value is an upper limit of the number of messages that can be added to a TX message bundle. Signed-off-by: Erik Stromdahl --- drivers/net/wireless/ath/ath10k/htc.h | 1 + drivers/net/wireless/ath/ath10k/mac.c | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/drivers/net/wireless/ath/ath10k/htc.h b/drivers/net/wireless/ath/ath10k/htc.h index e60fbea698a9..d69bb83049c4 100644 --- a/drivers/net/wireless/ath/ath10k/htc.h +++ b/drivers/net/wireless/ath/ath10k/htc.h @@ -51,6 +51,7 @@ struct ath10k; */ #define HTC_HOST_MAX_MSG_PER_RX_BUNDLE 8 +#define HTC_HOST_MAX_MSG_PER_TX_BUNDLE 16 enum ath10k_htc_tx_flags { ATH10K_HTC_FLAG_NEED_CREDIT_UPDATE = 0x01, diff --git a/drivers/net/wireless/ath/ath10k/mac.c b/drivers/net/wireless/ath/ath10k/mac.c index f31ae3be4778..e36ca4145572 100644 --- a/drivers/net/wireless/ath/ath10k/mac.c +++ b/drivers/net/wireless/ath/ath10k/mac.c @@ -4026,7 +4026,7 @@ void ath10k_mac_tx_push_pending(struct ath10k *ar) drv_priv); /* Prevent aggressive sta/tid taking over tx queue */ - max = 16; + max = HTC_HOST_MAX_MSG_PER_TX_BUNDLE; ret = 0; while (ath10k_mac_tx_can_push(hw, txq) && max--) { ret = ath10k_mac_tx_push_txq(hw, txq); @@ -4287,7 +4287,7 @@ static void ath10k_mac_op_wake_tx_queue(struct ieee80211_hw *hw, struct ieee80211_txq *f_txq; struct ath10k_txq *f_artxq; int ret = 0; - int max = 16; + int max = HTC_HOST_MAX_MSG_PER_TX_BUNDLE; spin_lock_bh(&ar->txqs_lock); if (list_empty(&artxq->list))