Subject: Re: [PATCH bpf-next v8 2/5] Documentation/bpf: Add documentation for BPF_PROG_RUN

From: Toke Høiland-Jørgensen <[email-masked]>
Date: Wed, 02 Mar 2022 22:34:41 +0100

Alexei Starovoitov <[email-masked]> writes:

> On Fri, Feb 18, 2022 at 06:50:26PM +0100, Toke Høiland-Jørgensen wrote:
>> This adds documentation for the BPF_PROG_RUN command; a short overview of
>> the command itself, and a more verbose description of the "live packet"
>> mode for XDP introduced in the previous commit.
>
> Overall the patch set looks great. The doc really helps.

Great, thanks!

> One nit below.
>
>> +- When running the program with multiple repetitions, the execution will happen
>> +  in batches, where the program is executed multiple times in a loop, the result
>> +  is saved, and other actions (like redirecting the packet or passing it to the
>> +  networking stack) will happen for the whole batch after the execution. This is
>> +  similar to how execution happens in driver-mode XDP for each hardware NAPI
>> +  cycle. The batch size defaults to 64 packets (which is same as the NAPI batch
>> +  size), but the batch size can be specified by userspace through the
>> +  ``batch_size`` parameter, up to a maximum of 256 packets.
>
> This paragraph is a bit confusing.
> I've read it as the program can do only one kind of result per batch and
> it will apply to the whole batch.
> But the program can do XDP_PASS/REDIRECT in any order.
> Can you make "the result is saved" a bit more clear?

Yeah, re-reading it now, I see what you mean; will try to make it
clearer...

-Toke