[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <20191219061006.21980-1-bjorn.topel@gmail.com>
Date: Thu, 19 Dec 2019 07:09:58 +0100
From: Björn Töpel <bjorn.topel@...il.com>
To: netdev@...r.kernel.org, ast@...nel.org, daniel@...earbox.net
Cc: Björn Töpel <bjorn.topel@...il.com>,
bpf@...r.kernel.org, davem@...emloft.net,
jakub.kicinski@...ronome.com, hawk@...nel.org,
john.fastabend@...il.com, magnus.karlsson@...el.com,
jonathan.lemon@...il.com
Subject: [PATCH bpf-next v2 0/8] Simplify xdp_do_redirect_map()/xdp_do_flush_map() and XDP maps
This series aims to simplify the XDP maps and
xdp_do_redirect_map()/xdp_do_flush_map(), and to crank out some more
performance from XDP_REDIRECT scenarios.
The first part of the series simplifies all XDP_REDIRECT capable maps,
so that __XXX_flush_map() does not require the map parameter, by
moving the flush list from the map to global scope.
This results in that the map_to_flush member can be removed from
struct bpf_redirect_info, and its corresponding logic.
Simpler code, and more performance due to that checks/code per-packet
is moved to flush.
Pre-series performance:
$ sudo taskset -c 22 ./xdpsock -i enp134s0f0 -q 20 -n 1 -r -z
sock0@...134s0f0:20 rxdrop xdp-drv
pps pkts 1.00
rx 20,797,350 230,942,399
tx 0 0
$ sudo ./xdp_redirect_cpu --dev enp134s0f0 --cpu 22 xdp_cpu_map0
Running XDP/eBPF prog_name:xdp_cpu_map5_lb_hash_ip_pairs
XDP-cpumap CPU:to pps drop-pps extra-info
XDP-RX 20 7723038 0 0
XDP-RX total 7723038 0
cpumap_kthread total 0 0 0
redirect_err total 0 0
xdp_exception total 0 0
Post-series performance:
$ sudo taskset -c 22 ./xdpsock -i enp134s0f0 -q 20 -n 1 -r -z
sock0@...134s0f0:20 rxdrop xdp-drv
pps pkts 1.00
rx 21,524,979 86,835,327
tx 0 0
$ sudo ./xdp_redirect_cpu --dev enp134s0f0 --cpu 22 xdp_cpu_map0
Running XDP/eBPF prog_name:xdp_cpu_map5_lb_hash_ip_pairs
XDP-cpumap CPU:to pps drop-pps extra-info
XDP-RX 20 7840124 0 0
XDP-RX total 7840124 0
cpumap_kthread total 0 0 0
redirect_err total 0 0
xdp_exception total 0 0
Results: +3.5% and +1.5% for the ubenchmarks.
v1->v2 [1]:
* Removed 'unused-variable' compiler warning (Jakub)
[1] https://lore.kernel.org/bpf/20191218105400.2895-1-bjorn.topel@gmail.com/
Björn Töpel (8):
xdp: simplify devmap cleanup
xdp: simplify cpumap cleanup
xdp: fix graze->grace type-o in cpumap comments
xsk: make xskmap flush_list common for all map instances
xdp: make devmap flush_list common for all map instances
xdp: make cpumap flush_list common for all map instances
xdp: remove map_to_flush and map swap detection
xdp: simplify __bpf_tx_xdp_map()
include/linux/bpf.h | 8 ++---
include/linux/filter.h | 1 -
include/net/xdp_sock.h | 11 +++---
kernel/bpf/cpumap.c | 76 ++++++++++++++--------------------------
kernel/bpf/devmap.c | 78 ++++++++++--------------------------------
kernel/bpf/xskmap.c | 18 ++--------
net/core/filter.c | 63 ++++++----------------------------
net/xdp/xsk.c | 17 ++++-----
8 files changed, 75 insertions(+), 197 deletions(-)
--
2.20.1
Powered by blists - more mailing lists