On Tue, Apr 20, 2021 at 9:52 AM Jiri Olsa wrote:
>
> On Tue, Apr 20, 2021 at 08:33:43AM -0700, Alexei Starovoitov wrote:
> > On Tue, Apr 20, 2021 at 5:51 AM Jiri Olsa wrote:
> > >
> > > On Fri, Apr 16, 2021 at 12:48:34PM -0400, Steven Rostedt wrote:
> > &g
On Tue, Apr 20, 2021 at 5:51 AM Jiri Olsa wrote:
>
> On Fri, Apr 16, 2021 at 12:48:34PM -0400, Steven Rostedt wrote:
> > On Sat, 17 Apr 2021 00:03:04 +0900
> > Masami Hiramatsu wrote:
> >
> > > > Anyway, IIRC, Masami wasn't sure that the full regs was ever needed for
> > > > the
> > > > return (
On Sat, Apr 17, 2021 at 1:16 AM Christophe Leroy
wrote:
>
>
>
> Le 16/04/2021 à 01:49, Alexei Starovoitov a écrit :
> > On Thu, Apr 15, 2021 at 8:41 AM Quentin Monnet
> > wrote:
> >>
> >> 2021-04-15 16:37 UTC+0200 ~ Daniel Borkmann
> >>
On Thu, Apr 15, 2021 at 10:47 AM Pedro Tammela wrote:
>
> Andrii suggested to remove this abstraction layer and have the percpu
> handling more explicit[1].
>
> This patch also updates the tests that relied on the macros.
>
> [1]
> https://lore.kernel.org/bpf/caef4bzymj_zpdq8zi4dbntbojkrpu2tvopys
On Mon, Apr 19, 2021 at 6:52 AM Pedro Tammela wrote:
>
> Em dom., 18 de abr. de 2021 às 19:56, Alexei Starovoitov
> escreveu:
> >
> > On Sun, Apr 18, 2021 at 1:03 PM Pedro Tammela wrote:
> > >
> > > ENOTSUPP is not a valid userland errno[1], which is a
On Sun, Apr 18, 2021 at 1:03 PM Pedro Tammela wrote:
>
> ENOTSUPP is not a valid userland errno[1], which is annoying for
> userland applications that implement a fallback to iterative, report
> errors via 'strerror()' or both.
>
> The batched ops return this errno whenever an operation
> is not i
On Sat, Apr 17, 2021 at 04:48:53PM +, Al Viro wrote:
> On Sat, Apr 17, 2021 at 07:36:39AM -0700, Alexei Starovoitov wrote:
>
> > The kernel will perform the same work with FDs. The same locks are held
> > and the same execution conditions are in both cases. The LSM hooks,
On Fri, Apr 16, 2021 at 10:01:43PM -0700, Alexei Starovoitov wrote:
> On Fri, Apr 16, 2021 at 9:04 PM Al Viro wrote:
> >
> > On Fri, Apr 16, 2021 at 08:46:05PM -0700, Alexei Starovoitov wrote:
> > > On Fri, Apr 16, 2021 at 8:42 PM Al Viro wrote:
> > > >
> &
On Fri, Apr 16, 2021 at 9:04 PM Al Viro wrote:
>
> On Fri, Apr 16, 2021 at 08:46:05PM -0700, Alexei Starovoitov wrote:
> > On Fri, Apr 16, 2021 at 8:42 PM Al Viro wrote:
> > >
> > > On Fri, Apr 16, 2021 at 08:32:20PM -0700, Alexei Starovoitov wrote:
&g
On Fri, Apr 16, 2021 at 8:42 PM Al Viro wrote:
>
> On Fri, Apr 16, 2021 at 08:32:20PM -0700, Alexei Starovoitov wrote:
> > From: Alexei Starovoitov
> >
> > Add bpf_sys_close() helper to be used by the syscall/loader program to close
> > intermediate FDs and othe
From: Alexei Starovoitov
Convert few tests that don't use CO-RE to light skeleton.
Signed-off-by: Alexei Starovoitov
---
tools/testing/selftests/bpf/.gitignore| 1 +
tools/testing/selftests/bpf/Makefile | 15 ++-
.../selftests/bpf/prog_
From: Alexei Starovoitov
Add bpf_sys_close() helper to be used by the syscall/loader program to close
intermediate FDs and other cleanup.
Signed-off-by: Alexei Starovoitov
---
include/uapi/linux/bpf.h | 7 +++
kernel/bpf/syscall.c | 14 ++
tools/include/uapi
From: Alexei Starovoitov
In order to be able to generate loader program in the later
patches change the order of data and text relocations.
Also improve the test to include data relos.
Signed-off-by: Alexei Starovoitov
---
tools/lib/bpf/libbpf.c| 82
From: Alexei Starovoitov
Add -L flag to bpftool to use libbpf gen_trace facility and syscall/loader
program
for skeleton generation and program loading.
"bpftool gen skeleton -L" command will generate a "light skeleton" or "loader
skeleton"
that is similar to
From: Alexei Starovoitov
Typical program loading sequence involves creating bpf maps and applying
map FDs into bpf instructions in various places in the bpf program.
This job is done by libbpf that is using compiler generated ELF relocations
to patch certain instruction after maps are created
From: Alexei Starovoitov
Add support for FD_IDX make libbpf prefer that approach to loading programs.
Signed-off-by: Alexei Starovoitov
---
tools/lib/bpf/bpf.c | 1 +
tools/lib/bpf/libbpf.c | 70 +
tools/lib/bpf/libbpf_internal.h | 1 +
3
From: Alexei Starovoitov
The BPF program loading process performed by libbpf is quite complex
and consists of the following steps:
"open" phase:
- parse elf file and remember relocations, sections
- collect externs and ksyms including their btf_ids in prog's BTF
- patch BTF data
From: Alexei Starovoitov
Improve selftest to check that btf_load is working from bpf program.
Signed-off-by: Alexei Starovoitov
---
tools/testing/selftests/bpf/progs/syscall.c | 48 +
1 file changed, 48 insertions(+)
diff --git a/tools/testing/selftests/bpf/progs
From: Alexei Starovoitov
Similar to prog_load make btf_load command to be availble to
bpf_prog_type_syscall program.
Signed-off-by: Alexei Starovoitov
---
include/linux/btf.h | 2 +-
kernel/bpf/btf.c | 8
kernel/bpf/syscall.c | 7 ---
3 files changed, 9 insertions(+), 8
From: Alexei Starovoitov
Add bpf_btf_find_by_name_kind() helper.
Signed-off-by: Alexei Starovoitov
---
include/linux/bpf.h| 1 +
include/uapi/linux/bpf.h | 8 ++
kernel/bpf/btf.c | 51 ++
kernel/bpf/syscall.c | 2
From: Alexei Starovoitov
bpf_prog_type_syscall is a program that creates a bpf map,
updates it, and loads another bpf program using bpf_sys_bpf() helper.
Signed-off-by: Alexei Starovoitov
---
tools/testing/selftests/bpf/Makefile | 1 +
.../selftests/bpf/prog_tests/syscall.c
From: Alexei Starovoitov
With the help from bpfptr_t prepare relevant bpf syscall commands
to be used from kernel and user space.
Signed-off-by: Alexei Starovoitov
---
include/linux/bpf.h | 8 +--
kernel/bpf/bpf_iter.c | 13 ++---
kernel/bpf/syscall.c | 110
From: Alexei Starovoitov
Trivial support for syscall program type.
Signed-off-by: Alexei Starovoitov
---
tools/lib/bpf/libbpf.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/tools/lib/bpf/libbpf.c b/tools/lib/bpf/libbpf.c
index 9cc2d45b0080..254a0c9aa6cf 100644
--- a/tools/lib/bpf
From: Alexei Starovoitov
Similar to sockptr_t introduce bpfptr_t with few additions:
make_bpfptr() creates new user/kernel pointer in the same address space as
existing user/kernel pointer.
bpfptr_add() advances the user/kernel pointer.
Signed-off-by: Alexei Starovoitov
---
include/linux
From: Alexei Starovoitov
This is a first step towards signed bpf programs and the third approach of that
kind.
The first approach was to bring libbpf into the kernel as a user-mode-driver.
The second approach was to invent a new file format and let kernel execute
that format as a sequence of
From: Alexei Starovoitov
Add placeholders for bpf_sys_bpf() helper and new program type.
Signed-off-by: Alexei Starovoitov
---
include/linux/bpf.h| 10
include/linux/bpf_types.h | 2 ++
include/uapi/linux/bpf.h | 8 ++
kernel/bpf/syscall.c | 46
On Thu, Apr 15, 2021 at 8:41 AM Quentin Monnet wrote:
>
> 2021-04-15 16:37 UTC+0200 ~ Daniel Borkmann
> > On 4/15/21 11:32 AM, Jianlin Lv wrote:
> >> For debugging JITs, dumping the JITed image to kernel log is discouraged,
> >> "bpftool prog dump jited" is much better way to examine JITed dumps.
On Wed, Apr 14, 2021 at 12:52 PM Jiri Olsa wrote:
>
> hi,
> while adding test for pinning the module while there's
> trampoline attach to it, I noticed that we don't allow
> link detach and following re-attach for trampolines.
> Adding that for tracing and lsm programs.
>
> You need to have patch
On 4/15/21 1:35 PM, Andrii Nakryiko wrote:
How about we start in the most restrictive way first. Each extern
would need to specify all the attributes that should match the map
definition. That includes max_entries. That way the typedef struct {
... } my_map_t re-use will work right out of the bo
On Wed, Apr 14, 2021 at 9:02 PM Cong Wang wrote:
>
> On Mon, Apr 12, 2021 at 4:01 PM Alexei Starovoitov
> wrote:
> >
> > On Mon, Apr 05, 2021 at 05:36:27PM -0700, Cong Wang wrote:
> > > On Fri, Apr 2, 2021 at 4:45 PM Alexei Starovoitov
> > > wrote:
> &
On Wed, Apr 14, 2021 at 04:48:25PM -0700, Andrii Nakryiko wrote:
> On Wed, Apr 14, 2021 at 3:00 PM Alexei Starovoitov wrote:
> >
> > On 4/14/21 1:01 PM, Andrii Nakryiko wrote:
> > > Add extra logic to handle map externs (only BTF-defined maps are
> > > support
On 4/14/21 1:01 PM, Andrii Nakryiko wrote:
While -Og is designed to work well with debugger, it's still inferior to -O0
in terms of debuggability experience. It will cause some variables to still be
inlined, it will also prevent single-stepping some statements and otherwise
interfere with debuggi
On 4/14/21 1:01 PM, Andrii Nakryiko wrote:
Add extra logic to handle map externs (only BTF-defined maps are supported for
linking). Re-use the map parsing logic used during bpf_object__open(). Map
externs are currently restricted to always and only specify map type, key
type and/or size, and valu
On Tue, Apr 13, 2021 at 9:32 AM wrote:
>
> > -Original Message-
> > From: Alexei Starovoitov
> >
> > On Tue, Apr 13, 2021 at 9:19 AM wrote:
> > >
> > > > -Original Message-
> > > > From: Alexei Starovo
On Tue, Apr 13, 2021 at 9:19 AM wrote:
>
> > -Original Message-
> > From: Alexei Starovoitov
> >
> > On Tue, Apr 13, 2021 at 9:10 AM wrote:
> > >
> > >
> > >
> > > > -Original Message-
> > > > Fro
On Tue, Apr 13, 2021 at 9:10 AM wrote:
>
>
>
> > -Original Message-
> > From: Alexei Starovoitov
> >
> > On Tue, Apr 13, 2021 at 2:52 AM Yang Li wrote:
> > >
> > > Fix the following coccicheck warnings:
> > > ./tools/
On Tue, Apr 13, 2021 at 2:52 AM Yang Li wrote:
>
> Fix the following coccicheck warnings:
> ./tools/testing/selftests/bpf/progs/profiler.inc.h:189:7-11: WARNING
> comparing pointer to 0, suggest !E
> ./tools/testing/selftests/bpf/progs/profiler.inc.h:361:7-11: WARNING
> comparing pointer to 0, sug
On Mon, Apr 05, 2021 at 05:36:27PM -0700, Cong Wang wrote:
> On Fri, Apr 2, 2021 at 4:45 PM Alexei Starovoitov
> wrote:
> >
> > On Fri, Apr 02, 2021 at 02:24:51PM -0700, Cong Wang wrote:
> > > > > where the key is the timer ID and the value is the timer expire
>
On Mon, Apr 12, 2021 at 12:11 AM Hao Sun wrote:
>
> Besides, another similar bug occurred while fault injection was enabled.
>
> BUG: unable to handle kernel paging request in bpf_prog_alloc_no_stats
>
> RAX: ffda RBX: 0
On Sat, Apr 03, 2021 at 01:24:12PM +0200, Toke Høiland-Jørgensen wrote:
> > if (!prog->aux->dst_trampoline && !tgt_prog) {
> > - err = -ENOENT;
> > - goto out_unlock;
> > + /*
> > +* Allow re-attach for tracing programs, if it's currently
> > +
On Sat, Apr 03, 2021 at 12:38:06AM +0530, Kumar Kartikeya Dwivedi wrote:
> On Sat, Apr 03, 2021 at 12:02:14AM IST, Alexei Starovoitov wrote:
> > On Fri, Apr 2, 2021 at 8:27 AM Kumar Kartikeya Dwivedi
> > wrote:
> > > [...]
> >
> > All of these things are mess
On Fri, Apr 2, 2021 at 10:12 PM Cong Wang wrote:
>
> On Wed, Mar 31, 2021 at 11:01 PM John Fastabend
> wrote:
> > This 'else if' is always true if above is false right? Would be
> > impler and clearer IMO as,
> >
> >if (used <= 0) {
> > if (!copied)
> >
On Fri, Apr 02, 2021 at 02:24:51PM -0700, Cong Wang wrote:
> > > where the key is the timer ID and the value is the timer expire
> > > timer.
> >
> > The timer ID is unnecessary. We cannot introduce new IDR for every new
> > bpf object. It doesn't scale.
>
> The IDR is per map, not per timer.
Per
On Wed, Mar 31, 2021 at 09:26:35PM -0700, Cong Wang wrote:
> This patch introduces a bpf timer map and a syscall to create bpf timer
> from user-space.
That will severely limit timer api usability.
I agree with Song here. If user space has to create it there is no reason
to introduce new sys_bpf
On Fri, Apr 2, 2021 at 8:27 AM Kumar Kartikeya Dwivedi wrote:
>
> This would be fine, because it's not a fast path or anything, but right now we
> return the id using the netlink response, otherwise for query we have to open
> the socket, prepare the msg, send and recv again. So it's a minor
> op
from:
git://git.kernel.org/pub/scm/linux/kernel/git/bpf/bpf-next.git
Thanks a lot!
Also thanks to reporters, reviewers and testers of commits in this pull-request:
Alexei Starovoitov, Andrii Nakryiko, Cong Wang, Jakub Sitnicki, John
Fastabend, Lorenz Bauer, Roman Gushchin, Song Liu, Yonghong
Merge branch 'AF_XDP Socket Creation Fixes' (2021-04-01 14:45:52 -0700)
--------
Alexei Starovoitov (1):
Merge branch 'AF_XDP Socket Creation Fixes'
Ciara Loftus (3):
libbpf: Ensure umem pointer is non-NUL
On Wed, Mar 31, 2021 at 12:06 AM Björn Töpel wrote:
>
> On Wed, 31 Mar 2021 at 08:43, Ciara Loftus wrote:
> >
> > This series fixes some issues around socket creation for AF_XDP.
> >
> > Patch 1 fixes a potential NULL pointer dereference in
> > xsk_socket__create_shared.
> >
> > Patch 2 ensures t
On Wed, Mar 31, 2021 at 7:04 AM Lorenz Bauer wrote:
>
> On Fri, 26 Mar 2021 at 16:05, Lorenz Bauer wrote:
> >
> > Invoking BPF_OBJ_GET on a pinned bpf_link checks the path access
> > permissions based on file_flags, but the returned fd ignores flags.
> > This means that any user can acquire a "re
On Wed, Mar 31, 2021 at 7:04 AM Lorenz Bauer wrote:
>
> On Fri, 26 Mar 2021 at 16:05, Lorenz Bauer wrote:
> >
> > Invoking BPF_OBJ_GET on a pinned bpf_link checks the path access
> > permissions based on file_flags, but the returned fd ignores flags.
> > This means that any user can acquire a "re
On Thu, Apr 1, 2021 at 10:52 AM John Fastabend wrote:
>
> Cong Wang wrote:
> > From: Cong Wang
> >
> > We have thousands of services connected to a daemon on every host
> > via AF_UNIX dgram sockets, after they are moved into VM, we have to
> > add a proxy to forward these communications from VM
On Tue, Mar 30, 2021 at 2:26 PM Daniel Borkmann wrote:
>
> On 3/30/21 10:39 PM, Andrii Nakryiko wrote:
> > On Sun, Mar 28, 2021 at 1:11 AM Kumar Kartikeya Dwivedi
> > wrote:
> >> On Sun, Mar 28, 2021 at 10:12:40AM IST, Andrii Nakryiko wrote:
> >>> Is there some succinct but complete enough docume
On Tue, Mar 30, 2021 at 1:28 PM Andrii Nakryiko
wrote:
> >
> > In the other thread you've proposed to copy paste hash implemenation
> > into pahole. That's not ideal. If we had libbpfutil other projects
> > could have used that without copy-paste.
>
> I know it's not ideal. But I don't think libbp
On Tue, Mar 30, 2021 at 3:54 PM Pedro Tammela wrote:
>
> BPF_CALL_2(bpf_ringbuf_submit, void *, sample, u64, flags)
> {
> + if (unlikely(flags & ~(BPF_RB_NO_WAKEUP | BPF_RB_FORCE_WAKEUP)))
> + return -EINVAL;
> +
> bpf_ringbuf_commit(sample, flags, false /* discard */
On Mon, Mar 29, 2021 at 3:54 PM Maciej Fijalkowski
wrote:
>
> Changes since v4 (all in patch 6):
> - do not close potentially invalid bpf_link fd (Toke)
> - fix misspelling in label (Toke)
> - mask out XDP_FLAGS_UPDATE_IF_NOEXIST and XDP_FLAGS_REPLACE explicitly when
> creating bpf_link (Toke)
On Mon, Mar 29, 2021 at 10:41 PM Martin KaFai Lau wrote:
>
> This set updates the document about the bpf program calling kernel
> function. In particular, updates are regarding to the clang
> requirement in selftests and kfunc-call not an ABI.
Applied.
On 3/26/21 9:25 PM, Andrii Nakryiko wrote:
Free temporary allocated memory used to construct finalized .BTF.ext data.
Found by Coverity static analysis on libbpf's Github repo.
Fixes: 8fd27bf69b86 ("libbpf: Add BPF static linker BTF and BTF.ext support")
Signed-off-by: Andrii Nakryiko
Applied.
On Tue, Mar 30, 2021 at 5:06 AM Ciara Loftus wrote:
>
> If the call to xsk_socket__create fails, the user may want to retry the
> socket creation using the same umem. Ensure that the umem is in the
> same state on exit if the call fails by:
> 1. ensuring the umem _save pointers are unmodified.
> 2
On Tue, Mar 30, 2021 at 2:43 AM Lorenz Bauer wrote:
>
> On Thu, 25 Mar 2021 at 01:52, Martin KaFai Lau wrote:
> >
> > This series adds support to allow bpf program calling kernel function.
>
> I think there are more build problems with this. Has anyone hit this before?
>
> $ CLANG=clang-12 O=../k
On Sun, Mar 28, 2021 at 07:38:42PM -0700, Andrii Nakryiko wrote:
>
> See above. I don't know which hassle is libbpf for users today. You
> were implying code size used for functionality users might not use
> (e.g., linker). Libbpf is a very small library, <300KB. There are
> users building tools f
On Sun, Mar 28, 2021 at 11:09:23PM -0700, Andrii Nakryiko wrote:
>
> BPF skeleton works just fine without BTF, if BPF programs don't use
> global data. I have no way of knowing how BPF skeleton is used in the
> wild, and specifically whether it is used without BTF and
> .data/.rodata.
No way of k
On Mon, Mar 29, 2021 at 1:41 AM Loftus, Ciara wrote:
>
> >
> > On Fri, Mar 26, 2021 at 02:29:46PM +, Ciara Loftus wrote:
> > > During xsk_socket__create the XDP_RX_RING and XDP_TX_RING
> > setsockopts
> > > are called to create the rx and tx rings for the AF_XDP socket. If the
> > > ring
> >
On Sat, Mar 27, 2021 at 09:32:58PM -0700, Andrii Nakryiko wrote:
> > I think it's better to start with new library for tc/xdp and have
> > libbpf as a dependency on that new lib.
> > For example we can add it as subdir in tools/lib/bpf/.
> >
> > Similarly I think integerating static linking into li
On Sat, Mar 27, 2021 at 04:17:16PM +0100, Toke Høiland-Jørgensen wrote:
> Alexei Starovoitov writes:
>
> > On Thu, Mar 25, 2021 at 05:30:03PM +0530, Kumar Kartikeya Dwivedi wrote:
> >> This adds some basic tests for the low level bpf_tc_* API and its
> >> bpf_progr
On Sun, Mar 28, 2021 at 5:32 PM Martin KaFai Lau wrote:
>
> There is a typo in the bbr function, s/even/event/.
> This patch fixes it.
>
> Fixes: e78aea8b2170 ("bpf: tcp: Put some tcp cong functions in allowlist for
> bpf-tcp-cc")
> Signed-off-by: Martin KaFai Lau
Applied.
On Fri, Mar 26, 2021 at 9:44 AM Andrii Nakryiko
wrote:
> > Because they double the maintenance cost now and double the support forever.
> > We never needed to worry about skeleton without BTF and now it would be
> > a thing ? So all tests realistically need to be doubled: with and without
> > BTF
On Sun, Mar 28, 2021 at 01:20:00PM -0700, Cong Wang wrote:
> From: Cong Wang
>
> We have thousands of services connected to a daemon on every host
> via AF_UNIX dgram sockets, after they are moved into VM, we have to
> add a proxy to forward these communications from VM to host, because
> rewriti
On Sun, Mar 28, 2021 at 5:05 AM Atul Gopinathan
wrote:
>
> Currently, building the bpf-next source with the CONFIG_BPF_SYSCALL
> enabled is causing a compilation error:
>
> "net/ipv4/bpf_tcp_ca.c:209:28: error: expected identifier or '(' before
> ',' token"
>
> Fix this by removing an unnecessary
On Sat, Mar 27, 2021 at 3:08 PM Cong Wang wrote:
> BTFIDS vmlinux
> FAILED unresolved symbol cubictcp_state
> make: *** [Makefile:1199: vmlinux] Error 255
>
> I suspect it is related to the kernel config or linker version.
>
> # grep TCP_CONG .config
> CONFIG_TCP_CONG_ADVANCED=y
> CONFIG_TCP_CO
On Sat, Mar 27, 2021 at 2:25 PM Cong Wang wrote:
>
> Hi,
>
> On Wed, Mar 24, 2021 at 8:40 PM Martin KaFai Lau wrote:
> > Martin KaFai Lau (14):
> > bpf: Simplify freeing logic in linfo and jited_linfo
> > bpf: Refactor btf_check_func_arg_match
> > bpf: Support bpf program calling kernel fun
On Sat, Mar 27, 2021 at 1:19 AM Jianlin Lv wrote:
>
> > On Fri, Mar 26, 2021 at 5:40 AM Jianlin Lv wrote:
> > >
> > > When CONFIG_BPF_JIT_ALWAYS_ON is enabled, the value of
> > bpf_jit_enable
> > > in /proc/sys is limited to SYSCTL_ONE. This is not convenient for
> > > debugging.
> > > This patc
On Wed, Mar 24, 2021 at 06:51:42PM -0700, Martin KaFai Lau wrote:
> ref_tname = btf_name_by_offset(btf, ref_t->name_off);
> - if (btf_get_prog_ctx_type(log, btf, t, env->prog->type, i)) {
> + if (btf_is_kernel(btf)) {
> + const struct btf_ty
On Fri, Mar 26, 2021 at 11:59:00AM +0100, Jiri Olsa wrote:
> Currently module can be unloaded even if there's a trampoline
> register in it. It's easily reproduced by running in parallel:
>
> # while :; do ./test_progs -t module_attach; done
> # while :; do rmmod bpf_testmod; sleep 0.5; done
>
On Fri, Mar 26, 2021 at 02:29:46PM +, Ciara Loftus wrote:
> During xsk_socket__create the XDP_RX_RING and XDP_TX_RING setsockopts
> are called to create the rx and tx rings for the AF_XDP socket. If the ring
> has already been set up, the setsockopt will return an error. However,
> in the event
On Thu, Mar 25, 2021 at 05:30:03PM +0530, Kumar Kartikeya Dwivedi wrote:
> This adds some basic tests for the low level bpf_tc_* API and its
> bpf_program__attach_tc_* wrapper on top.
*_block() apis from patch 3 and 4 are not covered by this selftest.
Why were they added ? And how were they tested
On Fri, Mar 26, 2021 at 5:40 AM Jianlin Lv wrote:
>
> When CONFIG_BPF_JIT_ALWAYS_ON is enabled, the value of bpf_jit_enable in
> /proc/sys is limited to SYSCTL_ONE. This is not convenient for debugging.
> This patch modifies the value of extra2 (max) to 2 that support developers
> to emit traces o
On 3/26/21 3:11 AM, Toke Høiland-Jørgensen wrote:
Martin KaFai Lau writes:
On Thu, Mar 25, 2021 at 11:02:23PM +0100, Toke Høiland-Jørgensen wrote:
Martin KaFai Lau writes:
This patch adds support to BPF verifier to allow bpf program calling
kernel function directly.
Hi Martin
This is ex
r you to fetch changes up to e2c69f3a5b4edfbcade2c38862c1839fc371c5d5:
bpf: Avoid old-style declaration warnings (2021-03-24 09:32:28 -0700)
Alexei Starovoitov (3):
Merge branch 'Build BPF selftests and its libbpf,
On Tue, Mar 23, 2021 at 10:15:33PM +0100, Jiri Olsa wrote:
> Currently module can be unloaded even if there's a trampoline
> register in it. It's easily reproduced by running in parallel:
>
> # while :; do ./test_progs -t module_attach; done
> # while :; do ./test_progs -t fentry_test; done
>
On Mon, Mar 22, 2021 at 09:56:19AM -0700, Andrii Nakryiko wrote:
> On Sun, Mar 21, 2021 at 6:07 PM Alexei Starovoitov
> wrote:
> >
> > On Sat, Mar 20, 2021 at 10:00:57AM -0700, Andrii Nakryiko wrote:
> > > On Fri, Mar 19, 2021 at 7:22 PM Alexei Starovoitov
> >
On Sat, Mar 20, 2021 at 10:00:57AM -0700, Andrii Nakryiko wrote:
> On Fri, Mar 19, 2021 at 7:22 PM Alexei Starovoitov
> wrote:
> >
> > On Fri, Mar 19, 2021 at 01:59:09PM -0700, Andrii Nakryiko wrote:
> > > Add ability to skip BTF generation for some BPF object files.
b/scm/linux/kernel/git/bpf/bpf.git
for you to fetch changes up to b9082970478009b778aa9b22d5561eef35b53b63:
bpf: Use NOP_ATOMIC5 instead of emit_nops(&prog, 5) for BPF_TRAMP_F_CALL_ORIG
(2021-03-19 19:25:39 -0700)
----
Alexei St
On Fri, Mar 19, 2021 at 6:40 PM Stanislav Fomichev wrote:
>
> On Fri, Mar 19, 2021 at 5:33 PM Alexei Starovoitov
> wrote:
> >
> > On Fri, Mar 19, 2021 at 5:25 PM Stanislav Fomichev wrote:
> > >
> > > On Fri, Mar 19, 2021 at 5:14 PM Alexei Starovoitov
>
On Fri, Mar 19, 2021 at 01:59:09PM -0700, Andrii Nakryiko wrote:
> Add ability to skip BTF generation for some BPF object files. This is done
> through using a convention of .nobtf.c file name suffix.
>
> Also add third statically linked file to static_linked selftest. This file has
> no BTF, caus
On Fri, Mar 19, 2021 at 5:25 PM Stanislav Fomichev wrote:
>
> On Fri, Mar 19, 2021 at 5:14 PM Alexei Starovoitov
> wrote:
> >
> > On Fri, Mar 19, 2021 at 5:00 PM Stanislav Fomichev wrote:
> > >
> > > __bpf_arch_text_poke does rewrite only for atomic
On Fri, Mar 19, 2021 at 5:00 PM Stanislav Fomichev wrote:
>
> __bpf_arch_text_poke does rewrite only for atomic nop5, emit_nops(xxx, 5)
> emits non-atomic one which breaks fentry/fexit with k8 atomics:
>
> P6_NOP5 == P6_NOP5_ATOMIC (0f1f44 == 0f1f44)
> K8_NOP5 != K8_NOP5_ATOMIC (906690
On 3/19/21 2:51 PM, Andrii Nakryiko wrote:
It's a matter of taste, I suppose. I'd probably disagree with you on
the readability of those verifier parts ;) So it's up to you, of
course, but for me this code pattern:
for (...) {
if (A) {
handleA;
} else if (B) {
handle
On Fri, Mar 19, 2021 at 8:17 AM Yonghong Song wrote:
>
>
>
> On 3/19/21 12:21 AM, Daniel Borkmann wrote:
> > On 3/19/21 3:11 AM, Piotr Krysiuk wrote:
> >> Hi Daniel,
> >>
> >> On Fri, Mar 19, 2021 at 12:16 AM Stephen Rothwell
> >> wrote:
> >>
> >>> diff --cc kernel/bpf/verifier.c
> >>> index 44e4
On 3/18/21 6:03 PM, Andrii Nakryiko wrote:
+ desc->imm = BPF_CAST_CALL(addr) - __bpf_call_base;
Is this difference guaranteed to always fit within s32?
we have this restriction in many places: JIT, dispatcher, trampoline,
and bpf interpreter.
Modules and kernel .text are in the same 4G
On Thu, Mar 18, 2021 at 12:42 PM Andrii Nakryiko wrote:
>
> This patch set adds new libbpf APIs and their bpftool integration that allows
> to perform static linking of BPF object files. Currently no extern resolution
> across object files is performed. This is going to be the focus of the follow
On 3/17/21 1:05 PM, Andrii Nakryiko wrote:
Provide NULL and KERNEL_VERSION macros in bpf_helpers.h. Patch #2 removes such
custom NULL definition from one of the selftests.
v2->v3:
- instead of vmlinux.h, do this in bpf_helpers.h;
- added KERNEL_VERSION, which comes up periodically as well;
On Wed, Mar 17, 2021 at 1:47 PM Andrii Nakryiko
wrote:
>
> On Tue, Mar 16, 2021 at 10:34 PM Alexei Starovoitov
> wrote:
> >
> > On Sat, Mar 13, 2021 at 11:35:36AM -0800, Andrii Nakryiko wrote:
> > >
> > > -$(TRUNNER
On Wed, Mar 17, 2021 at 5:52 AM Jianlin Lv wrote:
> return BPF_CLASS(meta->insn.code);
> diff --git a/include/uapi/linux/bpf.h b/include/uapi/linux/bpf.h
> index 2d3036e292a9..5d77675e7112 100644
> --- a/include/uapi/linux/bpf.h
> +++ b/include/uapi/linux/bpf.h
> @@ -21,6 +21,7 @@
> #defi
On Wed, Mar 17, 2021 at 10:38 AM Andrii Nakryiko
wrote:
> > diff --git a/tools/bpf/bpftool/btf.c b/tools/bpf/bpftool/btf.c
> > index 62953bbf68b4..ff6a76632873 100644
> > --- a/tools/bpf/bpftool/btf.c
> > +++ b/tools/bpf/bpftool/btf.c
> > @@ -405,6 +405,8 @@ static int dump_btf_c(const struct btf
On Sat, Mar 13, 2021 at 11:35:36AM -0800, Andrii Nakryiko wrote:
>
> -$(TRUNNER_BPF_SKELS): $(TRUNNER_OUTPUT)/%.skel.h:\
> - $(TRUNNER_OUTPUT)/%.o \
> - $(BPFTOOL)\
> -
On Sat, Mar 13, 2021 at 11:35:33AM -0800, Andrii Nakryiko wrote:
> + for (j = 0; j < n; j++, src_var++) {
> + void *sec_vars = dst_sec->sec_vars;
> +
> + sec_vars = libbpf_reallocarray(sec_vars,
> +
On 3/13/21 1:09 PM, Andrii Nakryiko wrote:
Build BPF selftests and libbpf and bpftool, that are used as part of
selftests, in debug mode (specifically, -Og). This makes it much simpler and
nicer to do development and/or bug fixing. See patch #4 for some unscientific
measurements.
This patch set
On Tue, Mar 09, 2021 at 08:04:26PM -0800, Andrii Nakryiko wrote:
> +
> + struct btf *strtab_btf; /* we use struct btf to manage strings */
...
> + str_off = btf__add_str(linker->strtab_btf, sec->sec_name);
> + sec->shdr->sh_name = str_off;
That bit took me an hour to grok.
That single
g IFF_PHONY_HEADROOM self-definition
xsk: Respect device's headroom and tailroom on generic xmit path
Alexei Starovoitov (8):
Merge branch 'bpf: enable task local storage for tracing'
Merge branch 'selftests/bpf: xsk improvements and new stats'
Merg
On Tue, Mar 9, 2021 at 12:37 PM Steven Rostedt wrote:
>
> The size of the fields and order changes all the time in various events. I
> recommend doing so *all the time*. If you upgrade a kernel, then all the bpf
> programs you have for that kernel should also be updated. You can't rely on
> fields
1 - 100 of 4471 matches
Mail list logo