mbox series

[net-next,v6,0/3] enic: Use Page Pool API for receiving packets

Message ID 20250117080139.28018-1-johndale@cisco.com (mailing list archive)
Headers show
Series enic: Use Page Pool API for receiving packets | expand

Message

John Daley Jan. 17, 2025, 8:01 a.m. UTC
Use the Page Pool API for RX. The Page Pool API improves bandwidth and
CPU overhead by recycling pages instead of allocating new buffers in the
driver. Also, page pool fragment allocation for smaller MTUs is used
allow multiple packets to share pages.

RX code was moved to its own file and some refactoring was done
beforehand to make the page pool changes more trasparent and to simplify
the resulting code.

Signed-off-by: John Daley <johndale@cisco.com>

---
Changes in v2:
- Fixed a valid warning found by build_clang where a variable was used
  before it was initialized. The warnings in include/linux/mm.h were not
  addressed since they do not appear to be realated to this patchset.

Changes in v3:
- Moved a function to before where is was called and removed the forward
  declaration. Reworded a commit message. No functional changes.

Changes in v4:
- Replaced call to page_pool_put_page() with page_pool_put_full_page()
  since page_pool_dev_alloc() API is used and page_pool is created with
  PP_FLAG_DMA_SYNC_DEV flag.
- Reworded final commit message one more time to try to make it clear
  that there is just one fix for the commit.

Changes in v5:
- Removed link related patches from the patchset. These were merged
  seperately.
- Removed inappropriate calls to napi_free_frags()
- Moved pp_alloc_error out of ethtool stats and accumulate into netdev
  queue stat 'alloc_error'.

Changes in v6:
- Use the page pool API for all MTUs, not just <= PAGE_SIZE. Use page
  pool 'order' field to accomodate MTUs > PAGE_SIZE. Remove the
  function pointers and functions that handled the bigger MTUs.

John Daley (3):
  enic: Move RX functions to their own file
  enic: Simplify RX handler function
  enic: Use the Page Pool API for RX

 drivers/net/ethernet/cisco/enic/Makefile    |   2 +-
 drivers/net/ethernet/cisco/enic/enic.h      |   3 +
 drivers/net/ethernet/cisco/enic/enic_main.c | 264 ++------------------
 drivers/net/ethernet/cisco/enic/enic_rq.c   | 242 ++++++++++++++++++
 drivers/net/ethernet/cisco/enic/enic_rq.h   |  10 +
 drivers/net/ethernet/cisco/enic/vnic_rq.h   |   2 +
 6 files changed, 283 insertions(+), 240 deletions(-)
 create mode 100644 drivers/net/ethernet/cisco/enic/enic_rq.c
 create mode 100644 drivers/net/ethernet/cisco/enic/enic_rq.h