Re: [PATCH bpf-next 2/4] xsk: allow AF_XDP sockets to receive packets directly from a queue

2019-10-07 Thread Toke Høiland-Jørgensen
Sridhar Samudrala writes: > int xdp_do_redirect(struct net_device *dev, struct xdp_buff *xdp, > struct bpf_prog *xdp_prog) > { > struct bpf_redirect_info *ri = this_cpu_ptr(&bpf_redirect_info); > struct bpf_map *map = READ_ONCE(ri->map); > + struct xdp_sock *xs

Re: [PATCH 2/2] netfilter: revert "conntrack: silent a memory leak warning"

2019-10-07 Thread Maciej Żenczykowski
Right, so I'm not claiming I'm following what's happening here. This is on a 4.14 LTS + stuff android device kernel... which isn't exactly trustworthy... backporting this patch (ie. the one I proposed reverting) would potentially fix things, but I don't really understand why we need this kmemleak

[PATCH bpf-next 2/4] xsk: allow AF_XDP sockets to receive packets directly from a queue

2019-10-07 Thread Sridhar Samudrala
Introduce a flag that can be specified during the bind() call of an AF_XDP socket to receive packets directly from a queue when there is no XDP program attached to the device. This is enabled by introducing a special BPF prog pointer called BPF_PROG_DIRECT_XSK and a new bind flag XDP_DIRECT that c

[PATCH bpf-next 3/4] libbpf: handle AF_XDP sockets created with XDP_DIRECT bind flag.

2019-10-07 Thread Sridhar Samudrala
Don't allow an AF_XDP socket trying to bind with XDP_DIRECT bind flag when a normal XDP program is already attached to the device, Don't attach the default XDP program when AF_XDP socket is created with XDP_DIRECT bind flag. Signed-off-by: Sridhar Samudrala --- tools/lib/bpf/xsk.c | 6 ++ 1

[PATCH bpf-next 4/4] xdpsock: add an option to create AF_XDP sockets in XDP_DIRECT mode

2019-10-07 Thread Sridhar Samudrala
This option enables an AF_XDP socket to bind with a XDP_DIRECT flag that allows packets received on the associated queue to be received directly when an XDP program is not attached. Signed-off-by: Sridhar Samudrala --- samples/bpf/xdpsock_user.c | 17 + 1 file changed, 13 inserti

[PATCH bpf-next 1/4] bpf: introduce bpf_get_prog_id and bpf_set_prog_id helper functions.

2019-10-07 Thread Sridhar Samudrala
Currently the users of bpf prog id access it directly via prog->aux->id. Next patch in this series introduces a special bpf prog pointer to support AF_XDP sockets bound to a queue to receive packets from that queue directly. As the special bpf prog pointer is not associated with any struct bpf_prog

[PATCH bpf-next 0/4] Enable direct receive on AF_XDP sockets

2019-10-07 Thread Sridhar Samudrala
This is a rework of the following patch series https://lore.kernel.org/netdev/1565840783-8269-1-git-send-email-sridhar.samudr...@intel.com/#r that tried to enable direct receive by bypassing XDP program attached to the device. Based on the community feedback and some suggestions from Bjorn, chang

Re: [PATCH v4 bpf-next 6/7] libbpf: add BPF_CORE_READ/BPF_CORE_READ_INTO helpers

2019-10-07 Thread Andrii Nakryiko
On Mon, Oct 7, 2019 at 9:56 PM Alexei Starovoitov wrote: > > On 10/7/19 3:47 PM, Andrii Nakryiko wrote: > > Add few macros simplifying BCC-like multi-level probe reads, while also > > emitting CO-RE relocations for each read. > > > > Acked-by: John Fastabend > > Acked-by: Song Liu > > Signed-off

Re: [PATCH 1/2] netfilter: fix a memory leak in nf_conntrack_in

2019-10-07 Thread Cong Wang
On Mon, Oct 7, 2019 at 10:35 PM Maciej Żenczykowski wrote: > > From: Maciej Żenczykowski Please, at least a simple copy-n-paste of kmemleak report will help a lot here. A changelog would save your time and mine too. Thanks.

Re: [PATCH 2/2] netfilter: revert "conntrack: silent a memory leak warning"

2019-10-07 Thread Florian Westphal
Maciej Żenczykowski wrote: > From: Maciej Żenczykowski > > This reverts commit 114aa35d06d4920c537b72f9fa935de5dd205260. > > By my understanding of kmemleak the reasoning for this patch > is incorrect. If kmemleak couldn't handle rcu we'd have it > reporting leaks all over the place. My belie

Re: [PATCH 1/2] netfilter: fix a memory leak in nf_conntrack_in

2019-10-07 Thread Florian Westphal
Maciej Żenczykowski wrote: > From: Maciej Żenczykowski > > Cc: Cong Wang > Cc: Eric Dumazet > Cc: Pablo Neira Ayuso > Signed-off-by: Maciej Żenczykowski > --- > net/netfilter/nf_conntrack_core.c | 3 ++- > 1 file changed, 2 insertions(+), 1 deletion(-) > > diff --git a/net/netfilter/nf_con

Re: [PATCH 2/2] netfilter: revert "conntrack: silent a memory leak warning"

2019-10-07 Thread Cong Wang
On Mon, Oct 7, 2019 at 10:35 PM Maciej Żenczykowski wrote: > > From: Maciej Żenczykowski > > This reverts commit 114aa35d06d4920c537b72f9fa935de5dd205260. > > By my understanding of kmemleak the reasoning for this patch > is incorrect. If kmemleak couldn't handle rcu we'd have it > reporting lea

Re: [PATCH mlx5-next v2 1/3] net/mlx5: Expose optimal performance scatter entries capability

2019-10-07 Thread Leon Romanovsky
On Mon, Oct 07, 2019 at 04:59:31PM +0300, Leon Romanovsky wrote: > From: Yamin Friedman > > Expose maximum scatter entries per RDMA READ for optimal performance. > > Signed-off-by: Yamin Friedman > Reviewed-by: Or Gerlitz > Signed-off-by: Leon Romanovsky > --- > include/linux/mlx5/mlx5_ifc.h |

Re: [ipsec-next:testing 7/8] include/net/espintcp.h:36:20: sparse: sparse: incorrect type in return expression (different address spaces)

2019-10-07 Thread Steffen Klassert
On Sun, Oct 06, 2019 at 10:46:40AM +0800, kbuild test robot wrote: > tree: > https://git.kernel.org/pub/scm/linux/kernel/git/klassert/ipsec-next.git > testing > head: 5374d99ba41893b4bb1ddbe35a88b1f08e860903 > commit: 735de2631f8680ac714df1ecc8e052785e9f9f8e [7/8] xfrm: add espintcp > (RFC 8

ingress bandwidth limitation for ipv6 is inaccurate

2019-10-07 Thread yue longguang
Firstly, thank you stephen. Hi, kuznet: 1. according to my test, bandwidth limitation is inaccurate for ingress ipv6 . The accuracy is affected by burst. if rate is less than 100mbit , set burst to 1MB or 2MB, the result is almost acceptable. but when rate is bigger , the result is approxi

Re: [PATCH rdma-next v2 2/3] RDMA/rw: Support threshold for registration vs scattering to local pages

2019-10-07 Thread Leon Romanovsky
On Mon, Oct 07, 2019 at 03:22:30PM -0700, Bart Van Assche wrote: > On 10/7/19 9:03 AM, Leon Romanovsky wrote: > > On Mon, Oct 07, 2019 at 08:07:55AM -0700, Bart Van Assche wrote: > > > On 10/7/19 6:59 AM, Leon Romanovsky wrote: > > > >/* > > > > - * Check if the device might use memory registra

Re: [PATCH] net/mlx5: Fixed a typo in a comment in esw_del_uc_addr()

2019-10-07 Thread Leon Romanovsky
On Mon, Oct 07, 2019 at 05:38:55PM -0700, Qing Huang wrote: > I know this is not critical. Maybe someone can merge this or fix it with > other commits? Thanks. It is not "linux-rdma", but netdev. Your chances will be much higher if you use get_maintainer.pl and put relevant mailing lists together

[PATCH RFC] r8169: add experimental RTL8117 support

2019-10-07 Thread Heiner Kallweit
This adds experimental support for RTL8117. This chip version is found on the ASUS Pro WS X570-ACE board. I have no hardware to test, therefore I'd appreciate if people owning this board could test and provide feedback. Signed-off-by: Heiner Kallweit --- drivers/net/ethernet/realtek/r8169_main.c

Re: [PATCH 2/2] netfilter: revert "conntrack: silent a memory leak warning"

2019-10-07 Thread Maciej Żenczykowski
Please think both these patches through. I'm not going to claim I'm 100% certain of their correctness. I'm confused by: include/net/netfilter/nf_conntrack.h:65: * beware nf_ct_get() is different and don't inc refcnt. and maybe there's some subtlety to this krealloc+rcu+kmemleak thing I'm miss

[PATCH 2/2] netfilter: revert "conntrack: silent a memory leak warning"

2019-10-07 Thread Maciej Żenczykowski
From: Maciej Żenczykowski This reverts commit 114aa35d06d4920c537b72f9fa935de5dd205260. By my understanding of kmemleak the reasoning for this patch is incorrect. If kmemleak couldn't handle rcu we'd have it reporting leaks all over the place. My belief is that this was instead papering over a

[PATCH 1/2] netfilter: fix a memory leak in nf_conntrack_in

2019-10-07 Thread Maciej Żenczykowski
From: Maciej Żenczykowski Cc: Cong Wang Cc: Eric Dumazet Cc: Pablo Neira Ayuso Signed-off-by: Maciej Żenczykowski --- net/netfilter/nf_conntrack_core.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/net/netfilter/nf_conntrack_core.c b/net/netfilter/nf_conntrack_core.c

Re: [PATCH v4 bpf-next 6/7] libbpf: add BPF_CORE_READ/BPF_CORE_READ_INTO helpers

2019-10-07 Thread Alexei Starovoitov
On 10/7/19 3:47 PM, Andrii Nakryiko wrote: > Add few macros simplifying BCC-like multi-level probe reads, while also > emitting CO-RE relocations for each read. > > Acked-by: John Fastabend > Acked-by: Song Liu > Signed-off-by: Andrii Nakryiko ... > +/* > + * BPF_CORE_READ() is used to simplify

[PATCH net-next] Change in Openvswitch to support MPLS label depth of 3 in ingress direction

2019-10-07 Thread Martin Varghese
From: Martin Varghese The openvswitch was supporting a MPLS label depth of 1 in the ingress direction though the userspace OVS supports a max depth of 3 labels. This change enables openvswitch module to support a max depth of 3 labels in the ingress. Signed-off-by: Martin Varghese --- net/open

Re: [PATCH bpf-next v7] samples: bpf: add max_pckt_size option at xdp_adjust_tail

2019-10-07 Thread Daniel T. Lee
On Tue, Oct 8, 2019 at 12:24 PM Alexei Starovoitov wrote: > > On Mon, Oct 7, 2019 at 10:21 AM Daniel T. Lee wrote: > > > > Currently, at xdp_adjust_tail_kern.c, MAX_PCKT_SIZE is limited > > to 600. To make this size flexible, static global variable > > 'max_pcktsz' is added. > > > > By updating n

Re: [PATCH bpf-next v7] samples: bpf: add max_pckt_size option at xdp_adjust_tail

2019-10-07 Thread Alexei Starovoitov
On Mon, Oct 7, 2019 at 10:21 AM Daniel T. Lee wrote: > > Currently, at xdp_adjust_tail_kern.c, MAX_PCKT_SIZE is limited > to 600. To make this size flexible, static global variable > 'max_pcktsz' is added. > > By updating new packet size from the user space, xdp_adjust_tail_kern.o > will use this

Re: [PATCH net-next 7/9] net: openvswitch: add likely in flow_lookup

2019-10-07 Thread Tonghao Zhang
On Wed, Oct 2, 2019 at 10:07 AM Pravin Shelar wrote: > > On Sun, Sep 29, 2019 at 7:09 PM wrote: > > > > From: Tonghao Zhang > > > > The most case *index < ma->max, we add likely for performance. > > > > Signed-off-by: Tonghao Zhang > > --- > > net/openvswitch/flow_table.c | 2 +- > > 1 file ch

Re: [PATCH bpf-next v3 0/2] bpf/flow_dissector: add mode to enforce global BPF flow dissector

2019-10-07 Thread Alexei Starovoitov
On Mon, Oct 7, 2019 at 9:21 AM Stanislav Fomichev wrote: > > While having a per-net-ns flow dissector programs is convenient for > testing, security-wise it's better to have only one vetted global > flow dissector implementation. > > Let's have a convention that when BPF flow dissector is installe

Re: [PATCH net-next 5/9] net: openvswitch: optimize flow-mask looking up

2019-10-07 Thread Tonghao Zhang
On Wed, Oct 2, 2019 at 10:03 AM Pravin Shelar wrote: > > On Sun, Sep 29, 2019 at 7:09 PM wrote: > > > > From: Tonghao Zhang > > > > The full looking up on flow table traverses all mask array. > > If mask-array is too large, the number of invalid flow-mask > > increase, performance will be drop.

Re: [PATCH] samples: Trivial - fix spelling mistake in usage

2019-10-07 Thread Alexei Starovoitov
On Mon, Oct 7, 2019 at 1:51 AM Anton Ivanov wrote: > > Signed-off-by: Anton Ivanov Please add some text to commit log even for trivial patches. I fixed it up this time and applied.

Re: [PATCH bpf-next 06/10] bpf: add support for BTF pointers to interpreter

2019-10-07 Thread Andrii Nakryiko
On Fri, Oct 4, 2019 at 10:07 PM Alexei Starovoitov wrote: > > Pointer to BTF object is a pointer to kernel object or NULL. > The memory access in the interpreter has to be done via probe_kernel_read > to avoid page faults. > > Signed-off-by: Alexei Starovoitov > --- LGTM. Acked-by: Andrii Nakry

Re: [PATCH v2 bpf-next] bpftool: fix bpftool build by switching to bpf_object__open_file()

2019-10-07 Thread Jakub Kicinski
On Mon, 7 Oct 2019 19:38:15 -0700, Alexei Starovoitov wrote: > On Mon, Oct 7, 2019 at 7:23 PM Jakub Kicinski wrote: > > On Mon, 7 Oct 2019 19:16:45 -0700, Alexei Starovoitov wrote: > > > On Mon, Oct 7, 2019 at 7:00 PM Jakub Kicinski wrote: > > > > On Mon, 7 Oct 2019 15:56:04 -0700, Andrii Nakry

Re: [PATCH v2 bpf-next] bpftool: fix bpftool build by switching to bpf_object__open_file()

2019-10-07 Thread Alexei Starovoitov
On Mon, Oct 7, 2019 at 7:23 PM Jakub Kicinski wrote: > > On Mon, 7 Oct 2019 19:16:45 -0700, Alexei Starovoitov wrote: > > On Mon, Oct 7, 2019 at 7:00 PM Jakub Kicinski wrote: > > > On Mon, 7 Oct 2019 15:56:04 -0700, Andrii Nakryiko wrote: > > > > diff --git a/tools/bpf/bpftool/prog.c b/tools/bpf/b

Re: [PATCH v2 bpf-next] bpftool: fix bpftool build by switching to bpf_object__open_file()

2019-10-07 Thread Jakub Kicinski
On Mon, 7 Oct 2019 19:16:45 -0700, Alexei Starovoitov wrote: > On Mon, Oct 7, 2019 at 7:00 PM Jakub Kicinski wrote: > > On Mon, 7 Oct 2019 15:56:04 -0700, Andrii Nakryiko wrote: > > > diff --git a/tools/bpf/bpftool/prog.c b/tools/bpf/bpftool/prog.c > > > index 43fdbbfe41bb..27da96a797ab 100644 >

Re: [PATCH v2 bpf-next] bpftool: fix bpftool build by switching to bpf_object__open_file()

2019-10-07 Thread Alexei Starovoitov
On Mon, Oct 7, 2019 at 7:00 PM Jakub Kicinski wrote: > > On Mon, 7 Oct 2019 15:56:04 -0700, Andrii Nakryiko wrote: > > diff --git a/tools/bpf/bpftool/prog.c b/tools/bpf/bpftool/prog.c > > index 43fdbbfe41bb..27da96a797ab 100644 > > --- a/tools/bpf/bpftool/prog.c > > +++ b/tools/bpf/bpftool/prog.c

Re: [PATCH v2 bpf-next] bpftool: fix bpftool build by switching to bpf_object__open_file()

2019-10-07 Thread Jakub Kicinski
On Mon, 7 Oct 2019 15:56:04 -0700, Andrii Nakryiko wrote: > diff --git a/tools/bpf/bpftool/prog.c b/tools/bpf/bpftool/prog.c > index 43fdbbfe41bb..27da96a797ab 100644 > --- a/tools/bpf/bpftool/prog.c > +++ b/tools/bpf/bpftool/prog.c > @@ -1092,9 +1092,7 @@ static int do_run(int argc, char **argv) >

Re: [PATCH v2 bpf-next] bpftool: fix bpftool build by switching to bpf_object__open_file()

2019-10-07 Thread Alexei Starovoitov
On Mon, Oct 7, 2019 at 3:58 PM Andrii Nakryiko wrote: > > As part of libbpf in 5e61f2707029 ("libbpf: stop enforcing kern_version, > populate it for users") non-LIBBPF_API __bpf_object__open_xattr() API > was removed from libbpf.h header. This broke bpftool, which relied on > that function. This p

Re: [PATCH net-next 2/9] net: openvswitch: convert mask list in mask array

2019-10-07 Thread Tonghao Zhang
On Wed, Oct 2, 2019 at 10:02 AM Pravin Shelar wrote: > > On Sun, Sep 29, 2019 at 7:09 PM wrote: > > > > From: Tonghao Zhang > > > > Port the codes to linux upstream and with little changes. > > > > Pravin B Shelar, says: > > | mask caches index of mask in mask_list. On packet recv OVS > > | need

Re: [ovs-dev] [PATCH net-next 0/9] optimize openvswitch flow looking up

2019-10-07 Thread Tonghao Zhang
On Fri, Oct 4, 2019 at 1:09 AM William Tu wrote: > > Hi Tonghao, > > Thanks for the patch. > > > On 29 Sep 2019, at 19:09, xiangxia.m@gmail.com wrote: > > > > > From: Tonghao Zhang > > > > > > This series patch optimize openvswitch. > > > > > > Patch 1, 2, 4: Port Pravin B Shelar patches to >

Re: [PATCH bpf-next 05/10] bpf: implement accurate raw_tp context access via BTF

2019-10-07 Thread Andrii Nakryiko
On Fri, Oct 4, 2019 at 10:04 PM Alexei Starovoitov wrote: > > libbpf analyzes bpf C program, searches in-kernel BTF for given type name > and stores it into expected_attach_type. > The kernel verifier expects this btf_id to point to something like: > typedef void (*btf_trace_kfree_skb)(void *, str

Re: [PATCH bpf-next 04/10] libbpf: auto-detect btf_id of raw_tracepoint

2019-10-07 Thread Andrii Nakryiko
On Fri, Oct 4, 2019 at 10:04 PM Alexei Starovoitov wrote: > > For raw tracepoint program types libbpf will try to find > btf_id of raw tracepoint in vmlinux's BTF. > It's a responsiblity of bpf program author to annotate the program > with SEC("raw_tracepoint/name") where "name" is a valid raw tra

Re: [PATCH bpf-next] bpftool: fix bpftool build by switching to bpf_object__open_file()

2019-10-07 Thread Andrii Nakryiko
-- Andrii On Mon, Oct 7, 2019 at 2:50 PM Andrii Nakryiko wrote: > > On Mon, Oct 7, 2019 at 2:46 PM Stanislav Fomichev wrote: > > > > On 10/07, Andrii Nakryiko wrote: > > > As part of libbpf in 5e61f2707029 ("libbpf: stop enforcing kern_version, > > > populate it for users") non-LIBBPF_API __bpf_

[PATCH v2 bpf-next] bpftool: fix bpftool build by switching to bpf_object__open_file()

2019-10-07 Thread Andrii Nakryiko
As part of libbpf in 5e61f2707029 ("libbpf: stop enforcing kern_version, populate it for users") non-LIBBPF_API __bpf_object__open_xattr() API was removed from libbpf.h header. This broke bpftool, which relied on that function. This patch fixes the build by switching to newly added bpf_object__open

[PATCH v4 bpf-next 0/7] Move bpf_helpers and add BPF_CORE_READ macros

2019-10-07 Thread Andrii Nakryiko
This patch set makes bpf_helpers.h and bpf_endian.h a part of libbpf itself for consumption by user BPF programs, not just selftests. It also splits off tracing helpers into bpf_tracing.h, which also becomes part of libbpf. Some of the legacy stuff (BPF_ANNOTATE_KV_PAIR, load_{byte,half,word}, bpf_

[PATCH v4 bpf-next 1/7] selftests/bpf: undo GCC-specific bpf_helpers.h changes

2019-10-07 Thread Andrii Nakryiko
Having GCC provide its own bpf-helper.h is not the right approach and is going to be changed. Undo bpf_helpers.h change before moving bpf_helpers.h into libbpf. Acked-by: Song Liu Acked-by: Ilya Leoshkevich Acked-by: John Fastabend Signed-off-by: Andrii Nakryiko --- tools/testing/selftests/bp

[PATCH v4 bpf-next 6/7] libbpf: add BPF_CORE_READ/BPF_CORE_READ_INTO helpers

2019-10-07 Thread Andrii Nakryiko
Add few macros simplifying BCC-like multi-level probe reads, while also emitting CO-RE relocations for each read. Acked-by: John Fastabend Acked-by: Song Liu Signed-off-by: Andrii Nakryiko --- tools/lib/bpf/bpf_helpers.h | 153 +++- 1 file changed, 150 insertion

[PATCH v4 bpf-next 4/7] selftests/bpf: split off tracing-only helpers into bpf_tracing.h

2019-10-07 Thread Andrii Nakryiko
Split-off PT_REGS-related helpers into bpf_tracing.h header. Adjust selftests and samples to include it where necessary. Acked-by: John Fastabend Acked-by: Song Liu Signed-off-by: Andrii Nakryiko --- samples/bpf/map_perf_test_kern.c | 1 + samples/bpf/offwaketime_kern.c|

[PATCH v4 bpf-next 7/7] selftests/bpf: add BPF_CORE_READ and BPF_CORE_READ_STR_INTO macro tests

2019-10-07 Thread Andrii Nakryiko
Validate BPF_CORE_READ correctness and handling of up to 9 levels of nestedness using cyclic task->(group_leader->)*->tgid chains. Also add a test of maximum-dpeth BPF_CORE_READ_STR_INTO() macro. Acked-by: John Fastabend Acked-by: Song Liu Signed-off-by: Andrii Nakryiko --- .../selftests/bpf/

[PATCH v4 bpf-next 3/7] selftests/bpf: adjust CO-RE reloc tests for new bpf_core_read() macro

2019-10-07 Thread Andrii Nakryiko
To allow adding a variadic BPF_CORE_READ macro with slightly different syntax and semantics, define CORE_READ in CO-RE reloc tests, which is a thin wrapper around low-level bpf_core_read() macro, which in turn is just a wrapper around bpf_probe_read(). Acked-by: John Fastabend Acked-by: Song Liu

[PATCH v4 bpf-next 2/7] selftests/bpf: samples/bpf: split off legacy stuff from bpf_helpers.h

2019-10-07 Thread Andrii Nakryiko
Split off few legacy things from bpf_helpers.h into separate bpf_legacy.h file: - load_{byte|half|word}; - remove extra inner_idx and numa_node fields from bpf_map_def and introduce bpf_map_def_legacy for use in samples; - move BPF_ANNOTATE_KV_PAIR into bpf_legacy.h. Adjust samples and selftests

[PATCH v4 bpf-next 5/7] libbpf: move bpf_{helpers,helper_defs,endian,tracing}.h into libbpf

2019-10-07 Thread Andrii Nakryiko
Move bpf_helpers.h, bpf_tracing.h, and bpf_endian.h into libbpf. Move bpf_helper_defs.h generation into libbpf's Makefile. Ensure all those headers are installed along the other libbpf headers. Also, adjust selftests and samples include path to include libbpf now. Acked-by: Song Liu Signed-off-by

[PATCH net] bonding: fix potential NULL deref in bond_update_slave_arr

2019-10-07 Thread Eric Dumazet
syzbot got a NULL dereference in bond_update_slave_arr() [1], happening after a failure to allocate bond->slave_arr A workqueue (bond_slave_arr_handler) is supposed to retry the allocation later, but if the slave is removed before the workqueue had a chance to complete, bond->slave_err can still b

Re: [PATCH rdma-next v2 2/3] RDMA/rw: Support threshold for registration vs scattering to local pages

2019-10-07 Thread Bart Van Assche
On 10/7/19 9:03 AM, Leon Romanovsky wrote: On Mon, Oct 07, 2019 at 08:07:55AM -0700, Bart Van Assche wrote: On 10/7/19 6:59 AM, Leon Romanovsky wrote: /* - * Check if the device might use memory registration. This is currently only - * true for iWarp devices. In the future we can hopefully

Re: [PATCH] samples: Trivial - fix spelling mistake in usage

2019-10-07 Thread Song Liu
On Mon, Oct 7, 2019 at 1:51 AM Anton Ivanov wrote: > > Signed-off-by: Anton Ivanov Acked-by: Song Liu For future patches, please specify "PATCH bpf-next" or "PATCH bpf" in the subject line. This one I guess goes to bpf-next. Thanks, Song

Re: nf_conntrack_in() - is there a leak here?

2019-10-07 Thread Pablo Neira Ayuso
Hi, On Mon, Oct 07, 2019 at 07:10:37AM -0700, Maciej Żenczykowski wrote: > unsigned int > nf_conntrack_in(struct sk_buff *skb, const struct nf_hook_state *state) > { > enum ip_conntrack_info ctinfo; > struct nf_conn *ct, *tmpl; > u_int8_t protonum; > int dataoff, re

Re: [patch iproute2-next v3 1/2] devlink: introduce cmdline option to switch to a different namespace

2019-10-07 Thread David Ahern
On 10/3/19 3:51 AM, Jiri Pirko wrote: > From: Jiri Pirko > > Similar to ip tool, add an option to devlink to operate under certain > network namespace. Unfortunately, "-n" is already taken, so use "-N" > instead. > > Example: > > $ devlink -N testns1 dev show > > Signed-off-by: Jiri Pirko > -

Re: [PATCH iproute2-next] rdma: Relax requirement to have PID for HW objects

2019-10-07 Thread David Ahern
On 10/2/19 7:49 AM, Leon Romanovsky wrote: > From: Leon Romanovsky > > RDMA has weak connection between PIDs and HW objects, because > the latter tied to file descriptors for their lifetime management. > > The outcome of such connection is that for the following scenario, > the returned PID will

Re: [patch iproute2-next v2 2/2] ip: allow to use alternative names as handle

2019-10-07 Thread David Ahern
On 10/2/19 4:56 AM, Jiri Pirko wrote: > @@ -1106,7 +1106,8 @@ int iplink_get(char *name, __u32 filt_mask) > > if (name) { > addattr_l(&req.n, sizeof(req), > - IFLA_IFNAME, name, strlen(name) + 1); > + !check_ifname(name) ? IFLA_IFNAM

Re: [PATCH bpf-next] bpftool: fix bpftool build by switching to bpf_object__open_file()

2019-10-07 Thread Andrii Nakryiko
On Mon, Oct 7, 2019 at 2:46 PM Stanislav Fomichev wrote: > > On 10/07, Andrii Nakryiko wrote: > > As part of libbpf in 5e61f2707029 ("libbpf: stop enforcing kern_version, > > populate it for users") non-LIBBPF_API __bpf_object__open_xattr() API > > was removed from libbpf.h header. This broke bpft

Re: i40e_pto.c: Odd use of strlcpy converted from strncpy

2019-10-07 Thread Jeff Kirsher
On Mon, 2019-10-07 at 13:48 -0700, Joe Perches wrote: > On Mon, 2019-10-07 at 13:44 -0700, Jeff Kirsher wrote: > > On Sun, 2019-10-06 at 10:19 -0700, Joe Perches wrote: > > > This got converted from strncpy to strlcpy but it's > > > now not necessary to use one character less than the > > > actual

Re: [PATCH bpf-next] bpftool: fix bpftool build by switching to bpf_object__open_file()

2019-10-07 Thread Stanislav Fomichev
On 10/07, Andrii Nakryiko wrote: > As part of libbpf in 5e61f2707029 ("libbpf: stop enforcing kern_version, > populate it for users") non-LIBBPF_API __bpf_object__open_xattr() API > was removed from libbpf.h header. This broke bpftool, which relied on > that function. This patch fixes the build by

Re: [patch iproute2-next v2 1/2] ip: add support for alternative name addition/deletion/list

2019-10-07 Thread David Ahern
On 10/2/19 4:56 AM, Jiri Pirko wrote: > diff --git a/ip/iplink.c b/ip/iplink.c > index 212a088535da..e3f8a28fe94c 100644 > --- a/ip/iplink.c > +++ b/ip/iplink.c > @@ -111,7 +111,9 @@ void iplink_usage(void) > "\n" > " ip link xstats type TYPE [ ARGS ]\n" >

[PATCH bpf-next] bpftool: fix bpftool build by switching to bpf_object__open_file()

2019-10-07 Thread Andrii Nakryiko
As part of libbpf in 5e61f2707029 ("libbpf: stop enforcing kern_version, populate it for users") non-LIBBPF_API __bpf_object__open_xattr() API was removed from libbpf.h header. This broke bpftool, which relied on that function. This patch fixes the build by switching to newly added bpf_object__open

Re: [PATCH bpf-next 0/9] xdp: Support multiple programs on a single interface through chain calls

2019-10-07 Thread Alexei Starovoitov
On Mon, Oct 07, 2019 at 05:43:44PM +0100, Edward Cree wrote: > > (Although I also think full-blown dynamically-linked calls ought not to be >  impossible, *if* we restrict them to taking a ctx and returning a u64, in >  which case the callee can be verified as though it were a normal program, >  a

RE:PERSONAL LETTER FROM MRS RASHIA AMIRA

2019-10-07 Thread Mr Barrister Hans Erich
Greetings My name is Barrister Hans Erich. I have a client who is interested to invest in your country, she is a well known politician in her country and deserve a lucrative investment partnership with you outside her country without any delay Please can you manage such investment please Kin

Re: i40e_pto.c: Odd use of strlcpy converted from strncpy

2019-10-07 Thread Joe Perches
On Mon, 2019-10-07 at 13:44 -0700, Jeff Kirsher wrote: > On Sun, 2019-10-06 at 10:19 -0700, Joe Perches wrote: > > This got converted from strncpy to strlcpy but it's > > now not necessary to use one character less than the > > actual size. > > > > Perhaps the sizeof() - 1 is now not correct and i

Re: [PATCH v2 bpf-next] selftests/bpf: fix dependency ordering for attach_probe test

2019-10-07 Thread Alexei Starovoitov
On Mon, Oct 7, 2019 at 1:42 PM Andrii Nakryiko wrote: > > Current Makefile dependency chain is not strict enough and allows > test_attach_probe.o to be built before test_progs's > prog_test/attach_probe.o is built, which leads to assembler complaining > about missing included binary. > > This patc

Re: [PATCH bpf-next v2 1/5] bpf: Support injecting chain calls into BPF programs on load

2019-10-07 Thread Alexei Starovoitov
On Mon, Oct 07, 2019 at 12:11:31PM +0200, Toke Høiland-Jørgensen wrote: > Alexei Starovoitov writes: > > > On Fri, Oct 04, 2019 at 07:22:41PM +0200, Toke Høiland-Jørgensen wrote: > >> From: Toke Høiland-Jørgensen > >> > >> This adds support for injecting chain call logic into eBPF programs befo

Re: i40e_pto.c: Odd use of strlcpy converted from strncpy

2019-10-07 Thread Jeff Kirsher
On Sun, 2019-10-06 at 10:19 -0700, Joe Perches wrote: > This got converted from strncpy to strlcpy but it's > now not necessary to use one character less than the > actual size. > > Perhaps the sizeof() - 1 is now not correct and it > should use strscpy and a normal sizeof. > > from: > > commit

Re: [PATCH bpf-next v3 1/5] bpf: Support chain calling multiple BPF programs after each other

2019-10-07 Thread Alexei Starovoitov
On Mon, Oct 07, 2019 at 07:20:36PM +0200, Toke Høiland-Jørgensen wrote: > From: Toke Høiland-Jørgensen > > This adds support for wrapping eBPF program dispatch in chain calling > logic. The code injection is controlled by a flag at program load time; if > the flag is set, the BPF program will car

[PATCH v2 bpf-next] selftests/bpf: fix dependency ordering for attach_probe test

2019-10-07 Thread Andrii Nakryiko
Current Makefile dependency chain is not strict enough and allows test_attach_probe.o to be built before test_progs's prog_test/attach_probe.o is built, which leads to assembler complaining about missing included binary. This patch is a minimal fix to fix this issue by enforcing that test_attach_p

Re: [PATCH bpf-next v3 2/5] bpf: Add support for setting chain call sequence for programs

2019-10-07 Thread Daniel Borkmann
On Mon, Oct 07, 2019 at 07:20:37PM +0200, Toke Høiland-Jørgensen wrote: > From: Toke Høiland-Jørgensen > > This adds support for setting and deleting bpf chain call programs through > a couple of new commands in the bpf() syscall. The CHAIN_ADD and CHAIN_DEL > commands take two eBPF program fds a

[Patch net] net_sched: fix backward compatibility for TCA_KIND

2019-10-07 Thread Cong Wang
Marcelo noticed a backward compatibility issue of TCA_KIND after we move from NLA_STRING to NLA_NUL_STRING, so it is probably too late to change it. Instead, to make everyone happy, we can just insert a NUL to terminate the string with nla_strlcpy() like we do for TC actions. Fixes: 62794fc4fbf5

[Patch net] net_sched: fix backward compatibility for TCA_ACT_KIND

2019-10-07 Thread Cong Wang
For TCA_ACT_KIND, we have to keep the backward compatibility too, and rely on nla_strlcpy() to check and terminate the string with a NUL. Note for TC actions, nla_strcmp() is already used to compare kind strings, so we don't need to fix other places. Fixes: 199ce850ce11 ("net_sched: add policy va

Re: [PATCH bpf-next v2 1/5] bpf: Support injecting chain calls into BPF programs on load

2019-10-07 Thread Daniel Borkmann
On Mon, Oct 07, 2019 at 12:11:31PM +0200, Toke Høiland-Jørgensen wrote: > Alexei Starovoitov writes: > > On Fri, Oct 04, 2019 at 07:22:41PM +0200, Toke Høiland-Jørgensen wrote: > >> From: Toke Høiland-Jørgensen > >> > >> This adds support for injecting chain call logic into eBPF programs before

Re: [PATCH bpf-next 0/9] xdp: Support multiple programs on a single interface through chain calls

2019-10-07 Thread Edward Cree
On 07/10/2019 18:12, Lorenz Bauer wrote: > Sure, but this is the simplest, not necessarily realistic use case. There > is a reason that libbpf has the API it has. For example, we patch our > eBPF before loading it. I'm sure there are other complications, which is > why I prefer to keep loading my o

[PATCH net-next] tun: fix memory leak in error path

2019-10-07 Thread Eric Dumazet
syzbot reported a warning [1] that triggered after recent Jiri patch. This exposes a bug that we hit already in the past (see commit ff244c6b29b1 ("tun: handle register_netdevice() failures properly") for details) tun uses priv->destructor without an ndo_init() method. register_netdevice() can r

RE: [PATCH bpf-next v3 0/5] xdp: Support multiple programs on a single interface through chain calls

2019-10-07 Thread John Fastabend
Toke Høiland-Jørgensen wrote: > This series adds support for executing multiple XDP programs on a single > interface in sequence, through the use of chain calls, as discussed at the > Linux > Plumbers Conference last month: > > https://linuxplumbersconf.org/event/4/contributions/460/ > Can we a

Re: [PATCH v4 bpf-next 1/3] uapi/bpf: fix helper docs

2019-10-07 Thread Andrii Nakryiko
On Mon, Oct 7, 2019 at 2:43 AM Daniel Borkmann wrote: > > On Sun, Oct 06, 2019 at 08:07:36PM -0700, Andrii Nakryiko wrote: > > Various small fixes to BPF helper documentation comments, enabling > > automatic header generation with a list of BPF helpers. > > > > Signed-off-by: Andrii Nakryiko > >

Re: [PATCH bpf-next] selftests/bpf: fix dependency ordering for attach_probe test

2019-10-07 Thread Andrii Nakryiko
On Sun, Oct 6, 2019 at 10:29 PM Alexei Starovoitov wrote: > > On Sun, Oct 6, 2019 at 8:31 PM Andrii Nakryiko wrote: > > > > Current Makefile dependency chain is not strict enough and allows > > test_attach_probe.o to be built before test_progs's > > prog_test/attach_probe.o is built, which leads

[PATCH bpf-next v3 4/5] libbpf: Add syscall wrappers for BPF_PROG_CHAIN_* commands

2019-10-07 Thread Toke Høiland-Jørgensen
From: Toke Høiland-Jørgensen This adds simple syscall wrappers for the new BPF_PROG_CHAIN_* commands to libbpf. Signed-off-by: Toke Høiland-Jørgensen --- tools/lib/bpf/bpf.c | 34 ++ tools/lib/bpf/bpf.h |4 tools/lib/bpf/libbpf.map |3 ++

[PATCH bpf-next v3 2/5] bpf: Add support for setting chain call sequence for programs

2019-10-07 Thread Toke Høiland-Jørgensen
From: Toke Høiland-Jørgensen This adds support for setting and deleting bpf chain call programs through a couple of new commands in the bpf() syscall. The CHAIN_ADD and CHAIN_DEL commands take two eBPF program fds and a return code, and install the 'next' program to be chain called after the 'pre

[PATCH bpf-next v7] samples: bpf: add max_pckt_size option at xdp_adjust_tail

2019-10-07 Thread Daniel T. Lee
Currently, at xdp_adjust_tail_kern.c, MAX_PCKT_SIZE is limited to 600. To make this size flexible, static global variable 'max_pcktsz' is added. By updating new packet size from the user space, xdp_adjust_tail_kern.o will use this value as a new max packet size. This static global variable can be

[PATCH bpf-next v3 5/5] selftests: Add tests for XDP chain calls

2019-10-07 Thread Toke Høiland-Jørgensen
From: Toke Høiland-Jørgensen This adds new self tests for the XDP chain call functionality. Signed-off-by: Toke Høiland-Jørgensen --- tools/testing/selftests/bpf/.gitignore|1 tools/testing/selftests/bpf/Makefile |3 tools/testing/selftests/bpf/progs/xdp_dummy.c |

[PATCH bpf-next v3 3/5] tools: Update bpf.h header for program chain calls

2019-10-07 Thread Toke Høiland-Jørgensen
From: Toke Høiland-Jørgensen This updates the bpf.h UAPI header in tools/ to add the bpf chain call-related definitions. Signed-off-by: Toke Høiland-Jørgensen --- tools/include/uapi/linux/bpf.h | 16 1 file changed, 16 insertions(+) diff --git a/tools/include/uapi/linux/bpf

[PATCH bpf-next v3 0/5] xdp: Support multiple programs on a single interface through chain calls

2019-10-07 Thread Toke Høiland-Jørgensen
This series adds support for executing multiple XDP programs on a single interface in sequence, through the use of chain calls, as discussed at the Linux Plumbers Conference last month: https://linuxplumbersconf.org/event/4/contributions/460/ # HIGH-LEVEL IDEA Since Alexei pointed out some issue

[PATCH bpf-next v3 1/5] bpf: Support chain calling multiple BPF programs after each other

2019-10-07 Thread Toke Høiland-Jørgensen
From: Toke Høiland-Jørgensen This adds support for wrapping eBPF program dispatch in chain calling logic. The code injection is controlled by a flag at program load time; if the flag is set, the BPF program will carry a flag bit that changes the program dispatch logic to wrap it in a chain call l

Re: [PATCH bpf-next v6] samples: bpf: add max_pckt_size option at xdp_adjust_tail

2019-10-07 Thread Daniel T. Lee
On Tue, Oct 8, 2019 at 1:41 AM Andrii Nakryiko wrote: > > On Mon, Oct 7, 2019 at 9:06 AM Daniel T. Lee wrote: > > > > Currently, at xdp_adjust_tail_kern.c, MAX_PCKT_SIZE is limited > > to 600. To make this size flexible, static global variable > > 'max_pcktsz' is added. > > > > By updating new pa

Re: [PATCH bpf-next 0/9] xdp: Support multiple programs on a single interface through chain calls

2019-10-07 Thread Lorenz Bauer
On Mon, 7 Oct 2019 at 17:43, Edward Cree wrote: > > I might be being naïve, but it doesn't sound more painful than is normal > for userland. I mean, what operations have you got- > * create/destroy map (maybe, see above) > * load prog (pass it an fd from which it can read an ELF, and more fds >

Re: [PATCH bpf-next] selftests/bpf: fix dependency ordering for attach_probe test

2019-10-07 Thread Alan Maguire
On Sun, 6 Oct 2019, Andrii Nakryiko wrote: > Current Makefile dependency chain is not strict enough and allows > test_attach_probe.o to be built before test_progs's > prog_test/attach_probe.o is built, which leads to assembler compainig > about missing included binary. > > This patch is a minimal

Re: [PATCH v3 bpf-next 1/4] libbpf: stop enforcing kern_version, populate it for users

2019-10-07 Thread Andrii Nakryiko
On Mon, Oct 7, 2019 at 9:14 AM Stanislav Fomichev wrote: > > On 10/04, Andrii Nakryiko wrote: > > Kernel version enforcement for kprobes/kretprobes was removed from > > 5.0 kernel in 6c4fc209fcf9 ("bpf: remove useless version check for prog > > load"). > > Since then, BPF programs were specifying

Re: [PATCH bpf-next 0/9] xdp: Support multiple programs on a single interface through chain calls

2019-10-07 Thread Edward Cree
On 04/10/2019 16:58, Lorenz Bauer wrote: > If you want to support > all use cases (which you kind of have to) then you'll end up writing an > RPC wrapper for libbpf, Yes, you more-or-less would need that.  Though I think you can e.g. have  the clients load & pin their own maps and then pass the map

Re: [PATCH bpf-next v6] samples: bpf: add max_pckt_size option at xdp_adjust_tail

2019-10-07 Thread Andrii Nakryiko
On Mon, Oct 7, 2019 at 9:06 AM Daniel T. Lee wrote: > > Currently, at xdp_adjust_tail_kern.c, MAX_PCKT_SIZE is limited > to 600. To make this size flexible, static global variable > 'max_pcktsz' is added. > > By updating new packet size from the user space, xdp_adjust_tail_kern.o > will use this v

Re: [PATCH bpf-next 05/10] bpf: implement accurate raw_tp context access via BTF

2019-10-07 Thread Alan Maguire
On Fri, 4 Oct 2019, Alexei Starovoitov wrote: > libbpf analyzes bpf C program, searches in-kernel BTF for given type name > and stores it into expected_attach_type. > The kernel verifier expects this btf_id to point to something like: > typedef void (*btf_trace_kfree_skb)(void *, struct sk_buff *s

[PATCH bpf-next v3 0/2] bpf/flow_dissector: add mode to enforce global BPF flow dissector

2019-10-07 Thread Stanislav Fomichev
While having a per-net-ns flow dissector programs is convenient for testing, security-wise it's better to have only one vetted global flow dissector implementation. Let's have a convention that when BPF flow dissector is installed in the root namespace, child namespaces can't override it. The int

[PATCH bpf-next v3 1/2] bpf/flow_dissector: add mode to enforce global BPF flow dissector

2019-10-07 Thread Stanislav Fomichev
Always use init_net flow dissector BPF program if it's attached and fall back to the per-net namespace one. Also, deny installing new programs if there is already one attached to the root namespace. Users can still detach their BPF programs, but can't attach any new ones (-EEXIST). Cc: Petar Penko

[PATCH bpf-next v3 2/2] selftests/bpf: add test for BPF flow dissector in the root namespace

2019-10-07 Thread Stanislav Fomichev
Make sure non-root namespaces get an error if root flow dissector is attached. Cc: Petar Penkov Acked-by: Song Liu Signed-off-by: Stanislav Fomichev --- .../selftests/bpf/test_flow_dissector.sh | 48 --- 1 file changed, 42 insertions(+), 6 deletions(-) diff --git a/tools

Re: [PATCH v3 bpf-next 1/4] libbpf: stop enforcing kern_version, populate it for users

2019-10-07 Thread Stanislav Fomichev
On 10/04, Andrii Nakryiko wrote: > Kernel version enforcement for kprobes/kretprobes was removed from > 5.0 kernel in 6c4fc209fcf9 ("bpf: remove useless version check for prog > load"). > Since then, BPF programs were specifying SEC("version") just to please > libbpf. We should stop enforcing this

[PATCH bpf-next v6] samples: bpf: add max_pckt_size option at xdp_adjust_tail

2019-10-07 Thread Daniel T. Lee
Currently, at xdp_adjust_tail_kern.c, MAX_PCKT_SIZE is limited to 600. To make this size flexible, static global variable 'max_pcktsz' is added. By updating new packet size from the user space, xdp_adjust_tail_kern.o will use this value as a new max packet size. This static global variable can be

Re: [PATCH rdma-next v2 2/3] RDMA/rw: Support threshold for registration vs scattering to local pages

2019-10-07 Thread Leon Romanovsky
On Mon, Oct 07, 2019 at 08:07:55AM -0700, Bart Van Assche wrote: > On 10/7/19 6:59 AM, Leon Romanovsky wrote: > > /* > > - * Check if the device might use memory registration. This is currently > > only > > - * true for iWarp devices. In the future we can hopefully fine tune this > > based > >

Re: [PATCH rdma-next v2 2/3] RDMA/rw: Support threshold for registration vs scattering to local pages

2019-10-07 Thread Leon Romanovsky
On Mon, Oct 07, 2019 at 08:12:37AM -0700, Bart Van Assche wrote: > On 10/7/19 6:59 AM, Leon Romanovsky wrote: > > diff --git a/include/rdma/ib_verbs.h b/include/rdma/ib_verbs.h > > index 4f671378dbfc..60fd98a9b7e8 100644 > > --- a/include/rdma/ib_verbs.h > > +++ b/include/rdma/ib_verbs.h > > @@ -44

  1   2   >