Re: [PATCH bpf-next v9 1/5] bpf: Add "live packet" mode for XDP in BPF_PROG_RUN

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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



[Index of Archives]     [Linux Samsung SoC]     [Linux Rockchip SoC]     [Linux Actions SoC]     [Linux for Synopsys ARC Processors]     [Linux NFS]     [Linux NILFS]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]


  Powered by Linux