libeth_rx_alloc() always allocates with GFP_ATOMIC, including when a
driver fills its Rx rings at open or on queue reconfiguration. That
fill runs in process context, right after page_pool_create() and before
the queues' NAPI is enabled, so it may sleep, and GFP_ATOMIC is
needlessly restrictive there: it can neither reclaim nor compact, while
the initial fill can allocate tens of thousands of buffers across all
queues.

Patch 1 adds __libeth_rx_alloc() taking a gfp_t parameter and turns
libeth_rx_alloc() into its GFP_ATOMIC wrapper.
Patch 2 switches idpf's initial Rx ring fill (both splitq and singleq)
to GFP_KERNEL.

v3:
  - rename libeth_rx_alloc_gfp() to __libeth_rx_alloc() and put the gfp
    argument on its own line in page_pool_alloc_netmem() (Alexander Lobakin)
v2: https://lore.kernel.org/r/[email protected]/
  - split into two patches (libeth helper and idpf consumer)
v1: https://lore.kernel.org/r/[email protected]/

Luigi Rizzo (2):
  libeth: add __libeth_rx_alloc() to specify allocation flags
  idpf: use GFP_KERNEL for the initial Rx ring fill

 .../ethernet/intel/idpf/idpf_singleq_txrx.c   |  7 +++---
 drivers/net/ethernet/intel/idpf/idpf_txrx.c   |  9 ++++---
 drivers/net/ethernet/intel/idpf/idpf_txrx.h   |  2 +-
 include/net/libeth/rx.h                       | 24 +++++++++++++++----
 4 files changed, 31 insertions(+), 11 deletions(-)

-- 
2.56.0.385.gac671c819a-goog

Reply via email to