From: Alexei Starovoitov <alexei.starovoitov@gmail.com>
To: davem@davemloft.net
Cc: daniel@iogearbox.net, andrii@kernel.org, netdev@vger.kernel.org,
bpf@vger.kernel.org, kernel-team@fb.com
Subject: [PATCH v2 bpf-next 0/3] bpf: Introduce BPF timers.
Date: Thu, 10 Jun 2021 21:24:39 -0700 [thread overview]
Message-ID: <20210611042442.65444-1-alexei.starovoitov@gmail.com> (raw)
From: Alexei Starovoitov <ast@kernel.org>
v1->v2:
- Addressed great feedback from Andrii and Toke.
- Fixed race between parallel bpf_timer_*() ops.
- Fixed deadlock between timer callback and LRU eviction or bpf_map_delete/update.
- Disallowed mmap and global timers.
- Allow bpf_spin_lock and bpf_timer in an element. One of each.
- Fixed memory leaks due to map destruction and LRU eviction.
- Add support for specifying clockid in bpf_timer_init.
- Make bpf_timer helpers gpl_only.
- Fix key pointer in callback_fn when bpf_timer is inside array.
- A ton more tests.
The 1st patch implements interaction between bpf programs and bpf core.
The 2nd patch implements necessary safety checks.
The 3rd patch is the test.
Alexei Starovoitov (3):
bpf: Introduce bpf_timer
bpf: Add verifier checks for bpf_timer.
selftests/bpf: Add bpf_timer test.
include/linux/bpf.h | 47 ++-
include/linux/btf.h | 1 +
include/uapi/linux/bpf.h | 40 +++
kernel/bpf/arraymap.c | 14 +
kernel/bpf/btf.c | 77 ++++-
kernel/bpf/hashtab.c | 56 +++-
kernel/bpf/helpers.c | 227 ++++++++++++++
kernel/bpf/local_storage.c | 4 +-
kernel/bpf/map_in_map.c | 1 +
kernel/bpf/syscall.c | 21 +-
kernel/bpf/verifier.c | 133 ++++++++
kernel/trace/bpf_trace.c | 2 +-
scripts/bpf_doc.py | 2 +
tools/include/uapi/linux/bpf.h | 40 +++
.../testing/selftests/bpf/prog_tests/timer.c | 55 ++++
tools/testing/selftests/bpf/progs/timer.c | 293 ++++++++++++++++++
16 files changed, 970 insertions(+), 43 deletions(-)
create mode 100644 tools/testing/selftests/bpf/prog_tests/timer.c
create mode 100644 tools/testing/selftests/bpf/progs/timer.c
--
2.30.2
next reply other threads:[~2021-06-11 4:26 UTC|newest]
Thread overview: 22+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-06-11 4:24 Alexei Starovoitov [this message]
2021-06-11 4:24 ` [PATCH v2 bpf-next 1/3] bpf: Introduce bpf_timer Alexei Starovoitov
2021-06-11 6:42 ` Cong Wang
2021-06-11 18:45 ` Alexei Starovoitov
2021-06-15 6:10 ` Cong Wang
2021-06-16 4:53 ` Alexei Starovoitov
2021-06-11 7:05 ` Cong Wang
2021-06-11 22:12 ` Yonghong Song
2021-06-15 3:33 ` Alexei Starovoitov
2021-06-15 4:21 ` Yonghong Song
2021-06-14 16:51 ` Yonghong Song
2021-06-15 3:29 ` Alexei Starovoitov
2021-06-15 5:31 ` Andrii Nakryiko
2021-06-15 5:40 ` Alexei Starovoitov
2021-06-15 15:24 ` Andrii Nakryiko
2021-06-16 4:26 ` Alexei Starovoitov
2021-06-16 5:54 ` Andrii Nakryiko
2021-06-16 16:52 ` Alexei Starovoitov
2021-06-15 4:48 ` Andrii Nakryiko
2021-06-11 4:24 ` [PATCH v2 bpf-next 2/3] bpf: Add verifier checks for bpf_timer Alexei Starovoitov
2021-06-11 4:24 ` [PATCH v2 bpf-next 3/3] selftests/bpf: Add bpf_timer test Alexei Starovoitov
2021-06-11 6:47 ` [PATCH v2 bpf-next 0/3] bpf: Introduce BPF timers Cong Wang
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20210611042442.65444-1-alexei.starovoitov@gmail.com \
--to=alexei.starovoitov@gmail.com \
--cc=andrii@kernel.org \
--cc=bpf@vger.kernel.org \
--cc=daniel@iogearbox.net \
--cc=davem@davemloft.net \
--cc=kernel-team@fb.com \
--cc=netdev@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).