[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20210420182143.om3gheczszoovp2y@kafai-mbp.dhcp.thefacebook.com>
Date: Tue, 20 Apr 2021 11:21:43 -0700
From: Martin KaFai Lau <kafai@...com>
To: Hangbin Liu <liuhangbin@...il.com>
CC: <bpf@...r.kernel.org>, <netdev@...r.kernel.org>,
Toke Høiland-Jørgensen <toke@...hat.com>,
Jiri Benc <jbenc@...hat.com>,
Jesper Dangaard Brouer <brouer@...hat.com>,
Eelco Chaudron <echaudro@...hat.com>, <ast@...nel.org>,
Daniel Borkmann <daniel@...earbox.net>,
Lorenzo Bianconi <lorenzo.bianconi@...hat.com>,
David Ahern <dsahern@...il.com>,
Andrii Nakryiko <andrii.nakryiko@...il.com>,
Alexei Starovoitov <alexei.starovoitov@...il.com>,
John Fastabend <john.fastabend@...il.com>,
Maciej Fijalkowski <maciej.fijalkowski@...el.com>,
Björn Töpel <bjorn.topel@...il.com>
Subject: Re: [PATCHv8 bpf-next 2/4] xdp: extend xdp_redirect_map with
broadcast support
On Thu, Apr 15, 2021 at 09:53:18PM +0800, Hangbin Liu wrote:
> This patch adds two flags BPF_F_BROADCAST and BPF_F_EXCLUDE_INGRESS to
> extend xdp_redirect_map for broadcast support.
>
> With BPF_F_BROADCAST the packet will be broadcasted to all the interfaces
> in the map. with BPF_F_EXCLUDE_INGRESS the ingress interface will be
> excluded when do broadcasting.
>
> When getting the devices in dev hash map via dev_map_hash_get_next_key(),
> there is a possibility that we fall back to the first key when a device
> was removed. This will duplicate packets on some interfaces. So just walk
> the whole buckets to avoid this issue. For dev array map, we also walk the
> whole map to find valid interfaces.
>
> Function bpf_clear_redirect_map() was removed in
> commit ee75aef23afe ("bpf, xdp: Restructure redirect actions").
> Add it back as we need to use ri->map again.
>
> Here is the performance result by using 10Gb i40e NIC, do XDP_DROP on
> veth peer, run xdp_redirect_{map, map_multi} in sample/bpf and send pkts
> via pktgen cmd:
> ./pktgen_sample03_burst_single_flow.sh -i eno1 -d $dst_ip -m $dst_mac -t 10 -s 64
>
> There are some drop back as we need to loop the map and get each interface.
>
> Version | Test | Generic | Native
> 5.12 rc4 | redirect_map i40e->i40e | 1.9M | 9.6M
> 5.12 rc4 | redirect_map i40e->veth | 1.7M | 11.7M
> 5.12 rc4 + patch | redirect_map i40e->i40e | 1.9M | 9.3M
> 5.12 rc4 + patch | redirect_map i40e->veth | 1.7M | 11.4M
> 5.12 rc4 + patch | redirect_map multi i40e->i40e | 1.9M | 8.9M
> 5.12 rc4 + patch | redirect_map multi i40e->veth | 1.7M | 10.9M
> 5.12 rc4 + patch | redirect_map multi i40e->mlx4+veth | 1.2M | 3.8M
>
> Acked-by: Toke Høiland-Jørgensen <toke@...hat.com>
> Signed-off-by: Hangbin Liu <liuhangbin@...il.com>
>
> ---
> v8:
> use hlist_for_each_entry_rcu() when looping the devmap hash ojbs
Acked-by: Martin KaFai Lau <kafai@...com>
Powered by blists - more mailing lists