Re: [PATCH 2/3] net: bpf jit: x86: optimize choose_load_func error path

Eric Dumazet
2013-10-13T16:36:35Z

On Sun, 2013-10-13 at 16:54 +0200, Vladimir Murzin wrote:
> Macro CHOOSE_LOAD_FUNC returns handler for "any offset" if checks for K
> were not passed. At the same time handlers for "any offset" cases make
> the same checks against r_addr at run-time, that will always lead to
> bpf_error.
>
> Run-time checks are still necessary for indirect load operations, but
> error path for absolute and mesh loads are worth to optimize during bpf
> compile time.

I don't get the point.

What real world use case or problem are you trying to handle ?

bpf_error returns 0, so it seems your patch does the same.

A buggy BPF program should not expect us to 'save' a few cycles.