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
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/
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: add tests for direct packet access from CGROUP_SKB
include
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/
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
> On Oct 18, 2018, at 10:22 PM, Eric Dumazet wrote:
>
>
>
> On 10/18/2018 10:01 PM, Song Liu wrote:
>> Tests are added to make sure CGROUP_SKB cannot access:
>> tc_classid, data_meta, flow_keys
>>
>> and can read and write:
>> mark, prority,
On Thu, Oct 18, 2018 at 1:48 PM Matteo Croce wrote:
>
> Find the ifindex via ioctl(SIOCGIFINDEX) instead of requiring the
> numeric ifindex.
Maybe use if_nametoindex which is simpler?
>
> Signed-off-by: Matteo Croce
> ---
> samples/bpf/xdp1_user.c | 26 --
> 1 file
On Thu, Oct 18, 2018 at 1:48 PM Matteo Croce wrote:
>
> Store only the total packet count for every protocol, instead of the
> whole per-cpu array.
> Use bpf_map_get_next_key() to iterate the map, instead of looking up
> all the protocols.
>
> Signed-off-by: Matteo Croce
Acked-by: Yonghong Song
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/
KB to access
some __skb_buff data directly.
Song Liu (2):
bpf: add cg_skb_is_valid_access for BPF_PROG_TYPE_CGROUP_SKB
bpf: add tests for direct packet access from CGROUP_SKB
include/linux/filter.h | 21 +++
kernel/bpf/cgroup.c | 6 +
net/bp
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
On Thu, Oct 18, 2018 at 10:33 AM Mauricio Vasquez
wrote:
>
>
> On 10/18/18 11:36 AM, Song Liu wrote:
> > On Thu, Oct 18, 2018 at 6:16 AM Mauricio Vasquez B
> > wrote:
> >> test_maps:
> >> Tests that queue/stack maps are behaving correctly even in corner cas
On Thu, Oct 18, 2018 at 6:16 AM Mauricio Vasquez B
wrote:
>
> test_maps:
> Tests that queue/stack maps are behaving correctly even in corner cases
>
> test_progs:
> Tests new ebpf helpers
>
> Signed-off-by: Mauricio Vasquez B
> ---
> tools/lib/bpf/bpf.c| 12 ++
> other use cases, like for exampling saving last N kernel events in a map
> and then analysing from userspace.
>
> Signed-off-by: Mauricio Vasquez B
Acked-by: Song Liu
> ---
> include/linux/bpf.h |6 +
> include/linux/bpf_types.h |2
> include/uapi/linux/bpf
AND_DELETE_ELEM syscall is added,
> this is mapped to the pop operation in the queue/stack maps
> and it is still to implement in other kind of maps.
>
> Signed-off-by: Mauricio Vasquez B
Acked-by: Song Liu
> ---
> include/uapi/linux/bpf.h |1 +
&
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: add tests for direct packet access from CGROUP_SKB
include/linux/filter.h
(), to compute proper data_end for the
BPF program, and restore original data afterwards.
Signed-off-by: Song Liu
---
include/linux/filter.h | 24
kernel/bpf/cgroup.c| 6 ++
net/core/filter.c | 36 +++-
3 files changed, 65 insertions
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/
> On Oct 17, 2018, at 11:25 PM, Alexei Starovoitov
> wrote:
>
> On Wed, Oct 17, 2018 at 10:39:49PM -0700, Song Liu wrote:
>> Tests are added to make sure CGROUP_SKB cannot access:
>> tc_classid, data_meta, flow_keys
>>
>> and can read and
(), to compute proper data_end for the
BPF program, and restore original data afterwards.
Signed-off-by: Song Liu
---
include/linux/filter.h | 24
kernel/bpf/cgroup.c| 6 ++
net/core/filter.c | 36 +++-
3 files changed, 65 insertions
f 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: add tests for direct packet access from CGROUP_SKB
include/linux/filter.h | 24 +++
kernel/bpf/cgroup.c | 6
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/
> On Oct 17, 2018, at 9:44 PM, Alexei Starovoitov
> wrote:
>
> On Wed, Oct 17, 2018 at 04:36:15PM -0700, Song Liu wrote:
>> BPF programs of BPF_PROG_TYPE_CGROUP_SKB need to access headers in the
>> skb. This patch enables direct access o
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.
Song Liu (2):
bpf: add cg_skb_is_valid_acc
BPF programs of BPF_PROG_TYPE_CGROUP_SKB need to access headers in the
skb. This patch enables direct access of skb for these programs.
In __cgroup_bpf_run_filter_skb(), bpf_compute_data_pointers() is called
to compute proper data_end for the BPF program.
Signed-off-by: Song Liu
---
kernel/bpf
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/
%rbp
1: mov%rsp,%rbp
..
80: add$0x28,%rbp
84: leaveq
85: retq
Signed-off-by: Yonghong Song
---
tools/bpf/bpftool/btf_dumper.c | 90 ++
tools/bpf/bpftool/main.h | 2 +
tools/bpf/bpftool/prog.c | 54
The kernel uapi bpf.h is synced to tools directory.
Signed-off-by: Yonghong Song
---
tools/include/uapi/linux/bpf.h | 11 +++
1 file changed, 11 insertions(+)
diff --git a/tools/include/uapi/linux/bpf.h b/tools/include/uapi/linux/bpf.h
index f9187b41dff6..7ebbf4f06a65 100644
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
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 | 87 ++--
tools/testing
to
return btf_id and jited_func_types, so user spaces can
print out the function prototype for each jited function.
Signed-off-by: Yonghong Song
---
include/linux/bpf.h | 2 +
include/linux/bpf_verifier.h | 1 +
include/linux/btf.h | 2 +
include/uapi/linux/bpf.h | 11
section cannot. The loader
may need to do some relocation and merging,
similar to merging multiple code sections, before
loading into the kernel.
Signed-off-by: Yonghong Song
---
tools/lib/bpf/btf.c| 232 +
tools/lib/bpf/btf.h| 48 +
tools
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
Signed-off-by: Yonghong Song
---
kernel/bpf/btf.c | 37
loading/retriving
of func_type info.
Signed-off-by: Yonghong Song
---
tools/testing/selftests/bpf/test_btf.c | 278 -
1 file changed, 275 insertions(+), 3 deletions(-)
diff --git a/tools/testing/selftests/bpf/test_btf.c
b/tools/testing/selftests/bpf/test_btf.c
index
Add several BTF_KIND_FUNC and BTF_KIND_FUNC_PROTO
unit tests in bpf selftest test_btf.
Signed-off-by: Martin KaFai Lau
Signed-off-by: Yonghong Song
---
tools/lib/bpf/btf.c| 4 +
tools/testing/selftests/bpf/test_btf.c | 216 +
2 files changed, 220
function signature is
available to both kernel and user space.
Here, the insn offset is not available during the dump time
as relocation is resolved pretty late in the compilation process.
Signed-off-by: Martin KaFai Lau
Signed-off-by: Yonghong Song
---
include/u
d/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 and BTF_KIND_FUNC_PROTO
tools/bpf: sync kernel btf.h header
tools/bpf: add btf func/func_proto unit
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
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 | 9 ++---
1 file changed, 6 insertions(+), 3 deletions(-)
diff --git a/tools/include/uapi/linux/btf.h b/tools/include/uapi/linux/btf.h
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.
Signed-off-by: Yonghong Song
---
tools/lib/bpf/bpf.c | 3 +++
tools
> On Oct 17, 2018, at 12:02 PM, Alexei Starovoitov wrote:
>
> On 10/17/18 10:26 AM, Alexei Starovoitov wrote:
>> On Tue, Oct 16, 2018 at 10:56:05PM -0700, Song Liu wrote:
>>> BPF programs of BPF_PROG_TYPE_CGROUP_SKB need to access headers in the
>>> skb.
On 10/17/18 4:11 AM, Edward Cree wrote:
> On 17/10/18 08:24, Yonghong Song wrote:
>> This patch added support to print function signature
>> if btf func_info is available. Note that ksym
>> now uses function name instead of prog_name as
>> prog_name has a limit of 1
On 10/17/18 9:13 AM, Edward Cree wrote:
> On 17/10/18 08:23, Yonghong Song wrote:
>> This patch adds BTF_KIND_FUNC and BTF_KIND_FUNC_PROTO
>> support to the type section. BTF_KIND_FUNC_PROTO is used
>> to specify the type of a function pointer. With this,
>> BTF ha
Hi David,
On Wed, Oct 17, 2018 at 8:09 AM David Ahern wrote:
>
> On 10/16/18 11:43 PM, Song Liu wrote:
> > I agree that processing events while recording has significant overhead.
> > In this case, perf user space need to know details about the the jited BPF
> > program.
On 10/17/18 4:02 AM, Edward Cree wrote:
> I think the BTF work needs to be better documented; at the moment the only way
> to determine how BTF sections are structured is to read through the headers,
> and cross-reference with the DWARF spec to guess at the semantics of various
> fields.
t 16, 2018 at 11:43:11PM -0700, Song Liu escreveu:
> > > On Tue, Oct 16, 2018 at 4:43 PM David Ahern wrote:
> > > > On 10/15/18 4:33 PM, Song Liu wrote:
> > > > > I am working with Alexei on the idea of fetching BPF program
> > > > > in
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
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
%rbp
1: mov%rsp,%rbp
..
80: add$0x28,%rbp
84: leaveq
85: retq
Signed-off-by: Yonghong Song
---
tools/bpf/bpftool/btf_dumper.c | 96 ++
tools/bpf/bpftool/main.h | 2 +
tools/bpf/bpftool/prog.c | 54
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 | 72 +++-
tools/testing
The kernel uapi bpf.h is synced to tools directory.
Signed-off-by: Yonghong Song
---
tools/include/uapi/linux/bpf.h | 11 +++
1 file changed, 11 insertions(+)
diff --git a/tools/include/uapi/linux/bpf.h b/tools/include/uapi/linux/bpf.h
index f9187b41dff6..7ebbf4f06a65 100644
.
In this patch, only func type info is processed.
The functionality is implemented in libbpf.
Signed-off-by: Yonghong Song
---
tools/lib/bpf/btf.c| 232 +
tools/lib/bpf/btf.h| 31 ++
tools/lib/bpf/libbpf.c | 53 +-
3 files changed, 312
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.
Signed-off-by: Yonghong Song
---
tools/lib/bpf/bpf.c | 3 +++
tools
sections.
Patch #11 refactors to have btf_get_from_id() in libbpf for reuse.
Patch #12 enhance test_btf file testing to test func info.
Patch #13 adds bpftool support for func signature dump.
Yonghong Song (13):
bpf: btf: Break up btf_type_is_void()
bpf: btf: Add BTF_KIND_FUNC and BTF_KIND_FU
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
Signed-off-by: Yonghong Song
---
kernel/bpf/btf.c | 37
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 | 9 ++---
1 file changed, 6 insertions(+), 3 deletions(-)
diff --git a/tools/include/uapi/linux/btf.h b/tools/include/uapi/linux/btf.h
loading/retriving
of func_type info.
Signed-off-by: Yonghong Song
---
tools/testing/selftests/bpf/test_btf.c | 278 -
1 file changed, 275 insertions(+), 3 deletions(-)
diff --git a/tools/testing/selftests/bpf/test_btf.c
b/tools/testing/selftests/bpf/test_btf.c
index
to
return btf_id and jited_func_types, so user spaces can
print out the function prototype for each jited function.
Signed-off-by: Yonghong Song
---
include/linux/bpf.h | 2 +
include/linux/bpf_verifier.h | 1 +
include/linux/btf.h | 2 +
include/uapi/linux/bpf.h | 11
function signature is
available to both kernel and user space.
Here, the insn offset is not available during the dump time
as relocation is resolved pretty late in the compilation process.
Signed-off-by: Martin KaFai Lau
Signed-off-by: Yonghong Song
---
include/u
Add several BTF_KIND_FUNC and BTF_KIND_FUNC_PROTO
unit tests in bpf selftest test_btf.
Signed-off-by: Martin KaFai Lau
Signed-off-by: Yonghong Song
---
tools/lib/bpf/btf.c| 4 +
tools/testing/selftests/bpf/test_btf.c | 216 +
2 files changed, 220
Hi David,
On Tue, Oct 16, 2018 at 4:43 PM David Ahern wrote:
>
> On 10/15/18 4:33 PM, Song Liu wrote:
> > I am working with Alexei on the idea of fetching BPF program information via
> > BPF_OBJ_GET_INFO_BY_FD cmd. I added PERF_RECORD_BPF_EVENT
> > to perf_event_type,
BPF programs of BPF_PROG_TYPE_CGROUP_SKB need to access headers in the
skb. This patch enables direct access of skb for these programs.
In __cgroup_bpf_run_filter_skb(), bpf_compute_data_pointers() is called
to compute proper data_end for the BPF program.
Signed-off-by: Song Liu
---
kernel/bpf
Tests are added to make sure CGROUP_SKB can directly access len, data,
and data_end in __sk_buff, but not other fields.
Signed-off-by: Song Liu
---
tools/testing/selftests/bpf/test_verifier.c | 30 +
1 file changed, 30 insertions(+)
diff --git a/tools/testing/selftests/bpf
This set enables BPF program of type BPF_PROG_TYPE_CGROUP_SKB to access
__skb_buff->len/data/data_end directly.
Song Liu (2):
bpf: add cg_skb_is_valid_access for BPF_PROG_TYPE_CGROUP_SKB
bpf: add tests for direct packet access from CGROUP_SKB
kernel/bpf/cgroup.c |
On 10/16/18 11:27 AM, Alexei Starovoitov wrote:
> On Fri, Oct 12, 2018 at 11:54:20AM -0700, Yonghong Song wrote:
>> The BTF support was added to kernel by Commit 69b693f0aefa
>> ("bpf: btf: Introduce BPF Type Format (BTF)"), which introduced
>> .BTF section into EL
On 10/16/18 10:59 AM, Alexei Starovoitov wrote:
> On Fri, Oct 12, 2018 at 11:54:42AM -0700, Yonghong Song wrote:
>> This patch added interface to load a program with the following
>> additional information:
>> . prog_btf_fd
>> . func_info and func_
On 10/15/18 3:36 PM, Daniel Borkmann wrote:
> On 10/12/2018 08:54 PM, Yonghong Song wrote:
> [...]
>> +static bool btf_name_valid_identifier(const struct btf *btf, u32 offset)
>> +{
>> +/* offset must be valid */
>> +const char *src = >strings[offset
On 10/15/18 3:30 PM, Daniel Borkmann wrote:
> On 10/12/2018 08:54 PM, Yonghong Song wrote:
>> This patch adds BTF_KIND_FUNC and BTF_KIND_FUNC_PROTO
>> support to the type section. BTF_KIND_FUNC_PROTO is used
>> to specify the type of a function pointer. With this,
>>
On 10/15/18 4:12 PM, Martin Lau wrote:
> On Fri, Oct 12, 2018 at 11:54:42AM -0700, Yonghong Song wrote:
>> This patch added interface to load a program with the following
>> additional information:
>> . prog_btf_fd
>> . func_info and func_info_len
>&
[ perf record: Captured and wrote 9.337 MB perf.data (93178 samples) ]
In this example, the bpf program was loaded and then unloaded in
another terminal. When machine__process_bpf_event() processes
the load event, the bpf program is already unloaded. Therefore,
machine__process_bpf_event() will not be able to get information
about the program via BPF_OBJ_GET_INFO_BY_FD cmd.
To solve this problem, we will need to run BPF_OBJ_GET_INFO_BY_FD
as soon as perf get the event from kernel. I looked around the perf
code for a while. But I haven't found a good example where some
events are processed before the end of perf-record. Could you
please help me with this?
Thanks,
Song
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
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 | 72 +++-
tools/testing
%rbp
1: mov%rsp,%rbp
..
80: add$0x28,%rbp
84: leaveq
85: retq
Signed-off-by: Yonghong Song
---
tools/bpf/bpftool/btf_dumper.c | 96 ++
tools/bpf/bpftool/main.h | 2 +
tools/bpf/bpftool/prog.c | 54
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
to
return btf_id and jited_func_types, so user spaces can
print out the function prototype for each jited function.
Signed-off-by: Yonghong Song
---
include/linux/bpf.h | 2 +
include/linux/bpf_verifier.h | 1 +
include/linux/btf.h | 2 +
include/uapi/linux/bpf.h | 11
The kernel uapi bpf.h is synced to tools directory.
Signed-off-by: Yonghong Song
---
tools/include/uapi/linux/bpf.h | 11 +++
1 file changed, 11 insertions(+)
diff --git a/tools/include/uapi/linux/bpf.h b/tools/include/uapi/linux/bpf.h
index f9187b41dff6..7ebbf4f06a65 100644
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.
Signed-off-by: Yonghong Song
---
tools/lib/bpf/bpf.c | 3 +++
tools
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 | 9 ++---
1 file changed, 6 insertions(+), 3 deletions(-)
diff --git a/tools/include/uapi/linux/btf.h b/tools/include/uapi/linux/btf.h
loading/retriving
of func_type info.
Signed-off-by: Yonghong Song
---
tools/testing/selftests/bpf/test_btf.c | 278 -
1 file changed, 275 insertions(+), 3 deletions(-)
diff --git a/tools/testing/selftests/bpf/test_btf.c
b/tools/testing/selftests/bpf/test_btf.c
index
gnature is
available to both kernel and user space.
Here, the insn offset is not available during the dump time
as relocation is resolved pretty late in the compilation process.
Signed-off-by: Martin KaFai Lau
Signed-off-by: Yonghong Song
---
include/uapi/linux/btf.h | 9 +-
kernel/bpf/btf.c
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
Add several BTF_KIND_FUNC and BTF_KIND_FUNC_PROTO
unit tests in bpf selftest test_btf.
Signed-off-by: Martin KaFai Lau
Signed-off-by: Yonghong Song
---
tools/lib/bpf/btf.c| 4 +
tools/testing/selftests/bpf/test_btf.c | 216 +
2 files changed, 220
FContext.h).
Signed-off-by: Yonghong Song
---
tools/lib/bpf/btf.c| 232 +
tools/lib/bpf/btf.h| 31 ++
tools/lib/bpf/libbpf.c | 53 +-
3 files changed, 312 insertions(+), 4 deletions(-)
diff --git a/tools/lib/bpf/btf.c b/tools/lib/bpf/b
11 refactors to have btf_get_from_id() in libbpf for reuse.
Patch #12 enhance test_btf file testing to test func info.
Patch #13 adds bpftool support for func signature dump.
Yonghong Song (13):
bpf: btf: Break up btf_type_is_void()
bpf: btf: Add BTF_KIND_FUNC and BTF_KIND_FUNC_PROTO
tools/bpf: sync
On Wed, Oct 10, 2018 at 10:48 AM Mauricio Vasquez
wrote:
>
>
>
> On 10/10/2018 11:48 AM, Song Liu wrote:
> > On Wed, Oct 10, 2018 at 7:06 AM Mauricio Vasquez B
> > wrote:
> >> The following patch implements a bpf queue/stack maps that
> >
ptr = map->ops->map_lookup_and_delete_elem(map, key);
> + if (ptr)
> + memcpy(value, ptr, value_size);
I think we are exposed to race condition with push and pop in parallel.
map_lookup_and_delete_elem() only updates the head/tail, so it giv
d-off-by: Mauricio Vasquez B
Acked-by: Song Liu
> ---
> include/linux/bpf_types.h |2 +-
> kernel/bpf/stackmap.c |2 +-
> 2 files changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/include/linux/bpf_types.h b/include/linux/bpf_types.h
> index 5432f4c9f50e..65
On Wed, Oct 10, 2018 at 7:06 AM Mauricio Vasquez B
wrote:
>
> Sync both files.
>
> Signed-off-by: Mauricio Vasquez B
Acked-by: Song Liu
> ---
> tools/include/uapi/linux/bpf.h | 30 +-
> 1 file changed, 29 insertions(+), 1 deletion(-)
&
gt; This will be used in the following patch that implements some new
> helpers that receive a pointer to be filled with a map value.
>
> Signed-off-by: Mauricio Vasquez B
Acked-by: Song Liu
> ---
> include/linux/bpf.h |1 +
> kernel/bpf/verifier.c |9 ++---
> 2 f
rces that key must be
> null.
>
> Signed-off-by: Mauricio Vasquez B
Acked-by: Song Liu
> ---
> kernel/bpf/syscall.c | 19 +++
> 1 file changed, 15 insertions(+), 4 deletions(-)
>
> diff --git a/kernel/bpf/syscall.c b/kernel/bpf/syscall.c
> index 4f41623
> On Oct 9, 2018, at 4:14 PM, Yonghong Song wrote:
>
> Use __u32 instead u32 in libbpf.c and also use
> uapi perf_event.h instead of tools/perf/perf-sys.h.
>
> Signed-off-by: Yonghong Song
Acked-by: Song Liu
> ---
> tools/lib/bpf/Makefile | 2 +-
> tools/lib/bp
Use __u32 instead u32 in libbpf.c and also use
uapi perf_event.h instead of tools/perf/perf-sys.h.
Signed-off-by: Yonghong Song
---
tools/lib/bpf/Makefile | 2 +-
tools/lib/bpf/libbpf.c | 8
2 files changed, 5 insertions(+), 5 deletions(-)
diff --git a/tools/lib/bpf/Makefile b/tools
For the series:
Acked-by: Song Liu
On Tue, Oct 9, 2018 at 3:04 AM Jesper Dangaard Brouer wrote:
>
> While implementing PoC building blocks for eBPF code XDP+TC that can
> manipulate VLANs headers, I discovered a bug in generic-XDP.
>
> The fix should be backported to stable
On Tue, Oct 9, 2018 at 6:05 AM Mauricio Vasquez
wrote:
>
>
>
> On 10/08/2018 08:36 PM, Song Liu wrote:
> > On Mon, Oct 8, 2018 at 12:12 PM Mauricio Vasquez B
> > wrote:
> >> Queue/stack maps implement a FIFO/LIFO data storage for ebpf programs.
> >
heck whether verifier prevents
> bpf_map_lookup_elem call on above programs from bpf program.
>
> Signed-off-by: Prashant Bhole
> Acked-by: Alexei Starovoitov
Acked-by: Song Liu
> ---
> tools/testing/selftests/bpf/test_verifier.c | 121 +++-
> 1 file changed,
and replace change:
> fixup_map1 -> fixup_map_hash_8b
> fixup_map2 -> fixup_map_hash_48b
> fixup_map3 -> fixup_map_hash_16b
> fixup_map4 -> fixup_map_array_48b
>
> Suggested-by: Alexei Starovoitov
> Signed-off-by: Prashant Bhole
> Acked-by: Alexei Sta
;,"0x00","0x00"
> ],
> "value": {
> "error": "Operation not supported"
> },
> "key": ["0x0b","0x00","0x00","0x00"
> ],
> "value": {
> "
ed-by: Jakub Kicinski
> Acked-by: Alexei Starovoitov
Acked-by: Song Liu
> ---
> tools/bpf/bpftool/map.c | 83 -
> 1 file changed, 49 insertions(+), 34 deletions(-)
>
> diff --git a/tools/bpf/bpftool/map.c b/tools/bpf/bpftool/map.c
&g
gt; Signed-off-by: Prashant Bhole
> Acked-by: Alexei Starovoitov
Acked-by: Song Liu
> ---
> kernel/bpf/arraymap.c | 2 +-
> kernel/bpf/sockmap.c | 2 +-
> kernel/bpf/stackmap.c | 2 +-
> kernel/bpf/xskmap.c | 2 +-
> 4 files changed, 4 insertions(+), 4 deletions(-)
>
> Acked-by: Alexei Starovoitov
Acked-by: Song Liu
> ---
> kernel/bpf/syscall.c | 9 +++--
> 1 file changed, 7 insertions(+), 2 deletions(-)
>
> diff --git a/kernel/bpf/syscall.c b/kernel/bpf/syscall.c
> index 5742df21598c..4f416234251f 100644
> --- a/kernel/bpf/syscal
101 - 200 of 1050 matches
Mail list logo