lkml.org 
[lkml]   [2021]   [Dec]   [22]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH v2 44/50] wilc1000: don't allocate tx_buffer when zero-copy is available
Date
If a driver supports zero-copy transmit transfers, there is no need to
have a transmit buffer.

Signed-off-by: David Mosberger-Tang <davidm@egauge.net>
---
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)
--
2.25.1
\
 
 \ /
  Last update: 2021-12-23 02:16    [W:0.243 / U:0.504 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site