Lorenzo Bianconi 28b1520ebf bpf: cpumap: Implement XDP_REDIRECT for eBPF programs attached to map entries
Introduce XDP_REDIRECT support for eBPF programs attached to cpumap
entries.
This patch has been tested on Marvell ESPRESSObin using a modified
version of xdp_redirect_cpu sample in order to attach a XDP program
to CPUMAP entries to perform a redirect on the mvneta interface.
In particular the following scenario has been tested:

rq (cpu0) --> mvneta - XDP_REDIRECT (cpu0) --> CPUMAP - XDP_REDIRECT (cpu1) --> mvneta

$./xdp_redirect_cpu -p xdp_cpu_map0 -d eth0 -c 1 -e xdp_redirect \
	-f xdp_redirect_kern.o -m tx_port -r eth0

tx: 285.2 Kpps rx: 285.2 Kpps

Attaching a simple XDP program on eth0 to perform XDP_TX gives
comparable results:

tx: 288.4 Kpps rx: 288.4 Kpps

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>
Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
Acked-by: Jesper Dangaard Brouer <brouer@redhat.com>
Link: https://lore.kernel.org/bpf/2cf8373a731867af302b00c4ff16c122630c4980.1594734381.git.lorenzo@kernel.org
2020-07-16 17:00:32 +02:00
..
2018-04-16 11:53:35 +01:00
2020-06-09 11:28:59 -07:00
2019-11-27 07:44:25 +01:00
2017-11-17 09:51:57 -08:00
2019-11-08 11:23:37 +01:00
2019-03-27 15:52:01 -03:00
2017-09-25 20:38:26 +02:00
2020-04-22 12:55:54 -07:00
2020-06-11 13:33:47 -04:00
2020-06-11 12:22:41 -07:00
2018-02-13 21:30:22 +01:00
2020-06-17 22:51:01 +01:00
2017-12-19 10:56:24 +01:00
2020-01-09 18:41:41 -08:00
2020-06-11 12:22:41 -07:00
2019-12-01 14:00:59 -08:00