From patchwork Thu Dec 14 16:53:10 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Maya Erez X-Patchwork-Id: 10112703 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 89B8160327 for ; Thu, 14 Dec 2017 16:53:30 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 7C95229C5F for ; Thu, 14 Dec 2017 16:53:30 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 6F72629C9C; Thu, 14 Dec 2017 16:53:30 +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 1D55029C99 for ; Thu, 14 Dec 2017 16:53:30 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753547AbdLNQx2 (ORCPT ); Thu, 14 Dec 2017 11:53:28 -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 S1753524AbdLNQx1 (ORCPT ); Thu, 14 Dec 2017 11:53:27 -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=1513270407; x=1544806407; h=cc:from:to:subject:date:message-id:in-reply-to: references; bh=eE538GU46lzs6f9lMB4TY0N97BkBzn9ryqlM0BflGtM=; b=oBV/X/8+6DOaVPZDw5mzx/mXPk/jPQt3rLgO1zWq9UENOFczKfXZQCM7 Aq8ILacgIzDZMUo2M8qgngh7M9VS3WlN3vyOiocMUG6Jg91mgYqeH82Wy i/Zie8C6b/Li3iiu7IOA8/NfMJjIu08NB18cLeUYqHl1ZazHUhJhFy22Z w=; 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:27 -0800 Cc: Lazar Alexei , linux-wireless@vger.kernel.org, wil6210@qca.qualcomm.com, Maya Erez X-IronPort-AV: E=McAfee;i="5900,7806,8744"; a="3345934" X-MGA-submission: =?us-ascii?q?MDHgvYzx/Ay/osrf0QRSL9tpFIKU5VfJ0zPPn+?= =?us-ascii?q?UDGByI2qMjoH1g9AY2uNXm5ewPT+2dfWBsqSVOJr1CGHedBGD7VOkHef?= =?us-ascii?q?9QJvvBBUjnqzOlQgK1c0U967/evU/34uXC+Sl4Eg87j7MqIDW1ANhp7b?= =?us-ascii?q?pc?= Received: from lx-merez1.mea.qualcomm.com ([10.18.173.103]) by ironmsg03-sd.qualcomm.com with ESMTP; 14 Dec 2017 08:53:25 -0800 From: Maya Erez To: Kalle Valo Subject: [PATCH v2 6/9] wil6210: add support for headroom configuration Date: Thu, 14 Dec 2017 18:53:10 +0200 Message-Id: <1513270393-919-7-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: Lazar Alexei Add module parameter for configuring the headroom size in the skb allocation. Signed-off-by: Lazar Alexei Signed-off-by: Maya Erez --- drivers/net/wireless/ath/wil6210/txrx.c | 28 +++++++++++++++++++++++++++- 1 file changed, 27 insertions(+), 1 deletion(-) diff --git a/drivers/net/wireless/ath/wil6210/txrx.c b/drivers/net/wireless/ath/wil6210/txrx.c index 62c04f0..89967ce 100644 --- a/drivers/net/wireless/ath/wil6210/txrx.c +++ b/drivers/net/wireless/ath/wil6210/txrx.c @@ -41,6 +41,32 @@ module_param(rx_large_buf, bool, 0444); MODULE_PARM_DESC(rx_large_buf, " allocate 8KB RX buffers, default - no"); +#define WIL6210_MAX_HEADROOM_SIZE (256) + +static ushort headroom_size; /* = 0; */ +static int headroom_size_set(const char *val, const struct kernel_param *kp) +{ + int ret; + + ret = param_set_uint(val, kp); + if (ret) + return ret; + + if (headroom_size > WIL6210_MAX_HEADROOM_SIZE) + return -EINVAL; + + return 0; +} + +static const struct kernel_param_ops headroom_ops = { + .set = headroom_size_set, + .get = param_get_ushort, +}; + +module_param_cb(headroom_size, &headroom_ops, &headroom_size, 0644); +MODULE_PARM_DESC(headroom_size, + " headroom size for rx skb allocation, default - 0"); + static inline uint wil_rx_snaplen(void) { return rx_align_2 ? 6 : 0; @@ -630,7 +656,7 @@ static int wil_rx_refill(struct wil6210_priv *wil, int count) u32 next_tail; int rc = 0; int headroom = ndev->type == ARPHRD_IEEE80211_RADIOTAP ? - WIL6210_RTAP_SIZE : 0; + WIL6210_RTAP_SIZE : headroom_size; for (; next_tail = wil_vring_next_tail(v), (next_tail != v->swhead) && (count-- > 0);