From patchwork Thu Dec 23 01:14:07 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: David Mosberger-Tang X-Patchwork-Id: 527678 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id F17D5C433EF for ; Thu, 23 Dec 2021 01:15:24 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1346296AbhLWBPS (ORCPT ); Wed, 22 Dec 2021 20:15:18 -0500 Received: from o1.ptr2625.egauge.net ([167.89.112.53]:27298 "EHLO o1.ptr2625.egauge.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1346225AbhLWBOm (ORCPT ); Wed, 22 Dec 2021 20:14:42 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=egauge.net; h=from:subject:in-reply-to:references:mime-version:to:cc: content-transfer-encoding:content-type; s=sgd; bh=lHfpOqhOfpDOCfOX9m8HbTSH198YL4xz6udBaxMWEhU=; b=He/CxrgZEFngolwjXHMJWEKjUhKIOSVokvqKUvxw4wiwguybmmU9i+segEnZplKOvvAG 5jmo4LObHAT+dvq7TfL61pUedZuzA7xhnxG9Yn6r5PRe2IgXT7UISNbitqvuozqKZmImf7 iimBVGIlEBTWSA5uCU57sYi2VtMP5BN//v1fvoU+KWrLQzm10T13c+t/adNTE4aITX7LTh B+8GmGlr0SOSWfl4f0hs8xcK6UAyYy71iptESF+BUtz7P5CBGJYLylyC15jowYBKtpqs2o 2g12eiVTJOVDT2YOcE+QWqGq5uO6lDsiOTqBbdpHenorb0i7f8cPtSbCxQ4vuE1w== Received: by filterdrecv-656998cfdd-gwqfx with SMTP id filterdrecv-656998cfdd-gwqfx-1-61C3CD5F-2 2021-12-23 01:14:07.065548949 +0000 UTC m=+7955180.472261611 Received: from pearl.egauge.net (unknown) by geopod-ismtpd-4-0 (SG) with ESMTP id jn2DgsfWQie8Tv6IdcNhoA Thu, 23 Dec 2021 01:14:06.899 +0000 (UTC) Received: by pearl.egauge.net (Postfix, from userid 1000) id DAF3270150E; Wed, 22 Dec 2021 18:14:05 -0700 (MST) From: David Mosberger-Tang Subject: [PATCH v2 44/50] wilc1000: don't allocate tx_buffer when zero-copy is available Date: Thu, 23 Dec 2021 01:14:07 +0000 (UTC) Message-Id: <20211223011358.4031459-45-davidm@egauge.net> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20211223011358.4031459-1-davidm@egauge.net> References: <20211223011358.4031459-1-davidm@egauge.net> MIME-Version: 1.0 X-SG-EID: +kMxBqj35EdRUKoy8diX1j4AXmPtd302oan+iXZuF8m2Nw4HRW2irNspffT/khET6RJF6+Prbl0h/EtF1rRLvCku2d01bUPHXOooMP+/Uf3qjDaNo4LbXVJ1cRCS8pJYe4aPxCLVg3LPM7wKTY3qogKRr+YpQH0519OH2M8hpB4NZjZKunaHEkmPPwism+S4DYZvqP2+CJrhK5vtcQLwAUmryUrxiEJsHMQ7VBwIoJ6o4EAWmLYChlo/lzTRj+pfIDF8IVBjo48BvdnDRQOwaQ== To: Ajay Singh Cc: Claudiu Beznea , Kalle Valo , "David S. Miller" , Jakub Kicinski , linux-wireless@vger.kernel.org, netdev@vger.kernel.org, linux-kernel@vger.kernel.org, David Mosberger-Tang X-Entity-ID: Xg4JGAcGrJFIz2kDG9eoaQ== Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org If a driver supports zero-copy transmit transfers, there is no need to have a transmit buffer. Signed-off-by: David Mosberger-Tang --- drivers/net/wireless/microchip/wilc1000/wlan.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/drivers/net/wireless/microchip/wilc1000/wlan.c b/drivers/net/wireless/microchip/wilc1000/wlan.c index d96a7e2a0bd59..d46d6e8122c8d 100644 --- a/drivers/net/wireless/microchip/wilc1000/wlan.c +++ b/drivers/net/wireless/microchip/wilc1000/wlan.c @@ -1604,12 +1604,12 @@ int wilc_wlan_init(struct net_device *dev) init_q_limits(wilc); - if (!wilc->tx_buffer) + if (!wilc->hif_func->hif_sk_buffs_tx && !wilc->tx_buffer) { wilc->tx_buffer = kmalloc(WILC_TX_BUFF_SIZE, GFP_KERNEL); - - if (!wilc->tx_buffer) { - ret = -ENOBUFS; - goto fail; + if (!wilc->tx_buffer) { + ret = -ENOBUFS; + goto fail; + } } if (!wilc->rx_buffer)