Skip to content

igc: Add support for AF_XDP zero-copy

Jithu Joseph intel-wired-lan 3 versions – New

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v6 Latest9 patches 0 repliesNew
  2. v59 patches 0 repliesSuperseded
  3. v49 patches 0 repliesSuperseded

Changes in v6 from the cover letter

Patch 8/9 - "igc: Enable RX via AF_XDP zero-copy"
* In XDP_PASS flow, copy metadata too into the skb.
* When h/w timestamp is added by the NIC, after copying it into a local variable, update xdp_buff->data_meta so that metadata length when XDP program is called 0.
* In igc_xdp_enable_pool(), call xsk_pool_dma_unmap() on failure.

Patches in v6 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/9igc: Move igc_xdp_is_enabled()drivers/net/ethernet/intel/igc/igc_main.c drivers/net/ethernet/intel/igc/igc_xdp.h+5 -51 reply
2/9igc: Refactor __igc_xdp_run_prog()drivers/net/ethernet/intel/igc/igc_main.c+28 -281 reply
3/9igc: Refactor igc_clean_rx_ring()drivers/net/ethernet/intel/igc/igc_main.c+14 -91 reply
4/9igc: Refactor XDP rxq info registrationdrivers/net/ethernet/intel/igc/igc_main.c drivers/net/ethernet/intel/igc/igc_xdp.c drivers/net/ethernet/intel/igc/igc_xdp.h+12 -341 reply
5/9igc: Introduce TX/RX stats helpersdrivers/net/ethernet/intel/igc/igc_main.c+31 -121 reply
6/9igc: Introduce igc_unmap_tx_buffer() helperdrivers/net/ethernet/intel/igc/igc_main.c+15 -341 reply
7/9igc: Replace IGC_TX_FLAGS_XDP flag by an enumdrivers/net/ethernet/intel/igc/igc.h drivers/net/ethernet/intel/igc/igc_main.c+28 -71 reply
8/9igc: Enable RX via AF_XDP zero-copydrivers/net/ethernet/intel/igc/igc.h drivers/net/ethernet/intel/igc/igc_base.h drivers/net/ethernet/intel/igc/igc_main.c +2 more+450 -191 reply
9/9igc: Enable TX via AF_XDP zero-copydrivers/net/ethernet/intel/igc/igc.h drivers/net/ethernet/intel/igc/igc_base.h drivers/net/ethernet/intel/igc/igc_main.c +1 more+129 -81 reply

Reviews trailers per patch

All 9 patches have a Reviewed-by or Acked-by.

PatchMaciej FijalkowskiDvora Fuxbrumer
1/9R-b T-b
2/9R-b T-b
3/9R-b T-b
4/9R-b T-b
5/9R-b T-b
6/9R-b T-b
7/9R-b T-b
8/9R-b T-b
9/9R-b T-b

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v6 thread

Cover letter [Intel-wired-lan] [PATCH v6 0/9] igc: Add support for AF_XDP zero-copy

Hi all,

This is the sixth version of this series which adds AF_XDP zero-copy support to igc driver.

This revision addresses review comments from Jakub Kicinski.

changes in v6:
Patch 8/9 - "igc: Enable RX via AF_XDP zero-copy"
* In XDP_PASS flow, copy metadata too into the skb.
* When h/w timestamp is added by the NIC, after copying it into a local variable, update xdp_buff->data_meta so that metadata length when XDP program is called 0.
* In igc_xdp_enable_pool(), call xsk_pool_dma_unmap() on failure.

Known issues (carried from v3):
When an XDP application is running in Tx-Only mode with Zero-Copy enabled, it is not expected to add the frames to the fill-queue. I have noticed the following two issues in this scenario:
- If XDP_USE_NEED_WAKEUP flag is not set by application, igc_poll() will go into infinite loop because the buffer allocation resulting in igc_clean_rx_irq_zc() indicating that all work is not done and NAPI should keep polling. This does not occur if XDP_USE_NEED_WAKEUP flag is set.
- Since there are no buffers allocated by userspace for the fill queue, there is no memory allocated for the NIC to copy the data to. If the packet received is destined to the hardware queue where XDP application is running, no packets are received even on other queues.
Both these issues can be mitigated by adding a few frames to the fill queue. The second issue can also be mitigated by making sure no packets are being received on the hardware queue where Rx is running.

v5 is here:

    https://patchwork.ozlabs.org/project/intel-wired-lan/cover/20210226002308.2348-1-jithu.joseph at intel.com/

v4 is here:

    https://patchwork.ozlabs.org/project/intel-wired-lan/cover/20210222090936.6768-1-jithu.joseph at intel.com/

v3 is here:

    https://patchwork.ozlabs.org/project/intel-wired-lan/cover/20210209024243.23406-1-vedang.patel at intel.com/

v2 is here:

    https://patchwork.ozlabs.org/project/intel-wired-lan/cover/20201223203705.78705-1-andre.guedes at intel.com/

v1 is here:

    https://patchwork.ozlabs.org/project/intel-wired-lan/cover/20201217202415.77891-1-andre.guedes at intel.com/

Andre Guedes (9):
igc: Move igc_xdp_is_enabled()
igc: Refactor __igc_xdp_run_prog()
igc: Refactor igc_clean_rx_ring()
igc: Refactor XDP rxq info registration
igc: Introduce TX/RX stats helpers
igc: Introduce igc_unmap_tx_buffer() helper
igc: Replace IGC_TX_FLAGS_XDP flag by an enum
igc: Enable RX via AF_XDP zero-copy
igc: Enable TX via AF_XDP zero-copy

 drivers/net/ethernet/intel/igc/igc.h      |  33 +-
 drivers/net/ethernet/intel/igc/igc_base.h |   2 +
 drivers/net/ethernet/intel/igc/igc_main.c | 658 ++++++++++++++++++----
 drivers/net/ethernet/intel/igc/igc_xdp.c  | 109 +++-
 drivers/net/ethernet/intel/igc/igc_xdp.h  |   8 +-
 5 files changed, 683 insertions(+), 127 deletions(-)
Signature · 1 line
2.17.1