On 05/21, Yonghong Song wrote:
> This patch tries to solve the following specific use case.
>
> Currently, bpf program can already collect stack traces
> through kernel function get_perf_callchain()
> when certain events happens (e.g., cache miss counter or
> cpu clock counter overflows). But such
On 05/22, Alexei Starovoitov wrote:
> On 5/22/19 9:15 AM, Andrii Nakryiko wrote:
> > It's easy to have a mismatch of "intended to be public" vs really
> > exposed API functions. While Makefile does check for this mismatch, if
> > it actually occurs it's not trivial to determine which functions are
On 05/22, Alexei Starovoitov wrote:
> On 5/22/19 9:38 AM, Stanislav Fomichev wrote:
> > On 05/21, Yonghong Song wrote:
> >> This patch tries to solve the following specific use case.
> >>
> >> Currently, bpf program can already collect stack traces
> >&g
On 05/22, Andrii Nakryiko wrote:
> On Wed, May 22, 2019 at 9:46 AM Stanislav Fomichev wrote:
> >
> > On 05/22, Alexei Starovoitov wrote:
> > > On 5/22/19 9:15 AM, Andrii Nakryiko wrote:
> > > > It's easy to have a mismatch of "intended to be public&q
On 05/21, Yonghong Song wrote:
> The test covered both nmi and tracepoint perf events.
> $ ./test_send_signal_user
> test_send_signal (tracepoint): OK
> test_send_signal (perf_event): OK
>
> Signed-off-by: Yonghong Song
> ---
> tools/testing/selftests/bpf/Makefile | 3 +-
> tool
On 05/22, Andrii Nakryiko wrote:
> There is a need for fast point lookups inside libbpf for multiple use
> cases (e.g., name resolution for BTF-to-C conversion, by-name lookups in
> BTF for upcoming BPF CO-RE relocation support, etc). This patch
> implements simple resizable non-thread safe hashmap
On 05/22, Andrii Nakryiko wrote:
> Test all APIs for internal hashmap implementation.
>
> Signed-off-by: Andrii Nakryiko
> ---
> tools/testing/selftests/bpf/.gitignore | 1 +
> tools/testing/selftests/bpf/Makefile | 2 +-
> tools/testing/selftests/bpf/test_hashmap.c | 382 +
up. In that case
we can use rcu_dereference_check(..., 1) since we know that there
should not be any existing users when we dismantle the cgroup.
v2:
* remove comment about potential race; that can't happen
because all callers are in rcu-update section
Cc: Roman Gushchin
Signed-off-by: Stanis
u_swap_protected
Cc: Roman Gushchin
Signed-off-by: Stanislav Fomichev
---
include/linux/bpf-cgroup.h | 2 +-
kernel/bpf/cgroup.c| 30 +++---
2 files changed, 20 insertions(+), 12 deletions(-)
diff --git a/include/linux/bpf-cgroup.h b/include/linux/bpf-cgroup.
Now that we don't have __rcu markers on the bpf_prog_array helpers,
let's use proper rcu_dereference_protected to obtain array pointer
under mutex.
Cc: Steven Rostedt
Cc: Ingo Molnar
Signed-off-by: Stanislav Fomichev
---
kernel/trace/bpf_trace.c | 18 ++
1 file c
On 05/22, Andrii Nakryiko wrote:
> On Wed, May 22, 2019 at 1:30 PM Stanislav Fomichev wrote:
> >
> > On 05/22, Andrii Nakryiko wrote:
> > > There is a need for fast point lookups inside libbpf for multiple use
> > > cases (e.g., name resolution for BTF-to
On 05/22, Andrii Nakryiko wrote:
> On Wed, May 22, 2019 at 3:15 PM Andrii Nakryiko
> wrote:
> >
> > On Wed, May 22, 2019 at 1:31 PM Stanislav Fomichev wrote:
> > >
> > > On 05/22, Andrii Nakryiko wrote:
> > > > Test all APIs for internal hashm
Right now test_tunnel.sh always exits with success even if some
of the subtests fail. Since the output is very verbose, it's
hard to spot the issues with subtests. Let's fail the script
if any subtest fails.
Signed-off-by: Stanislav Fomichev
---
tools/testing/selftests/bpf/test_tunn
omment about potential race; that can't happen
because all callers are in rcu-update section
Cc: Roman Gushchin
Signed-off-by: Stanislav Fomichev
---
include/linux/bpf.h | 12 ++--
kernel/bpf/core.c | 37 +
2 files changed, 19 insertions(+), 30
Now that we don't have __rcu markers on the bpf_prog_array helpers,
let's use proper rcu_dereference_protected to obtain array pointer
under mutex.
Cc: Steven Rostedt
Cc: Ingo Molnar
Signed-off-by: Stanislav Fomichev
---
kernel/trace/bpf_trace.c | 18 ++
1 file c
reference to include percpu_ref_is_dying;
cgroup_bpf is now reference counted and we don't hold cgroup_mutex
anymore in cgroup_bpf_release
v2:
* replace xchg with rcu_swap_protected
Cc: Roman Gushchin
Signed-off-by: Stanislav Fomichev
---
include/linux/bpf-cgroup.h | 2 +-
kernel
Now that we don't have __rcu markers on the bpf_prog_array helpers,
let's use proper rcu_dereference_protected to obtain array pointer
under mutex.
Cc: linux-me...@vger.kernel.org
Cc: Mauro Carvalho Chehab
Cc: Sean Young
Signed-off-by: Stanislav Fomichev
---
drivers/media/rc/bpf-l
On 05/28, Roman Gushchin wrote:
> On Tue, May 28, 2019 at 11:29:45AM -0700, Stanislav Fomichev wrote:
> > Now that we don't have __rcu markers on the bpf_prog_array helpers,
> > let's use proper rcu_dereference_protected to obtain array pointer
> > under mutex.
&g
omment about potential race; that can't happen
because all callers are in rcu-update section
Cc: Roman Gushchin
Acked-by: Roman Gushchin
Signed-off-by: Stanislav Fomichev
---
include/linux/bpf.h | 12 ++--
kernel/bpf/core.c | 37 +
2 files ch
in cgroup_bpf_release
v2:
* replace xchg with rcu_swap_protected
Cc: Roman Gushchin
Signed-off-by: Stanislav Fomichev
---
include/linux/bpf-cgroup.h | 2 +-
kernel/bpf/cgroup.c| 28 +---
2 files changed, 18 insertions(+), 12 deletions(-)
diff --git a/include/linux/bpf
Now that we don't have __rcu markers on the bpf_prog_array helpers,
let's use proper rcu_dereference_protected to obtain array pointer
under mutex.
Cc: Steven Rostedt
Cc: Ingo Molnar
Signed-off-by: Stanislav Fomichev
---
kernel/trace/bpf_trace.c | 18 ++
1 file c
This flag is not used by any caller, remove it.
Signed-off-by: Stanislav Fomichev
---
include/net/flow_dissector.h | 5 ++---
net/core/flow_dissector.c| 10 +-
2 files changed, 3 insertions(+), 12 deletions(-)
diff --git a/include/net/flow_dissector.h b/include/net
On 05/31, Andrii Nakryiko wrote:
> This patch adds support for a new way to define BPF maps. It relies on
> BTF to describe mandatory and optional attributes of a map, as well as
> captures type information of key and value naturally. This eliminates
> the need for BPF_ANNOTATE_KV_PAIR hack and ens
On 05/31, Andrii Nakryiko wrote:
> On Fri, May 31, 2019 at 2:28 PM Stanislav Fomichev wrote:
> >
> > On 05/31, Andrii Nakryiko wrote:
> > > This patch adds support for a new way to define BPF maps. It relies on
> > > BTF to describe mandatory and optiona
On 06/03, Andrii Nakryiko wrote:
> On Mon, Jun 3, 2019 at 9:32 AM Stanislav Fomichev wrote:
> >
> > On 05/31, Andrii Nakryiko wrote:
> > > On Fri, May 31, 2019 at 2:28 PM Stanislav Fomichev
> > > wrote:
> > > >
> > > > On 05/31, Andrii Na
> BTF is mandatory for _any_ new feature.
If something is easy to support without asking everyone to upgrade to
a bleeding edge llvm, why not do it?
So much for backwards compatibility and flexibility.
> It's for introspection and debuggability in the first place.
> Good debugging is not optional.
On 06/03, Stanislav Fomichev wrote:
> > BTF is mandatory for _any_ new feature.
> If something is easy to support without asking everyone to upgrade to
> a bleeding edge llvm, why not do it?
> So much for backwards compatibility and flexibility.
>
> > It's for intro
On 06/04, Andrii Nakryiko wrote:
> On Tue, Jun 4, 2019 at 6:45 AM Stanislav Fomichev wrote:
> >
> > On 06/03, Stanislav Fomichev wrote:
> > > > BTF is mandatory for _any_ new feature.
> > > If something is easy to support without asking everyone to upgrade to
. Meaning, they can access underlying socket
and use cgroup and socket local storage.
Stanislav Fomichev (7):
bpf: implement getsockopt and setsockopt hooks
bpf: sync bpf.h to tools/
libbpf: support sockopt hooks
selftests/bpf: test sockopt section name
selftests/bpf: add sockopt test
bpf
default, kernel code path is executed after the hook (to let
BPF handle only a subset of the options). There is new
bpf_sockopt_handled handler that returns control to the userspace
instead (bypassing the kernel handling).
The return code is either 1 (success) or 0 (EPERM).
Signed-off-by: Sta
Add sockopt selftests:
* require proper expected_attach_type
* enforce context field read/write access
* test bpf_sockopt_handled handler
* test EPERM
* test limiting optlen from getsockopt
* test out-of-bounds access
Signed-off-by: Stanislav Fomichev
---
tools/testing/selftests/bpf/.gitignore
Make libbpf aware of new sockopt hooks so it can derive prog type
and hook point from the section names.
Signed-off-by: Stanislav Fomichev
---
tools/lib/bpf/libbpf.c| 5 +
tools/lib/bpf/libbpf_probes.c | 1 +
2 files changed, 6 insertions(+)
diff --git a/tools/lib/bpf/libbpf.c b
Add tests that make sure libbpf section detection works.
Signed-off-by: Stanislav Fomichev
---
tools/testing/selftests/bpf/test_section_names.c | 10 ++
1 file changed, 10 insertions(+)
diff --git a/tools/testing/selftests/bpf/test_section_names.c
b/tools/testing/selftests/bpf
Support sockopt prog type and cgroup hooks in the bpftool.
Signed-off-by: Stanislav Fomichev
---
tools/bpf/bpftool/Documentation/bpftool-cgroup.rst | 7 +--
tools/bpf/bpftool/Documentation/bpftool-prog.rst | 2 +-
tools/bpf/bpftool/bash-completion/bpftool | 8 +---
tools/bpf
Provide user documentation about sockopt prog type and cgroup hooks.
Signed-off-by: Stanislav Fomichev
---
Documentation/bpf/index.rst | 1 +
Documentation/bpf/prog_cgroup_sockopt.rst | 42 +++
2 files changed, 43 insertions(+)
create mode 100644
Export new prog type and hook points to the libbpf.
Signed-off-by: Stanislav Fomichev
---
tools/include/uapi/linux/bpf.h | 17 -
1 file changed, 16 insertions(+), 1 deletion(-)
diff --git a/tools/include/uapi/linux/bpf.h b/tools/include/uapi/linux/bpf.h
index 7c6aef253173
On 06/05, Martin Lau wrote:
> On Tue, Jun 04, 2019 at 02:35:18PM -0700, Stanislav Fomichev wrote:
> > Implement new BPF_PROG_TYPE_CGROUP_SOCKOPT program type and
> > BPF_CGROUP_{G,S}ETSOCKOPT cgroup hooks.
> >
> > BPF_CGROUP_SETSOCKOPT get a read-only view
On 06/05, Andrii Nakryiko wrote:
> On Tue, Jun 4, 2019 at 2:35 PM Stanislav Fomichev wrote:
> >
> > Implement new BPF_PROG_TYPE_CGROUP_SOCKOPT program type and
> > BPF_CGROUP_{G,S}ETSOCKOPT cgroup hooks.
> >
> > BPF_CGROUP_SETSOCKOPT get a read-only
On 06/05, Martin Lau wrote:
> On Wed, Jun 05, 2019 at 12:17:24PM -0700, Stanislav Fomichev wrote:
> > On 06/05, Martin Lau wrote:
> > > On Tue, Jun 04, 2019 at 02:35:18PM -0700, Stanislav Fomichev wrote:
> > > > Implement new BPF_PROG_TYPE_CGROUP_SOCKOPT program ty
On 06/05, Andrii Nakryiko wrote:
> On Wed, Jun 5, 2019 at 1:54 PM Stanislav Fomichev wrote:
> >
> > On 06/05, Andrii Nakryiko wrote:
> > > On Tue, Jun 4, 2019 at 2:35 PM Stanislav Fomichev wrote:
> > > >
> > > > Implement new BPF_PROG_TYPE_CGROUP_
Make libbpf aware of new sockopt hooks so it can derive prog type
and hook point from the section names.
Signed-off-by: Stanislav Fomichev
---
tools/lib/bpf/libbpf.c| 5 +
tools/lib/bpf/libbpf_probes.c | 1 +
2 files changed, 6 insertions(+)
diff --git a/tools/lib/bpf/libbpf.c b
Export new prog type and hook points to the libbpf.
Signed-off-by: Stanislav Fomichev
---
tools/include/uapi/linux/bpf.h | 14 ++
1 file changed, 14 insertions(+)
diff --git a/tools/include/uapi/linux/bpf.h b/tools/include/uapi/linux/bpf.h
index 7c6aef253173..310b6bbfded8 100644
. Meaning, they can access underlying socket
and use cgroup and socket local storage.
Stanislav Fomichev (8):
bpf: implement getsockopt and setsockopt hooks
bpf: sync bpf.h to tools/
libbpf: support sockopt hooks
selftests/bpf: test sockopt section name
selftests/bpf: add sockopt test
Martin Lau)
* dropped bpf_target_off from ctx rewrites (Martin Lau)
* use return code for kernel bypass (Martin Lau & Andrii Nakryiko)
Signed-off-by: Stanislav Fomichev
---
include/linux/bpf-cgroup.h | 29
include/linux/bpf.h| 46 ++
include/linux/bpf_types.h | 1 +
include
Add tests that make sure libbpf section detection works.
Signed-off-by: Stanislav Fomichev
---
tools/testing/selftests/bpf/test_section_names.c | 10 ++
1 file changed, 10 insertions(+)
diff --git a/tools/testing/selftests/bpf/test_section_names.c
b/tools/testing/selftests/bpf
Add sockopt selftests:
* require proper expected_attach_type
* enforce context field read/write access
* test bpf_sockopt_handled handler
* test EPERM
* test limiting optlen from getsockopt
* test out-of-bounds access
v2:
* use return code 2 for kernel bypass
Signed-off-by: Stanislav Fomichev
socktop test that introduces new SOL_CUSTOM sockopt level and
stores whatever users sets in sk storage. Whenever getsockopt
is called, the original value is retrieved.
v2:
* new test
Signed-off-by: Stanislav Fomichev
---
tools/testing/selftests/bpf/.gitignore| 1 +
tools/testing
Provide user documentation about sockopt prog type and cgroup hooks.
v2:
* use return code 2 for kernel bypass
Signed-off-by: Stanislav Fomichev
---
Documentation/bpf/index.rst | 1 +
Documentation/bpf/prog_cgroup_sockopt.rst | 39 +++
2 files changed, 40
Support sockopt prog type and cgroup hooks in the bpftool.
Acked-by: Jakub Kicinski
Signed-off-by: Stanislav Fomichev
---
tools/bpf/bpftool/Documentation/bpftool-cgroup.rst | 7 +--
tools/bpf/bpftool/Documentation/bpftool-prog.rst | 2 +-
tools/bpf/bpftool/bash-completion/bpftool
On 06/06, Andrii Nakryiko wrote:
> On Thu, Jun 6, 2019 at 12:03 PM Stanislav Fomichev wrote:
> >
> > Implement new BPF_PROG_TYPE_CGROUP_SOCKOPT program type and
> > BPF_CGROUP_{G,S}ETSOCKOPT cgroup hooks.
> >
> > BPF_CGROUP_SETSOCKOPT get a read-only
On 06/06, Andrii Nakryiko wrote:
> On Thu, Jun 6, 2019 at 3:27 PM Stanislav Fomichev wrote:
> >
> > On 06/06, Andrii Nakryiko wrote:
> > > On Thu, Jun 6, 2019 at 12:03 PM Stanislav Fomichev
> > > wrote:
> > > >
> > > > Im
On 06/07, Martin Lau wrote:
> On Thu, Jun 06, 2019 at 10:51:39AM -0700, Stanislav Fomichev wrote:
> > Implement new BPF_PROG_TYPE_CGROUP_SOCKOPT program type and
> > BPF_CGROUP_{G,S}ETSOCKOPT cgroup hooks.
> >
> > BPF_CGROUP_SETSOCKOPT get a read-only view
. Meaning, they can access underlying socket
and use cgroup and socket local storage.
Stanislav Fomichev (8):
bpf: implement getsockopt and setsockopt hooks
bpf: sync bpf.h to tools/
libbpf: support sockopt hooks
selftests/bpf: test sockopt section name
selftests/bpf: add sockopt test
Make libbpf aware of new sockopt hooks so it can derive prog type
and hook point from the section names.
Signed-off-by: Stanislav Fomichev
---
tools/lib/bpf/libbpf.c| 5 +
tools/lib/bpf/libbpf_probes.c | 1 +
2 files changed, 6 insertions(+)
diff --git a/tools/lib/bpf/libbpf.c b
or bpf_sockopt->sk (Martin Lau)
* dropped bpf_target_off from ctx rewrites (Martin Lau)
* use return code for kernel bypass (Martin Lau & Andrii Nakryiko)
Acked-by: Andrii Nakryiko
Signed-off-by: Stanislav Fomichev
---
include/linux/bpf-cgroup.h | 29
include/linux/bpf.h|
Export new prog type and hook points to the libbpf.
Signed-off-by: Stanislav Fomichev
---
tools/include/uapi/linux/bpf.h | 14 ++
1 file changed, 14 insertions(+)
diff --git a/tools/include/uapi/linux/bpf.h b/tools/include/uapi/linux/bpf.h
index 7c6aef253173..174136aa6906 100644
Add tests that make sure libbpf section detection works.
Signed-off-by: Stanislav Fomichev
---
tools/testing/selftests/bpf/test_section_names.c | 10 ++
1 file changed, 10 insertions(+)
diff --git a/tools/testing/selftests/bpf/test_section_names.c
b/tools/testing/selftests/bpf
Provide user documentation about sockopt prog type and cgroup hooks.
v2:
* use return code 2 for kernel bypass
Signed-off-by: Stanislav Fomichev
---
Documentation/bpf/index.rst | 1 +
Documentation/bpf/prog_cgroup_sockopt.rst | 39 +++
2 files changed, 40
socktop test that introduces new SOL_CUSTOM sockopt level and
stores whatever users sets in sk storage. Whenever getsockopt
is called, the original value is retrieved.
v3:
* drop (__u8 *)(long) casts for optval{,_end}
v2:
* new test
Signed-off-by: Stanislav Fomichev
---
tools/testing
Support sockopt prog type and cgroup hooks in the bpftool.
Acked-by: Jakub Kicinski
Signed-off-by: Stanislav Fomichev
---
tools/bpf/bpftool/Documentation/bpftool-cgroup.rst | 7 +--
tools/bpf/bpftool/Documentation/bpftool-prog.rst | 2 +-
tools/bpf/bpftool/bash-completion/bpftool
Signed-off-by: Stanislav Fomichev
---
tools/testing/selftests/bpf/.gitignore | 1 +
tools/testing/selftests/bpf/Makefile | 3 +-
tools/testing/selftests/bpf/test_sockopt.c | 773 +
3 files changed, 776 insertions(+), 1 deletion(-)
create mode 100644 tools
On 06/08, Martin Lau wrote:
> On Fri, Jun 07, 2019 at 09:29:13AM -0700, Stanislav Fomichev wrote:
> > Implement new BPF_PROG_TYPE_CGROUP_SOCKOPT program type and
> > BPF_CGROUP_{G,S}ETSOCKOPT cgroup hooks.
> >
> > BPF_CGROUP_SETSOCKOPT get a read-only view
kernel bypass (Martin Lau & Andrii Nakryiko)
Cc: Martin Lau
Acked-by: Andrii Nakryiko
Signed-off-by: Stanislav Fomichev
---
include/linux/bpf-cgroup.h | 29
include/linux/bpf.h| 45 +++
include/linux/bpf_types.h | 1 +
include/linux/filter.h | 13 ++
include/uapi/
Make libbpf aware of new sockopt hooks so it can derive prog type
and hook point from the section names.
Cc: Martin Lau
Signed-off-by: Stanislav Fomichev
---
tools/lib/bpf/libbpf.c| 5 +
tools/lib/bpf/libbpf_probes.c | 1 +
2 files changed, 6 insertions(+)
diff --git a/tools/lib
Cc: Martin Lau
Signed-off-by: Stanislav Fomichev
---
tools/testing/selftests/bpf/.gitignore | 1 +
tools/testing/selftests/bpf/Makefile | 3 +-
tools/testing/selftests/bpf/test_sockopt.c | 773 +
3 files changed, 776 insertions(+), 1 deletion(-)
create mode
Add tests that make sure libbpf section detection works.
Cc: Martin Lau
Signed-off-by: Stanislav Fomichev
---
tools/testing/selftests/bpf/test_section_names.c | 10 ++
1 file changed, 10 insertions(+)
diff --git a/tools/testing/selftests/bpf/test_section_names.c
b/tools/testing
Export new prog type and hook points to the libbpf.
Cc: Martin Lau
Signed-off-by: Stanislav Fomichev
---
tools/include/uapi/linux/bpf.h | 14 ++
1 file changed, 14 insertions(+)
diff --git a/tools/include/uapi/linux/bpf.h b/tools/include/uapi/linux/bpf.h
index 7c6aef253173
Support sockopt prog type and cgroup hooks in the bpftool.
Cc: Martin Lau
Acked-by: Jakub Kicinski
Signed-off-by: Stanislav Fomichev
---
tools/bpf/bpftool/Documentation/bpftool-cgroup.rst | 7 +--
tools/bpf/bpftool/Documentation/bpftool-prog.rst | 2 +-
tools/bpf/bpftool/bash-completion
Provide user documentation about sockopt prog type and cgroup hooks.
v2:
* use return code 2 for kernel bypass
Cc: Martin Lau
Signed-off-by: Stanislav Fomichev
---
Documentation/bpf/index.rst | 1 +
Documentation/bpf/prog_cgroup_sockopt.rst | 39 +++
2 files
n Lau
Signed-off-by: Stanislav Fomichev
---
tools/testing/selftests/bpf/.gitignore| 1 +
tools/testing/selftests/bpf/Makefile | 3 +-
.../testing/selftests/bpf/progs/sockopt_sk.c | 67
tools/testing/selftests/bpf/test_sockopt_sk.c | 156 ++
4 files changed
. Meaning, they can access underlying socket
and use cgroup and socket local storage.
Stanislav Fomichev (8):
bpf: implement getsockopt and setsockopt hooks
bpf: sync bpf.h to tools/
libbpf: support sockopt hooks
selftests/bpf: test sockopt section name
selftests/bpf: add sockopt test
On 06/10, Andrii Nakryiko wrote:
> On Mon, Jun 10, 2019 at 9:39 AM Stanislav Fomichev wrote:
> >
> > This series implements two new per-cgroup hooks: getsockopt and
> > setsockopt along with a new sockopt program type. The idea is pretty
> > similar to recently introduc
On 06/10, Martin Lau wrote:
> On Mon, Jun 10, 2019 at 09:34:14AM -0700, Stanislav Fomichev wrote:
> > Implement new BPF_PROG_TYPE_CGROUP_SOCKOPT program type and
> > BPF_CGROUP_{G,S}ETSOCKOPT cgroup hooks.
> >
> > BPF_CGROUP_SETSOCKOPT get a read-only view
. Meaning, they can access underlying socket
and use cgroup and socket local storage.
Stanislav Fomichev (8):
bpf: implement getsockopt and setsockopt hooks
bpf: sync bpf.h to tools/
libbpf: support sockopt hooks
selftests/bpf: test sockopt section name
selftests/bpf: add sockopt test
ed bpf_target_off from ctx rewrites (Martin Lau)
* use return code for kernel bypass (Martin Lau & Andrii Nakryiko)
Cc: Martin Lau
Acked-by: Andrii Nakryiko
Signed-off-by: Stanislav Fomichev
---
include/linux/bpf-cgroup.h | 29 +
include/linux/bpf.h| 45 +++
include/linux
Export new prog type and hook points to the libbpf.
Cc: Martin Lau
Signed-off-by: Stanislav Fomichev
---
tools/include/uapi/linux/bpf.h | 14 ++
1 file changed, 14 insertions(+)
diff --git a/tools/include/uapi/linux/bpf.h b/tools/include/uapi/linux/bpf.h
index 7c6aef253173
Provide user documentation about sockopt prog type and cgroup hooks.
v2:
* use return code 2 for kernel bypass
Cc: Martin Lau
Signed-off-by: Stanislav Fomichev
---
Documentation/bpf/index.rst | 1 +
Documentation/bpf/prog_cgroup_sockopt.rst | 39 +++
2 files
n Lau
Signed-off-by: Stanislav Fomichev
---
tools/testing/selftests/bpf/.gitignore| 1 +
tools/testing/selftests/bpf/Makefile | 3 +-
.../testing/selftests/bpf/progs/sockopt_sk.c | 67
tools/testing/selftests/bpf/test_sockopt_sk.c | 156 ++
4 files changed
Support sockopt prog type and cgroup hooks in the bpftool.
Cc: Martin Lau
Acked-by: Jakub Kicinski
Signed-off-by: Stanislav Fomichev
---
tools/bpf/bpftool/Documentation/bpftool-cgroup.rst | 7 +--
tools/bpf/bpftool/Documentation/bpftool-prog.rst | 2 +-
tools/bpf/bpftool/bash-completion
Make libbpf aware of new sockopt hooks so it can derive prog type
and hook point from the section names.
Cc: Martin Lau
Signed-off-by: Stanislav Fomichev
---
tools/lib/bpf/libbpf.c| 5 +
tools/lib/bpf/libbpf_probes.c | 1 +
2 files changed, 6 insertions(+)
diff --git a/tools/lib
Cc: Martin Lau
Signed-off-by: Stanislav Fomichev
---
tools/testing/selftests/bpf/.gitignore | 1 +
tools/testing/selftests/bpf/Makefile | 3 +-
tools/testing/selftests/bpf/test_sockopt.c | 773 +
3 files changed, 776 insertions(+), 1 deletion(-)
create mode
Add tests that make sure libbpf section detection works.
Cc: Martin Lau
Signed-off-by: Stanislav Fomichev
---
tools/testing/selftests/bpf/test_section_names.c | 10 ++
1 file changed, 10 insertions(+)
diff --git a/tools/testing/selftests/bpf/test_section_names.c
b/tools/testing
Move the file and rename internal BPF_SOCK_ADDR define to
BPF_SOCK_ADDR_STORE. This selftest will be extended in the next commit
with the wide loads.
Cc: Yonghong Song
Signed-off-by: Stanislav Fomichev
---
.../selftests/bpf/verifier/wide_access.c | 36 +++
.../selftests
some bpf_sock_addr fields
as well.
(This can probably wait for bpf-next, I'll defer to Younhong and the
maintainers.)
Cc: Yonghong Song
Stanislav Fomichev (5):
bpf: rename bpf_ctx_wide_store_ok to bpf_ctx_wide_access_ok
bpf: allow wide aligned loads for bpf_sock_addr user_ip6 and
m
Add explicit check for u64 loads of user_ip6 and msg_src_ip6 and
update the comment.
Cc: Yonghong Song
Signed-off-by: Stanislav Fomichev
---
include/uapi/linux/bpf.h | 4 ++--
net/core/filter.c| 12 +++-
2 files changed, 13 insertions(+), 3 deletions(-)
diff --git a/include
Update bpf_sock_addr comments to indicate support for 8-byte reads
from user_ip6 and msg_src_ip6.
Cc: Yonghong Song
Signed-off-by: Stanislav Fomichev
---
tools/include/uapi/linux/bpf.h | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/tools/include/uapi/linux/bpf.h b
Rename bpf_ctx_wide_store_ok to bpf_ctx_wide_access_ok to indicate
that it can be used for both loads and stores.
Cc: Yonghong Song
Signed-off-by: Stanislav Fomichev
---
include/linux/filter.h | 2 +-
net/core/filter.c | 12 ++--
2 files changed, 7 insertions(+), 7 deletions
Mirror existing wide store tests with wide loads. The only significant
difference is expected error string.
Cc: Yonghong Song
Signed-off-by: Stanislav Fomichev
---
.../selftests/bpf/verifier/wide_access.c | 37 +++
1 file changed, 37 insertions(+)
diff --git a/tools
On 07/16, Martin Lau wrote:
> On Tue, Jul 09, 2019 at 09:33:21AM -0700, Stanislav Fomichev wrote:
> > On 06/11, Martin KaFai Lau wrote:
> > > The cloned sk should not carry its parent-listener's sk_bpf_storage.
> > > This patch fixes it by setting it back to NULL.
On 07/16, Andrii Nakryiko wrote:
> e46fc22e60a4 ("selftests/bpf: make directory prerequisites order-only")
> exposed existing problem in Makefile for test_verifier and test_maps tests:
> their dependency on auto-generated header file with a list of all tests wasn't
> recorded explicitly. This patch
On 07/16, Andrii Nakryiko wrote:
> On Tue, Jul 16, 2019 at 12:55 PM Stanislav Fomichev wrote:
> >
> > On 07/16, Andrii Nakryiko wrote:
> > > e46fc22e60a4 ("selftests/bpf: make directory prerequisites order-only")
> > > exposed existing problem
On 07/16, Andrii Nakryiko wrote:
> On Tue, Jul 16, 2019 at 3:57 PM Stanislav Fomichev wrote:
> >
> > On 07/16, Andrii Nakryiko wrote:
> > > On Tue, Jul 16, 2019 at 12:55 PM Stanislav Fomichev
> > > wrote:
> > > >
> > > > On 07/16, Andr
em de Bruijn
Cc: Petar Penkov
Stanislav Fomichev (7):
bpf/flow_dissector: pass input flags to BPF flow dissector program
bpf/flow_dissector: document flags
bpf/flow_dissector: support flags in BPF_PROG_TEST_RUN
tools/bpf: sync bpf_flow_keys flags
sefltests/bpf: su
Describe what each input flag does and who uses it.
Cc: Willem de Bruijn
Cc: Petar Penkov
Signed-off-by: Stanislav Fomichev
---
Documentation/bpf/prog_flow_dissector.rst | 18 ++
1 file changed, 18 insertions(+)
diff --git a/Documentation/bpf/prog_flow_dissector.rst
b
This will allow us to write tests for those flags.
Cc: Willem de Bruijn
Cc: Petar Penkov
Signed-off-by: Stanislav Fomichev
---
net/bpf/test_run.c | 39 +++
1 file changed, 35 insertions(+), 4 deletions(-)
diff --git a/net/bpf/test_run.c b/net/bpf
Exit as soon as we found that packet is encapped when
FLOW_DISSECTOR_F_STOP_AT_ENCAP is passed.
Add appropriate selftest cases.
Cc: Willem de Bruijn
Cc: Petar Penkov
Signed-off-by: Stanislav Fomichev
---
.../selftests/bpf/prog_tests/flow_dissector.c | 60 +++
tools/testing
Export bpf_flow_keys flags to tools/libbpf/selftests.
Cc: Willem de Bruijn
Cc: Petar Penkov
Signed-off-by: Stanislav Fomichev
---
tools/include/uapi/linux/bpf.h | 5 +
1 file changed, 5 insertions(+)
diff --git a/tools/include/uapi/linux/bpf.h b/tools/include/uapi/linux/bpf.h
index
have FLOW_DISSECTOR_F_PARSE_1ST_FRAG flag.
eth_get_headlen calls flow dissector with
FLOW_DISSECTOR_F_PARSE_1ST_FRAG flag so we can't run tests that
have different set of input flags against it.
Cc: Willem de Bruijn
Cc: Petar Penkov
Signed-off-by: Stanislav Fomichev
---
.../selftests/bpf/prog_tests/flow_dissect
Add support for exporting ipv6 flow label via bpf_flow_keys.
Export flow label from bpf_flow.c and also return early when
FLOW_DISSECTOR_F_STOP_AT_FLOW_LABEL is passed.
Cc: Willem de Bruijn
Cc: Petar Penkov
Signed-off-by: Stanislav Fomichev
---
include/uapi/linux/bpf.h
low.c
Cc: Willem de Bruijn
Cc: Petar Penkov
Signed-off-by: Stanislav Fomichev
---
include/linux/skbuff.h | 2 +-
include/net/flow_dissector.h | 4
include/uapi/linux/bpf.h | 5 +
net/bpf/test_run.c | 2 +-
net/core/flow_dissector.c| 5 +++--
5 files change
1 - 100 of 856 matches
Mail list logo