RFC AF_XDP support for veth.
Get series with b4
b4 am [email protected]Versions newest first · linked by author and title
- v3 RFC Latest6 patches 3 repliesIn review
- v2 RFC3 patches 4 repliesSuperseded
- v1 RFC3 patches 6 repliesSuperseded
Changes in v3 from the cover letter
- refactor the xsk_umem_consume_tx_virtual, suggested by Björn Töpel
- fix the racy condition by processing tx and its peer's rx napi, suggested by Björn Töpel
- add AF_XDP zero copy TX
- add AF_XDP RX
Patches in v3 No applies recorded yet
| # | Subject and files | Size | Replies | Applied |
|---|---|---|---|---|
| 1/6 | xsk: add xsk_umem_consume_tx_virtual.include/ net/ net/ | +39 | 0 replies | |
| 2/6 | veth: support AF_XDP TX copy-mode.drivers/ | +199 | 3 replies | |
| 3/6 | xsk: add new MEM type for virtual device.include/ net/ net/ | +4 | 0 replies | |
| 4/6 | veth: add zero-copy AF_XDP TX support.drivers/ | +18 | 0 replies | |
| 5/6 | veth: add AF_XDP RX support.drivers/ | +17 | 0 replies | |
| 6/6 | samples: bpf: add veth AF_XDP example.samples/ | +82 | 0 replies |
Reviews trailers per patch
No Reviewed-by, Acked-by or Tested-by trailers for v3 yet.
Cover letter [PATCH bpf-next RFCv3 0/6] AF_XDP support for veth.
The patch series adds AF_XDP support for veth device. The first patch adds a new API for supporting non-physical NIC device to get packet's virtual address. The second patch implements the async xmit with one extra copy. The third and forth patches implement the zero copy AF_XDP TX support. The fifth patch implements the AF_XDP RX and last patch adds example use cases.
I tested with 2 namespaces, one as sender, the other as receiver. The packet rate is measure at the receiver side.
ip netns add at_ns0
ip link add p0 type veth peer name p1
ip link set p0 netns at_ns0
ip link set dev p1 up
ip netns exec at_ns0 ip link set dev p0 up
# receiver ip netns exec at_ns0 xdp_rxq_info --dev p0 --action XDP_DROP
# receiver with AF_XDP ip netns exec at_ns0 xdpsock -i p0 -r -N -z
# sender without AF_XDP ZC xdpsock -i p1 -t -S
# sender with AF_XDP xdpsock -i p1 -t -N -z
Without AF_XDP: 724 Kpps
With AF_XDP: 1.1 Mpps (with ksoftirqd 100% cpu)
With AF_XDP: 1.4 Mpps (with ksoftirqd 100% cpu)
With both peer running AF_XDP: 2.4Mpps
v2->v3:
- refactor the xsk_umem_consume_tx_virtual, suggested by Björn Töpel
- fix the racy condition by processing tx and its peer's rx napi, suggested by Björn Töpel
- add AF_XDP zero copy TX
- add AF_XDP RX
v1->v2:
- refactor the xsk_umem_consume_tx_virtual
- use the umems provided by netdev
- fix bug from locating peer side rq with qid
William Tu (6):
xsk: add xsk_umem_consume_tx_virtual.
veth: support AF_XDP TX copy-mode.
xsk: add new MEM type for virtual device.
veth: add zero-copy AF_XDP TX support.
veth: add AF_XDP RX support.
samples: bpf: add veth AF_XDP example.
drivers/net/veth.c | 212 ++++++++++++++++++++++++++++++++++++++++- include/net/xdp.h | 1 + include/net/xdp_sock.h | 7 ++ net/core/xdp.c | 1 + net/xdp/xdp_umem.c | 1 + net/xdp/xsk.c | 41 ++++++-- samples/bpf/test_veth_afxdp.sh | 82 ++++++++++++++++ 7 files changed, 336 insertions(+), 9 deletions(-) create mode 100755 samples/bpf/test_veth_afxdp.sh
Signature · 1 line
2.7.4