]> git.ipfire.org Git - thirdparty/iproute2.git/commitdiff
examples/bpf: move struct bpf_elf_map defined maps to legacy folder
authorHangbin Liu <haliu@redhat.com>
Mon, 23 Nov 2020 13:12:00 +0000 (21:12 +0800)
committerDavid Ahern <dsahern@gmail.com>
Wed, 25 Nov 2020 05:14:06 +0000 (22:14 -0700)
Reviewed-by: Toke Høiland-Jørgensen <toke@redhat.com>
Signed-off-by: Hangbin Liu <haliu@redhat.com>
Signed-off-by: David Ahern <dsahern@gmail.com>
examples/bpf/README
examples/bpf/legacy/bpf_cyclic.c [moved from examples/bpf/bpf_cyclic.c with 95% similarity]
examples/bpf/legacy/bpf_graft.c [moved from examples/bpf/bpf_graft.c with 97% similarity]
examples/bpf/legacy/bpf_map_in_map.c [moved from examples/bpf/bpf_map_in_map.c with 96% similarity]
examples/bpf/legacy/bpf_shared.c [moved from examples/bpf/bpf_shared.c with 97% similarity]
examples/bpf/legacy/bpf_tailcall.c [moved from examples/bpf/bpf_tailcall.c with 98% similarity]

index 1bbdda3f8dc19d0120f1cf5fb1f4b2fc92f1d2f6..732bcc8315496ef076c295e6d7640035bd751991 100644 (file)
@@ -1,8 +1,12 @@
 eBPF toy code examples (running in kernel) to familiarize yourself
 with syntax and features:
 
- - bpf_shared.c                -> Ingress/egress map sharing example
- - bpf_tailcall.c      -> Using tail call chains
- - bpf_cyclic.c                -> Simple cycle as tail calls
- - bpf_graft.c         -> Demo on altering runtime behaviour
- - bpf_map_in_map.c     -> Using map in map example
+ - legacy/bpf_shared.c         -> Ingress/egress map sharing example
+ - legacy/bpf_tailcall.c       -> Using tail call chains
+ - legacy/bpf_cyclic.c         -> Simple cycle as tail calls
+ - legacy/bpf_graft.c          -> Demo on altering runtime behaviour
+ - legacy/bpf_map_in_map.c     -> Using map in map example
+
+Note: Users should use new BTF way to defined the maps, the examples
+in legacy folder which is using struct bpf_elf_map defined maps is not
+recommanded.
similarity index 95%
rename from examples/bpf/bpf_cyclic.c
rename to examples/bpf/legacy/bpf_cyclic.c
index 11d1c061dc17d81ccdd1a5043a73d9738159e5fb..3359073039d78120ca687fa01fc17d864074fbe1 100644 (file)
@@ -1,4 +1,4 @@
-#include "../../include/bpf_api.h"
+#include "../../../include/bpf_api.h"
 
 /* Cyclic dependency example to test the kernel's runtime upper
  * bound on loops. Also demonstrates on how to use direct-actions,
similarity index 97%
rename from examples/bpf/bpf_graft.c
rename to examples/bpf/legacy/bpf_graft.c
index 07113d4a0a4033ea22ce5295e0ca183bf841f5f3..f4c920ccb3a204f208fd25a064f07b509b11870b 100644 (file)
@@ -1,4 +1,4 @@
-#include "../../include/bpf_api.h"
+#include "../../../include/bpf_api.h"
 
 /* This example demonstrates how classifier run-time behaviour
  * can be altered with tail calls. We start out with an empty
similarity index 96%
rename from examples/bpf/bpf_map_in_map.c
rename to examples/bpf/legacy/bpf_map_in_map.c
index ff0e623a8197f680124b39b20b7d09cb2e3fc3ba..575f88128fd187e245adc9302b1c954042061a84 100644 (file)
@@ -1,4 +1,4 @@
-#include "../../include/bpf_api.h"
+#include "../../../include/bpf_api.h"
 
 #define MAP_INNER_ID   42
 
similarity index 97%
rename from examples/bpf/bpf_shared.c
rename to examples/bpf/legacy/bpf_shared.c
index 21fe6f1e04435a87cd0f79cd484b0363a47612b6..05b2b9ef10c6aa38b516d03684900117049dab1f 100644 (file)
@@ -1,4 +1,4 @@
-#include "../../include/bpf_api.h"
+#include "../../../include/bpf_api.h"
 
 /* Minimal, stand-alone toy map pinning example:
  *
similarity index 98%
rename from examples/bpf/bpf_tailcall.c
rename to examples/bpf/legacy/bpf_tailcall.c
index 161eb60625699284701c0eb4bccf846a3879c957..8ebc554c1f96760196efe2cb05b097694a390620 100644 (file)
@@ -1,5 +1,5 @@
 /* SPDX-License-Identifier: GPL-2.0 */
-#include "../../include/bpf_api.h"
+#include "../../../include/bpf_api.h"
 
 #define ENTRY_INIT     3
 #define ENTRY_0                0