netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jesper Dangaard Brouer <brouer@redhat.com>
To: Lorenzo Bianconi <lorenzo@kernel.org>
Cc: netdev@vger.kernel.org, bpf@vger.kernel.org, davem@davemloft.net,
	ast@kernel.org, daniel@iogearbox.net, toke@redhat.com,
	lorenzo.bianconi@redhat.com, dsahern@kernel.org,
	andrii.nakryiko@gmail.com, brouer@redhat.com
Subject: Re: [PATCH v3 bpf-next 8/9] samples/bpf: xdp_redirect_cpu: load a eBPF program on cpumap
Date: Wed, 24 Jun 2020 11:00:39 +0200	[thread overview]
Message-ID: <20200624110039.75d05bba@carbon> (raw)
In-Reply-To: <cba75456c04b1df529c20d5a94092fb1011c0628.1592947694.git.lorenzo@kernel.org>

On Tue, 23 Jun 2020 23:39:33 +0200
Lorenzo Bianconi <lorenzo@kernel.org> wrote:

> Extend xdp_redirect_cpu_{usr,kern}.c adding the possibility to load
> a XDP program on cpumap entries. The following options have been added:
> - mprog-name: cpumap entry program name
> - mprog-filename: cpumap entry program filename
> - redirect-device: output interface if the cpumap program performs a
>   XDP_REDIRECT to an egress interface
> - redirect-map: bpf map used to perform XDP_REDIRECT to an egress
>   interface
> - mprog-disable: disable loading XDP program on cpumap entries
> 
> Add xdp_pass, xdp_drop, xdp_redirect stats accounting
> 
> Co-developed-by: Jesper Dangaard Brouer <brouer@redhat.com>
> Signed-off-by: Jesper Dangaard Brouer <brouer@redhat.com>
> Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>

Acked-by: Jesper Dangaard Brouer <brouer@redhat.com>


Example command and output:

sudo ./xdp_redirect_cpu --dev i40e2 --qsize 64 --cpu 2 --prog xdp_cpu_map0 \
  --mprog-filename xdp1_kern.o   --mprog-name xdp1

Running XDP/eBPF prog_name:xdp_cpu_map0
XDP-cpumap      CPU:to  pps            drop-pps    extra-info
XDP-RX          4       17,904,077     0           0          
XDP-RX          total   17,904,077     0          
cpumap-enqueue    4:2   17,904,076     418,122     8.00       bulk-average
cpumap-enqueue  sum:2   17,904,076     418,122     8.00       bulk-average
cpumap_kthread  2       17,485,954     0           35,139     sched
cpumap_kthread  total   17,485,954     0           35,139     sched-sum
redirect_err    total   0              0          
xdp_exception   total   0              0          

2nd remote XDP/eBPF prog_name: xdp1
XDP-cpumap      CPU:to  xdp-pass       xdp-drop    xdp-redir
xdp-in-kthread  2       0              17,485,955  0         
xdp-in-kthread  total   0              17,485,955  0         



Another example, where RSS is deliberately setup to only hit CPU-0.

 $ sudo ./xdp_redirect_cpu --dev i40e2 --qsize 192 --cpu 2  --cpu 3 --cpu 4 \
    --prog xdp_cpu_map5_lb_hash_ip_pairs \
    --mprog-name xdp_redirect --redirect-device mlx5p1  --redirect-map tx_port

Running XDP/eBPF prog_name:xdp_cpu_map5_lb_hash_ip_pairs
XDP-cpumap      CPU:to  pps            drop-pps    extra-info
XDP-RX          0       10,603,984     0           0          
XDP-RX          total   10,603,984     0          
cpumap-enqueue    0:2   3,539,815      0           6.88       bulk-average
cpumap-enqueue  sum:2   3,539,815      0           6.88       bulk-average
cpumap-enqueue    0:3   3,554,091      0           6.88       bulk-average
cpumap-enqueue  sum:3   3,554,091      0           6.88       bulk-average
cpumap-enqueue    0:4   3,510,076      84          6.87       bulk-average
cpumap-enqueue  sum:4   3,510,076      84          6.87       bulk-average
cpumap_kthread  2       3,539,817      0           91,310     sched
cpumap_kthread  3       3,554,101      0           93,604     sched
cpumap_kthread  4       3,509,991      0           92,893     sched
cpumap_kthread  total   10,603,910     0           277,809    sched-sum
redirect_err    total   0              0          
xdp_exception   total   0              0          

2nd remote XDP/eBPF prog_name: xdp_redirect
XDP-cpumap      CPU:to  xdp-pass       xdp-drop    xdp-redir
xdp-in-kthread  2       0              0           3,539,818 
xdp-in-kthread  3       0              0           3,554,101 
xdp-in-kthread  4       0              0           3,509,991 
xdp-in-kthread  total   0              0           10,603,910

More performance test examples can be found here:
 https://github.com/xdp-project/xdp-project/blob/master/areas/cpumap/cpumap04-map-xdp-prog.org

-- 
Best regards,
  Jesper Dangaard Brouer
  MSc.CS, Principal Kernel Engineer at Red Hat
  LinkedIn: http://www.linkedin.com/in/brouer


  reply	other threads:[~2020-06-24  9:00 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-06-23 21:39 [PATCH v3 bpf-next 0/9] introduce support for XDP programs in CPUMAP Lorenzo Bianconi
2020-06-23 21:39 ` [PATCH v3 bpf-next 1/9] cpumap: use non-locked version __ptr_ring_consume_batched Lorenzo Bianconi
2020-06-23 21:39 ` [PATCH v3 bpf-next 2/9] net: Refactor xdp_convert_buff_to_frame Lorenzo Bianconi
2020-06-24  8:06   ` Jesper Dangaard Brouer
2020-06-23 21:39 ` [PATCH v3 bpf-next 3/9] samples/bpf: xdp_redirect_cpu_user: do not update bpf maps in option loop Lorenzo Bianconi
2020-06-23 21:39 ` [PATCH v3 bpf-next 4/9] cpumap: formalize map value as a named struct Lorenzo Bianconi
2020-06-24  8:08   ` Jesper Dangaard Brouer
2020-06-23 21:39 ` [PATCH v3 bpf-next 5/9] bpf: cpumap: add the possibility to attach an eBPF program to cpumap Lorenzo Bianconi
2020-06-24  8:12   ` Jesper Dangaard Brouer
2020-06-23 21:39 ` [PATCH v3 bpf-next 6/9] bpf: cpumap: implement XDP_REDIRECT for eBPF programs attached to map entries Lorenzo Bianconi
2020-06-24  8:32   ` Jesper Dangaard Brouer
2020-06-23 21:39 ` [PATCH v3 bpf-next 7/9] libbpf: add SEC name for xdp programs attached to CPUMAP Lorenzo Bianconi
2020-06-24  5:49   ` Andrii Nakryiko
2020-06-24  8:36     ` Jesper Dangaard Brouer
2020-06-24 14:29       ` Alexei Starovoitov
2020-06-25 14:26         ` [PATCH bpf] libbpf: adjust SEC short cut for expected attach type BPF_XDP_DEVMAP Jesper Dangaard Brouer
2020-06-25 16:58           ` Andrii Nakryiko
2020-06-25 21:12           ` Daniel Borkmann
2020-06-23 21:39 ` [PATCH v3 bpf-next 8/9] samples/bpf: xdp_redirect_cpu: load a eBPF program on cpumap Lorenzo Bianconi
2020-06-24  9:00   ` Jesper Dangaard Brouer [this message]
2020-06-23 21:39 ` [PATCH v3 bpf-next 9/9] selftest: add tests for XDP programs in CPUMAP entries Lorenzo Bianconi
2020-06-24  5:51   ` Andrii Nakryiko
2020-06-24 15:37     ` Lorenzo Bianconi

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20200624110039.75d05bba@carbon \
    --to=brouer@redhat.com \
    --cc=andrii.nakryiko@gmail.com \
    --cc=ast@kernel.org \
    --cc=bpf@vger.kernel.org \
    --cc=daniel@iogearbox.net \
    --cc=davem@davemloft.net \
    --cc=dsahern@kernel.org \
    --cc=lorenzo.bianconi@redhat.com \
    --cc=lorenzo@kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=toke@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).