From patchwork Thu Dec 14 16:53:11 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Maya Erez X-Patchwork-Id: 10112705 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 A3CB460327 for ; Thu, 14 Dec 2017 16:53:32 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 9821329C78 for ; Thu, 14 Dec 2017 16:53:32 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 8CB7929C9A; Thu, 14 Dec 2017 16:53:32 +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=-6.8 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI,T_DKIM_INVALID 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 2F9F529C99 for ; Thu, 14 Dec 2017 16:53:32 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753557AbdLNQxa (ORCPT ); Thu, 14 Dec 2017 11:53:30 -0500 Received: from alexa-out.qualcomm.com ([129.46.98.28]:17927 "EHLO alexa-out.qualcomm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753524AbdLNQx3 (ORCPT ); Thu, 14 Dec 2017 11:53:29 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=qca.qualcomm.com; i=@qca.qualcomm.com; q=dns/txt; s=qcdkim; t=1513270409; x=1544806409; h=from:to:cc:subject:date:message-id:in-reply-to: references; bh=14V+h2rd+Jk97bXrvjILAZmjzD0q1YSaMNnTqTNPz9I=; b=DC628lVofYbth6vl5D0mat61N31q0+MYjAJPqzrcv5uxqoU+2OxFtGNb 1AlC3n7tC92Rhdvc+5jMer63XQLLXjD3MSl5A4jwDMxk0c6HIC0KVN/5F S38p7DGEzAifUSMkpt2FjUPZ3Ml/7jH41ZRUskqcYUqqlLIPhBKgaPGsa g=; Received: from ironmsg03-sd.qualcomm.com ([10.53.140.143]) by alexa-out.qualcomm.com with ESMTP/TLS/AES256-SHA; 14 Dec 2017 08:53:29 -0800 X-IronPort-AV: E=McAfee;i="5900,7806,8744"; a="3345946" X-MGA-submission: =?us-ascii?q?MDHT33FxWvFfg7q9T9Dli3N+0nlC35DazE7RhU?= =?us-ascii?q?eggBuRPkLqtKuv9Y8rqy+l4kBqc2icUUC7+U+49S+NDIpI+Hn4MXQNlu?= =?us-ascii?q?6F+w4YCzGDUgH53YzO7ao5QHXmu1wxVhID/Qa4juflbbC9lODiivDmpX?= =?us-ascii?q?9F?= Received: from lx-merez1.mea.qualcomm.com ([10.18.173.103]) by ironmsg03-sd.qualcomm.com with ESMTP; 14 Dec 2017 08:53:27 -0800 From: Maya Erez To: Kalle Valo Cc: Lior David , linux-wireless@vger.kernel.org, wil6210@qca.qualcomm.com, Maya Erez Subject: [PATCH v2 7/9] wil6210: configurable broadcast TX MCS Date: Thu, 14 Dec 2017 18:53:11 +0200 Message-Id: <1513270393-919-8-git-send-email-qca_merez@qca.qualcomm.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1513270393-919-1-git-send-email-qca_merez@qca.qualcomm.com> References: <1513270393-919-1-git-send-email-qca_merez@qca.qualcomm.com> 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: Lior David Add 2 module parameters that control broadcast/multicast TX packets: 1. bcast_mcs0_limit - specify the maximum packet size that will be sent with MCS 0. 2. bcast_mcs - specify the MCS index to use when sending packets larger than above limit. Signed-off-by: Lior David Signed-off-by: Maya Erez --- drivers/net/wireless/ath/wil6210/txrx.c | 59 +++++++++++++++++++++++++++++++-- 1 file changed, 57 insertions(+), 2 deletions(-) diff --git a/drivers/net/wireless/ath/wil6210/txrx.c b/drivers/net/wireless/ath/wil6210/txrx.c index 89967ce..4fc05f7 100644 --- a/drivers/net/wireless/ath/wil6210/txrx.c +++ b/drivers/net/wireless/ath/wil6210/txrx.c @@ -67,6 +67,60 @@ static int headroom_size_set(const char *val, const struct kernel_param *kp) MODULE_PARM_DESC(headroom_size, " headroom size for rx skb allocation, default - 0"); +static uint bcast_mcs0_limit = WIL_BCAST_MCS0_LIMIT; +static int bcast_mcs0_limit_set(const char *val, const struct kernel_param *kp) +{ + int ret; + uint saved = bcast_mcs0_limit; + + ret = param_set_uint(val, kp); + if (ret) + return ret; + + if (bcast_mcs0_limit > WIL_BCAST_MCS0_LIMIT) { + bcast_mcs0_limit = saved; + ret = -EINVAL; + } + + return ret; +} + +static const struct kernel_param_ops bcast_mcs0_limit_ops = { + .set = bcast_mcs0_limit_set, + .get = param_get_uint, +}; + +module_param_cb(bcast_mcs0_limit_set, &bcast_mcs0_limit_ops, + &bcast_mcs0_limit, 0644); +MODULE_PARM_DESC(bcast_mcs0_limit, + " max broadcast packet size with MCS0, default - 1024 bytes"); + +static uint bcast_mcs = 1; +static int bcast_mcs_set(const char *val, const struct kernel_param *kp) +{ + int ret; + uint saved = bcast_mcs; + + ret = param_set_uint(val, kp); + if (ret) + return ret; + + if (bcast_mcs > WIL_MCS_MAX || bcast_mcs == 0) { + bcast_mcs = saved; + ret = -EINVAL; + } + + return ret; +} + +static const struct kernel_param_ops bcast_mcs_ops = { + .set = bcast_mcs_set, + .get = param_get_uint, +}; + +module_param_cb(bcast_mcs, &bcast_mcs_ops, &bcast_mcs, 0644); +MODULE_PARM_DESC(bcast_mcs, " MCS index for large bcast TX, default - 1"); + static inline uint wil_rx_snaplen(void) { return rx_align_2 ? 6 : 0; @@ -1783,8 +1837,9 @@ static int __wil_tx_vring(struct wil6210_priv *wil, struct vring *vring, wil_tx_desc_map(d, pa, len, vring_index); if (unlikely(mcast)) { d->mac.d[0] |= BIT(MAC_CFG_DESC_TX_0_MCS_EN_POS); /* MCS 0 */ - if (unlikely(len > WIL_BCAST_MCS0_LIMIT)) /* set MCS 1 */ - d->mac.d[0] |= (1 << MAC_CFG_DESC_TX_0_MCS_INDEX_POS); + if (unlikely(len > bcast_mcs0_limit)) /* use bcast_mcs */ + d->mac.d[0] |= (bcast_mcs << + MAC_CFG_DESC_TX_0_MCS_INDEX_POS); } /* Process TCP/UDP checksum offloading */ if (unlikely(wil_tx_desc_offload_setup(d, skb))) {