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; > + } > +