diff options
| author | Thomas Zimmermann <[email protected]> | 2023-10-11 09:50:59 +0200 | 
|---|---|---|
| committer | Thomas Zimmermann <[email protected]> | 2023-10-11 09:50:59 +0200 | 
| commit | 57390019b68b83f96eb98f490367b9df1f2d77cb (patch) | |
| tree | e6d4b6c75efdd2d7fb7d37f980688c491be3ff6a /tools/testing/selftests/bpf/progs/async_stack_depth.c | |
| parent | e5f9d543419c78ac58f3b3557bc5a76b20ff600b (diff) | |
| parent | 389af786f92ecdff35883551d54bf4e507ffcccb (diff) | |
Merge drm/drm-next into drm-misc-next
Updating drm-misc-next to the state of Linux v6.6-rc2.
Signed-off-by: Thomas Zimmermann <[email protected]>
Diffstat (limited to 'tools/testing/selftests/bpf/progs/async_stack_depth.c')
| -rw-r--r-- | tools/testing/selftests/bpf/progs/async_stack_depth.c | 25 | 
1 files changed, 23 insertions, 2 deletions
diff --git a/tools/testing/selftests/bpf/progs/async_stack_depth.c b/tools/testing/selftests/bpf/progs/async_stack_depth.c index 477ba950bb43..3517c0e01206 100644 --- a/tools/testing/selftests/bpf/progs/async_stack_depth.c +++ b/tools/testing/selftests/bpf/progs/async_stack_depth.c @@ -22,9 +22,16 @@ static int timer_cb(void *map, int *key, struct bpf_timer *timer)  	return buf[69];  } +__attribute__((noinline)) +static int bad_timer_cb(void *map, int *key, struct bpf_timer *timer) +{ +	volatile char buf[300] = {}; +	return buf[255] + timer_cb(NULL, NULL, NULL); +} +  SEC("tc") -__failure __msg("combined stack size of 2 calls") -int prog(struct __sk_buff *ctx) +__failure __msg("combined stack size of 2 calls is 576. Too large") +int pseudo_call_check(struct __sk_buff *ctx)  {  	struct hmap_elem *elem;  	volatile char buf[256] = {}; @@ -37,4 +44,18 @@ int prog(struct __sk_buff *ctx)  	return bpf_timer_set_callback(&elem->timer, timer_cb) + buf[0];  } +SEC("tc") +__failure __msg("combined stack size of 2 calls is 608. Too large") +int async_call_root_check(struct __sk_buff *ctx) +{ +	struct hmap_elem *elem; +	volatile char buf[256] = {}; + +	elem = bpf_map_lookup_elem(&hmap, &(int){0}); +	if (!elem) +		return 0; + +	return bpf_timer_set_callback(&elem->timer, bad_timer_cb) + buf[0]; +} +  char _license[] SEC("license") = "GPL";  |