[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20210621134902.83587-4-coiby.xu@gmail.com>
Date: Mon, 21 Jun 2021 21:48:46 +0800
From: Coiby Xu <coiby.xu@...il.com>
To: linux-staging@...ts.linux.dev
Cc: netdev@...r.kernel.org,
Benjamin Poirier <benjamin.poirier@...il.com>,
Shung-Hsi Yu <shung-hsi.yu@...e.com>,
Manish Chopra <manishc@...vell.com>,
GR-Linux-NIC-Dev@...vell.com (supporter:QLOGIC QLGE 10Gb ETHERNET
DRIVER), Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
linux-kernel@...r.kernel.org (open list)
Subject: [RFC 03/19] staging: qlge: alloc skb with only enough room for header when data is put in the fragments
Data is put in the fragments. No need to alloc a skb with unnecessarily
large data buffer.
Suggested-by: Benjamin Poirier <benjamin.poirier@...il.com>
Signed-off-by: Coiby Xu <coiby.xu@...il.com>
---
drivers/staging/qlge/TODO | 2 --
drivers/staging/qlge/qlge_main.c | 4 ++--
2 files changed, 2 insertions(+), 4 deletions(-)
diff --git a/drivers/staging/qlge/TODO b/drivers/staging/qlge/TODO
index 0e26fac1ddc5..49cb09fc2be4 100644
--- a/drivers/staging/qlge/TODO
+++ b/drivers/staging/qlge/TODO
@@ -4,8 +4,6 @@
ql_build_rx_skb(). That function is now used exclusively to handle packets
that underwent header splitting but it still contains code to handle non
split cases.
-* in the "chain of large buffers" case, the driver uses an skb allocated with
- head room but only puts data in the frags.
* rename "rx" queues to "completion" queues. Calling tx completion queues "rx
queues" is confusing.
* struct rx_ring is used for rx and tx completions, with some members relevant
diff --git a/drivers/staging/qlge/qlge_main.c b/drivers/staging/qlge/qlge_main.c
index 6dd69b689a58..c91969b01bd5 100644
--- a/drivers/staging/qlge/qlge_main.c
+++ b/drivers/staging/qlge/qlge_main.c
@@ -1471,7 +1471,7 @@ static void qlge_process_mac_rx_page(struct qlge_adapter *qdev,
struct napi_struct *napi = &rx_ring->napi;
size_t hlen = ETH_HLEN;
- skb = netdev_alloc_skb(ndev, length);
+ skb = napi_alloc_skb(&rx_ring->napi, SMALL_BUFFER_SIZE);
if (!skb) {
rx_ring->rx_dropped++;
put_page(lbq_desc->p.pg_chunk.page);
@@ -1765,7 +1765,7 @@ static struct sk_buff *qlge_build_rx_skb(struct qlge_adapter *qdev,
* jumbo mtu on a non-TCP/UDP frame.
*/
lbq_desc = qlge_get_curr_lchunk(qdev, rx_ring);
- skb = netdev_alloc_skb(qdev->ndev, length);
+ skb = napi_alloc_skb(&rx_ring->napi, SMALL_BUFFER_SIZE);
if (!skb) {
netif_printk(qdev, probe, KERN_DEBUG, qdev->ndev,
"No skb available, drop the packet.\n");
--
2.32.0
Powered by blists - more mailing lists