[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20220308020449.eyxoq4s5ddurcqxv@kafai-mbp.dhcp.thefacebook.com>
Date: Mon, 7 Mar 2022 18:04:49 -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>,
Andrii Nakryiko <andrii@...nel.org>,
Song Liu <songliubraving@...com>, Yonghong Song <yhs@...com>,
John Fastabend <john.fastabend@...il.com>,
KP Singh <kpsingh@...nel.org>,
"David S. Miller" <davem@...emloft.net>,
Jakub Kicinski <kuba@...nel.org>,
Jesper Dangaard Brouer <hawk@...nel.org>,
netdev@...r.kernel.org, bpf@...r.kernel.org
Subject: Re: [PATCH bpf-next v9 1/5] bpf: Add "live packet" mode for XDP in
BPF_PROG_RUN
On Sun, Mar 06, 2022 at 11:34:00PM +0100, Toke Høiland-Jørgensen wrote:
> @@ -938,6 +1222,18 @@ int bpf_prog_test_run_xdp(struct bpf_prog *prog, const union bpf_attr *kattr,
> prog->expected_attach_type == BPF_XDP_CPUMAP)
> return -EINVAL;
>
> + if (kattr->test.flags & ~BPF_F_TEST_XDP_LIVE_FRAMES)
> + return -EINVAL;
> +
> + if (do_live) {
> + if (!batch_size)
> + batch_size = NAPI_POLL_WEIGHT;
> + else if (batch_size > TEST_XDP_MAX_BATCH)
> + return -E2BIG;
> + } else if (batch_size) {
Other bpf_prog_test_run_*() also needs to check for non zero test.batch_size.
> + return -EINVAL;
> + }
> +
Powered by blists - more mailing lists