[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20220309061254.lbz7no6hxjphr34w@kafai-mbp.dhcp.thefacebook.com>
Date: Tue, 8 Mar 2022 22:12:54 -0800
From: Martin KaFai Lau <kafai@...com>
To: Toke Høiland-Jørgensen <toke@...hat.com>
Cc: Alexei Starovoitov <ast@...nel.org>,
Daniel Borkmann <daniel@...earbox.net>,
"David S. Miller" <davem@...emloft.net>,
Jakub Kicinski <kuba@...nel.org>,
Jesper Dangaard Brouer <hawk@...nel.org>,
John Fastabend <john.fastabend@...il.com>,
Andrii Nakryiko <andrii@...nel.org>,
Song Liu <songliubraving@...com>, Yonghong Song <yhs@...com>,
KP Singh <kpsingh@...nel.org>, netdev@...r.kernel.org,
bpf@...r.kernel.org
Subject: Re: [PATCH bpf-next v10 0/5] Add support for transmitting packets
using XDP in bpf_prog_run()
On Tue, Mar 08, 2022 at 03:57:56PM +0100, Toke Høiland-Jørgensen wrote:
> This series adds support for transmitting packets using XDP in
> bpf_prog_run(), by enabling a new mode "live packet" mode which will handle
> the XDP program return codes and redirect the packets to the stack or other
> devices.
>
> The primary use case for this is testing the redirect map types and the
> ndo_xdp_xmit driver operation without an external traffic generator. But it
> turns out to also be useful for creating a programmable traffic generator
> in XDP, as well as injecting frames into the stack. A sample traffic
> generator, which was included in previous versions of the series, but now
> moved to xdp-tools, transmits up to 9 Mpps/core on my test machine.
>
> To transmit the frames, the new mode instantiates a page_pool structure in
> bpf_prog_run() and initialises the pages to contain XDP frames with the
> data passed in by userspace. These frames can then be handled as though
> they came from the hardware XDP path, and the existing page_pool code takes
> care of returning and recycling them. The setup is optimised for high
> performance with a high number of repetitions to support stress testing and
> the traffic generator use case; see patch 1 for details.
>
> v10:
> - Only propagate memory allocation errors from xdp_test_run_batch()
Other than a case in patch 1. The set lgtm.
Acked-by: Martin KaFai Lau <kafai@...com>
> - Get rid of BPF_F_TEST_XDP_RESERVED; batch_size can be used to probe
> - Check that batch_size is unset in non-XDP test_run funcs
> - Lower the number of repetitions in the selftest to 10k
> - Count number of recycled pages in the selftest
> - Fix a few other nits from Martin, carry forward ACKs
Powered by blists - more mailing lists