From patchwork Mon Jan 28 15:36:19 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Maya Erez X-Patchwork-Id: 10783913 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-2.web.codeaurora.org (Postfix) with ESMTP id E621791E for ; Mon, 28 Jan 2019 15:42:45 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id D57432B707 for ; Mon, 28 Jan 2019 15:42:45 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id D3C292B752; Mon, 28 Jan 2019 15:42:45 +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.9 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI, 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 66E3A2B707 for ; Mon, 28 Jan 2019 15:42:45 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726804AbfA1Pmo (ORCPT ); Mon, 28 Jan 2019 10:42:44 -0500 Received: from alexa-out-ams-02.qualcomm.com ([185.23.61.163]:19718 "EHLO alexa-out-ams-02.qualcomm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726779AbfA1Pmn (ORCPT ); Mon, 28 Jan 2019 10:42:43 -0500 X-Greylist: delayed 371 seconds by postgrey-1.27 at vger.kernel.org; Mon, 28 Jan 2019 10:42:40 EST X-IronPort-AV: E=Sophos;i="5.56,534,1539640800"; d="scan'208";a="1881353" Received: from ironmsg03-ams.qualcomm.com ([10.251.56.4]) by alexa-out-ams-02.qualcomm.com with ESMTP; 28 Jan 2019 16:36:31 +0100 X-IronPort-AV: E=McAfee;i="5900,7806,9150"; a="7037503" Received: from lx-merez1.mea.qualcomm.com ([10.18.173.103]) by ironmsg03-ams.qualcomm.com with ESMTP; 28 Jan 2019 16:36:30 +0100 From: Maya Erez To: Kalle Valo Cc: Dedy Lansky , linux-wireless@vger.kernel.org, wil6210@qti.qualcomm.com, Maya Erez Subject: [PATCH v2 05/12] wil6210: add option to drop Tx packets when tx ring is full Date: Mon, 28 Jan 2019 17:36:19 +0200 Message-Id: <1548689786-23288-6-git-send-email-merez@codeaurora.org> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1548689786-23288-1-git-send-email-merez@codeaurora.org> References: <1548689786-23288-1-git-send-email-merez@codeaurora.org> 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 From: Dedy Lansky In AP mode with multiple clients, driver stops net queue (netif_tx_stop_queue) upon first ring (serving specific client) becoming full. This can have negative effect on transmission to other clients which may still have room in their corresponding rings. Implement new policy in which stop/wake net queue are not used. In case there is no room in the ring for a transmitted packet, drop the packet. New policy is disabled by default and can be enabled with new drop_if_ring_full module param. Signed-off-by: Dedy Lansky Signed-off-by: Maya Erez --- drivers/net/wireless/ath/wil6210/txrx.c | 6 ++++++ drivers/net/wireless/ath/wil6210/wil_platform.h | 2 ++ 2 files changed, 8 insertions(+) diff --git a/drivers/net/wireless/ath/wil6210/txrx.c b/drivers/net/wireless/ath/wil6210/txrx.c index 51ff242..00996f1 100644 --- a/drivers/net/wireless/ath/wil6210/txrx.c +++ b/drivers/net/wireless/ath/wil6210/txrx.c @@ -2064,6 +2064,10 @@ static inline void __wil_update_net_queues(struct wil6210_priv *wil, wil_dbg_txrx(wil, "check_stop=%d, mid=%d, stopped=%d", check_stop, vif->mid, vif->net_queue_stopped); + if (ring && wil->config.drop_if_ring_full) + /* no need to stop/wake net queues */ + return; + if (ring && WIL_Q_PER_STA_USED(vif)) { __wil_update_net_queues_per_sta(wil, vif, ring, check_stop); return; @@ -2227,6 +2231,8 @@ netdev_tx_t wil_start_xmit(struct sk_buff *skb, struct net_device *ndev) dev_kfree_skb_any(skb); return NETDEV_TX_OK; case -ENOMEM: + if (wil->config.drop_if_ring_full) + goto drop; return NETDEV_TX_BUSY; default: break; /* goto drop; */ diff --git a/drivers/net/wireless/ath/wil6210/wil_platform.h b/drivers/net/wireless/ath/wil6210/wil_platform.h index aca5d0d..986985c 100644 --- a/drivers/net/wireless/ath/wil6210/wil_platform.h +++ b/drivers/net/wireless/ath/wil6210/wil_platform.h @@ -64,6 +64,8 @@ struct wil_platform_config { u8 ac_queues; /* enable allocating tx queue(s) per station, default - no */ u8 q_per_sta; + /* drop Tx packets in case tx ring is full, default - no */ + u8 drop_if_ring_full; }; /**