selftests/bpf: Fix non-strict SEC() program sections
Fix few more SEC() definitions that were previously missed. Signed-off-by: Andrii Nakryiko <andrii@kernel.org> Signed-off-by: Alexei Starovoitov <ast@kernel.org> Acked-by: Dave Marchevsky <davemarchevsky@fb.com> Link: https://lore.kernel.org/bpf/20211103220845.2676888-9-andrii@kernel.org
This commit is contained in:
committed by
Alexei Starovoitov
parent
5c5edcdebf
commit
3d1d62397f
@@ -448,7 +448,7 @@ static __always_inline int process_packet(void *data, __u64 off, void *data_end,
|
|||||||
return bpf_redirect(ifindex, 0);
|
return bpf_redirect(ifindex, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
SEC("l4lb-demo")
|
SEC("tc")
|
||||||
int balancer_ingress(struct __sk_buff *ctx)
|
int balancer_ingress(struct __sk_buff *ctx)
|
||||||
{
|
{
|
||||||
void *data_end = (void *)(long)ctx->data_end;
|
void *data_end = (void *)(long)ctx->data_end;
|
||||||
|
|||||||
@@ -447,7 +447,7 @@ static __noinline int process_packet(void *data, __u64 off, void *data_end,
|
|||||||
return bpf_redirect(ifindex, 0);
|
return bpf_redirect(ifindex, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
SEC("l4lb-demo")
|
SEC("tc")
|
||||||
int balancer_ingress(struct __sk_buff *ctx)
|
int balancer_ingress(struct __sk_buff *ctx)
|
||||||
{
|
{
|
||||||
void *data_end = (void *)(long)ctx->data_end;
|
void *data_end = (void *)(long)ctx->data_end;
|
||||||
|
|||||||
@@ -30,7 +30,7 @@ struct {
|
|||||||
__type(value, struct array_elem);
|
__type(value, struct array_elem);
|
||||||
} array_map SEC(".maps");
|
} array_map SEC(".maps");
|
||||||
|
|
||||||
SEC("map_lock_demo")
|
SEC("cgroup/skb")
|
||||||
int bpf_map_lock_test(struct __sk_buff *skb)
|
int bpf_map_lock_test(struct __sk_buff *skb)
|
||||||
{
|
{
|
||||||
struct hmap_elem zero = {}, *val;
|
struct hmap_elem zero = {}, *val;
|
||||||
|
|||||||
@@ -24,7 +24,7 @@ struct {
|
|||||||
__uint(value_size, sizeof(__u32));
|
__uint(value_size, sizeof(__u32));
|
||||||
} map_out SEC(".maps");
|
} map_out SEC(".maps");
|
||||||
|
|
||||||
SEC("test")
|
SEC("tc")
|
||||||
int _test(struct __sk_buff *skb)
|
int _test(struct __sk_buff *skb)
|
||||||
{
|
{
|
||||||
void *data_end = (void *)(long)skb->data_end;
|
void *data_end = (void *)(long)skb->data_end;
|
||||||
|
|||||||
@@ -5,7 +5,7 @@
|
|||||||
|
|
||||||
char _license[] SEC("license") = "GPL";
|
char _license[] SEC("license") = "GPL";
|
||||||
|
|
||||||
SEC("skb_ctx")
|
SEC("tc")
|
||||||
int process(struct __sk_buff *skb)
|
int process(struct __sk_buff *skb)
|
||||||
{
|
{
|
||||||
#pragma clang loop unroll(full)
|
#pragma clang loop unroll(full)
|
||||||
|
|||||||
@@ -45,7 +45,7 @@ struct {
|
|||||||
|
|
||||||
#define CREDIT_PER_NS(delta, rate) (((delta) * rate) >> 20)
|
#define CREDIT_PER_NS(delta, rate) (((delta) * rate) >> 20)
|
||||||
|
|
||||||
SEC("spin_lock_demo")
|
SEC("tc")
|
||||||
int bpf_sping_lock_test(struct __sk_buff *skb)
|
int bpf_sping_lock_test(struct __sk_buff *skb)
|
||||||
{
|
{
|
||||||
volatile int credit = 0, max_credit = 100, pkt_len = 64;
|
volatile int credit = 0, max_credit = 100, pkt_len = 64;
|
||||||
|
|||||||
@@ -244,7 +244,7 @@ static __always_inline void send_basic_event(struct sock *sk,
|
|||||||
bpf_map_update_elem(&ev_record_map, &key, &ev, BPF_ANY);
|
bpf_map_update_elem(&ev_record_map, &key, &ev, BPF_ANY);
|
||||||
}
|
}
|
||||||
|
|
||||||
SEC("dummy_tracepoint")
|
SEC("tp/dummy/tracepoint")
|
||||||
int _dummy_tracepoint(struct dummy_tracepoint_args *arg)
|
int _dummy_tracepoint(struct dummy_tracepoint_args *arg)
|
||||||
{
|
{
|
||||||
if (!arg->sock)
|
if (!arg->sock)
|
||||||
|
|||||||
Reference in New Issue
Block a user