• Daniel Borkmann's avatar
    bpf: make error reporting in bpf_warn_invalid_xdp_action more clear · 9beb8bed
    Daniel Borkmann authored
    Differ between illegal XDP action code and just driver
    unsupported one to provide better feedback when we throw
    a one-time warning here. Reason is that with 814abfab
    
    
    ("xdp: add bpf_redirect helper function") not all drivers
    support the new XDP return code yet and thus they will
    fall into their 'default' case when checking for return
    codes after program return, which then triggers a
    bpf_warn_invalid_xdp_action() stating that the return
    code is illegal, but from XDP perspective it's not.
    
    I decided not to place something like a XDP_ACT_MAX define
    into uapi i) given we don't have this either for all other
    program types, ii) future action codes could have further
    encoding there, which would render such define unsuitable
    and we wouldn't be able to rip it out again, and iii) we
    rarely add new action codes.
    Signed-off-by: default avatarDaniel Borkmann <daniel@iogearbox.net>
    Acked-by: default avatarAlexei Starovoitov <ast@kernel.org>
    Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
    9beb8bed
bpf.h 25.8 KB