;flow_dissector: properly cap thoff field")'.
>
> Signed-off-by: Stanislav Fomichev
Acked-by: Song Liu
> ---
> net/core/flow_dissector.c | 5 -
> 1 file changed, 4 insertions(+), 1 deletion(-)
>
> diff --git a/net/core/flow_dissector.c b/net/core/flow_dissector
ds confusion, when by the time bpf flow dissector exits,
> nhoff == thoff, which doesn't make much sense.
>
> Signed-off-by: Stanislav Fomichev
Acked-by: Song Liu
> ---
> net/core/flow_dissector.c | 1 +
> tools/testing/selftests/bpf/bpf_flow.c | 36 -
; tools/testing/selftests/bpf/test_progs.c | 78 +++-
> 10 files changed, 289 insertions(+), 94 deletions(-)
> create mode 100644 tools/testing/selftests/bpf/flow_dissector_load.h
>
> --
> 2.20.0.rc1.387.gf8505762e3-goog
>
For the series:
Acked-by: Song Liu
On Tue, Dec 4, 2018 at 3:26 PM Stanislav Fomichev wrote:
>
> On 12/04, Song Liu wrote:
> > On Mon, Dec 3, 2018 at 8:01 PM Stanislav Fomichev wrote:
> > >
> > > We are returning thoff from the flow dissector, not the nhoff. Pass
> > > thoff along with nh
On Mon, Dec 3, 2018 at 3:08 PM Stanislav Fomichev wrote:
>
> On 12/03, Song Liu wrote:
> > On Mon, Dec 3, 2018 at 11:00 AM Stanislav Fomichev wrote:
> > >
> > > The input is packet data, the output is struct bpf_flow_key. This should
> > > make it easy
off = min_t(u16, key_control->thoff,
> - skb->len);
> rcu_read_unlock();
> return ret;
> }
> --
> 2.20.0.rc1.387.gf8505762e3-goog
>
Same question as 3/5:
Do we need this fix without this set? If yes, do we need it for bpf
tree as well?
Thanks,
Song
etwork_offset(skb);
> + flow_keys->thoff = flow_keys->nhoff;
Do we need this fix without this set? If yes, do we need it for bpf
tree as well?
Thanks,
Song
>
> bpf_compute_data_pointers((struct sk_buff *)skb);
> result = BPF_PROG_RUN(prog, skb);
> diff
t = __skb_flow_bpf_dissect(prog, ctx, _keys_dissector,
> +flow_keys);
> + break;
> + default:
> + ret = BPF_PROG_RUN(prog, ctx);
> + break;
> + }
> +
Is it possible to fold the
Signed-off-by: Daniel T. Lee
Acked-by: Song Liu
> ---
> samples/bpf/bpf_load.c | 4 +++-
> 1 file changed, 3 insertions(+), 1 deletion(-)
>
> diff --git a/samples/bpf/bpf_load.c b/samples/bpf/bpf_load.c
> index 434ea34a5954..eae7b635343d 100644
> --- a/samples/bpf/bpf_loa
Binutils libopcode
> implementation which is using 0x50 for srlv and 0x90 for srav.
>
> Fixes: f31318fdf324 ("MIPS: uasm: Add srlv uasm instruction")
> CC: Markos Chandras
> CC: Paul Burton
> Acked-by: Jakub Kicinski
> Signed-off-by: Jiong Wang
Acked-by: Song Liu
>
es/bpf/bpf_load.c
> @@ -58,7 +58,9 @@ static int write_kprobe_events(const char *val)
> {
> int fd, ret, flags;
>
> - if ((val != NULL) && (val[0] == '\0'))
> + if (val == NULL)
> + return -1;
> + else if ((val != NULL) && (val[0] == '\0'))
We only need
+ else if (val[0] == '\0')
right?
Thanks,
Song
gt; permissions should be needed.
>
> Fixes: 76d1b894c515 ("libbpf: Document API and ABI conventions")
> Signed-off-by: Andrey Ignatov
Acked-by: Song Liu
> ---
> tools/lib/bpf/README.rst | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/to
as wire_len.
>
> Changes v1->v2
> - Rename pkt_len to wire_len
>
> Signed-off-by: Petar Penkov
> Signed-off-by: Vlad Dumitrescu
> Signed-off-by: Willem de Bruijn
Acked-by: Song Liu
> ---
> include/uapi/linux/bpf.h| 1 +
> net/core/filter.
n. The functions require CAP_SYS_ADMIN so it's not really an
> information leak.
>
> Fixes: 1cf1cae963c2 ("bpf: introduce BPF_PROG_TEST_RUN command")
> Signed-off-by: Dan Carpenter
Acked-by: Song Liu
> ---
> net/bpf/test_run.c | 4 ++--
> 1 file changed, 2 insertions(
> 4 files changed, 50 insertions(+)
Please split this into 3 patches:
1 for include/uapi/linux/bpf.h and filter.c
1 for tools/include/uapi/linux/bpf.h
1 for tools/testing/selftests/bpf/test_verifier.c
Other than this
Acked-by: Song Liu
>
> diff --git a/include/uapi/l
nu version of strerror_r is expected.
Signed-off-by: Yonghong Song
---
tools/lib/bpf/libbpf.c | 2 ++
tools/lib/bpf/libbpf_errno.c | 1 +
2 files changed, 3 insertions(+)
Changelog:
v1 -> v2:
. undef _GNU_SOURCE instead of multiversioning strerror_r,
suggested by Jakub.
diff --gi
On 11/29/18 1:00 PM, Jakub Kicinski wrote:
> On Thu, 29 Nov 2018 12:38:03 -0800, Yonghong Song wrote:
>> diff --git a/tools/lib/bpf/libbpf_errno.c b/tools/lib/bpf/libbpf_errno.c
>> index d83b17f8435c..286e497c50ec 100644
>> --- a/tools/lib/bpf/libbpf_errno.c
>> +++ b/t
value than non-gnu version,
so strerror_r return value is handled differently if _GNU_SOURCE is defined.
Signed-off-by: Yonghong Song
---
tools/lib/bpf/libbpf.c | 2 ++
tools/lib/bpf/libbpf_errno.c | 10 ++
2 files changed, 12 insertions(+)
diff --git a/tools/lib/bpf/libbpf.c b
On Wed, Nov 28, 2018 at 12:59 PM David Miller wrote:
>
>
> Cannot cast a u64 to a pointer on 32-bit without an intervening (long)
> cast otherwise GCC warns.
>
> Signed-off-by: David S. Miller
Acked-by: Song Liu
> --
>
> diff --git a/tools/lib/bpf/btf.c b/tools/li
On Wed, Nov 28, 2018 at 10:09 AM Yonghong Song wrote:
>
> Commit b12d6ec09730 ("bpf: btf: add btf print functionality")
> added btf pretty print functionality to bpftool.
> There is a problem though in printing a bitfield whose type
> has modifiers.
>
> For examp
l m d id 76
[{
"key": 0,
"value": {
"a": 0x1,
"b": 0x2
}
}
]
The kernel pretty print is implemented correctly and does not
have this issue.
Fixes: b12d6ec09730 ("bpf: btf: add btf pri
Function btf_name_valid_identifier() have been implemented in
bpf-next commit 2667a2626f4d ("bpf: btf: Add BTF_KIND_FUNC and
BTF_KIND_FUNC_PROTO"). Backport this function so later patch
can use it.
Fixes: 69b693f0aefa ("bpf: btf: Introduce BPF Type Format (BTF)")
Signed-o
Signed-off-by: Yonghong Song
---
tools/testing/selftests/bpf/test_btf.c | 14 +++---
1 file changed, 7 insertions(+), 7 deletions(-)
diff --git a/tools/testing/selftests/bpf/test_btf.c
b/tools/testing/selftests/bpf/test_btf.c
index f42b3396d622..b361bb851829 100644
--- a/tools/testing/sel
.." line.
Patches #2, #3 and #4 can be applied to bpf-next without conflict.
[1]: http://vger.kernel.org/lpc-bpf2018.html#session-2
Yonghong Song (4):
bpf: btf: implement btf_name_valid_identifier()
bpf: btf: check name validity for various types
tools/bpf: fix two test_btf unit test c
uot;bpf: btf: Add BTF tests")
Acked-by: Martin KaFai Lau
Signed-off-by: Yonghong Song
---
tools/testing/selftests/bpf/test_btf.c | 361 +
1 file changed, 361 insertions(+)
diff --git a/tools/testing/selftests/bpf/test_btf.c
b/tools/testing/selftests/bpf/test_btf.c
. This can be relaxed later if we found
use cases for a different (non-C) frontend.
Fixes: 69b693f0aefa ("bpf: btf: Introduce BPF Type Format (BTF)")
Acked-by: Martin KaFai Lau
Signed-off-by: Yonghong Song
---
kernel/bpf/btf.c | 57
1 file c
On 11/27/18 11:02 AM, Alexei Starovoitov wrote:
> On Mon, Nov 26, 2018 at 09:17:13PM -0800, Yonghong Song wrote:
>> Commit 2667a2626f4d ("bpf: btf: Add BTF_KIND_FUNC
>> and BTF_KIND_FUNC_PROTO") checked the name validity
>> for BTF_KIND
On 11/27/18 7:24 AM, Naresh Kamboju wrote:
> CONFIG_FTRACE_SYSCALLS=y is required for get_cgroup_id_user test case
> this test reads a file from debug trace path
> /sys/kernel/debug/tracing/events/syscalls/sys_enter_nanosleep/id
>
> Signed-off-by: Naresh Kamboju
Acked-by
valid name is required, the name must be
a valid C identifier. This can be relaxed later if we found
use cases for a different (non-C) frontend.
Acked-by: Martin KaFai Lau
Signed-off-by: Yonghong Song
---
kernel/bpf/btf.c | 57
1 file changed, 57
Signed-off-by: Yonghong Song
---
tools/testing/selftests/bpf/test_btf.c | 18 +-
1 file changed, 9 insertions(+), 9 deletions(-)
diff --git a/tools/testing/selftests/bpf/test_btf.c
b/tools/testing/selftests/bpf/test_btf.c
index bae7308b7ec5..99a92923e3f9 100644
--- a/tools/testing/sel
OK
Acked-by: Martin KaFai Lau
Signed-off-by: Yonghong Song
---
tools/testing/selftests/bpf/test_btf.c | 362 +
1 file changed, 362 insertions(+)
diff --git a/tools/testing/selftests/bpf/test_btf.c
b/tools/testing/selftests/bpf/test_btf.c
index 99a92923e3f9..a72678153
makes BTF more sound in the kernel and future
BTF-to-header-file converesion ([1]) less fragile.
[1]: http://vger.kernel.org/lpc-bpf2018.html#session-2
Yonghong Song (3):
bpf: btf: check name validity for various types
tools/bpf: fix two test_btf unit test cases
tools/bpf: add addition
ed id 1490
no instructions returned
Yonghong Song (2):
bpf: btf: support proper non-jit func info
tools/bpf: change selftest test_btf for both jit and non-jit
include/linux/bpf.h| 6 ++-
include/linux/bpf_verifier.h | 1 -
kernel/bpf/core.c
iscrepancy.
Fixes: 838e96904ff3 ("bpf: Introduce bpf_func_info")
Signed-off-by: Yonghong Song
---
include/linux/bpf.h | 6 ++--
include/linux/bpf_verifier.h | 1 -
kernel/bpf/core.c| 3 +-
kernel/bpf/syscall.c | 33 ++
kernel/bpf/ve
The selftest test_btf is changed to test both jit and non-jit.
The test result should be the same regardless of whether jit
is enabled or not.
Signed-off-by: Yonghong Song
---
tools/testing/selftests/bpf/test_btf.c | 33 +++---
1 file changed, 3 insertions(+), 30 deletions
On 11/21/18 9:40 AM, Andrey Ignatov wrote:
> More and more projects use libbpf and one day it'll likely be packaged
> and distributed as DSO and that requires ABI versioning so that both
> compatible and incompatible changes to ABI can be introduced in a safe
> way in the future without breaking
-by: Emre Cantimur
Tested-by: Andrey Ignatov
Signed-off-by: Yonghong Song
---
tools/lib/bpf/libbpf.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/tools/lib/bpf/libbpf.c b/tools/lib/bpf/libbpf.c
index cb6565d79603..f022ac82e882 100644
--- a/tools/lib/bpf/libbpf.c
+++ b/tools/l
On Wed, Nov 21, 2018 at 3:44 AM Naresh Kamboju
wrote:
>
> Kselftest bpf get_cgroup_id_user is failed on all devices.
>
> selftests: bpf: get_cgroup_id_user
> main:PASS:setup_cgroup_environment
> main:PASS:create_and_get_cgroup
> main:PASS:join_cgroup
> main:PASS:bpf_prog_load
>
On Tue, Nov 20, 2018 at 1:37 PM Stanislav Fomichev wrote:
>
> Wrap headers in extern "C", to turn off C++ mangling.
> This simplifies including libbpf in c++ and linking against it.
>
> v2 changes:
> * do the same for btf.h
>
> Signed-off-by: Stanislav
ompilation failure can be avoided.
Fixes: 838e96904ff3 ("bpf: Introduce bpf_func_info")
Reported-by: kbuild test robot
Cc: Martin KaFai Lau
Signed-off-by: Yonghong Song
---
include/linux/btf.h | 14 ++
1 file changed, 14 insertions(+)
Changelog:
v1 -> v2:
. Two fun
ompilation failure can be avoided.
Fixes: 838e96904ff3 ("bpf: Introduce bpf_func_info")
Reported-by: kbuild test robot
Cc: Martin KaFai Lau
Signed-off-by: Yonghong Song
---
include/linux/btf.h | 12
1 file changed, 12 insertions(+)
diff --git a/include/linux/btf.h b/inclu
On Tue, Nov 20, 2018 at 10:19 AM Stanislav Fomichev wrote:
>
> Wrap headers in extern "C", to turn off C++ mangling.
> This simplifies including libbpf in c++ and linking against it.
>
> Signed-off-by: Stanislav Fomichev
> ---
> tools/lib/bpf/bpf.h| 9 +
> tools/lib/bpf/libbpf.h | 9
ing another field
in the uapi as described in https://www.spinics.net/lists/netdev/msg534277.html,
then
Acked-by: Yonghong Song
On Tue, Nov 20, 2018 at 3:35 AM Lorenz Bauer wrote:
>
> On Sun, 18 Nov 2018 at 05:59, Y Song wrote:
> >
> > On Fri, Nov 16, 2018 at 12:55 PM Lorenz Bauer wrote:
> > >
> > > Make sure that bpf_prog_test_run returns the correct length
> > > in the s
support for map in map in libbpf
> bpf: adding tests for mapinmap helpber in libbpf
For the whole series.
Acked-by: Yonghong Song
>
> tools/lib/bpf/libbpf.c | 7 +++
> tools/lib/bpf/libbpf.h | 2 +
> tools/testing/selftests/bpf/Makefil
by assigning the type to the temporary variable only after the
> call to gelf_getsym().
>
> Fixes: 7a04dd84a7f9 ("bpf: check map symbol type properly with newer llvm
> compiler")
> Reported-by: Ron Philip
> Signed-off-by: Quentin Monnet
> Reviewed-by: Jiong Wang
Th
I support
> to specify BPF obj name"), libbpf unconditionally sets bpf_attr->name
> for programs. Pre v4.14 kernels don't know about programs names and
> return an error about unexpected non-zero data. Retry sys_bpf without
> a program name to cover older kernels.
>
> Signed-off-by: Stanislav Fomichev
Acked-by: Yonghong Song
On Mon, Nov 19, 2018 at 4:13 PM Nikita V. Shirokov wrote:
>
> adding test/example of bpf_map__add_inner_map_fd usage
>
> Signed-off-by: Nikita V. Shirokov
> ---
> tools/testing/selftests/bpf/Makefile| 3 +-
> tools/testing/selftests/bpf/test_mapinmap.c | 53
>
On Mon, Nov 19, 2018 at 4:13 PM Nikita V. Shirokov wrote:
>
> idea is pretty simple. for specified map (pointed by struct bpf_map)
> we would provide descriptor of already loaded map, which is going to be
> used as a prototype for inner map. proposed workflow:
> 1) open bpf's object
On Fri, Nov 16, 2018 at 12:54 PM Lorenz Bauer wrote:
>
> Right now, there is no safe way to use BPF_PROG_TEST_RUN with data_out.
> This is because bpf_test_finish copies the output buffer to user space
> without checking its size. This can lead to the kernel overwriting
> data in user space after
On Fri, Nov 16, 2018 at 12:55 PM Lorenz Bauer wrote:
>
> Make sure that bpf_prog_test_run returns the correct length
> in the size_out argument and that the kernel respects the
> output size hint.
>
> Signed-off-by: Lorenz Bauer
> ---
> tools/testing/selftests/bpf/test_progs.c | 34
On Fri, Nov 16, 2018 at 12:54 PM Lorenz Bauer wrote:
>
> Require size_out to be non-NULL if data_out is given. This prevents
> accidental overwriting of process memory after the output buffer.
>
> Adjust callers of bpf_prog_test_run to this behaviour.
>
> Signed-off-by: Lorenz Bauer
> ---
>
On Fri, Nov 16, 2018 at 12:54 PM Lorenz Bauer wrote:
>
> Use data_size_out as a size hint when copying test output to user space.
> A program using BPF_PERF_OUTPUT can compare its own buffer length with
> data_size_out after the syscall to detect whether truncation has taken
> place. Callers
> On Nov 16, 2018, at 3:41 AM, Lorenz Bauer wrote:
>
> Allow forcing the seed of a hash table to zero, for deterministic
> execution during benchmarking and testing.
>
> Changes from v2:
> * Change ordering of BPF_F_ZERO_SEED in linux/bpf.h
>
> Comments adressed from v1:
> * Add comment to
t for BPF_F_ZERO_SEED
>
> include/uapi/linux/bpf.h| 9 ++--
> kernel/bpf/hashtab.c| 13 -
> tools/include/uapi/linux/bpf.h | 13 +++--
> tools/testing/selftests/bpf/test_maps.c | 68 +
> 4 files changed, 84 insertions(+),
On 11/8/18 2:56 PM, Edward Cree wrote:
> On 08/11/18 19:42, Alexei Starovoitov wrote:
>> same link let's continue at 1pm PST.
> So, one thing we didn't really get onto was maps, and you mentioned that it
> wasn't really clear what I was proposing there.
> What I have in mind comes in two
On 11/8/18 12:52 PM, Edward Cree wrote:
> On 08/11/18 20:36, Yonghong Song wrote:
>> This patch adds BTF_KIND_FUNC support to the type section.
>> BTF_KIND_FUNC is used to specify the signature of a
>> defined subprogram or the pointee of a function pointer.
>>
&
Change the bpf programs test_btf_haskv.c and test_btf_nokv.c to
have two sections, and enhance test_btf.c test_file feature
to test btf func_info returned by the kernel.
Signed-off-by: Yonghong Song
---
tools/testing/selftests/bpf/test_btf.c | 117 +--
tools/testing
Add additional checks in tools/testing/selftests/bpf and
samples/bpf such that if clang/llvm compiler can generate
BTF sections, do not use pahole.
Signed-off-by: Yonghong Song
---
samples/bpf/Makefile | 8
tools/testing/selftests/bpf/Makefile | 8
2 files
):
bpf_prog_89d64e4abf0f0126_test_long_fname_2:
0: push %rbp
1: mov%rsp,%rbp
..
80: add$0x28,%rbp
84: leaveq
85: retq
Signed-off-by: Yonghong Song
---
tools/bpf/bpftool/btf_dumper.c| 98 +++
tools/bpf/bpftool/main.h | 2 +
tools
Add several BTF_KIND_FUNC unit tests in bpf selftest test_btf.
Signed-off-by: Martin KaFai Lau
Signed-off-by: Yonghong Song
---
tools/lib/bpf/btf.c| 3 +
tools/testing/selftests/bpf/test_btf.c | 262 +
2 files changed, 265 insertions(+)
diff --git
The function get_btf() is implemented in tools/bpf/bpftool/map.c
to get a btf structure given a map_info. This patch
refactored this function to be function btf_get_from_id()
in tools/lib/bpf so that it can be used later.
Signed-off-by: Yonghong Song
---
tools/bpf/bpftool/map.c | 68
section cannot. The loader
may need to do some relocation and merging,
similar to merging multiple code sections, before
loading into the kernel.
Acked-by: Martin KaFai Lau
Signed-off-by: Yonghong Song
---
tools/lib/bpf/bpf.c| 46 ++-
tools/lib/bpf/btf.c| 274
loading/retriving
of func_type info.
Acked-by: Martin KaFai Lau
Signed-off-by: Yonghong Song
---
tools/testing/selftests/bpf/test_btf.c | 315 -
1 file changed, 312 insertions(+), 3 deletions(-)
diff --git a/tools/testing/selftests/bpf/test_btf.c
b/tools/testing
The kernel uapi bpf.h is synced to tools directory.
Acked-by: Martin KaFai Lau
Signed-off-by: Yonghong Song
---
tools/include/uapi/linux/bpf.h | 13 +
1 file changed, 13 insertions(+)
diff --git a/tools/include/uapi/linux/bpf.h b/tools/include/uapi/linux/bpf.h
index 852dc17ab47a
This patch breaks up btf_type_is_void() into
btf_type_is_void() and btf_type_is_fwd().
It also adds btf_type_nosize() to better describe it is
testing a type has nosize info.
Signed-off-by: Martin KaFai Lau
---
kernel/bpf/btf.c | 37 ++---
1 file changed, 22
The new fields are added for program load in lib/bpf so
application uses api bpf_load_program_xattr() is able
to load program with btf and func_info data.
This functionality will be used in next patch
by bpf selftest test_btf.
Acked-by: Martin KaFai Lau
Signed-off-by: Yonghong Song
---
tools
program below,
int foo(int (*bar)(int)) { return bar(5); }
two func types will be generated:
FuncType #1: subprogram "foo" with parameter "bar"
FuncType #2: pointee of function pointer "int (*)(int)"
Signed-off-by: Martin KaFai Lau
Signed-off-by: Yonghong Song
---
The kernel uapi btf.h is synced to the tools directory.
Signed-off-by: Martin KaFai Lau
Signed-off-by: Yonghong Song
---
tools/include/uapi/linux/btf.h | 17 ++---
1 file changed, 14 insertions(+), 3 deletions(-)
diff --git a/tools/include/uapi/linux/btf.h b/tools/include/uapi
also
print out function prototypes for each jited function.
Acked-by: Martin KaFai Lau
Signed-off-by: Yonghong Song
---
include/linux/bpf.h | 5 +-
include/linux/bpf_verifier.h | 1 +
include/linux/btf.h | 2 +
include/uapi/linux/bpf.h | 13
kernel/bpf/btf.c
h for validity test.
. Removed/changed several verifier messages.
. Modified several commit messages to remove line_off reference.
Yonghong Song (13):
bpf: btf: Break up btf_type_is_void()
bpf: btf: Add BTF_KIND_FUNC
tools/bpf: sync kernel btf.h header
tools/bpf: add btf func unit tests i
Hi Peter,
> On Nov 8, 2018, at 7:00 AM, Peter Zijlstra wrote:
>
> On Wed, Nov 07, 2018 at 06:25:04PM +0000, Song Liu wrote:
>>
>>
>>> On Nov 7, 2018, at 12:40 AM, Peter Zijlstra wrote:
>>>
>>> On Tue, Nov 06, 2018 at 12:52:42PM -0800, Song
l test robot
Cc: Li Zhijian
Signed-off-by: Yonghong Song
---
tools/include/uapi/linux/pkt_cls.h | 612 +++
tools/include/uapi/linux/tc_act/tc_bpf.h | 37 ++
2 files changed, 649 insertions(+)
create mode 100644 tools/include/uapi/linux/pkt_cls.h
create mode 100644 tool
On 11/7/18 5:15 PM, Li Zhijian wrote:
> On 11/8/2018 9:00 AM, Yonghong Song wrote:
>> Commit f6f3bac08ff9 ("tools/bpf: bpftool: add net support")
>> added certain networking support to bpftool.
>> The implementation relies on a relatively recent uapi heade
y to tools/include/uapi directory so
building the bpftool does not depend on host system for this file.
Fixes: f6f3bac08ff9 ("tools/bpf: bpftool: add net support")
Reported-by: kernel test robot
Signed-off-by: Yonghong Song
---
tools/include/uapi/linux/tc_act/tc_bpf.h | 37
On Thu, Oct 25, 2018 at 8:12 AM Lorenz Bauer wrote:
>
> On Tue, 9 Oct 2018 at 01:08, Song Liu wrote:
> >
> > > --- a/include/uapi/linux/bpf.h
> > > +++ b/include/uapi/linux/bpf.h
> > > @@ -253,6 +253,8 @@ enum bpf_attach_type {
> > > #define BP
rror(errno));
> > return 1;
> > }
> > maps[i].fd = map_fd[i];
> >
>
> LGTM
>
> Acked-by: John Fastabend
Acked-by: Song Liu
On 11/2/18 8:42 AM, Edward Cree wrote:
> On 02/11/18 15:02, Arnaldo Carvalho de Melo wrote:
>> Yeah, didn't work as well:
>
>> And the -vv in 'perf trace' didn't seem to map to further details in the
>> output of the verifier debug:
> Yeah for log_level 2 you probably need to make source-level
Currently, when there is no subprog (prog->aux->func_cnt == 0),
bpf_prog_info does not return any jited_ksyms or jited_func_lens. This
patch adds main program address (prog->bpf_func) and main program
length (prog->jited_len) to bpf_prog_info.
Signed-off-by: Song Liu
---
kernel/b
s set improves bpf program address showed in /proc/kallsyms and in
bpf_prog_info. First, real program address is showed instead of page
address. Second, when there is no subprogram, bpf_prog_info->jited_ksyms
and bpf_prog_info->jited_fun_lens returns the main prog address and
length.
Song Liu
.
This change is OK because these addresses are still protected by sysctl
kptr_restrict (see kallsyms_show_value()), and only programs loaded by
root are added to kallsyms (see bpf_prog_kallsyms_add()).
Signed-off-by: Song Liu
---
kernel/bpf/core.c | 4 +---
1 file changed, 1 insertion(+), 3 deletions
address.
This change is OK because bpf_prog_get_info_by_fd() is only available
to root.
Signed-off-by: Song Liu
---
kernel/bpf/syscall.c | 1 -
1 file changed, 1 deletion(-)
diff --git a/kernel/bpf/syscall.c b/kernel/bpf/syscall.c
index ccb93277aae2..34a9eef5992c 100644
--- a/kernel/bpf
> On Nov 2, 2018, at 3:19 AM, Daniel Borkmann wrote:
>
> On 11/02/2018 11:09 AM, Daniel Borkmann wrote:
>> On 11/01/2018 08:00 AM, Song Liu wrote:
>>> Currently, jited_ksyms in bpf_prog_info shows page addresses of jited
>>> bpf program. This is not ideal
l process these event before the end of perf-record.
Does this approach make sense?
Thanks!
Song
Currently, /proc/kallsyms shows page address of jited bpf program. This
is not ideal for detailed profiling (find hot instructions from stack
traces). This patch replaces the page address with real prog start
address.
Signed-off-by: Song Liu
---
kernel/bpf/core.c | 4 +---
1 file changed, 1
Currently, jited_ksyms in bpf_prog_info shows page addresses of jited
bpf program. This is not ideal for detailed profiling (find hot
instructions from stack traces). This patch replaces the page address
with real prog start address.
Signed-off-by: Song Liu
---
kernel/bpf/syscall.c | 1 -
1
This set improves bpf program address showed in /proc/kallsyms and in
bpf_prog_info. First, real program address is showed instead of page
address. Second, when there is no subprogram, bpf_prog_info->jited_ksyms
returns the main prog address.
Song Liu (3):
bpf: show real jited prog addr
Currently, when there is not subprog (prog->aux->func_cnt == 0),
bpf_prog_info does not return any jited_ksyms. This patch adds
main program address (prog->bpf_func) to jited_ksyms.
Signed-off-by: Song Liu
---
kernel/bpf/syscall.c | 16
1 file changed, 12 inserti
: Yonghong Song
Date: Wed Sep 19 16:04:13 2018 +
[bpf] Symbol sizes and types in object file
Clang-compiled object files currently don't include the symbol sizes and
types. Some tools however need that information. For example, ctfconvert
uses that information t
timeout expired
> > before data was received.
> >
> > Signed-off-by: John Fastabend
Acked-by: Song Liu
> > ---
>
> Add fixes tag.
>
> Fixes: 604326b41a6f ("bpf, sockmap: convert to generic sk_msg interface")
>
>
>
>
On Mon, Oct 29, 2018 at 2:58 PM Yonghong Song wrote:
>
> On our test machine, bpf selftest test_flow_dissector.sh failed
> with the following error:
> # ./test_flow_dissector.sh
> bpffs not mounted. Mounting...
> libbpf: failed to create map (name: 'jmp_table'): Opera
: bpf_prog_load bpf_flow.o
selftests: test_flow_dissector [FAILED]
Let us increase the rlimit to remove the above map
creation failure.
Signed-off-by: Yonghong Song
---
tools/testing/selftests/bpf/flow_dissector_load.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/tools/testing/selftests
On Wed, Oct 24, 2018 at 3:08 PM Daniel Borkmann wrote:
>
> On 10/24/2018 11:42 PM, Song Liu wrote:
> > On Wed, Oct 24, 2018 at 1:06 PM Daniel Borkmann
> > wrote:
> >>
> >> Given this seems to be quite fragile and can easily slip through the
> >> crac
++
> kernel/bpf/verifier.c | 13 ++---
> net/core/filter.c | 17 +
> tools/testing/selftests/bpf/test_verifier.c | 15 +--
> 5 files changed, 42 insertions(+), 7 deletions(-)
>
> --
> 2.9.5
>
Other than the nitpick on 7/7, for the series:
Acked-by: Song Liu
On Wed, Oct 24, 2018 at 1:06 PM Daniel Borkmann wrote:
>
> Given this seems to be quite fragile and can easily slip through the
> cracks, lets make direct packet write more robust by requiring that
> future program types which allow for such write must provide a prologue
> callback. In case of
could occurred.
> Hence netdev pointer comparison code is added.
>
> v2: compare netdev pointer instead of using net_eq() (Daniel Borkmann)
> v1: Initial patch
>
> Fixes: 2ddf71e23cc2 ("net: add notifier hooks for devmap bpf map")
> Signed-off-by: Taehee Yoo
Acked-b
proper data_end for the
BPF program, and restore original data afterwards.
Signed-off-by: Song Liu
---
include/linux/filter.h | 21 +
kernel/bpf/cgroup.c| 6 ++
net/core/filter.c | 36 +++-
3 files changed, 62 insertions(+), 1 deletion
ed helper function bpf_compute_and_save_data_pointers() and
bpf_restore_data_pointers().
Changes v1 -> v2:
1. Updated the list of read-only fields, and read-write fields.
2. Added dummy sk to bpf_prog_test_run_skb().
This set enables BPF program of type BPF_PROG_TYPE_CGROUP_SKB to access
some __skb_buff data directly.
Son
Tests are added to make sure CGROUP_SKB cannot access:
tc_classid, data_meta, flow_keys
and can read and write:
mark, prority, and cb[0-4]
and can read other fields.
To make selftest with skb->sk work, a dummy sk is added in
bpf_prog_test_run_skb().
Signed-off-by: Song Liu
---
net/
. Updated the list of read-only fields, and read-write fields.
2. Added dummy sk to bpf_prog_test_run_skb().
This set enables BPF program of type BPF_PROG_TYPE_CGROUP_SKB to access
some __skb_buff data directly.
Song Liu (2):
bpf: add cg_skb_is_valid_access for BPF_PROG_TYPE_CGROUP_SKB
bpf: ad
1 - 100 of 1050 matches
Mail list logo