Re: [PATCH bpf 1/2] selftests/bpf: use thoff instead of nhoff in BPF flow dissector

2018-12-07 Thread Alexei Starovoitov
On Wed, Dec 05, 2018 at 08:40:47PM -0800, Stanislav Fomichev wrote: > We are returning thoff from the flow dissector, not the nhoff. Pass > thoff along with nhoff to the bpf program (initially thoff == nhoff) > and expect flow dissector amend/return thoff, not nhoff. > > This avoids confusion,

Re: [PATCH v2 bpf-next 0/7] bpf: support BPF_ALU | BPF_ARSH

2018-12-07 Thread Alexei Starovoitov
On Wed, Dec 05, 2018 at 01:52:29PM -0500, Jiong Wang wrote: > BPF_ALU | BPF_ARSH | BPF_* were rejected by commit: 7891a87efc71 > ("bpf: arsh is not supported in 32 bit alu thus reject it"). As explained > in the commit message, this is due to there is no complete support for them > on interpreter

Re: [PATCH bpf-next 0/7] Add XDP_ATTACH bind() flag to AF_XDP sockets

2018-12-07 Thread Alexei Starovoitov
On Fri, Dec 07, 2018 at 12:44:24PM +0100, Björn Töpel wrote: > From: Björn Töpel > > Hi! > > This patch set adds support for a new XDP socket bind option, > XDP_ATTACH. > > The rationale behind attach is performance and ease of use. Many XDP > socket users just need a simple way of

Re: [PATCH bpf-next] bpf: relax verifier restriction on BPF_MOV | BPF_ALU

2018-12-07 Thread Alexei Starovoitov
On Fri, Dec 07, 2018 at 05:19:21PM +, Jiong Wang wrote: > On 06/12/2018 03:13, Alexei Starovoitov wrote: > > On Wed, Dec 05, 2018 at 03:32:50PM +, Jiong Wang wrote: > > > On 05/12/2018 14:52, Edward Cree wrote: > > > > On 05/12/18 09:46, Jiong Wang wrote: &

Re: [PATCH bpf-next] tools: bpftool: add a command to dump the trace pipe

2018-12-06 Thread Alexei Starovoitov
On Thu, Dec 06, 2018 at 05:20:54PM +, Quentin Monnet wrote: > 2018-12-05 19:18 UTC-0800 ~ Alexei Starovoitov > > > On Wed, Dec 05, 2018 at 06:15:23PM +, Quentin Monnet wrote: > >>>> + > >>>> +/* Allow room for NULL terminating byte and

Re: [PATCH bpf-next] tools: bpftool: add a command to dump the trace pipe

2018-12-05 Thread Alexei Starovoitov
On Wed, Dec 05, 2018 at 06:15:23PM +, Quentin Monnet wrote: > > > + > > > + /* Allow room for NULL terminating byte and pipe file name */ > > > + snprintf(format, sizeof(format), "%%*s %%%zds %%99s %%*s %%*d %%*d\\n", > > > + PATH_MAX - strlen(pipe_name) - 1); > > > > before scanning

Re: [PATCH bpf-next] bpf: relax verifier restriction on BPF_MOV | BPF_ALU

2018-12-05 Thread Alexei Starovoitov
On Wed, Dec 05, 2018 at 03:32:50PM +, Jiong Wang wrote: > On 05/12/2018 14:52, Edward Cree wrote: > > On 05/12/18 09:46, Jiong Wang wrote: > > > There is NO processed instruction number regression, either with or > > > without > > > -mattr=+alu32. > > > > > Cilium bpf > > > === > > >

Re: [PATCH bpf-next 0/4] Misc improvements on bpf_func_info

2018-12-05 Thread Alexei Starovoitov
On Wed, Dec 05, 2018 at 05:35:43PM -0800, Martin KaFai Lau wrote: > The patchset has a few improvements on bpf_func_info: > 1. Improvements on the behaviors of info.func_info, info.func_info_cnt >and info.func_info_rec_size. > 2. Name change: s/insn_offset/insn_off/ > > Please see individual

Re: [PATCH bpf-next v2 3/5] selftests/bpf: use thoff instead of nhoff in BPF flow dissector

2018-12-05 Thread Alexei Starovoitov
On Tue, Dec 04, 2018 at 03:26:15PM -0800, 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 nhoff to the bpf program (initially

pull-request: bpf 2018-12-05

2018-12-05 Thread Alexei Starovoitov
to a92a72a24d48080f6c49bb514c082fbb1e5bf8fc: Merge branch 'bpf-verifier-resilience' (2018-12-04 17:22:03 +0100) Alexei Starovoitov (4): Merge branch 'btf-check-name' bpf: check pending signals while verifying programs bpf: improve verifier

Re: [PATCH bpf-next] tools: bpftool: add a command to dump the trace pipe

2018-12-05 Thread Alexei Starovoitov
On Wed, Dec 05, 2018 at 10:28:24AM +, Quentin Monnet wrote: > BPF programs can use the bpf_trace_printk() helper to print debug > information into the trace pipe. Add a subcommand > "bpftool prog tracelog" to simply dump this pipe to the console. > > This is for a good part copied from

Re: [RFC bpf-next 1/7] bpf: interpreter support BPF_ALU | BPF_ARSH

2018-12-04 Thread Alexei Starovoitov
On Tue, Dec 04, 2018 at 12:10:05PM -0800, David Miller wrote: > From: Alexei Starovoitov > Date: Tue, 4 Dec 2018 11:29:55 -0800 > > > I guess sparc doesn't really have 32 subregisters. All registers > > are considered 64-bit. It has 32-bit alu ops on 64-bit registers &g

Re: [oss-drivers] Re: [RFC bpf-next 1/7] bpf: interpreter support BPF_ALU | BPF_ARSH

2018-12-04 Thread Alexei Starovoitov
On Tue, Dec 04, 2018 at 11:42:54AM -0800, Jakub Kicinski wrote: > On Tue, 4 Dec 2018 11:29:55 -0800, Alexei Starovoitov wrote: > > Regarding the set... It looks good to me. Pls resubmit without RFC tag > > and probably include mips patch as patch 1, so we can apply the whole > &

Re: [RFC bpf-next 1/7] bpf: interpreter support BPF_ALU | BPF_ARSH

2018-12-04 Thread Alexei Starovoitov
On Tue, Dec 04, 2018 at 08:43:11AM -0800, David Miller wrote: > From: Jiong Wang > Date: Tue, 4 Dec 2018 04:56:29 -0500 > > > This patch implements interpreting BPF_ALU | BPF_ARSH. Do arithmetic right > > shift on low 32-bit sub-register, and zero the high 32 bits. > > > > Reviewed-by: Jakub

Re: [PATCH v5 0/4] Fix unsafe BPF_PROG_TEST_RUN interface

2018-12-04 Thread Alexei Starovoitov
On Mon, Dec 03, 2018 at 11:31:22AM +, 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

[PATCH bpf 2/3] bpf: improve verifier branch analysis

2018-12-03 Thread Alexei Starovoitov
_L4.o 31733089 bpf_lb-DUNKNOWN.o 10801065 bpf_lxc-DDROP_ALL.o 29584 28052 bpf_lxc-DUNKNOWN.o 36916 35487 bpf_netdev.o11188 10864 bpf_overlay.o 66796643 bpf_lcx_jit.o 39555 38437 Reported-by: Anatoly Trosinenko Signed-

[PATCH bpf 0/3] bpf: improve verifier resilience

2018-12-03 Thread Alexei Starovoitov
Three patches to improve verifier ability to handle pathological bpf programs with a lot of branches: - make sure prog_load syscall can be aborted - improve branch taken analysis - introduce per-insn complexity limit for unprivileged programs Alexei Starovoitov (3): bpf: check pending signals

[PATCH bpf 3/3] bpf: add per-insn complexity limit

2018-12-03 Thread Alexei Starovoitov
6643 bpf_lcx_jit.o 38437 38437 But it also makes malicious program to be rejected in 0.4 seconds vs 6.5 Hence apply this limit to unprivileged programs only. Signed-off-by: Alexei Starovoitov Acked-by: Daniel Borkmann Acked-by: Edward Cree --- kernel/bpf/verifier.c | 7 ++- 1 fi

[PATCH bpf 1/3] bpf: check pending signals while verifying programs

2018-12-03 Thread Alexei Starovoitov
verification. Reported-by: Anatoly Trosinenko Signed-off-by: Alexei Starovoitov Acked-by: Daniel Borkmann Acked-by: Edward Cree --- kernel/bpf/verifier.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/kernel/bpf/verifier.c b/kernel/bpf/verifier.c index 6dd419550aba..751bb30b7c5c 100644

Re: [PATCH bpf-next] bpf: Fix memleak in aux->func_info and aux->btf

2018-12-02 Thread Alexei Starovoitov
On Sat, Dec 01, 2018 at 05:08:44PM -0800, Martin KaFai Lau wrote: > The aux->func_info and aux->btf are leaked in the error out cases > during bpf_prog_load(). This patch fixes it. > > Fixes: ba64e7d85252 ("bpf: btf: support proper non-jit func info") > Cc: Yonghong Song > Signed-off-by: Martin

Re: [PATCH net] bpf: uninitialized variables in test code

2018-12-01 Thread Alexei Starovoitov
with the return value of the testing > program. Let's add an additional argument with a pointer where to > store the testing program's result; and make bpf_test_run() > return either 0 or -ENOMEM. > > Fixes: f42ee093be29 ("bpf/test_run: support cgroup local storage") > Re

Re: [PATCH net] bpf: uninitialized variables in test code

2018-12-01 Thread Alexei Starovoitov
On Sat, Dec 01, 2018 at 07:13:50PM +, Roman Gushchin wrote: > On Fri, Nov 30, 2018 at 02:58:03PM -0800, Alexei Starovoitov wrote: > > On Thu, Nov 29, 2018 at 01:27:03PM +0300, Dan Carpenter wrote: > > > Smatch complains that if bpf_test_run() fails with -ENOMEM at

Re: [PATCH bpf-next v2 0/2] sample: xdp1 improvements

2018-11-30 Thread Alexei Starovoitov
On Sat, Dec 01, 2018 at 01:23:04AM +0100, Matteo Croce wrote: > Small improvements to improve the readability and easiness > to use of the xdp1 sample. Applied to bpf-next. I think that sample code could be more useful if it's wrapped with bash script like selftests/test_xdp* tests do. At that

Re: [PATCH v2 bpf-next 0/4] bpf: Improve verifier test coverage on sparc64 et al.

2018-11-30 Thread Alexei Starovoitov
On Fri, Nov 30, 2018 at 09:07:54PM -0800, David Miller wrote: > > On sparc64 a ton of test cases in test_verifier.c fail because > the memory accesses in the test case are unaligned (or cannot > be proven to be aligned by the verifier). > > Perhaps we can eventually try to (carefully) modify

Re: [PATCH bpf-next 1/4] bpf: Add BPF_F_ANY_ALIGNMENT.

2018-11-30 Thread Alexei Starovoitov
On Fri, Nov 30, 2018 at 08:44:20PM -0800, David Miller wrote: > From: Alexei Starovoitov > Date: Fri, 30 Nov 2018 13:58:20 -0800 > > > On Thu, Nov 29, 2018 at 07:32:41PM -0800, David Miller wrote: > >> diff --git a/include/uapi/linux/bpf.h b/include/uapi/linux/bpf.h >

Re: [PATCHv3 bpf 1/2] bpf: Support sk lookup in netns with id 0

2018-11-30 Thread Alexei Starovoitov
On Fri, Nov 30, 2018 at 03:32:20PM -0800, Joe Stringer wrote: > David Ahern and Nicolas Dichtel report that the handling of the netns id > 0 is incorrect for the BPF socket lookup helpers: rather than finding > the netns with id 0, it is resolving to the current netns. This renders > the netns_id

Re: [PATCH bpf] bpf: fix pointer offsets in context for 32 bit

2018-11-30 Thread Alexei Starovoitov
On Sat, Dec 01, 2018 at 01:18:53AM +0100, Daniel Borkmann wrote: > Currently, pointer offsets in three BPF context structures are > broken in two scenarios: i) 32 bit compiled applications running > on 64 bit kernels, and ii) LLVM compiled BPF programs running > on 32 bit kernels. The latter is

Re: BPF uapi structures and 32-bit

2018-11-30 Thread Alexei Starovoitov
On Wed, Nov 28, 2018 at 11:02:00AM -0800, David Miller wrote: > From: Daniel Borkmann > Date: Wed, 28 Nov 2018 11:34:55 +0100 > > > Yeah fully agree. Thinking diff below should address it, do you > > have a chance to give this a spin for sparc / 32 bit to check if > > test_verifier still

Re: [PATCHv2 bpf 1/2] bpf: Support sk lookup in netns with id 0

2018-11-30 Thread Alexei Starovoitov
On Fri, Nov 30, 2018 at 03:18:25PM -0800, Joe Stringer wrote: > On Fri, 30 Nov 2018 at 14:42, Alexei Starovoitov > wrote: > > > > On Thu, Nov 29, 2018 at 04:29:33PM -0800, Joe Stringer wrote: > > > David Ahern and Nicolas Dichtel report that the handling of the ne

Re: [PATCH net] bpf: uninitialized variables in test code

2018-11-30 Thread Alexei Starovoitov
On Thu, Nov 29, 2018 at 01:27:03PM +0300, Dan Carpenter wrote: > Smatch complains that if bpf_test_run() fails with -ENOMEM at the > begining then the "duration" is uninitialized. We then copy the > unintialized variables to the user inside the bpf_test_finish() > function. The functions require

Re: [PATCH bpf] bpf: Fix verifier log string check for bad alignment.

2018-11-30 Thread Alexei Starovoitov
On Wed, Nov 28, 2018 at 10:33:53PM -0800, David Miller wrote: > > The message got changed a lot time ago. > > This was responsible for 36 test case failures on sparc64. > > Fixes: f1174f77b50c ("bpf/verifier: rework value tracking") > Signed-off-by: David S. Miller Applied to bpf tree.

Re: [PATCHv2 bpf 1/2] bpf: Support sk lookup in netns with id 0

2018-11-30 Thread Alexei Starovoitov
On Thu, Nov 29, 2018 at 04:29:33PM -0800, Joe Stringer wrote: > David Ahern and Nicolas Dichtel report that the handling of the netns id > 0 is incorrect for the BPF socket lookup helpers: rather than finding > the netns with id 0, it is resolving to the current netns. This renders > the netns_id

Re: [PATCH bpf-next 0/5] tools: bpftool: fixes and small improvements

2018-11-30 Thread Alexei Starovoitov
On Fri, Nov 30, 2018 at 04:25:43PM +, Quentin Monnet wrote: > Hi, > Several items for bpftool are included in this set: the first three patches > are fixes for bpftool itself and bash completion, while the last two > slightly improve the information obtained when dumping programs or maps, on >

Re: [PATCH bpf-next 1/4] bpf: Add BPF_F_ANY_ALIGNMENT.

2018-11-30 Thread Alexei Starovoitov
On Thu, Nov 29, 2018 at 07:32:41PM -0800, David Miller wrote: > > Often we want to write tests cases that check things like bad context > offset accesses. And one way to do this is to use an odd offset on, > for example, a 32-bit load. > > This unfortunately triggers the alignment checks first

Re: [PATCH v4 3/4] libbpf: add bpf_prog_test_run_xattr

2018-11-30 Thread Alexei Starovoitov
On Wed, Nov 28, 2018 at 04:53:11PM +, Lorenz Bauer wrote: > Add a new function, which encourages safe usage of the test interface. > bpf_prog_test_run continues to work as before, but should be considered > unsafe. > > Signed-off-by: Lorenz Bauer .. > + > +LIBBPF_API int

Re: [PATCH bpf] tools: bpftool: fix a bitfield pretty print issue

2018-11-28 Thread Alexei Starovoitov
On Wed, Nov 28, 2018 at 09:38:23AM -0800, 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 example, for a type like >

Re: [PATCH] bpf: Fix various lib and testsuite build failures on 32-bit.

2018-11-28 Thread Alexei Starovoitov
On Wed, Nov 28, 2018 at 12:56:10PM -0800, 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 I was contemplating to apply that to bpf tree, but the first hunk is bpf-next only and later

Re: [PATCH bpf v2 0/4] bpf: btf: check name validity for various types

2018-11-28 Thread Alexei Starovoitov
On Tue, Nov 27, 2018 at 01:23:26PM -0800, Yonghong Song wrote: > This patch set added name checking for PTR, ARRAY, VOLATILE, TYPEDEF, > CONST, RESTRICT, STRUCT, UNION, ENUM and FWD types. Such a strict > name checking makes BTF more sound in the kernel and future > BTF-to-header-file converesion

Re: [PATCH v3 3/4] libbpf: add bpf_prog_test_run_xattr

2018-11-27 Thread Alexei Starovoitov
On Mon, Nov 26, 2018 at 4:45 AM Lorenz Bauer wrote: > > That's what I had initially, but that makes re-using test_attr really > awkward. Either > you need to reset data_out_size before every call because it is used > to return the > buffer size, I think that is exactly what the user of the

Re: [PATCH bpf] bpf: Support sk lookup in netns with id 0

2018-11-27 Thread Alexei Starovoitov
On Tue, Nov 27, 2018 at 10:01:40AM -0800, Joe Stringer wrote: > On Tue, 27 Nov 2018 at 06:49, Nicolas Dichtel > wrote: > > > > Le 26/11/2018 à 23:08, David Ahern a écrit : > > > On 11/26/18 2:27 PM, Joe Stringer wrote: > > >> @@ -2405,6 +2407,9 @@ enum bpf_func_id { > > >> /*

Re: [PATCH bpf-next 1/3] bpf: btf: check name validity for various types

2018-11-27 Thread Alexei Starovoitov
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_FUNC/BTF_KIND_FUNC_PROTO types such that: > . BTF_KIND_FUNC must have a valid identifier name > . BTF_KIND_PROTO

Re: [PATCH bpf-next v2 0/3] bpf: add sk_msg helper sk_msg_pop_data

2018-11-27 Thread Alexei Starovoitov
bly confusing user space applications, so fix it. lgtm for the set: Acked-by: Alexei Starovoitov

Re: [PATCH bpf-next v2 0/4] libbpf: ABI versioning and documentation

2018-11-26 Thread Alexei Starovoitov
On Fri, Nov 23, 2018 at 04:44:31PM -0800, Andrey Ignatov wrote: > This patch set adds ABI versioning and documentation to libbpf. > > Patch 1 renames btf_get_from_id to btf__get_from_id to follow naming > convention. > Patch 2 adds version script and has more details on ABI versioning. > Patch 3

Re: [PATCH bpf] bpf, doc: add entries of who looks over which jits

2018-11-26 Thread Alexei Starovoitov
and therefore BPF > core under a given architecture. Every new JIT in future /must/ > have an entry here as well. > > Signed-off-by: Daniel Borkmann > Acked-by: Alexei Starovoitov > Acked-by: Naveen N. Rao > Acked-by: Sandipan Das > Acked-by: Martin Schwidefsky > Ac

Re: [PATCH bpf-next 0/2] bpf: support proper non-jit func info

2018-11-26 Thread Alexei Starovoitov
On Sat, Nov 24, 2018 at 11:20:43PM -0800, Yonghong Song wrote: > Commit 838e96904ff3 ("bpf: Introduce bpf_func_info") > added bpf func info support. The userspace is able > to get better ksym's for bpf programs with jit, and > is able to print out func prototypes. > > For a program containing

Re: [PATCH bpf] sparc: Correct ctx->saw_frame_pointer logic.

2018-11-26 Thread Alexei Starovoitov
On Mon, Nov 26, 2018 at 02:52:18PM -0800, David Miller wrote: > > We need to initialize the frame pointer register not just if it is > seen as a source operand, but also if it is seen as the destination > operand of a store or an atomic instruction (which effectively is a > source operand). > >

Re: [PATCH bpf] sparc: Fix JIT fused branch convergance.

2018-11-26 Thread Alexei Starovoitov
On Mon, Nov 26, 2018 at 01:03:46PM -0800, David Miller wrote: > > On T4 and later sparc64 cpus we can use the fused compare and branch > instruction. > > However, it can only be used if the branch destination is in the range > of a signed 10-bit immediate offset. This amounts to 1024 >

Re: [PATCH bpf 0/2] Fix for arm64 jit

2018-11-26 Thread Alexei Starovoitov
On Mon, Nov 26, 2018 at 02:05:37PM +0100, Daniel Borkmann wrote: > This set contains a fix for arm64 BPF JIT. First patch generalizes > ppc64 way of retrieving subprog into bpf_jit_get_func_addr() as core > code and uses the same on arm64 in second patch. Tested on both arm64 > and ppc64. > >

Re: [PATCH v3 3/4] libbpf: add bpf_prog_test_run_xattr

2018-11-24 Thread Alexei Starovoitov
On Fri, Nov 23, 2018 at 11:25:11PM +0100, Daniel Borkmann wrote: > On 11/22/2018 03:09 PM, Lorenz Bauer wrote: > > Add a new function, which encourages safe usage of the test interface. > > bpf_prog_test_run continues to work as before, but should be considered > > unsafe. > > > > Signed-off-by:

Re: [PATCH v2 bpf-next] bpf: add skb->tstamp r/w access from tc clsact and cg skb progs

2018-11-22 Thread Alexei Starovoitov
On Thu, Nov 22, 2018 at 02:39:16PM -0500, Vlad Dumitrescu wrote: > This could be used to rate limit egress traffic in concert with a qdisc > which supports Earliest Departure Time, such as FQ. > > Write access from cg skb progs only with CAP_SYS_ADMIN, since the value > will be used by downstream

[PATCH bpf] bpf: fix integer overflow in queue_stack_map

2018-11-22 Thread Alexei Starovoitov
fix the following issues: - allow queue_stack_map for root only - fix u32 max_entries overflow - disallow value_size == 0 Reported-by: Wei Wu Fixes: f1a2e44a3aec ("bpf: add queue and stack maps") Signed-off-by: Alexei Starovoitov --- kernel/bpf/queue_stack_maps.c | 16 --

Re: [PATCH bpf-next] bpf: add read/write access to skb->tstamp from tc clsact progs

2018-11-21 Thread Alexei Starovoitov
On Wed, Nov 21, 2018 at 10:48:21AM -0800, Vlad Dumitrescu wrote: > On Wed, Nov 21, 2018 at 5:08 AM Eric Dumazet wrote: > > > > > > > > On 11/20/2018 06:40 PM, Alexei Starovoitov wrote: > > > > > > > > looks good to me. > > > >

Re: [PATCH bpf-next 1/2] libbpf: Add version script for DSO

2018-11-21 Thread Alexei Starovoitov
On 11/21/18 12:18 PM, Yonghong Song wrote: > > > 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

Re: [PATCH bpf-next v2] libbpf: make sure bpf headers are c++ include-able

2018-11-20 Thread Alexei Starovoitov
On Tue, Nov 20, 2018 at 05:59:52PM -0800, Stanislav Fomichev wrote: > On 11/20, Alexei Starovoitov wrote: > > On Tue, Nov 20, 2018 at 04:05:55PM -0800, Stanislav Fomichev wrote: > > > On 11/20, Alexei Starovoitov wrote: > > > > On Tue, Nov 20, 2018 at 01:37:23PM -

Re: [PATCH bpf-next] bpf: add read/write access to skb->tstamp from tc clsact progs

2018-11-20 Thread Alexei Starovoitov
On Tue, Nov 20, 2018 at 07:18:48PM -0500, Vlad Dumitrescu wrote: > This could be used to rate limit egress traffic in concert with a qdisc > which supports Earliest Departure Time, such as FQ. > > Signed-off-by: Vlad Dumitrescu > --- > include/uapi/linux/bpf.h| 1 + >

Re: [PATCH v4 bpf-next 1/2] bpf: adding support for map in map in libbpf

2018-11-20 Thread Alexei Starovoitov
On Tue, Nov 20, 2018 at 05:33:43PM -0800, 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

Re: [PATCH bpf-next v2] libbpf: make sure bpf headers are c++ include-able

2018-11-20 Thread Alexei Starovoitov
On Tue, Nov 20, 2018 at 04:05:55PM -0800, Stanislav Fomichev wrote: > On 11/20, Alexei Starovoitov wrote: > > On Tue, Nov 20, 2018 at 01:37:23PM -0800, Stanislav Fomichev wrote: > > > Wrap headers in extern "C", to turn off C++ mangling. > > > This simplifie

Re: BPF probe namespacing

2018-11-20 Thread Alexei Starovoitov
On Mon, Nov 19, 2018 at 03:29:07PM +, Peter Parkanyi wrote: > Hi, > > At LPC I raised the observation that currently it doesn't seem > feasible to insert a BPF probe from within a container that sees > events happening outside of the container, while it is possible to > insert a kernel

Re: [PATCH bpf-next v2] libbpf: make sure bpf headers are c++ include-able

2018-11-20 Thread Alexei Starovoitov
> --- a/tools/lib/bpf/bpf.h > +++ b/tools/lib/bpf/bpf.h > @@ -27,6 +27,10 @@ > #include > #include > > +#ifdef __cplusplus > +extern "C" { > +#endif Acked-by: Alexei Starovoitov was wondering whether it's possible to make it testable. HOSTCXX is available, but I don't see much of the kernel tree using it...

Re: [PATCH bpf-next v2] bpf: fix a compilation error when CONFIG_BPF_SYSCALL is not defined

2018-11-20 Thread Alexei Starovoitov
On Tue, Nov 20, 2018 at 02:08:20PM -0800, Yonghong Song wrote: > Kernel test robot (l...@intel.com) reports a compilation error at > https://www.spinics.net/lists/netdev/msg534913.html > introduced by commit 838e96904ff3 ("bpf: Introduce bpf_func_info"). > > If CONFIG_BPF is defined and

Re: [PATCH bpf-next] bpf: libbpf: retry program creation without the name

2018-11-20 Thread Alexei Starovoitov
On Wed, Nov 21, 2018 at 12:18:57AM +0100, Daniel Borkmann wrote: > On 11/21/2018 12:04 AM, Alexei Starovoitov wrote: > > On Tue, Nov 20, 2018 at 01:19:05PM -0800, Stanislav Fomichev wrote: > >> On 11/20, Alexei Starovoitov wrote: > >>> On Mon, Nov 19, 2018 at 04:46:

Re: [PATCH v3 bpf-next 1/2] bpf: adding support for map in map in libbpf

2018-11-20 Thread Alexei Starovoitov
On Mon, Nov 19, 2018 at 10:42:21PM -0800, 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

Re: [PATCH bpf-next] bpf: libbpf: retry program creation without the name

2018-11-20 Thread Alexei Starovoitov
On Tue, Nov 20, 2018 at 01:19:05PM -0800, Stanislav Fomichev wrote: > On 11/20, Alexei Starovoitov wrote: > > On Mon, Nov 19, 2018 at 04:46:25PM -0800, Stanislav Fomichev wrote: > > > [Recent commit 23499442c319 ("bpf: libbpf: retry map creation without > > > the

Re: [PATCH v2 3/4] libbpf: require size hint in bpf_prog_test_run

2018-11-20 Thread Alexei Starovoitov
On Tue, Nov 20, 2018 at 07:43:57PM +, Lorenz Bauer wrote: > On Tue, 20 Nov 2018 at 19:18, Alexei Starovoitov > wrote: > > > > On Tue, Nov 20, 2018 at 03:43:05PM +, Lorenz Bauer wrote: > > > Require size_out to be non-NULL if data_out is given. This prevents &

Re: [PATCH bpf-next] bpf: libbpf: retry program creation without the name

2018-11-20 Thread Alexei Starovoitov
On Mon, Nov 19, 2018 at 04:46:25PM -0800, Stanislav Fomichev wrote: > [Recent commit 23499442c319 ("bpf: libbpf: retry map creation without > the name") fixed this issue for maps, let's do the same for programs.] > > Since commit 88cda1c9da02 ("bpf: libbpf: Provide basic API support > to specify

Re: [PATCH v2 3/4] libbpf: require size hint in bpf_prog_test_run

2018-11-20