On Thu, Aug 8, 2019 at 4:30 AM Jesper Dangaard Brouer <brouer@xxxxxxxxxx> wrote: > > Another improvement from Toke, is that the bpf_redirect_map() helper, > now also check if the redirect index is valid in the map. If not, then > it returns another value than XDP_REDIRECT. You can choose the > alternative return value yourself, via "flags" e.g. XDP_PASS. Thus, > you don't even need to check/validate devmap in your BPF-code, as it is > part of the bpf_redirect_map() call now. > > action = bpf_redirect_map(&map, &index, flags_as_xdp_value) > > The default flags used in most programs today is 0, which maps to > XDP_ABORTED. This is sort of a small UAPI change, but for the better. > As today, the packet is dropped later, only diagnose/seen via > tracepoint xdp:xdp_redirect_map_err. > That's great to hear, as I'd thought it already worked that way (minus the flags to specify what the alternate action is). Thanks for explaining! --Zvi