Netdev List
 help / color / mirror / Atom feed
From: John Fastabend <john.fastabend@gmail.com>
To: Hangbin Liu <liuhangbin@gmail.com>, bpf@vger.kernel.org
Cc: netdev@vger.kernel.org,
	"Toke Høiland-Jørgensen" <toke@redhat.com>,
	"Jiri Benc" <jbenc@redhat.com>,
	"Jesper Dangaard Brouer" <brouer@redhat.com>,
	"Eelco Chaudron" <echaudro@redhat.com>,
	ast@kernel.org, "Daniel Borkmann" <daniel@iogearbox.net>,
	"Lorenzo Bianconi" <lorenzo.bianconi@redhat.com>,
	"David Ahern" <dsahern@gmail.com>,
	"Andrii Nakryiko" <andrii.nakryiko@gmail.com>,
	"Alexei Starovoitov" <alexei.starovoitov@gmail.com>,
	"John Fastabend" <john.fastabend@gmail.com>,
	"Maciej Fijalkowski" <maciej.fijalkowski@intel.com>,
	"Björn Töpel" <bjorn.topel@gmail.com>,
	"Martin KaFai Lau" <kafai@fb.com>,
	"Hangbin Liu" <liuhangbin@gmail.com>
Subject: RE: [PATCH RESEND v11 2/4] xdp: extend xdp_redirect_map with broadcast support
Date: Thu, 13 May 2021 13:01:16 -0700	[thread overview]
Message-ID: <609d858c171bf_634432084c@john-XPS-13-9370.notmuch> (raw)
In-Reply-To: <20210513070447.1878448-3-liuhangbin@gmail.com>

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.
> 
> With test topology:
>   +-------------------+             +-------------------+
>   | Host A (i40e 10G) |  ---------- | eno1(i40e 10G)    |
>   +-------------------+             |                   |
>                                     |   Host B          |
>   +-------------------+             |                   |
>   | Host C (i40e 10G) |  ---------- | eno2(i40e 10G)    |
>   +-------------------+             |                   |
>                                     |          +------+ |
>                                     | veth0 -- | Peer | |
>                                     | veth1 -- |      | |
>                                     | veth2 -- |  NS  | |
>                                     |          +------+ |
>                                     +-------------------+
> 
> On Host A:
>  # pktgen/pktgen_sample03_burst_single_flow.sh -i eno1 -d $dst_ip -m $dst_mac -s 64
> 
> On Host B(Intel(R) Xeon(R) CPU E5-2690 v3 @ 2.60GHz, 128G Memory):
> Use xdp_redirect_map and xdp_redirect_map_multi in samples/bpf for testing.
> All the veth peers in the NS have a XDP_DROP program loaded. The
> forward_map max_entries in xdp_redirect_map_multi is modify to 4.
> 
> Testing the performance impact on the regular xdp_redirect path with and
> without patch (to check impact of additional check for broadcast mode):
> 
> 5.12 rc4         | redirect_map        i40e->i40e      |    2.0M |  9.7M
> 5.12 rc4         | redirect_map        i40e->veth      |    1.7M | 11.8M
> 5.12 rc4 + patch | redirect_map        i40e->i40e      |    2.0M |  9.6M
> 5.12 rc4 + patch | redirect_map        i40e->veth      |    1.7M | 11.7M
> 
> Testing the performance when cloning packets with the redirect_map_multi
> test, using a redirect map size of 4, filled with 1-3 devices:
> 
> 5.12 rc4 + patch | redirect_map multi  i40e->veth (x1) |    1.7M | 11.4M
> 5.12 rc4 + patch | redirect_map multi  i40e->veth (x2) |    1.1M |  4.3M
> 5.12 rc4 + patch | redirect_map multi  i40e->veth (x3) |    0.8M |  2.6M
> 
> Acked-by: Toke Høiland-Jørgensen <toke@redhat.com>
> Acked-by: Martin KaFai Lau <kafai@fb.com>
> Signed-off-by: Hangbin Liu <liuhangbin@gmail.com>

[...]

LGTM thanks for sticking with it.

Acked-by: John Fastabend <john.fastabend@gmail.com>

  reply	other threads:[~2021-05-13 20:01 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-05-13  7:04 [PATCH RESEND v11 0/4] xdp: extend xdp_redirect_map with broadcast support Hangbin Liu
2021-05-13  7:04 ` [PATCH RESEND v11 1/4] bpf: run devmap xdp_prog on flush instead of bulk enqueue Hangbin Liu
2021-05-13 22:23   ` John Fastabend
2021-05-14  6:49   ` Jesper Dangaard Brouer
2021-05-13  7:04 ` [PATCH RESEND v11 2/4] xdp: extend xdp_redirect_map with broadcast support Hangbin Liu
2021-05-13 20:01   ` John Fastabend [this message]
2021-05-14  6:21     ` Jesper Dangaard Brouer
2021-05-18 20:36   ` Daniel Borkmann
2021-05-13  7:04 ` [PATCH RESEND v11 3/4] sample/bpf: add xdp_redirect_map_multi for redirect_map broadcast test Hangbin Liu
2021-05-13  7:04 ` [PATCH RESEND v11 4/4] selftests/bpf: add xdp_redirect_multi test Hangbin Liu

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=609d858c171bf_634432084c@john-XPS-13-9370.notmuch \
    --to=john.fastabend@gmail.com \
    --cc=alexei.starovoitov@gmail.com \
    --cc=andrii.nakryiko@gmail.com \
    --cc=ast@kernel.org \
    --cc=bjorn.topel@gmail.com \
    --cc=bpf@vger.kernel.org \
    --cc=brouer@redhat.com \
    --cc=daniel@iogearbox.net \
    --cc=dsahern@gmail.com \
    --cc=echaudro@redhat.com \
    --cc=jbenc@redhat.com \
    --cc=kafai@fb.com \
    --cc=liuhangbin@gmail.com \
    --cc=lorenzo.bianconi@redhat.com \
    --cc=maciej.fijalkowski@intel.com \
    --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