hc
2024-12-19 9370bb92b2d16684ee45cf24e879c93c509162da
kernel/drivers/net/ethernet/sfc/falcon/rx.c
....@@ -1,11 +1,8 @@
1
+// SPDX-License-Identifier: GPL-2.0-only
12 /****************************************************************************
23 * Driver for Solarflare network controllers and boards
34 * Copyright 2005-2006 Fen Systems Ltd.
45 * Copyright 2005-2013 Solarflare Communications Inc.
5
- *
6
- * This program is free software; you can redistribute it and/or modify it
7
- * under the terms of the GNU General Public License version 2 as published
8
- * by the Free Software Foundation, incorporated herein by reference.
96 */
107
118 #include <linux/socket.h>
....@@ -113,6 +110,8 @@
113110 struct ef4_rx_page_state *state;
114111 unsigned index;
115112
113
+ if (unlikely(!rx_queue->page_ring))
114
+ return NULL;
116115 index = rx_queue->page_remove & rx_queue->page_ptr_mask;
117116 page = rx_queue->page_ring[index];
118117 if (page == NULL)
....@@ -143,6 +142,7 @@
143142 * ef4_init_rx_buffers - create EF4_RX_BATCH page-based RX buffers
144143 *
145144 * @rx_queue: Efx RX queue
145
+ * @atomic: control memory allocation flags
146146 *
147147 * This allocates a batch of pages, maps them for DMA, and populates
148148 * struct ef4_rx_buffers for each one. Return a negative error code or
....@@ -295,6 +295,9 @@
295295 {
296296 struct ef4_rx_queue *rx_queue = ef4_channel_get_rx_queue(channel);
297297
298
+ if (unlikely(!rx_queue->page_ring))
299
+ return;
300
+
298301 do {
299302 ef4_recycle_rx_page(channel, rx_buf);
300303 rx_buf = ef4_rx_buf_next(rx_queue, rx_buf);
....@@ -319,6 +322,7 @@
319322 * This will aim to fill the RX descriptor queue up to
320323 * @rx_queue->@max_fill. If there is insufficient atomic
321324 * memory to do so, a slow fill will be scheduled.
325
+ * @atomic: control memory allocation flags
322326 *
323327 * The caller must provide serialisation (none is used here). In practise,
324328 * this means this function must run from the NAPI handler, or be called
....@@ -427,7 +431,6 @@
427431 unsigned int n_frags, u8 *eh)
428432 {
429433 struct napi_struct *napi = &channel->napi_str;
430
- gro_result_t gro_result;
431434 struct ef4_nic *efx = channel->efx;
432435 struct sk_buff *skb;
433436
....@@ -463,9 +466,7 @@
463466
464467 skb_record_rx_queue(skb, channel->rx_queue.core_index);
465468
466
- gro_result = napi_gro_frags(napi);
467
- if (gro_result != GRO_DROP)
468
- channel->irq_mod_score += 2;
469
+ napi_gro_frags(napi);
469470 }
470471
471472 /* Allocate and construct an SKB around page fragments */