[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20200624103209.18276e44@carbon>
Date: Wed, 24 Jun 2020 10:32:09 +0200
From: Jesper Dangaard Brouer <brouer@...hat.com>
To: Lorenzo Bianconi <lorenzo@...nel.org>
Cc: netdev@...r.kernel.org, bpf@...r.kernel.org, davem@...emloft.net,
ast@...nel.org, daniel@...earbox.net, toke@...hat.com,
lorenzo.bianconi@...hat.com, dsahern@...nel.org,
andrii.nakryiko@...il.com, brouer@...hat.com
Subject: Re: [PATCH v3 bpf-next 6/9] bpf: cpumap: implement XDP_REDIRECT for
eBPF programs attached to map entries
On Tue, 23 Jun 2020 23:39:31 +0200
Lorenzo Bianconi <lorenzo@...nel.org> wrote:
> 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
>
> Attacching a simple XDP program on eth0 to perform XDP_TX gives
^^^^^^^^^^
Spelling/typo.
> comparable results:
>
> tx: 288.4 Kpps rx: 288.4 Kpps
>
> Co-developed-by: Jesper Dangaard Brouer <brouer@...hat.com>
> Signed-off-by: Jesper Dangaard Brouer <brouer@...hat.com>
> Signed-off-by: Lorenzo Bianconi <lorenzo@...nel.org>
Acked-by: Jesper Dangaard Brouer <brouer@...hat.com>
> ---
> include/net/xdp.h | 1 +
> include/trace/events/xdp.h | 6 ++++--
> kernel/bpf/cpumap.c | 17 +++++++++++++++--
> 3 files changed, 20 insertions(+), 4 deletions(-)
[...]
> @@ -276,7 +286,10 @@ static int cpu_map_bpf_prog_run_xdp(struct bpf_cpu_map_entry *rcpu,
> }
> }
>
> - rcu_read_unlock();
> + if (stats->redirect)
> + xdp_do_flush_map();
> +
> + rcu_read_unlock_bh(); /* resched point, may call do_softirq() */
I've tested (on x86) that this extra resched point does not cause sched issues.
--
Best regards,
Jesper Dangaard Brouer
MSc.CS, Principal Kernel Engineer at Red Hat
LinkedIn: http://www.linkedin.com/in/brouer
Powered by blists - more mailing lists