.. | .. |
---|
| 1 | +// SPDX-License-Identifier: GPL-2.0-only |
---|
1 | 2 | /**************************************************************************** |
---|
2 | 3 | * Driver for Solarflare network controllers and boards |
---|
3 | 4 | * Copyright 2005-2006 Fen Systems Ltd. |
---|
4 | 5 | * 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. |
---|
9 | 6 | */ |
---|
10 | 7 | |
---|
11 | 8 | #include <linux/socket.h> |
---|
.. | .. |
---|
113 | 110 | struct ef4_rx_page_state *state; |
---|
114 | 111 | unsigned index; |
---|
115 | 112 | |
---|
| 113 | + if (unlikely(!rx_queue->page_ring)) |
---|
| 114 | + return NULL; |
---|
116 | 115 | index = rx_queue->page_remove & rx_queue->page_ptr_mask; |
---|
117 | 116 | page = rx_queue->page_ring[index]; |
---|
118 | 117 | if (page == NULL) |
---|
.. | .. |
---|
143 | 142 | * ef4_init_rx_buffers - create EF4_RX_BATCH page-based RX buffers |
---|
144 | 143 | * |
---|
145 | 144 | * @rx_queue: Efx RX queue |
---|
| 145 | + * @atomic: control memory allocation flags |
---|
146 | 146 | * |
---|
147 | 147 | * This allocates a batch of pages, maps them for DMA, and populates |
---|
148 | 148 | * struct ef4_rx_buffers for each one. Return a negative error code or |
---|
.. | .. |
---|
295 | 295 | { |
---|
296 | 296 | struct ef4_rx_queue *rx_queue = ef4_channel_get_rx_queue(channel); |
---|
297 | 297 | |
---|
| 298 | + if (unlikely(!rx_queue->page_ring)) |
---|
| 299 | + return; |
---|
| 300 | + |
---|
298 | 301 | do { |
---|
299 | 302 | ef4_recycle_rx_page(channel, rx_buf); |
---|
300 | 303 | rx_buf = ef4_rx_buf_next(rx_queue, rx_buf); |
---|
.. | .. |
---|
319 | 322 | * This will aim to fill the RX descriptor queue up to |
---|
320 | 323 | * @rx_queue->@max_fill. If there is insufficient atomic |
---|
321 | 324 | * memory to do so, a slow fill will be scheduled. |
---|
| 325 | + * @atomic: control memory allocation flags |
---|
322 | 326 | * |
---|
323 | 327 | * The caller must provide serialisation (none is used here). In practise, |
---|
324 | 328 | * this means this function must run from the NAPI handler, or be called |
---|
.. | .. |
---|
427 | 431 | unsigned int n_frags, u8 *eh) |
---|
428 | 432 | { |
---|
429 | 433 | struct napi_struct *napi = &channel->napi_str; |
---|
430 | | - gro_result_t gro_result; |
---|
431 | 434 | struct ef4_nic *efx = channel->efx; |
---|
432 | 435 | struct sk_buff *skb; |
---|
433 | 436 | |
---|
.. | .. |
---|
463 | 466 | |
---|
464 | 467 | skb_record_rx_queue(skb, channel->rx_queue.core_index); |
---|
465 | 468 | |
---|
466 | | - gro_result = napi_gro_frags(napi); |
---|
467 | | - if (gro_result != GRO_DROP) |
---|
468 | | - channel->irq_mod_score += 2; |
---|
| 469 | + napi_gro_frags(napi); |
---|
469 | 470 | } |
---|
470 | 471 | |
---|
471 | 472 | /* Allocate and construct an SKB around page fragments */ |
---|