This patch series provide collect_md mode for ERSPAN tunnel. The fist patch refactors the existing gre_fb_xmit function by exacting the route cache portion into a new function called prepare_fb_xmit. The second patch introduces the collect_md mode for ERSPAN tunnel, by calling the prepare_fb_xmit function and adding ERSPAN specific logic. The final patch adds the test case using bpf_skb_{set,get}_tunnel_{key,opt}.
Thank you William Tu (3): gre: refactor the gre_fb_xmit gre: add collect_md mode to ERSPAN tunnel samples/bpf: extend test_tunnel_bpf.sh with ERSPAN include/net/ip_tunnels.h | 4 +- net/ipv4/ip_gre.c | 157 ++++++++++++++++++++++++++++++++++++----- samples/bpf/tcbpf2_kern.c | 63 ++++++++++++++++- samples/bpf/test_tunnel_bpf.sh | 29 ++++++++ 4 files changed, 232 insertions(+), 21 deletions(-) -- 2.7.4