On 14/08/2019 17:58, Quentin Monnet wrote:
> 2019-08-14 17:45 UTC+0100 ~ Edward Cree <ec...@solarflare.com>
>> This might be a really dumb suggestion, but: you're wanting to collect a
>> summary statistic over an in-kernel data structure in a single syscall,
>> because making a series of syscalls to examine every entry is slow and
>> racy. Isn't that exactly a job for an in-kernel virtual machine, and
>> could you not supply an eBPF program which the kernel runs on each entry
>> in the map, thus supporting people who want to calculate something else
>> (mean, min and max, whatever) instead of count?
>>
> Hi Edward, I like the approach, thanks for the suggestion.
>
> But I did not mention that we were using offloaded maps: Tracing the
> kernel would probably work for programs running on the host, but this is
> not a solution we could extend to hardware offload.
I don't see where "tracing" comes into it; this is a new program type and
a new map op under the bpf() syscall.
Could the user-supplied BPF program not then be passed down to the device
for it to run against its offloaded maps?