From patchwork Sun Oct 15 20:53:26 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sergey Matyukevich X-Patchwork-Id: 10007285 X-Patchwork-Delegate: kvalo@adurom.com 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 AB60D60216 for ; Sun, 15 Oct 2017 20:54:00 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 9B9541FEB1 for ; Sun, 15 Oct 2017 20:54:00 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 8F62725404; Sun, 15 Oct 2017 20:54:00 +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=-7.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id DDB4F205A4 for ; Sun, 15 Oct 2017 20:53:59 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751687AbdJOUxz (ORCPT ); Sun, 15 Oct 2017 16:53:55 -0400 Received: from mail-bn3nam01on0051.outbound.protection.outlook.com ([104.47.33.51]:36001 "EHLO NAM01-BN3-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1751657AbdJOUxx (ORCPT ); Sun, 15 Oct 2017 16:53:53 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=quantenna.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=A6kZR0Pxcww4Ae/Fo4U4uZOURwyM0lhp5tTduMrvXfA=; b=NI1dDPAtTHw52mqqBe7pZeG8m+MVylaT3/gx7G/WUduPL0JxSF45mIK1xJsJZ0MJEpnWkxgXYACfft6x/jYCvY68s2xMs5dkW4QahQk+/i0pvGTFir+ohUW8hqcFtbBLCHlTmqQh84Pk8HCgBQcN6aW9gaqIX5u/KLvaj26qAEA= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=sergey.matyukevich.os@quantenna.com; Received: from bars.quantenna.com (195.182.157.78) by SN1PR05MB1934.namprd05.prod.outlook.com (10.162.132.12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.77.5; Sun, 15 Oct 2017 20:53:50 +0000 From: Sergey Matyukevich To: linux-wireless@vger.kernel.org Cc: Igor Mitsyanko , Avinash Patil , Vasily Ulyanov , Sergey Matyukevich Subject: [PATCH 4/5] qtnfmac: modify full Tx queue recovery Date: Sun, 15 Oct 2017 23:53:26 +0300 Message-Id: <20171015205327.9966-5-sergey.matyukevich.os@quantenna.com> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20171015205327.9966-1-sergey.matyukevich.os@quantenna.com> References: <20171015205327.9966-1-sergey.matyukevich.os@quantenna.com> MIME-Version: 1.0 X-Originating-IP: [195.182.157.78] X-ClientProxiedBy: VI1P189CA0029.EURP189.PROD.OUTLOOK.COM (10.165.188.42) To SN1PR05MB1934.namprd05.prod.outlook.com (10.162.132.12) X-MS-Office365-Filtering-Correlation-Id: 811c056f-8a2b-43a4-4ae4-08d5140ed720 X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(22001)(2017030254152)(2017052603199)(201703131423075)(201703031133081)(201702281549075); SRVR:SN1PR05MB1934; X-Microsoft-Exchange-Diagnostics: 1; SN1PR05MB1934; 3:MDrbbt0wMSrHCrqda2eUPrvmYztdfI51aO7qNLJOwmYhqPEUStkoWrCwuDj8fvMyj5mlBEBr67DMfrc1sy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NHY9DyseNLCK+9a2B2r7eFnUil7qOaAe99DoKqQSgvYvCZP6tToXfAwuq+fCWqXtPPJsgOrVL55kbyWuJgiZ7oVzfm6pTfW9+x06ZaxxjqP9eoeyVzA6C9RwXbLN13bou10ldEZaojuiKV+pysuGuqiLbsSIkfx4fpwihSX//vGxqxdYl5zC/3yYe3rcG5kkd0fRSVtlw6oiyr0E5YXgfbr/u+va/tXSIt9tkQiJ8AOGXiSYFVJAgzXHwBwqHXyVAr8tFQxpGCnUUYNAweTIm+Gqw/mtE; 4:iv0/52T7u6QNYB6NtIKalf/vMzggroxpIzqkXv2ZTEAA3DFQuKyXv0LQP564rfWq5NadiMP2vZj1U1dOK13HAeg+nbMCieiowiVZOXBCsrqLGELk9Bh5JDgyEvwE9Ku9x9C2ZS93qweesjLAwaKnFqtyOF2FMW1yYfizuuO1PHpf0xgBSlxSTNzebR4WyizDHCwj2ki9iJRRgls+RBW3cBudcHHjY7X4yaISZ9Qw9GT3Ym6LKhPiso9NJ/Szvlcl X-Exchange-Antispam-Report-Test: UriScan:; X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(100000700101)(100105000095)(100000701101)(100105300095)(100000702101)(100105100095)(6040450)(2401047)(5005006)(8121501046)(3002001)(10201501046)(100000703101)(100105400095)(93006095)(93001095)(6041248)(20161123555025)(20161123562025)(201703131423075)(201703061421075)(20161123560025)(20161123564025)(20161123558100)(6072148)(201708071742011)(100000704101)(100105200095)(100000705101)(100105500095); SRVR:SN1PR05MB1934; BCL:0; PCL:0; RULEID:(100000800101)(100110000095)(100000801101)(100110300095)(100000802101)(100110100095)(100000803101)(100110400095)(100000804101)(100110200095)(100000805101)(100110500095); SRVR:SN1PR05MB1934; X-Forefront-PRVS: 046164D5C4 X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(6009001)(346002)(376002)(189002)(199003)(4326008)(2906002)(5003940100001)(2361001)(2351001)(16586007)(53936002)(47776003)(69596002)(81156014)(5660300001)(106356001)(97736004)(105586002)(54906003)(8936002)(53416004)(50226002)(8676002)(81166006)(33646002)(6116002)(189998001)(101416001)(48376002)(1076002)(103116003)(66066001)(305945005)(2950100002)(575784001)(86362001)(16526018)(68736007)(6916009)(6486002)(36756003)(3846002)(6666003)(25786009)(508600001)(50986999)(76176999)(7736002)(107886003)(50466002); DIR:OUT; SFP:1101; SCL:1; SRVR:SN1PR05MB1934; H:bars.quantenna.com; FPR:; SPF:None; PTR:InfoNoRecords; MX:1; A:1; LANG:en; Received-SPF: None (protection.outlook.com: quantenna.com does not designate permitted sender hosts) X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; SN1PR05MB1934; 23:wjqy9KMJ6lxY37o7sTSATKY1pq10u3ekdV3JbRGX9?= =?us-ascii?Q?X9V+Ztt3/S5ZR0Sj2zHT0F0ZFAf3hdQTMdJzh6nQ56CNCH4yNYv+UgKWgtYE?= =?us-ascii?Q?GD5gDPDUjhZjwtJmgJU9FaB/mZFIjMW30c+UuiASkQTfc+l/rrrfY5/KRkV9?= =?us-ascii?Q?BFb8IAVLEB+McKRVnMHBTaB/brTcjgjG6zT+6ydgsxs35Wnl9+PO+ye5BDg5?= =?us-ascii?Q?2mePrEeiJN0f1zo4+hI4W1T35zMqB5Vqa7e+Ms+vAjDxWxBS3OXH1qfR+mV6?= =?us-ascii?Q?59MVSoSPHeR+eqKgDh2R16z5XseeE2PF2bc+2bMV9CNBca7IfeTkWYttOjgm?= =?us-ascii?Q?WOAEY394Ri2+//XeX+2fDE7k2vIUFx9HC/T0pstgZP0FHHq/0uxU/f3MFHD3?= =?us-ascii?Q?NOax+xu3P7N+b//CM+cSKhVLL4kOZzKf7rHg0ZkYZO/yvZUneU+KCtZwJR1D?= =?us-ascii?Q?SWDkCkMS1OGO1J6Wg9FzztVhX0VaxqoOH3Dr+CTQTgH2exi3BuDSVLagsmpn?= =?us-ascii?Q?tWe4T9KTydx9IWviqeK4IHfIz9uKlGHUKoyfPkjmph7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J4iIZhnaFGhDrPr/EDuXvMc3883aQUyrmKDQ4MobD0nbJTjuPRPPxhiiF665cWIy57L4RNcQsgnENnyH4sUzUNBzowMNUACZzf22899Isi5jyJA==; 5:+nqLukyc4b9Bsb8gV1paLuKwcqlIKpKUGT89WtVoQMbkQ6OSbwFGefJwVNayBXlNigZkxqr6dAigsgc67EmW4/B+NTkoiTExR251z7qHFDf970ru6yfI6lKGj4uvQWmcEslHkkF/w8aV44oiLor7GVB9ybrihkOR91ZKT8YgFPw=; 24:HGchbrtFJF0wIXNu+eNZ4Mg3YxfN+8as3R0JdQKG+wbtHDP+lSaPH6Z19BQYY/w56/imGAaJgM2Q7TxMwug2XganrQ7psi0+Gg99Z5snp58=; 7:2DOnn2l1Kv6blJF54WIyrhG8pjqeDKRcvltNa2sXcyINc7hplWJPuZzby4gEofYYqszq7+hziz5uraSxeGWzsbuvVLfEZYLPnzvrKi1VZ8nQ/iuSD1duVH6g3aDB4nLewXOmavvsGDPDJvQElVKfgphgOMJcbuxvEvjC0501wH2jPqF9o1nWFmO+UkQZK4yamjc+ARjTkwPpCzDvURI0sxkUlYHVZkvu9C3Bbwj1kpE= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: quantenna.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 15 Oct 2017 20:53:50.1295 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: a355dbce-62b4-4789-9446-c1d5582180ff X-MS-Exchange-Transport-CrossTenantHeadersStamped: SN1PR05MB1934 Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Current recovery approach is to wake s/w Tx queues for skb->dev netdevice. However this approach doesn't cover the case when h/w queue is full of packets from a single wireless interface. Suppose xmit attempt from the second wireless interface fails due to failed reclaim. Then the second interface will not have a chance to recover even if subsequent reclaims succeed. Possible solution is to attempt to wake all the s/w queues belonging to driver interfaces. Signed-off-by: Sergey Matyukevich --- drivers/net/wireless/quantenna/qtnfmac/core.c | 27 ++++++++++++++++++++++ drivers/net/wireless/quantenna/qtnfmac/core.h | 1 + .../net/wireless/quantenna/qtnfmac/pearl/pcie.c | 13 +++++++---- .../quantenna/qtnfmac/pearl/pcie_bus_priv.h | 1 + 4 files changed, 37 insertions(+), 5 deletions(-) diff --git a/drivers/net/wireless/quantenna/qtnfmac/core.c b/drivers/net/wireless/quantenna/qtnfmac/core.c index 5e60180482d1..5fd1a9c8b733 100644 --- a/drivers/net/wireless/quantenna/qtnfmac/core.c +++ b/drivers/net/wireless/quantenna/qtnfmac/core.c @@ -618,6 +618,33 @@ struct net_device *qtnf_classify_skb(struct qtnf_bus *bus, struct sk_buff *skb) } EXPORT_SYMBOL_GPL(qtnf_classify_skb); +void qtnf_wake_all_queues(struct net_device *ndev) +{ + struct qtnf_vif *vif = qtnf_netdev_get_priv(ndev); + struct qtnf_wmac *mac; + struct qtnf_bus *bus; + int macid; + int i; + + if (unlikely(!vif || !vif->mac || !vif->mac->bus)) + return; + + bus = vif->mac->bus; + + for (macid = 0; macid < QTNF_MAX_MAC; macid++) { + if (!(bus->hw_info.mac_bitmap & BIT(macid))) + continue; + + mac = bus->mac[macid]; + for (i = 0; i < QTNF_MAX_INTF; i++) { + vif = &mac->iflist[i]; + if (vif->netdev && netif_queue_stopped(vif->netdev)) + netif_tx_wake_all_queues(vif->netdev); + } + } +} +EXPORT_SYMBOL_GPL(qtnf_wake_all_queues); + MODULE_AUTHOR("Quantenna Communications"); MODULE_DESCRIPTION("Quantenna 802.11 wireless LAN FullMAC driver."); MODULE_LICENSE("GPL"); diff --git a/drivers/net/wireless/quantenna/qtnfmac/core.h b/drivers/net/wireless/quantenna/qtnfmac/core.h index 49ae700f66f0..da2c24e2271d 100644 --- a/drivers/net/wireless/quantenna/qtnfmac/core.h +++ b/drivers/net/wireless/quantenna/qtnfmac/core.h @@ -153,6 +153,7 @@ int qtnf_cmd_send_get_phy_params(struct qtnf_wmac *mac); struct qtnf_wmac *qtnf_core_get_mac(const struct qtnf_bus *bus, u8 macid); struct net_device *qtnf_classify_skb(struct qtnf_bus *bus, struct sk_buff *skb); +void qtnf_wake_all_queues(struct net_device *ndev); void qtnf_virtual_intf_cleanup(struct net_device *ndev); void qtnf_netdev_updown(struct net_device *ndev, bool up); diff --git a/drivers/net/wireless/quantenna/qtnfmac/pearl/pcie.c b/drivers/net/wireless/quantenna/qtnfmac/pearl/pcie.c index a8f2c46f3a25..3d88a0b2b5f5 100644 --- a/drivers/net/wireless/quantenna/qtnfmac/pearl/pcie.c +++ b/drivers/net/wireless/quantenna/qtnfmac/pearl/pcie.c @@ -617,9 +617,10 @@ static void qtnf_pcie_data_tx_reclaim(struct qtnf_pcie_bus_priv *priv) if (skb->dev) { skb->dev->stats.tx_packets++; skb->dev->stats.tx_bytes += skb->len; - - if (netif_queue_stopped(skb->dev)) - netif_wake_queue(skb->dev); + if (unlikely(priv->tx_stopped)) { + qtnf_wake_all_queues(skb->dev); + priv->tx_stopped = 0; + } } dev_kfree_skb_any(skb); @@ -666,8 +667,10 @@ static int qtnf_pcie_data_tx(struct qtnf_bus *bus, struct sk_buff *skb) int ret = 0; if (!qtnf_tx_queue_ready(priv)) { - if (skb->dev) - netif_stop_queue(skb->dev); + if (skb->dev) { + netif_tx_stop_all_queues(skb->dev); + priv->tx_stopped = 1; + } return NETDEV_TX_BUSY; } diff --git a/drivers/net/wireless/quantenna/qtnfmac/pearl/pcie_bus_priv.h b/drivers/net/wireless/quantenna/qtnfmac/pearl/pcie_bus_priv.h index e76a23716ee0..e477abec5f3b 100644 --- a/drivers/net/wireless/quantenna/qtnfmac/pearl/pcie_bus_priv.h +++ b/drivers/net/wireless/quantenna/qtnfmac/pearl/pcie_bus_priv.h @@ -35,6 +35,7 @@ struct qtnf_pcie_bus_priv { /* lock for tx reclaim operations */ spinlock_t tx_reclaim_lock; u8 msi_enabled; + u8 tx_stopped; int mps; struct workqueue_struct *workqueue;