Skip to content

RFC PMD driver for AF_XDP

Qi Zhang dpdk-dev 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 RFC Latest7 patches 15 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/7net/af_xdp: new PMD driverconfig/common_base config/common_linuxapp drivers/net/Makefile +6 more+900 -06 replies
2/7lib/mbuf: enable parse flags when create mempoollib/librte_mbuf/rte_mbuf.c lib/librte_mbuf/rte_mbuf.h+19 -40 replies
3/7lib/mempool: allow page size aligned mempoollib/librte_mempool/rte_mempool.c lib/librte_mempool/rte_mempool.h+3 -00 replies
4/7net/af_xdp: use mbuf mempool for buffer managementdrivers/net/af_xdp/rte_eth_af_xdp.c+97 -681 reply
5/7net/af_xdp: enable share mempooldrivers/net/af_xdp/rte_eth_af_xdp.c+125 -660 replies
6/7net/af_xdp: load BPF filedrivers/net/af_xdp/Makefile drivers/net/af_xdp/bpf_load.c drivers/net/af_xdp/bpf_load.h +3 more+1097 -41 reply
7/7app/testpmd: enable parameter for mempool flagsapp/test-pmd/parameters.c app/test-pmd/testpmd.c app/test-pmd/testpmd.h+22 -60 replies

Reviews trailers per patch

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

Read the v1 thread

Cover letter [RFC 0/7] PMD driver for AF_XDP

The RFC patches add a new PMD driver for AF_XDP which is a proposed faster version of AF_PACKET interface in Linux, see below link for detail AF_XDP introduction:
https://fosdem.org/2018/schedule/event/af_xdp/
https://lwn.net/Articles/745934/

This patchset is base on v18.02.
It also require a linux kernel that have below AF_XDP RFC patches be applied.
https://patchwork.ozlabs.org/patch/867961/
https://patchwork.ozlabs.org/patch/867960/
https://patchwork.ozlabs.org/patch/867938/
https://patchwork.ozlabs.org/patch/867939/
https://patchwork.ozlabs.org/patch/867940/
https://patchwork.ozlabs.org/patch/867941/
https://patchwork.ozlabs.org/patch/867942/
https://patchwork.ozlabs.org/patch/867943/
https://patchwork.ozlabs.org/patch/867944/
https://patchwork.ozlabs.org/patch/867945/
https://patchwork.ozlabs.org/patch/867946/
https://patchwork.ozlabs.org/patch/867947/
https://patchwork.ozlabs.org/patch/867948/
https://patchwork.ozlabs.org/patch/867949/
https://patchwork.ozlabs.org/patch/867950/
https://patchwork.ozlabs.org/patch/867951/
https://patchwork.ozlabs.org/patch/867952/
https://patchwork.ozlabs.org/patch/867953/
https://patchwork.ozlabs.org/patch/867954/
https://patchwork.ozlabs.org/patch/867955/
https://patchwork.ozlabs.org/patch/867956/
https://patchwork.ozlabs.org/patch/867957/
https://patchwork.ozlabs.org/patch/867958/
https://patchwork.ozlabs.org/patch/867959/

There is no clean upstream target yet since kernel patch is still in RFC stage, The purpose of the patchset is just for anyone that want to eveluate af_xdp with DPDK application and get feedback for further improvement.

To try with the new PMD
1. compile and install the kernel with above patches applied.
2. configure $LINUX_HEADER_DIR (dir of "make headers_install") and $TOOLS_DIR (dir at <kernel_src>/tools) at driver/net/af_xdp/Makefile before compile DPDK.
3. make sure libelf and libbpf is installed.

BTW, performance test shows our PMD can reach 94%~98% of the orignal benchmark when share memory is enabled.

Qi Zhang (7):
net/af_xdp: new PMD driver
lib/mbuf: enable parse flags when create mempool lib/mempool: allow page size aligned mempool net/af_xdp: use mbuf mempool for buffer management net/af_xdp: enable share mempool net/af_xdp: load BPF file
app/testpmd: enable parameter for mempool flags

 app/test-pmd/parameters.c                     |  12 +
 app/test-pmd/testpmd.c                        |  15 +-
 app/test-pmd/testpmd.h                        |   1 +
 config/common_base                            |   5 +
 config/common_linuxapp                        |   1 +
 drivers/net/Makefile                          |   1 +
 drivers/net/af_xdp/Makefile                   |  60 ++
 drivers/net/af_xdp/bpf_load.c                 | 798 +++++++++++++++++++++++
 drivers/net/af_xdp/bpf_load.h                 |  65 ++
 drivers/net/af_xdp/libbpf.h                   | 199 ++++++
 drivers/net/af_xdp/meson.build                |   7 +
 drivers/net/af_xdp/rte_eth_af_xdp.c           | 878 ++++++++++++++++++++++++++
 drivers/net/af_xdp/rte_pmd_af_xdp_version.map |   4 +
 drivers/net/af_xdp/xdpsock_queue.h            |  62 ++
 lib/librte_mbuf/rte_mbuf.c                    |  15 +-
 lib/librte_mbuf/rte_mbuf.h                    |   8 +-
 lib/librte_mempool/rte_mempool.c              |   2 +
 lib/librte_mempool/rte_mempool.h              |   1 +
 mk/rte.app.mk                                 |   1 +
 19 files changed, 2125 insertions(+), 10 deletions(-)
 create mode 100644 drivers/net/af_xdp/Makefile
 create mode 100644 drivers/net/af_xdp/bpf_load.c
 create mode 100644 drivers/net/af_xdp/bpf_load.h
 create mode 100644 drivers/net/af_xdp/libbpf.h
 create mode 100644 drivers/net/af_xdp/meson.build
 create mode 100644 drivers/net/af_xdp/rte_eth_af_xdp.c
 create mode 100644 drivers/net/af_xdp/rte_pmd_af_xdp_version.map
 create mode 100644 drivers/net/af_xdp/xdpsock_queue.h
Signature · 1 line
2.13.6