]> git.baikalelectronics.ru Git - kernel.git/commit
samples/bpf: make xdp_fwd more practically usable via devmap lookup
authorJesper Dangaard Brouer <brouer@redhat.com>
Thu, 8 Aug 2019 16:17:42 +0000 (18:17 +0200)
committerDaniel Borkmann <daniel@iogearbox.net>
Fri, 9 Aug 2019 16:05:03 +0000 (18:05 +0200)
commit58aab8bf92a6780a7552a17f49e754d0187d6a4c
treec581f37cf8c26549b17f14eb81757d18562a182d
parent0790440d142db40da3adaa553370c79fcf8b82dd
samples/bpf: make xdp_fwd more practically usable via devmap lookup

This address the TODO in samples/bpf/xdp_fwd_kern.c, which points out
that the chosen egress index should be checked for existence in the
devmap. This can now be done via taking advantage of Toke's work in
commit 1d5f354f1586 ("devmap: Allow map lookups from eBPF").

This change makes xdp_fwd more practically usable, as this allows for
a mixed environment, where IP-forwarding fallback to network stack, if
the egress device isn't configured to use XDP.

Signed-off-by: Jesper Dangaard Brouer <brouer@redhat.com>
Reviewed-by: David Ahern <dsahern@gmail.com>
Reviewed-by: Toke Høiland-Jørgensen <toke@redhat.com>
Acked-by: Yonghong Song <yhs@fb.com>
Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
samples/bpf/xdp_fwd_kern.c
samples/bpf/xdp_fwd_user.c