Skip to content

igb: Add support for AF_XDP zero-copy

Sriram Yagnaraman bpf intel-wired-lan netdev oe-kbuild-all 4 versions – In review

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v4 Latest4 patches 6 repliesIn review
  2. v34 patches 2 repliesSuperseded
  3. v24 patches 3 repliesSuperseded
Earlier versions · 1
VersionPostedPatchesRepliesStatus
v14 patches4 repliesSuperseded

Changes in v4 from the cover letter

- NULL check buffer_info in igb_dump before dereferencing (Simon Horman)

Patches in v4 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/4igb: prepare for AF_XDP zero-copy supportdrivers/net/ethernet/intel/igb/igb.h drivers/net/ethernet/intel/igb/igb_main.c+29 -150 replies
2/4igb: Introduce XSK data structures and helpersdrivers/net/ethernet/intel/igb/Makefile drivers/net/ethernet/intel/igb/igb.h drivers/net/ethernet/intel/igb/igb_main.c +1 more+233 -20 replies
3/4igb: add AF_XDP zero-copy Rx supportdrivers/net/ethernet/intel/igb/igb.h drivers/net/ethernet/intel/igb/igb_main.c drivers/net/ethernet/intel/igb/igb_xsk.c+336 -220 replies
4/4igb: add AF_XDP zero-copy Tx supportdrivers/net/ethernet/intel/igb/igb.h drivers/net/ethernet/intel/igb/igb_main.c drivers/net/ethernet/intel/igb/igb_xsk.c+101 -90 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v4 yet.

Read the v4 thread

Cover letter [PATCH iwl-next v4 0/4] igb: Add support for AF_XDP zero-copy

The first couple of patches adds helper funcctions to prepare for AF_XDP zero-copy support which comes in the last couple of patches, one each for Rx and TX paths.

As mentioned in v1 patchset [0], I don't have access to an actual IGB device to provide correct performance numbers. I have used Intel 82576EB emulator in QEMU [1] to test the changes to IGB driver.

The tests use one isolated vCPU for RX/TX and one isolated vCPU for the xdp-sock application [2]. Hope these measurements provide at the least some indication on the increase in performance when using ZC, especially in the TX path. It would be awesome if someone with a real IGB NIC can test the patch.

AF_XDP performance using 64 byte packets in Kpps.
Benchmark: XDP-SKB XDP-DRV XDP-DRV(ZC)
rxdrop 220 235 350
txpush 1.000 1.000 410
l2fwd 1.000 1.000 200

AF_XDP performance using 1500 byte packets in Kpps.
Benchmark: XDP-SKB XDP-DRV XDP-DRV(ZC)
rxdrop 200 210 310
txpush 1.000 1.000 410
l2fwd 0.900 1.000 160

[0]: https://lore.kernel.org/intel-wired-lan/[email protected]/
[1]: https://www.qemu.org/docs/master/system/devices/igb.html
[2]: https://github.com/xdp-project/bpf-examples/tree/master/AF_XDP-example

v3->v4:
- NULL check buffer_info in igb_dump before dereferencing (Simon Horman)

v2->v3:
- Avoid TX unit hang when using AF_XDP zero-copy by setting time_stamp on the tx_buffer_info
- Fix uninitialized nb_buffs (Simon Horman)

v1->v2:
- Use batch XSK APIs (Maciej Fijalkowski)
- Follow reverse xmas tree convention and remove the ternary operator use (Simon Horman)

Sriram Yagnaraman (4):
igb: prepare for AF_XDP zero-copy support
igb: Introduce XSK data structures and helpers
igb: add AF_XDP zero-copy Rx support
igb: add AF_XDP zero-copy Tx support

 drivers/net/ethernet/intel/igb/Makefile   |   2 +-
 drivers/net/ethernet/intel/igb/igb.h      |  35 +-
 drivers/net/ethernet/intel/igb/igb_main.c | 186 ++++++--
 drivers/net/ethernet/intel/igb/igb_xsk.c  | 522 ++++++++++++++++++++++
 4 files changed, 698 insertions(+), 47 deletions(-)
 create mode 100644 drivers/net/ethernet/intel/igb/igb_xsk.c
Signature · 1 line
2.34.1