On Fri, Aug 21, 2020 at 10:06 AM Andrii Nakryiko wrote:
>
> Add a set of APIs to perf_buffer manage to allow applications to integrate
> perf buffer polling into existing epoll-based infrastructure. One example is
> applications using libevent already and wanting to plug perf_buffer polling,
> ins
On Fri, Aug 21, 2020 at 12:04 PM Andrii Nakryiko
wrote:
>
> On Fri, Aug 21, 2020 at 11:44 AM Yonghong Song wrote:
> >
> > "link" has been an important concept for bpf ecosystem to connect
> > bpf program with other properties. Currently, the information related
> > information can be queried from
On Fri, Aug 21, 2020 at 1:53 PM Yonghong Song wrote:
>
>
>
> On 8/21/20 12:07 PM, Udip Pant wrote:
> >
> >
> > > On 8/20/20, 11:17 PM, "Yonghong Song" wrote:
> >>
> >>
> >>
> >> On 8/20/20 11:13 PM, Yonghong Song wrote:
> >>>
> >>>
> >>> On 8/20/20 5:28 PM, Udip Pant wrote:
> While using dy
Hi David,
The following pull-request contains BPF updates for your *net* tree.
We've added 11 non-merge commits during the last 5 day(s) which contain
a total of 12 files changed, 78 insertions(+), 24 deletions(-).
The main changes are:
1) three fixes in BPF task iterator logic, from Yonghong.
On Fri, Aug 21, 2020 at 6:36 AM Tobias Klauser wrote:
>
> Also remove trailing whitespaces in bpf_skb_get_tunnel_key example code.
>
> Signed-off-by: Tobias Klauser
Applied to bpf tree. Thanks
Please include destination tree in the subject line next time.
On Fri, Aug 21, 2020 at 08:01:32AM -0700, Roman Gushchin wrote:
>
> diff --git a/tools/testing/selftests/bpf/progs/map_ptr_kern.c
> b/tools/testing/selftests/bpf/progs/map_ptr_kern.c
> index 473665cac67e..49d1dcaf7999 100644
> --- a/tools/testing/selftests/bpf/progs/map_ptr_kern.c
> +++ b/tools/
On Thu, Aug 20, 2020 at 09:15:30AM -0700, Yonghong Song wrote:
>
>
> On 8/20/20 8:07 AM, Jakub Kicinski wrote:
> > On Wed, 19 Aug 2020 17:13:23 -0700 Yonghong Song wrote:
> > > + fill_link_info = iter_link->tinfo->reg_info->fill_link_info;
> > > + if (fill_link_info)
> > > + return fill_l
On Thu, Aug 20, 2020 at 3:29 AM Jakub Sitnicki wrote:
>
> On Tue, Aug 18, 2020 at 08:19 PM CEST, Alexei Starovoitov wrote:
> > On Tue, Aug 18, 2020 at 8:49 AM Jakub Sitnicki wrote:
> >> : rcu_read_lock();
> >> :
On Tue, Aug 18, 2020 at 10:12:05AM +0100, Alan Maguire wrote:
>
> Fair enough. I'm thinking a helper like
>
> long bpf_btf_snprintf(char *str, u32 str_size, struct btf_ptr *ptr,
> u32 ptr_size, u64 flags);
>
> Then the user can choose perf event or ringbuf interfaces
> to sha
On Thu, Aug 20, 2020 at 7:27 AM Carlos Neira wrote:
>
> Currently tests for bpf_get_ns_current_pid_tgid() are outside test_progs.
> This change folds both tests into test_progs.
>
> Changes from V5:
> - Fold both tests into test_progs.
>
> Signed-off-by: Carlos Neira
It doesn't apply. Pls rebas
On Wed, Aug 19, 2020 at 03:40:23PM -0700, Hao Luo wrote:
> +
> /* verify BPF_LD_IMM64 instruction */
> static int check_ld_imm(struct bpf_verifier_env *env, struct bpf_insn *insn)
> {
> @@ -7234,6 +7296,9 @@ static int check_ld_imm(struct bpf_verifier_env *env,
> struct bpf_insn *insn)
>
On Thu, Aug 20, 2020 at 1:24 AM Lorenzo Bianconi wrote:
>
> > 7f0a838254bd ("bpf, xdp: Maintain info on attached XDP BPF programs in
> > net_device")
> > inadvertently changed which XDP mode is assumed when no mode flags are
> > specified explicitly. Previously, driver mode was preferred, if driv
On Thu, Aug 20, 2020 at 10:54 AM Yonghong Song wrote:
>
>
>
> On 8/20/20 10:36 AM, Mark Wielaard wrote:
> > Hi
> >
> > On Thu, 2020-08-20 at 08:51 -0700, Yonghong Song wrote:
> Do you think we could skip these .debug_* sections somehow in elf
> parsing in resolve_btfids? resolve_btfids d
On Wed, Aug 19, 2020 at 12:45:14PM -0700, Andrii Nakryiko wrote:
>
> Selftests are added for all the new features. Selftests utilizing new Clang
> built-ins are designed such that they will compile with older Clangs and will
> be skipped during test runs. So this shouldn't cause any build and test
On Tue, Aug 18, 2020 at 7:00 PM Maciej Żenczykowski
wrote:
>
> From: Maciej Żenczykowski
>
> This reduces likelihood of incorrect use.
>
> Test: builds
I kept this in the commit log though it's a pointless comment.
Please reconsider for the future.
If you want to mention how you've tested it, pl
On Tue, Aug 18, 2020 at 6:07 PM Maciej Żenczykowski
wrote:
>
> From: Maciej Żenczykowski
>
> This reduces likelihood of incorrect use.
>
> Test: builds
> Signed-off-by: Maciej Żenczykowski
Applied. Thanks
On Wed, Aug 19, 2020 at 1:13 PM Andrii Nakryiko
wrote:
>
> On Tue, Aug 18, 2020 at 6:42 PM Yonghong Song wrote:
> >
> >
> >
> > On 8/18/20 2:33 PM, Andrii Nakryiko wrote:
> > > Add BPF program code sanitization pass, replacing calls to BPF
> > > bpf_probe_read_{kernel,user}[_str]() helpers with b
From: Alexei Starovoitov
Add a test that mounts two bpffs instances and checks progs.debug
and maps.debug for sanity data.
Signed-off-by: Alexei Starovoitov
---
.../selftests/bpf/prog_tests/test_bpffs.c | 94 +++
1 file changed, 94 insertions(+)
create mode 100644 tools
From: Alexei Starovoitov
v5->v6:
- refactored Makefiles with Andrii's help
- switched to explicit $(MAKE) style
- switched to userldlibs instead of userldflags
- fixed build issue with libbpf Makefile due to invocation from kbuild
- fixed menuconfig order as spotted by Daniel
- in
From: Alexei Starovoitov
Refactor the code a bit to extract bpf_link_by_id() helper.
It's similar to existing bpf_prog_by_id().
Signed-off-by: Alexei Starovoitov
Acked-by: Andrii Nakryiko
Acked-by: Song Liu
---
include/linux/bpf.h | 1 +
kernel/bpf/syscall.c
From: Alexei Starovoitov
Add kernel module with user mode driver that populates bpffs with
BPF iterators.
$ mount bpffs /my/bpffs/ -t bpf
$ ls -la /my/bpffs/
total 4
drwxrwxrwt 2 root root0 Jul 2 00:27 .
drwxr-xr-x 19 root root 4096 Jul 2 00:09 ..
-rw--- 1 root root0 Jul 2 00
From: Alexei Starovoitov
The program and map iterators work similar to seq_file-s.
Once the program is pinned in bpffs it can be read with "cat" tool
to print human readable output. In this case about BPF programs and maps.
For example:
$ cat /sys/fs/bpf/progs.debug
id name
On 8/18/20 6:36 PM, Andrii Nakryiko wrote:
Get rid of two feature detectors: reallocarray and libelf-mmap. Optional
feature detections complicate libbpf Makefile and cause more troubles for
various applications that want to integrate libbpf as part of their build.
Patch #1 replaces all reallocar
On Tue, Aug 18, 2020 at 06:31:51PM -0700, Andrii Nakryiko wrote:
> On Tue, Aug 18, 2020 at 6:21 PM Alexei Starovoitov
> wrote:
> >
> > On Tue, Aug 18, 2020 at 03:39:12PM -0700, Andrii Nakryiko wrote:
> > > This patch set adds libbpf support to two new classes
On Tue, Aug 18, 2020 at 6:24 PM Andrii Nakryiko wrote:
>
> Get rid of two feature detectors: reallocarray and libelf-mmap. Optional
> feature detections complicate libbpf Makefile and cause more troubles for
> various applications that want to integrate libbpf as part of their build.
>
> Patch #1
On Tue, Aug 18, 2020 at 03:39:12PM -0700, Andrii Nakryiko wrote:
> This patch set adds libbpf support to two new classes of CO-RE relocations:
> type-based (TYPE_EXISTS/TYPE_SIZE/TYPE_ID_LOCAL/TYPE_ID_TARGET) and enum
> value-vased (ENUMVAL_EXISTS/ENUMVAL_VALUE):
>
> LLVM patches adding these relo
On Tue, Aug 18, 2020 at 02:59:08PM -0700, Andrii Nakryiko wrote:
> It's trivial to handle missing ELF_C_MMAP_READ support in libelf the way that
> objtool has solved it in
> ("774bec3fddcc objtool: Add fallback from ELF_C_READ_MMAP to ELF_C_READ").
>
> So instead of having an entire feature detect
On Tue, Aug 18, 2020 at 05:30:37PM -0700, Yonghong Song wrote:
>
>
> On 8/18/20 5:05 PM, Alexei Starovoitov wrote:
> > On Tue, Aug 18, 2020 at 03:23:09PM -0700, Yonghong Song wrote:
> > >
> > > We did not use cond_resched() since for some iterators, e.g.,
On Tue, Aug 18, 2020 at 02:33:49PM -0700, Andrii Nakryiko wrote:
> This patch set refactors libbpf feature probing to be done lazily on as-needed
> basis, instead of proactively testing all possible features libbpf knows
> about. This allows to scale such detections and mitigations better, without
On Tue, Aug 18, 2020 at 1:39 AM Maciej Żenczykowski
wrote:
>
> From: Maciej Żenczykowski
>
> Test: builds
> Signed-off-by: Maciej Żenczykowski
I know it's a trivial patch, but please provide a proper commit log and explain
_why_ this type safety is necessary.
Also pls use email subject with [PA
On Tue, Aug 18, 2020 at 8:54 AM Yonghong Song wrote:
>
>
>
> On 8/18/20 12:16 AM, Xu Wang wrote:
> > Replace a comma between expression statements by a semicolon.
> >
> > Signed-off-by: Xu Wang
>
> Acked-by: Yonghong Song
Applied. Thanks
On Tue, Aug 18, 2020 at 9:01 AM Yonghong Song wrote:
>
>
>
> On 8/17/20 10:16 PM, Daniel T. Lee wrote:
> > From commit f1394b798814 ("block: mark blk_account_io_completion
> > static") symbol blk_account_io_completion() has been marked as static,
> > which makes it no longer possible to attach kp
On Tue, Aug 18, 2020 at 03:23:09PM -0700, Yonghong Song wrote:
>
> We did not use cond_resched() since for some iterators, e.g.,
> netlink iterator, where rcu read_lock critical section spans between
> consecutive seq_ops->next(), which makes impossible to do cond_resched()
> in the key while loop
On Tue, Aug 18, 2020 at 8:49 AM Jakub Sitnicki wrote:
> : rcu_read_lock();
> : run_array =
> rcu_dereference(net->bpf.run_array[NETNS_BPF_SK_LOOKUP]);
> 0.01 : 817f8624: mov0xd68(%r12),%rsi
> :
On Tue, Aug 18, 2020 at 9:24 AM Yonghong Song wrote:
> index f21b5e1e4540..885b14cab2c0 100644
> --- a/kernel/bpf/task_iter.c
> +++ b/kernel/bpf/task_iter.c
> @@ -27,6 +27,8 @@ static struct task_struct *task_seq_get_next(struct
> pid_namespace *ns,
> struct task_struct *task = NULL;
>
On Tue, Aug 18, 2020 at 9:47 AM Andrii Nakryiko wrote:
>
> On ppc64le we get the following warning:
>
> In file included from btf_dump.c:16:0:
> btf_dump.c: In function ‘btf_dump_emit_struct_def’:
> ../include/linux/kernel.h:20:17: error: comparison of distinct pointer
> types lacks a cast
On Mon, Aug 17, 2020 at 11:27 AM Josef Bacik wrote:
>
> On 8/17/20 1:42 PM, Yonghong Song wrote:
> > With latest `bpftool prog` command, we observed the following kernel
> > panic.
> > BUG: kernel NULL pointer dereference, address:
> >
> > This patch used get_file_rcu() which
On Fri, Aug 14, 2020 at 02:06:37PM +0100, Alan Maguire wrote:
> On Wed, 12 Aug 2020, Alexei Starovoitov wrote:
>
> > On Thu, Aug 06, 2020 at 03:42:23PM +0100, Alan Maguire wrote:
> > >
> > > The bpf_trace_printk tracepoint is augmented with a "trace_i
On Thu, Aug 13, 2020 at 01:49:36PM -0700, Andrii Nakryiko wrote:
> This patch set contains fixes to libbpf, bpftool, and selftests that were
> found while testing libbpf and selftests built in 32-bit mode. 64-bit nature
> of BPF target and 32-bit host environment don't always mix together well
> wi
On Thu, Aug 13, 2020 at 12:17:13AM -0700, Andrii Nakryiko wrote:
> This patch set contains fixes to libbpf, bpftool, and selftests that were
> found while testing libbpf and selftests built in 32-bit mode. 64-bit nature
> of BPF target and 32-bit host environment don't always mix together well
> wi
On Thu, Aug 06, 2020 at 03:42:23PM +0100, Alan Maguire wrote:
>
> The bpf_trace_printk tracepoint is augmented with a "trace_id"
> field; it is used to allow tracepoint filtering as typed display
> information can easily be interspersed with other tracing data,
> making it hard to read. Specifyin
On Wed, Aug 12, 2020 at 8:27 AM Song Liu wrote:
>
>
>
> > On Aug 12, 2020, at 5:31 AM, Jiri Olsa wrote:
> >
> > Currently when we look for build id within bpf_get_stackid helper
> > call, we check the first NOTE section and we fail if build id is
> > not there.
> >
> > However on some system (Fed
On Wed, Aug 12, 2020 at 8:35 AM Song Liu wrote:
>
>
>
> > On Aug 11, 2020, at 7:59 PM, Andrii Nakryiko wrote:
> >
> > Seems like C++17 standard mode doesn't recognize typeof() anymore. This can
> > be tested by compiling test_cpp test with -std=c++17 or -std=c++1z options.
> > The use of typeof i
On Wed, Aug 12, 2020 at 8:48 AM Stanislav Fomichev wrote:
>
> On Wed, Aug 12, 2020 at 2:24 AM Toke Høiland-Jørgensen
> wrote:
> >
> > Andrii Nakryiko writes:
> >
> > > Enforce XDP_FLAGS_UPDATE_IF_NOEXIST only if new BPF program to be
> > > attached is
> > > non-NULL (i.e., we are not detaching
On Fri, Aug 07, 2020 at 11:45:45AM +0200, Jiri Olsa wrote:
> hi,
> adding d_path helper function that returns full path for
> given 'struct path' object, which needs to be the kernel
> BTF 'path' object. The path is returned in buffer provided
> 'buf' of size 'sz' and is zero terminated.
>
> lon
On Thu, Aug 06, 2020 at 04:48:27PM -0700, Andrii Nakryiko wrote:
> On Thu, Aug 6, 2020 at 3:30 PM Alexei Starovoitov
> wrote:
> >
> > On Tue, Aug 04, 2020 at 11:24:07AM -0700, Andrii Nakryiko wrote:
> > > +
> > > +SEC("raw_tracepoint/sys_enter
On Thu, Aug 6, 2020 at 3:46 AM Jianlin Lv wrote:
>
> Clang compiler version: 12.0.0
> The following warning appears during the selftests/bpf compilation:
>
> prog_tests/send_signal.c:51:3: warning: ignoring return value of ‘write’,
> declared with attribute warn_unused_result [-Wunused-result]
>
On Thu, Aug 6, 2020 at 11:42 AM Jiri Benc wrote:
>
> Several bpf tests are interrupted by the default timeout of 45 seconds added
> by commit 852c8cbf34d3 ("selftests/kselftest/runner.sh: Add 45 second
> timeout per test"). In my case it was test_progs, test_tunnel.sh,
> test_lwt_ip_encap.sh and t
On Thu, Aug 6, 2020 at 11:26 AM Stanislav Fomichev wrote:
>
> I get the following error during compilation on my side:
> kernel/trace/bpf_trace.c: In function 'bpf_do_trace_printk':
> kernel/trace/bpf_trace.c:386:34: error: function 'bpf_do_trace_printk' can
> never be inlined because it uses var
On Thu, Aug 6, 2020 at 11:22 AM wrote:
>
> On 08/06, Stanislav Fomichev wrote:
> > int sets_patch(struct object *obj) doesn't have a 'return 0' at the end.
>
> > Signed-off-by: Stanislav Fomichev
> > ---
> > tools/bpf/resolve_btfids/main.c | 1 +
> > 1 file changed, 1 insertion(+)
>
> > diff -
On Wed, Aug 5, 2020 at 11:22 PM John Fastabend wrote:
>
> Daniel T. Lee wrote:
> > Recently, from commit 94a1fedd63ed ("libbpf: Add btf__parse_raw() and
> > generic btf__parse() APIs"), new API has been added to libbpf that
> > allows to parse BTF from raw data file (btf__parse_raw()).
> >
> > The
On Tue, Aug 4, 2020 at 10:51 PM Yonghong Song wrote:
>
> Andrii raised a concern that current uapi for bpf iterator map
> element is a little restrictive and not suitable for future potential
> complex customization. This is a valid suggestion, considering people
> may indeed add more complex cust
On Wed, Aug 5, 2020 at 11:27 PM John Fastabend wrote:
>
> Andrii Nakryiko wrote:
> > runqslower's Makefile is building/installing bpftool into
> > $(OUTPUT)/sbin/bpftool, which coincides with $(DEFAULT_BPFTOOL). In practice
> > this means that often when building selftests from scratch (after `mak
On Tue, Aug 04, 2020 at 11:24:07AM -0700, Andrii Nakryiko wrote:
> +
> +SEC("raw_tracepoint/sys_enter")
> +int test_core_type_id(void *ctx)
> +{
> + struct core_reloc_type_id_output *out = (void *)&data.out;
> +
> + out->local_anon_struct = bpf_core_type_id_local(struct { int
> marker_fiel
On Thu, Aug 6, 2020 at 10:51 AM Andrii Nakryiko
wrote:
> > I haven't checked which of the patches, or some in other series caused
> > this on Clear Linux:
> >
> > 21 clearlinux:latest : FAIL gcc (Clear Linux OS for Intel
> > Architecture) 10.2.1 20200723 releases/gcc-10.2.0-3-g677b8
On Wed, Aug 5, 2020 at 4:10 PM wrote:
> > Since google folks have trouble with zoom I've added google meets link
> > to the spreadsheet. Let's try it tomorrow.
Today we held BPF office hours via google meet and it worked well.
So we will be using it for future meetings.
zoom link has been removed
On Wed, Aug 05, 2020 at 06:56:26PM +, Song Liu wrote:
>
>
> > On Aug 5, 2020, at 10:16 AM, Alexei Starovoitov
> > wrote:
> >
> > On Wed, Aug 05, 2020 at 04:47:30AM +, Song Liu wrote:
> >>
> >> Being able to trigger BPF program on a di
On Wed, Aug 05, 2020 at 10:27:28AM -0700, Andrii Nakryiko wrote:
> On Wed, Aug 5, 2020 at 10:16 AM Alexei Starovoitov
> wrote:
> >
> > On Wed, Aug 05, 2020 at 04:47:30AM +, Song Liu wrote:
> > >
> > > Being able to trigger BPF program on a different CPU c
On Wed, Aug 05, 2020 at 04:47:30AM +, Song Liu wrote:
>
> Being able to trigger BPF program on a different CPU could enable many
> use cases and optimizations. The use case I am looking at is to access
> perf_event and percpu maps on the target CPU. For example:
> 0. trigger the program
On Mon, Aug 3, 2020 at 10:40 AM Daniel Borkmann wrote:
>
> On 8/3/20 7:34 PM, Daniel Borkmann wrote:
> > On 8/3/20 7:15 PM, Daniel Borkmann wrote:
> >> On 8/3/20 12:29 AM, Alexei Starovoitov wrote:
> >>> From: Alexei Starovoitov
> >>>
> >>&g
On Mon, Aug 03, 2020 at 12:36:30AM +0300, Dmitry Yakunin wrote:
> Now it's impossible to test all branches of cgroup_skb bpf program which
> accesses skb->family and skb->{local,remote}_ip{4,6} fields because they
> are zeroed during socket allocation. This commit fills socket family and
> addresse
From: Alexei Starovoitov
Refactor the code a bit to extract bpf_link_by_id() helper.
It's similar to existing bpf_prog_by_id().
Signed-off-by: Alexei Starovoitov
Acked-by: Andrii Nakryiko
Acked-by: Song Liu
---
include/linux/bpf.h | 1 +
kernel/bpf/syscall.c
From: Alexei Starovoitov
Add kernel module with user mode driver that populates bpffs with
BPF iterators.
$ mount bpffs /my/bpffs/ -t bpf
$ ls -la /my/bpffs/
total 4
drwxrwxrwt 2 root root0 Jul 2 00:27 .
drwxr-xr-x 19 root root 4096 Jul 2 00:09 ..
-rw--- 1 root root0 Jul 2 00
From: Alexei Starovoitov
v4->v5:
- addressed Song and Andrii feedback. s/pages/max_entries/
v3->v4:
- took THIS_MODULE in patch 3 as suggested by Daniel to simplify the code.
- converted BPF iterator to use BTF (when available) to print full BPF program
name
instead of 16-byte tru
From: Alexei Starovoitov
The program and map iterators work similar to seq_file-s.
Once the program is pinned in bpffs it can be read with "cat" tool
to print human readable output. In this case about BPF programs and maps.
For example:
$ cat /sys/fs/bpf/progs.debug
id name
From: Alexei Starovoitov
Add a test that mounts two bpffs instances and checks progs.debug
and maps.debug for sanity data.
Signed-off-by: Alexei Starovoitov
---
.../selftests/bpf/prog_tests/test_bpffs.c | 94 +++
1 file changed, 94 insertions(+)
create mode 100644 tools
On Fri, Jul 31, 2020 at 2:55 PM John Fastabend wrote:
>
> Andrii Nakryiko wrote:
> > core_retro selftest uses BPF program that's triggered on sys_enter
> > system-wide, but has no protection from some unrelated process doing syscall
> > while selftest is running. This leads to occasional test fail
On Fri, Jul 31, 2020 at 11:29 AM Andrii Nakryiko wrote:
>
> This patch set adds new BPF link operation, LINK_DETACH, allowing processes
> with BPF link FD to force-detach it from respective BPF hook, similarly how
> BPF link is auto-detached when such BPF hook (e.g., cgroup, net_device, netns,
> e
On Thu, Jul 30, 2020 at 7:44 PM Andrii Nakryiko wrote:
>
> The '&&' command seems to have a bad effect when $(cmd_$(1)) exits with
> non-zero effect: the command failure is masked (despite `set -e`) and all but
> the first command of $(dep-cmd) is executed (successfully, as they are mostly
> print
On Sat, Aug 01, 2020 at 07:03:18PM +0200, Jiri Olsa wrote:
> Adding d_path helper function that returns full path for
> given 'struct path' object, which needs to be the kernel
> BTF 'path' object. The path is returned in buffer provided
> 'buf' of size 'sz' and is zero terminated.
>
> bpf_d_pat
On Sat, Aug 01, 2020 at 09:13:57AM +0200, Maciej Fijalkowski wrote:
> On Sat, Aug 01, 2020 at 03:03:19AM +0200, Daniel Borkmann wrote:
> > On 7/31/20 2:03 AM, Maciej Fijalkowski wrote:
> > > v5->v6:
> > > - propagate only those poke descriptors that individual subprogram is
> > >actually using
On Fri, Jul 31, 2020 at 02:07:42AM +0200, Daniel Borkmann wrote:
> On 7/30/20 6:13 PM, Christian Brauner wrote:
> > On Thu, Jul 30, 2020 at 06:09:00PM +0200, Christoph Hellwig wrote:
> > > __bpfilter_process_sockopt never initialized the pos variable passed to
> > > the pipe write. This has been m
On Tue, Jul 21, 2020 at 11:46 PM Andrii Nakryiko wrote:
>
> Following cgroup and netns examples, implement bpf_link support for XDP.
>
> The semantics is described in patch #2. Program and link attachments are
> mutually exclusive, in the sense that neither link can replace attached
> program nor
On Sat, Jul 25, 2020 at 3:58 AM Kuniyuki Iwashima wrote:
>
> From: Willem de Bruijn
> Date: Fri, 24 Jul 2020 22:54:57 -0400
> > From: Willem de Bruijn
> >
> > Commit efc6b6f6c311 ("udp: Improve load balancing for SO_REUSEPORT.")
> >
> > in net conflicts with
> >
> > Commit 72f7e9440e9b ("udp
On Fri, Jul 24, 2020 at 1:08 PM Song Liu wrote:
>
> Architectures like s390, powerpc, arm64, riscv have speical definition of
> bpf_user_pt_regs_t. So we need to cast the pointer before passing it to
> bpf_get_stack(). This is similar to bpf_get_stack_tp().
>
> Fixes: 03d42fd2d83f ("bpf: Separate
From: Alexei Starovoitov
Add a test that mounts two bpffs instances and checks progs.debug
and maps.debug for sanity data.
Signed-off-by: Alexei Starovoitov
---
.../selftests/bpf/prog_tests/test_bpffs.c | 94 +++
1 file changed, 94 insertions(+)
create mode 100644 tools
From: Alexei Starovoitov
v3->v4:
- took THIS_MODULE in patch 3 as suggested by Daniel to simplify the code.
- converted BPF iterator to use BTF (when available) to print full BPF program
name
instead of 16-byte truncated version.
This is something I've been using drgn scripts for.
Tak
From: Alexei Starovoitov
Add kernel module with user mode driver that populates bpffs with
BPF iterators.
$ mount bpffs /my/bpffs/ -t bpf
$ ls -la /my/bpffs/
total 4
drwxrwxrwt 2 root root0 Jul 2 00:27 .
drwxr-xr-x 19 root root 4096 Jul 2 00:09 ..
-rw--- 1 root root0 Jul 2 00
From: Alexei Starovoitov
The program and map iterators work similar to seq_file-s.
Once the program is pinned in bpffs it can be read with "cat" tool
to print human readable output. In this case about BPF programs and maps.
For example:
$ cat /sys/fs/bpf/progs.debug
id name
From: Alexei Starovoitov
Refactor the code a bit to extract bpf_link_get_by_id() helper.
It's similar to existing bpf_prog_by_id().
Signed-off-by: Alexei Starovoitov
Acked-by: Andrii Nakryiko
---
include/linux/bpf.h | 1 +
kernel/bpf/syscall.c
On Fri, Jul 24, 2020 at 6:38 AM Willem de Bruijn
wrote:
>
> On Fri, Jul 24, 2020 at 2:13 AM Kuniyuki Iwashima wrote:
> >
> > From: David Miller
> > Date: Thu, 23 Jul 2020 15:10:51 -0700 (PDT)
> > > From: Kuniyuki Iwashima
> > > Date: Thu, 23 Jul 2020 01:52:27 +0900
> > >
> > > > This patch
On Fri, Jul 24, 2020 at 04:53:47PM +0200, Daniel Borkmann wrote:
>
> static const struct bpf_preload_umd_ops umd_ops = {
> .preload= do_preload,
> .finish = do_finish,
> .owner = THIS_MODULE,
> };
Thanks for the suggestion. It helped to get rid of
From: Alexei Starovoitov
Refactor the code a bit to extract bpf_link_get_by_id() helper.
It's similar to existing bpf_prog_by_id().
Signed-off-by: Alexei Starovoitov
Acked-by: Andrii Nakryiko
---
include/linux/bpf.h | 1 +
kernel/bpf/syscall.c
From: Alexei Starovoitov
The program and map iterators work similar to seq_file-s.
Once the program is pinned in bpffs it can be read with "cat" tool
to print human readable output. In this case about BPF programs and maps.
For example:
$ cat /sys/fs/bpf/progs.debug
id name
From: Alexei Starovoitov
Add kernel module with user mode driver that populates bpffs with
BPF iterators.
$ mount bpffs /my/bpffs/ -t bpf
$ ls -la /my/bpffs/
total 4
drwxrwxrwt 2 root root0 Jul 2 00:27 .
drwxr-xr-x 19 root root 4096 Jul 2 00:09 ..
-rw--- 1 root root0 Jul 2 00
From: Alexei Starovoitov
v2->v3:
- fixed module unload race (Daniel)
- added selftest (Daniel)
- fixed build bot warning
v1->v2:
- changed names to 'progs.debug' and 'maps.debug' to hopefully better indicate
instability of the text output. Having dot in the name al
From: Alexei Starovoitov
Add a test that mounts two bpffs instances and checks progs.debug
and maps.debug for sanity data.
Signed-off-by: Alexei Starovoitov
---
.../selftests/bpf/prog_tests/test_bpffs.c | 94 +++
1 file changed, 94 insertions(+)
create mode 100644 tools
On Thu, Jul 23, 2020 at 11:06:48AM -0700, Song Liu wrote:
> + pmu_fd = syscall(__NR_perf_event_open, &attr, -1 /* pid */,
> + 0 /* cpu 0 */, -1 /* group id */,
> + 0 /* flags */);
> + if (pmu_fd < 0 && errno == ENOENT) {
> + printf("%s:S
On Thu, Jul 23, 2020 at 11:41:08AM -0700, Yonghong Song wrote:
> Bpf iterator has been implemented for task, task_file,
> bpf_map, ipv6_route, netlink, tcp and udp so far.
>
> For map elements, there are two ways to traverse all elements from
> user space:
> 1. using BPF_MAP_GET_NEXT_KEY bpf sub
On Thu, Jul 23, 2020 at 7:19 AM wrote:
>
> From: Tom Rix
>
> A link error
>
> kernel/bpf/net_namespace.o: In function `bpf_netns_link_release':
> net_namespace.c: undefined reference to `bpf_sk_lookup_enabled'
>
> bpf_sk_lookup_enabled is defined with INET
> net_namespace is controlled by BPF_SYS
On Wed, Jul 22, 2020 at 11:20 PM Song Liu wrote:
>
>
>
> > On Jul 22, 2020, at 10:55 PM, Alexei Starovoitov
> > wrote:
> >
> > On Wed, Jul 22, 2020 at 11:42:08AM -0700, Song Liu wrote:
> >> diff --git a/kernel/events/core.c b/kernel/events/core.c
>
On Wed, Jul 22, 2020 at 11:15:33PM -0700, Yonghong Song wrote:
> Bpf iterator has been implemented for task, task_file,
> bpf_map, ipv6_route, netlink, tcp and udp so far.
>
> For map elements, there are two ways to traverse all elements from
> user space:
> 1. using BPF_MAP_GET_NEXT_KEY bpf sub
On Wed, Jul 22, 2020 at 11:42:08AM -0700, Song Liu wrote:
> diff --git a/kernel/events/core.c b/kernel/events/core.c
> index 856d98c36f562..f77d009fcce95 100644
> --- a/kernel/events/core.c
> +++ b/kernel/events/core.c
> @@ -9544,6 +9544,24 @@ static int perf_event_set_bpf_handler(struct
> perf_ev
On Wed, Jul 22, 2020 at 11:49:45AM -0700, Yonghong Song wrote:
> diff --git a/kernel/bpf/map_iter.c b/kernel/bpf/map_iter.c
> index 8a7af11b411f..5812dd465c49 100644
> --- a/kernel/bpf/map_iter.c
> +++ b/kernel/bpf/map_iter.c
> @@ -85,17 +85,21 @@ static const struct seq_operations bpf_map_seq_ops
On Wed, Jul 22, 2020 at 9:59 AM Kuniyuki Iwashima wrote:
>
> From: Jakub Sitnicki
> Date: Wed, 22 Jul 2020 18:17:18 +0200
> > This mini series contains a fix for a bug noticed when analyzing a reported
> > merge conflict between bpf-next and net tree [0].
> >
> > Apart from fixing a corner-ca
On Wed, Jul 22, 2020 at 1:21 AM Quentin Monnet wrote:
>
> On 22/07/2020 05:38, Andrii Nakryiko wrote:
> > Strip away DWARF info from .bpf.o files, before generating BPF skeletons.
> > This reduces bpftool binary size from 3.43MB to 2.58MB.
> >
> > Signed-off-by: Andrii Nakryiko
> Acked-by: Quenti
On Tue, Jul 21, 2020 at 11:02:04PM -0700, Andrii Nakryiko wrote:
>
> Just one technical moment, let me double-check my understanding again.
> You seem to be favoring pre-creating bpf_tracing_link because there is
> both tgt_prog (that we refcnt on EXT prog load) and we also lookup and
> initialize
On Wed, Jul 22, 2020 at 8:50 AM Willem de Bruijn
wrote:
>
> > TBH, I don't what is the preferred way to handle it. Perhaps DaveM or
> > Alexei/Daniel can say what would make their life easiest?
>
> Good point.
>
> With the above, there still remains a merge conflict, of course. But
> then we can t
On Wed, Jul 22, 2020 at 12:56 AM Christoph Hellwig wrote:
>
> On Mon, Jul 20, 2020 at 01:47:56PM -0700, Alexei Starovoitov wrote:
> > > a kernel pointer. This is something that works for most common sockopts
> > > (and is something that the ePBF support relies on), bu
ou to fetch changes up to 9165e1d70fb34ce438e78aad90408cfa86e4c2d0:
bpftool: Use only nftw for file tree parsing (2020-07-21 23:42:56 +0200)
Alexei Starovoitov (3):
Merge branch 'bpf-socket-lookup'
Merge bra
501 - 600 of 4471 matches
Mail list logo