From: William Tu Subject: [bpf-next RFC 0/3] AF_XDP support for veth. Date: Mon, 17 Dec 2018 11:39:42 -0800 Message-ID: <1545075585-27744-1-git-send-email-u9012063@gmail.com> To: bjorn.topel@gmail.com, magnus.karlsson@gmail.com, ast@kernel.org, daniel@iogearbox.net, netdev@vger.kernel.org, makita.toshiaki@lab.ntt.co.jp Return-path: Received: from mail-pl1-f195.google.com ([209.85.214.195]:44855 "EHLO mail-pl1-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726812AbeLQTkm (ORCPT ); Mon, 17 Dec 2018 14:40:42 -0500 Received: by mail-pl1-f195.google.com with SMTP id e11so5954463plt.11 for ; Mon, 17 Dec 2018 11:40:42 -0800 (PST) Sender: netdev-owner@vger.kernel.org List-ID: The patch series adds AF_XDP async xmit support for veth device. First patch add a new API for supporting non-physical NIC device to get packet's virtual address. The second patch implements the async xmit, 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 # sender with AF_XDP xdpsock -i p1 -t -N -z # or sender without AF_XDP xdpsock -i p1 -t -S Without AF_XDP: 724 Kpps RXQ stats RXQ:CPU pps issue-pps rx_queue_index 0:1 724339 0 rx_queue_index 0:sum 724339 With AF_XDP: 1.1 Mpps (with ksoftirqd 100% cpu) RXQ stats RXQ:CPU pps issue-pps rx_queue_index 0:3 1188181 0 rx_queue_index 0:sum 1188181 William Tu (3): xsk: add xsk_umem_consume_tx_virtual. veth: support AF_XDP. samples: bpf: add veth AF_XDP example. drivers/net/veth.c | 247 ++++++++++++++++++++++++++++++++++++++++- include/net/xdp_sock.h | 7 ++ net/xdp/xsk.c | 24 ++++ samples/bpf/test_veth_afxdp.sh | 67 +++++++++++ 4 files changed, 343 insertions(+), 2 deletions(-) create mode 100755 samples/bpf/test_veth_afxdp.sh -- 2.7.4