Re: [RFC][PATCH bpf-next] libbpf: add bpf_object__open_{file,mem} w/ sized opts

2019-10-01 Thread Toke Høiland-Jørgensen
Andrii Nakryiko writes: >> Sure, LGTM! Should we still keep the bit where it expands _opts in the >> struct name as part of the macro, or does that become too obtuse? > > For me it's a question of code navigation. When I'll have a code > > LIBBPF_OPTS(bpf_object_open, ); > > I'll want to jump to

[PATCH bpf v2] xsk: fix crash in poll when device does not support ndo_xsk_wakeup

2019-10-01 Thread Magnus Karlsson
Fixes a crash in poll() when an AF_XDP socket is opened in copy mode and the bound device does not have ndo_xsk_wakeup defined. Avoid trying to call the non-existing ndo and instead call the internal xsk sendmsg function to send packets in the same way (from the application's point of view) as call

Re: [PATCH bpf] xsk: fix crash in poll when device does not support ndo_xsk_wakeup

2019-10-01 Thread Magnus Karlsson
On Wed, Oct 2, 2019 at 7:57 AM Daniel Borkmann wrote: > > On Mon, Sep 30, 2019 at 03:30:12PM +0200, Magnus Karlsson wrote: > > Fixes a crash in poll() when an AF_XDP socket is opened in copy mode > > with the XDP_USE_NEED_WAKEUP flag set and the bound device does not > > have ndo_xsk_wakeup define

Re: Driver support for Realtek RTL8125 2.5GB Ethernet

2019-10-01 Thread Heiner Kallweit
On 26.07.2019 21:05, Heiner Kallweit wrote: > On 24.07.2019 22:02, Heiner Kallweit wrote: >> On 24.07.2019 10:19, Jian-Hong Pan wrote: >>> Hi all, >>> >>> We have got a consumer desktop equipped with Realtek RTL8125 2.5GB >>> Ethernet [1] recently. But, there is no related driver in mainline >>> k

Re: [PATCH net-next] net/rds: Use DMA memory pool allocation for rds_header

2019-10-01 Thread Ka-Cheong Poon
On 10/2/19 1:16 AM, David Miller wrote: From: Ka-Cheong Poon Date: Mon, 30 Sep 2019 02:08:00 -0700 Currently, RDS calls ib_dma_alloc_coherent() to allocate a large piece of contiguous DMA coherent memory to store struct rds_header for sending/receiving packets. The memory allocated is then pa

[PATCH 1/3] Clean up the net/caif/Kconfig menu

2019-10-01 Thread rd . dunlab
Clean up the net/caif/Kconfig menu: - remove extraneous space - minor language tweaks - fix punctuation Signed-off-by: Randy Dunlap Cc: Randy Dunlap --- net/caif/Kconfig | 10 +- 1 file changed, 5 insertions(+), 5 deletions(-) --- lnx-53-caif.orig/net/caif/Kconfig +++ lnx-53-caif/net

[PATCH 3/3] Minor fixes to the CAIF Transport drivers Kconfig file

2019-10-01 Thread rd . dunlab
Minor fixes to the CAIF Transport drivers Kconfig file: - end sentence with period - capitalize CAIF acronym Signed-off-by: Randy Dunlap Cc: Randy Dunlap --- drivers/net/caif/Kconfig |6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) --- lnx-53-caif.orig/drivers/net/caif/Kconfig +

[PATCH 2/3] Isolate CAIF transport drivers into their own menu

2019-10-01 Thread rd . dunlab
Isolate CAIF transport drivers into their own menu. This cleans up the main Network device support menu, makes it easier to find the CAIF drivers, and makes it easier to enable/disable them as a group. Signed-off-by: Randy Dunlap Cc: Randy Dunlap --- drivers/net/caif/Kconfig | 10 +-

[PATCH 0/3] CAIF Kconfig fixes

2019-10-01 Thread rd . dunlab
This series of patches cleans up the CAIF Kconfig menus in net/caif/Kconfig and drivers/net/caif/Kconfig and also puts the CAIF Transport drivers into their own sub-menu. drivers/net/caif/Kconfig | 16 net/caif/Kconfig | 10 +- 2 files changed, 17 insertion

Re: [RFC 3/4] net: mvneta: add basic XDP support

2019-10-01 Thread Ilias Apalodimas
On Tue, Oct 01, 2019 at 11:24:43AM +0200, Lorenzo Bianconi wrote: > Add basic XDP support to mvneta driver for devices that rely on software > buffer management. Currently supported verdicts are: > - XDP_DROP > - XDP_PASS > - XDP_REDIRECT > > Signed-off-by: Lorenzo Bianconi > --- > drivers/net/e

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

2019-10-01 Thread Andrii Nakryiko
On Tue, Oct 1, 2019 at 4:44 PM Song Liu wrote: > > > > > On Oct 1, 2019, at 3:42 PM, Andrii Nakryiko > > wrote: > > > > On Tue, Oct 1, 2019 at 2:46 PM Song Liu wrote: > >> > >> > >> > >>> On Oct 1, 2019, at 2:25 PM, Andrii Nakryiko > >>> wrote: > >>> > >>> On Tue, Oct 1, 2019 at 2:14 PM Song

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

2019-10-01 Thread Pravin Shelar
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 changed, 1 insertion(+), 1 deletion(-) > > diff --git a/net/openvswitch/flow_t

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

2019-10-01 Thread Pravin Shelar
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. > > This patch optimizes mask-array operation: > > * Inserting, insert

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

2019-10-01 Thread Pravin Shelar
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 to traverse mask-list to get cached mask. Therefore array > | is better f

Re: [PATCH bpf] samples/bpf: kbuild: add CONFIG_SAMPLE_BPF Kconfig

2019-10-01 Thread Masahiro Yamada
On Tue, Oct 1, 2019 at 11:16 PM Björn Töpel wrote: > > On Tue, 1 Oct 2019 at 14:33, Masahiro Yamada > wrote: > > > > Hi Bjorn > > > > On Tue, Oct 1, 2019 at 7:14 PM Björn Töpel wrote: > > > > [...] > > > subdir-$(CONFIG_SAMPLE_VFS)+= vfs > > > +subdir-$(CONFIG_SAMPLE_BPF)

Re: [PATCH net v2] ipv6: Handle race in addrconf_dad_work

2019-10-01 Thread David Miller
From: David Ahern Date: Mon, 30 Sep 2019 20:28:34 -0700 > From: David Ahern > > Rajendra reported a kernel panic when a link was taken down: ... > addrconf_dad_work is kicked to be scheduled when a device is brought > up. There is a race between addrcond_dad_work getting scheduled and > taking

Re: [PATCH net] tcp: adjust rto_base in retransmits_timed_out()

2019-10-01 Thread David Miller
From: Eric Dumazet Date: Mon, 30 Sep 2019 15:44:44 -0700 > The cited commit exposed an old retransmits_timed_out() bug > which assumed it could call tcp_model_timeout() with > TCP_RTO_MIN as rto_base for all states. > > But flows in SYN_SENT or SYN_RECV state uses a different > RTO base (1 sec i

Re: [PATCH net] cxgb4: fix out-of-bounds MSI-X info array access

2019-10-01 Thread David Miller
From: Vishal Kulkarni Date: Tue, 1 Oct 2019 04:07:57 +0530 > When fetching free MSI-X vectors for ULDs, check for the > error code before accessing MSI-X info array. Otherwise, > an out-of-bounds access is attempted, which results in > kernel panic. > > Fixes: 94cdb8bb993a ("cxgb4: Add support

Re: [PATCH net-next 0/2] Ease nsid allocation

2019-10-01 Thread David Miller
From: Nicolas Dichtel Date: Mon, 30 Sep 2019 18:02:12 +0200 > The goal of the series is to ease nsid allocation from userland. > The first patch is a preparation work and the second enables to receive the > new nsid in the answer to RTM_NEWNSID. The new reply message could break existing apps.

Re: [PATCH net] sctp: set newsk sk_socket before processing listening sk backlog

2019-10-01 Thread Marcelo Ricardo Leitner
On Mon, Sep 30, 2019 at 09:10:18PM +0800, Xin Long wrote: > This patch is to fix a NULL-ptr deref crash in selinux_sctp_bind_connect: > > [...] kasan: GPF could be caused by NULL-ptr deref or user memory access > [...] RIP: 0010:selinux_sctp_bind_connect+0x16a/0x230 > [...] Call Trace: > [

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

2019-10-01 Thread Song Liu
> On Oct 1, 2019, at 3:42 PM, Andrii Nakryiko wrote: > > On Tue, Oct 1, 2019 at 2:46 PM Song Liu wrote: >> >> >> >>> On Oct 1, 2019, at 2:25 PM, Andrii Nakryiko >>> wrote: >>> >>> On Tue, Oct 1, 2019 at 2:14 PM Song Liu wrote: > On Sep 30, 2019, at 11:58 AM, Andrii Nakr

Re: [RFC][PATCH bpf-next] libbpf: add bpf_object__open_{file,mem} w/ sized opts

2019-10-01 Thread Andrii Nakryiko
On Tue, Oct 1, 2019 at 2:49 PM Toke Høiland-Jørgensen wrote: > > Andrii Nakryiko writes: > > > On Tue, Oct 1, 2019 at 1:42 AM Toke Høiland-Jørgensen > > wrote: > >> > >> Andrii Nakryiko writes: > >> > >> > Add new set of bpf_object__open APIs using new approach to optional > >> > parameters ex

[PATCH net-next v2] net/rds: Log vendor error if send/recv Work requests fail

2019-10-01 Thread Sudhakar Dindukurti
Log vendor error if work requests fail. Vendor error provides more information that is used for debugging the issue. Signed-off-by: Sudhakar Dindukurti Acked-by: Santosh Shilimkar --- net/rds/ib_recv.c | 5 +++-- net/rds/ib_send.c | 4 ++-- 2 files changed, 5 insertions(+), 4 deletions(-) dif

Re: [PATCH bpf-next 2/6] libbpf: move bpf_helpers.h, bpf_endian.h into libbpf

2019-10-01 Thread Andrii Nakryiko
On Tue, Oct 1, 2019 at 4:31 PM Andrii Nakryiko wrote: > > On Tue, Oct 1, 2019 at 3:45 PM Daniel Borkmann wrote: > > > > On Mon, Sep 30, 2019 at 11:58:51AM -0700, Andrii Nakryiko wrote: > > > Make bpf_helpers.h and bpf_endian.h official part of libbpf. Ensure they > > > are installed along the oth

Re: [PATCH net-next] net/rds: Log vendor error if send/recv Work requests fail

2019-10-01 Thread sudhakar . dindukurti
Thanks Santosh. Will send the v2 with the below suggestion regards, Sudhakar On 10/01/2019 04:08 PM, santosh.shilim...@oracle.com wrote: On 10/1/19 3:41 PM, Sudhakar Dindukurti wrote: Logs vendor error if work requests fail. Vendor error provides s/Logs/Log more information that is used

Re: [PATCH bpf-next 2/6] libbpf: move bpf_helpers.h, bpf_endian.h into libbpf

2019-10-01 Thread Andrii Nakryiko
On Tue, Oct 1, 2019 at 3:45 PM Daniel Borkmann wrote: > > On Mon, Sep 30, 2019 at 11:58:51AM -0700, Andrii Nakryiko wrote: > > Make bpf_helpers.h and bpf_endian.h official part of libbpf. Ensure they > > are installed along the other libbpf headers. > > > > Signed-off-by: Andrii Nakryiko > > [...

Re: [PATCH net-next] net/rds: Log vendor error if send/recv Work requests fail

2019-10-01 Thread santosh . shilimkar
On 10/1/19 3:41 PM, Sudhakar Dindukurti wrote: Logs vendor error if work requests fail. Vendor error provides s/Logs/Log more information that is used for debugging the issue. Signed-off-by: Sudhakar Dindukurti --- rds_ib_mr_cqe_handler() is already patched so good to patch these two message

Re: [PATCH v2 bpf-next] libbpf: bump current version to v0.0.6

2019-10-01 Thread Daniel Borkmann
On Mon, Sep 30, 2019 at 03:25:03PM -0700, Andrii Nakryiko wrote: > New release cycle started, let's bump to v0.0.6 proactively. > > Acked-by: Song Liu > Signed-off-by: Andrii Nakryiko Applied, thanks!

Re: BUG: sk_backlog.len can overestimate

2019-10-01 Thread John Ousterhout
On Tue, Oct 1, 2019 at 1:53 PM Eric Dumazet wrote: > > On 10/1/19 1:45 PM, John Ousterhout wrote: > > > > > But this isn't really about socket resource limits (though that is > > conflated in the implementation); it's about limiting the time spent > > in a single call to __release_sock, no? > > Th

[PATCH net-next] net/rds: Log vendor error if send/recv Work requests fail

2019-10-01 Thread Sudhakar Dindukurti
Logs vendor error if work requests fail. Vendor error provides more information that is used for debugging the issue. Signed-off-by: Sudhakar Dindukurti --- net/rds/ib_recv.c | 5 +++-- net/rds/ib_send.c | 4 ++-- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/net/rds/ib_recv.c b

Re: [PATCH bpf-next] bpf, capabilities: introduce CAP_BPF

2019-10-01 Thread Steven Rostedt
On Tue, 1 Oct 2019 22:18:18 + Alexei Starovoitov wrote: > > And then you can just format the string from the bpf_trace_printk() > > into msg, and then have: > > > > trace_bpf_print(msg); > > It's an interesting idea, but I don't think it can work. > Please see bpf_trace_printk impleme

Re: [PATCH bpf-next 2/6] libbpf: move bpf_helpers.h, bpf_endian.h into libbpf

2019-10-01 Thread Daniel Borkmann
On Mon, Sep 30, 2019 at 11:58:51AM -0700, Andrii Nakryiko wrote: > Make bpf_helpers.h and bpf_endian.h official part of libbpf. Ensure they > are installed along the other libbpf headers. > > Signed-off-by: Andrii Nakryiko [...] > new file mode 100644 > index ..fbe28008450f > --- /de

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

2019-10-01 Thread Andrii Nakryiko
On Tue, Oct 1, 2019 at 2:46 PM Song Liu wrote: > > > > > On Oct 1, 2019, at 2:25 PM, Andrii Nakryiko > > wrote: > > > > On Tue, Oct 1, 2019 at 2:14 PM Song Liu wrote: > >> > >> > >>> On Sep 30, 2019, at 11:58 AM, Andrii Nakryiko wrote: > >>> > >>> Add few macros simplifying BCC-like multi-leve

Re: [PATCH net] sctp: set newsk sk_socket before processing listening sk backlog

2019-10-01 Thread David Miller
From: Xin Long Date: Mon, 30 Sep 2019 21:10:18 +0800 > This patch is to fix a NULL-ptr deref crash in selinux_sctp_bind_connect: ... Marcel and Neil, please review.

Re: [PATCH net-next] net: usb: ax88179_178a: allow optionally getting mac address from device tree

2019-10-01 Thread David Miller
From: Peter Fink Date: Mon, 30 Sep 2019 14:04:03 +0200 > From: Peter Fink > > Adopt and integrate the feature to pass the MAC address via device tree > from asix_device.c (03fc5d4) also to other ax88179 based asix chips. > E.g. the bootloader fills in local-mac-address and the driver will then

Re: [PATCH bpf] xsk: fix crash in poll when device does not support ndo_xsk_wakeup

2019-10-01 Thread Daniel Borkmann
On Mon, Sep 30, 2019 at 03:30:12PM +0200, Magnus Karlsson wrote: > Fixes a crash in poll() when an AF_XDP socket is opened in copy mode > with the XDP_USE_NEED_WAKEUP flag set and the bound device does not > have ndo_xsk_wakeup defined. Avoid trying to call the non-existing ndo > and instead call t

Re: [PATCH bpf-next] bpf, capabilities: introduce CAP_BPF

2019-10-01 Thread Alexei Starovoitov
On 10/1/19 3:10 PM, Steven Rostedt wrote: > On Mon, 30 Sep 2019 18:22:28 -0700 > Alexei Starovoitov wrote: > >> tracefs is a file system, so clearly file based acls are much better fit >> for all tracefs operations. >> But that is not the case for ftrace overall. >> bpf_trace_printk() calls trace

Re: [PATCH bpf-next] bpf, capabilities: introduce CAP_BPF

2019-10-01 Thread Steven Rostedt
On Mon, 30 Sep 2019 18:22:28 -0700 Alexei Starovoitov wrote: > tracefs is a file system, so clearly file based acls are much better fit > for all tracefs operations. > But that is not the case for ftrace overall. > bpf_trace_printk() calls trace_printk() that dumps into trace pipe. > Technically

Re: [PATCH bpf-next 2/6] libbpf: move bpf_helpers.h, bpf_endian.h into libbpf

2019-10-01 Thread John Fastabend
Andrii Nakryiko wrote: > On Tue, Oct 1, 2019 at 12:18 PM John Fastabend > wrote: > > > > Toke Høiland-Jørgensen wrote: > > > > > > > +struct bpf_map_def { > > > > + unsigned int type; > > > > + unsigned int key_size; > > > > + unsigned int value_size; > > > > + unsigned int max_entries; >

Re: [PATCH net-next] ipv6: minor code reorg in inet6_fill_ifla6_attrs()

2019-10-01 Thread David Miller
From: Nicolas Dichtel Date: Mon, 30 Sep 2019 14:02:16 +0200 > Just put related code together to ease code reading: the memcpy() is > related to the nla_reserve(). > > Signed-off-by: Nicolas Dichtel Applied.

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

2019-10-01 Thread David Miller
From: xiangxia.m@gmail.com Date: Mon, 30 Sep 2019 01:09:57 +0800 > This series patch optimize openvswitch. Someone please review this series. Thank you.

Re: [patch net-next 0/7] net: introduce alternative names for network interfaces

2019-10-01 Thread David Miller
From: Jiri Pirko Date: Mon, 30 Sep 2019 11:48:13 +0200 > This patchset introduces alternative names for network interfaces. > Main goal is to: > 1) Overcome the IFNAMSIZ limitation (altname limitation is 128 bytes) > 2) Allow to have multiple names at the same time (multiple udev patterns) > 3) A

Re: [RFC][PATCH bpf-next] libbpf: add bpf_object__open_{file,mem} w/ sized opts

2019-10-01 Thread Toke Høiland-Jørgensen
Andrii Nakryiko writes: > On Tue, Oct 1, 2019 at 1:42 AM Toke Høiland-Jørgensen wrote: >> >> Andrii Nakryiko writes: >> >> > Add new set of bpf_object__open APIs using new approach to optional >> > parameters extensibility allowing simpler ABI compatibility approach. >> > >> > This patch demons

Re: [PATCH bpf-next 5/6] selftests/bpf: adjust CO-RE reloc tests for new BPF_CORE_READ macro

2019-10-01 Thread Song Liu
> On Sep 30, 2019, at 11:58 AM, Andrii Nakryiko wrote: > > Given introduction of variadic BPF_CORE_READ with slightly different > syntax and semantics, define CORE_READ, which is a thin wrapper around > low-level bpf_core_read() macro, which in turn is just a wrapper around > bpf_probe_read().

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

2019-10-01 Thread Song Liu
> On Oct 1, 2019, at 2:25 PM, Andrii Nakryiko wrote: > > On Tue, Oct 1, 2019 at 2:14 PM Song Liu wrote: >> >> >>> On Sep 30, 2019, at 11:58 AM, Andrii Nakryiko wrote: >>> >>> Add few macros simplifying BCC-like multi-level probe reads, while also >>> emitting CO-RE relocations for each re

[PATCH V12 0/4] BPF: New helper to obtain namespace data from current task

2019-10-01 Thread Carlos Neira
Currently bpf_get_current_pid_tgid(), is used to do pid filtering in bcc's scripts but this helper returns the pid as seen by the root namespace which is fine when a bcc script is not executed inside a container. When the process of interest is inside a container, pid filtering will not work if bpf

[PATCH V12 3/4] tools: Added bpf_get_ns_current_pid_tgid helper

2019-10-01 Thread Carlos Neira
sync tools/include/uapi/linux/bpf.h to include new helper. Signed-off-by: Carlos Neira --- tools/include/uapi/linux/bpf.h | 18 +- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/tools/include/uapi/linux/bpf.h b/tools/include/uapi/linux/bpf.h index 77c6be96d676..ea8

[PATCH V12 1/4] fs/nsfs.c: added ns_match

2019-10-01 Thread Carlos Neira
ns_match returns true if the namespace inode and dev_t matches the ones provided by the caller. Signed-off-by: Carlos Neira --- fs/nsfs.c | 8 include/linux/proc_ns.h | 2 ++ 2 files changed, 10 insertions(+) diff --git a/fs/nsfs.c b/fs/nsfs.c index a0431642c6b5..256f6295

[PATCH V12 4/4] tools/testing/selftests/bpf: Add self-tests for new helper.

2019-10-01 Thread Carlos Neira
Self tests added for new helper Signed-off-by: Carlos Neira --- tools/testing/selftests/bpf/bpf_helpers.h | 3 + .../bpf/prog_tests/get_ns_current_pid_tgid.c | 85 +++ .../bpf/progs/get_ns_current_pid_tgid_kern.c | 47 ++ 3 files changed, 135 insertions(+) create

[PATCH V12 2/4] bpf: added new helper bpf_get_ns_current_pid_tgid

2019-10-01 Thread Carlos Neira
New bpf helper bpf_get_ns_current_pid_tgid, This helper will return pid and tgid from current task which namespace matches dev_t and inode number provided, this will allows us to instrument a process inside a container. Signed-off-by: Carlos Neira --- include/linux/bpf.h | 1 + include/uap

Re: [PATCH bpf-next 5/6] selftests/bpf: adjust CO-RE reloc tests for new BPF_CORE_READ macro

2019-10-01 Thread Andrii Nakryiko
On Tue, Oct 1, 2019 at 12:14 PM John Fastabend wrote: > > Andrii Nakryiko wrote: > > Given introduction of variadic BPF_CORE_READ with slightly different > > syntax and semantics, define CORE_READ, which is a thin wrapper around > > low-level bpf_core_read() macro, which in turn is just a wrapper

Re: [PATCH bpf-next 2/6] libbpf: move bpf_helpers.h, bpf_endian.h into libbpf

2019-10-01 Thread Andrii Nakryiko
On Tue, Oct 1, 2019 at 2:19 PM Song Liu wrote: > > > > > On Sep 30, 2019, at 11:58 AM, Andrii Nakryiko wrote: > > > > Make bpf_helpers.h and bpf_endian.h official part of libbpf. Ensure they > > are installed along the other libbpf headers. > > > > Signed-off-by: Andrii Nakryiko > > --- > > tool

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

2019-10-01 Thread Andrii Nakryiko
On Tue, Oct 1, 2019 at 2:14 PM Song Liu wrote: > > > > On Sep 30, 2019, at 11:58 AM, Andrii Nakryiko wrote: > > > > Add few macros simplifying BCC-like multi-level probe reads, while also > > emitting CO-RE relocations for each read. > > > > Signed-off-by: Andrii Nakryiko > > --- > > tools/lib/b

Re: [PATCH bpf-next 6/6] selftests/bpf: add BPF_CORE_READ and BPF_CORE_READ_STR_INTO macro tests

2019-10-01 Thread Song Liu
> On Oct 1, 2019, at 12:19 PM, John Fastabend wrote: > > Andrii Nakryiko wrote: >> 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. >> >

Re: [PATCH bpf-next 2/6] libbpf: move bpf_helpers.h, bpf_endian.h into libbpf

2019-10-01 Thread Song Liu
> On Sep 30, 2019, at 11:58 AM, Andrii Nakryiko wrote: > > Make bpf_helpers.h and bpf_endian.h official part of libbpf. Ensure they > are installed along the other libbpf headers. > > Signed-off-by: Andrii Nakryiko > --- > tools/lib/bpf/Makefile | 4 +- > tools/lib/bpf/bpf_endian.h |

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

2019-10-01 Thread Song Liu
> On Sep 30, 2019, at 11:58 AM, Andrii Nakryiko wrote: > > Add few macros simplifying BCC-like multi-level probe reads, while also > emitting CO-RE relocations for each read. > > Signed-off-by: Andrii Nakryiko > --- > tools/lib/bpf/bpf_helpers.h | 151 +++- > 1

[PATCH net-next] net_sched: remove need_resched() from qdisc_run()

2019-10-01 Thread Eric Dumazet
The introduction of this schedule point was done in commit 2ba2506ca7ca ("[NET]: Add preemption point in qdisc_run") at a time the loop was not bounded. Then later in commit d5b8aa1d246f ("net_sched: fix dequeuer fairness") we added a limit on the number of packets. Now is the time to remove the

Re: BUG: sk_backlog.len can overestimate

2019-10-01 Thread Eric Dumazet
On 10/1/19 1:45 PM, John Ousterhout wrote: > > But this isn't really about socket resource limits (though that is > conflated in the implementation); it's about limiting the time spent > in a single call to __release_sock, no? The proxy used is memory usage, not time usage. cond_resched() or

Re: BUG: sk_backlog.len can overestimate

2019-10-01 Thread John Ousterhout
On Tue, Oct 1, 2019 at 11:34 AM Eric Dumazet wrote: > > On 10/1/19 10:25 AM, John Ousterhout wrote: > > On Tue, Oct 1, 2019 at 9:19 AM Eric Dumazet wrote: > >> ... > >> Sorry, I have no idea what is the problem you see. > > > > OK, let me try again from the start. Consider two values: > > * sk->s

Re: [PATCH net-next] tcp: add ipv6_addr_v4mapped_loopback() helper

2019-10-01 Thread David Miller
From: Eric Dumazet Date: Tue, 1 Oct 2019 10:49:06 -0700 > tcp_twsk_unique() has a hard coded assumption about ipv4 loopback > being 127/8 > > Lets instead use the standard ipv4_is_loopback() method, > in a new ipv6_addr_v4mapped_loopback() helper. > > Signed-off-by: Eric Dumazet Applied, tha

Re: [PATCH bpf-next 2/6] libbpf: move bpf_helpers.h, bpf_endian.h into libbpf

2019-10-01 Thread Andrii Nakryiko
On Tue, Oct 1, 2019 at 12:18 PM John Fastabend wrote: > > Toke Høiland-Jørgensen wrote: > > > > > +struct bpf_map_def { > > > + unsigned int type; > > > + unsigned int key_size; > > > + unsigned int value_size; > > > + unsigned int max_entries; > > > + unsigned int map_flags; > > > + u

Re: [PATCH bpf-next 2/6] libbpf: move bpf_helpers.h, bpf_endian.h into libbpf

2019-10-01 Thread Andrii Nakryiko
On Tue, Oct 1, 2019 at 12:10 AM Toke Høiland-Jørgensen wrote: > > > > +struct bpf_map_def { > > + unsigned int type; > > + unsigned int key_size; > > + unsigned int value_size; > > + unsigned int max_entries; > > + unsigned int map_flags; > > + unsigned int inner_map_idx; >

RE: [PATCH bpf-next 6/6] selftests/bpf: add BPF_CORE_READ and BPF_CORE_READ_STR_INTO macro tests

2019-10-01 Thread John Fastabend
Andrii Nakryiko wrote: > 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. > > Signed-off-by: Andrii Nakryiko > --- Acked-by: John Fastabend

[PATCH net-next 3/3] net: dsa: sja1105: Rename sja1105_spi_send_packed_buf to sja1105_xfer_buf

2019-10-01 Thread Vladimir Oltean
The most commonly called function in the driver is long due for a rename. The "packed" word is redundant (it doesn't make sense to transfer an unpacked structure, since that is in CPU endianness yadda yadda), and the "spi" word is also redundant since argument 2 of the function is SPI_READ or SPI_W

[PATCH net-next 2/3] net: dsa: sja1105: Replace sja1105_spi_send_int with sja1105_xfer_{u32,u64}

2019-10-01 Thread Vladimir Oltean
Having a function that takes a variable number of unpacked bytes which it generically calls an "int" is confusing and makes auditing patches next to impossible. We only use spi_send_int with the int sizes of 32 and 64 bits. So just make the spi_send_int function less generic and replace it with th

[PATCH net-next 0/3] SJA1105 DSA coding style cleanup

2019-10-01 Thread Vladimir Oltean
This series provides some mechanical cleanup patches related to function names and prototypes. Vladimir Oltean (3): net: dsa: sja1105: Don't use "inline" function declarations in C files net: dsa: sja1105: Replace sja1105_spi_send_int with sja1105_xfer_{u32,u64} net: dsa: sja1105: Rename

[PATCH net-next 1/3] net: dsa: sja1105: Don't use "inline" function declarations in C files

2019-10-01 Thread Vladimir Oltean
Let the compiler decide. Signed-off-by: Vladimir Oltean --- drivers/net/dsa/sja1105/sja1105_clocking.c | 2 +- drivers/net/dsa/sja1105/sja1105_main.c | 7 +++ 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/drivers/net/dsa/sja1105/sja1105_clocking.c b/drivers/net/dsa/sja1

Re: [PATCH bpf-next 2/6] libbpf: move bpf_helpers.h, bpf_endian.h into libbpf

2019-10-01 Thread John Fastabend
Toke Høiland-Jørgensen wrote: > > > +struct bpf_map_def { > > + unsigned int type; > > + unsigned int key_size; > > + unsigned int value_size; > > + unsigned int max_entries; > > + unsigned int map_flags; > > + unsigned int inner_map_idx; > > + unsigned int numa_node; > > +}; > > Di

RE: [PATCH bpf-next 5/6] selftests/bpf: adjust CO-RE reloc tests for new BPF_CORE_READ macro

2019-10-01 Thread John Fastabend
Andrii Nakryiko wrote: > Given introduction of variadic BPF_CORE_READ with slightly different > syntax and semantics, define CORE_READ, which is a thin wrapper around > low-level bpf_core_read() macro, which in turn is just a wrapper around > bpf_probe_read(). BPF_CORE_READ is higher-level variadic

[PATCH net-next] net: dsa: Remove unused __DSA_SKB_CB macro

2019-10-01 Thread Vladimir Oltean
The struct __dsa_skb_cb is supposed to span the entire 48-byte skb control block, while the struct dsa_skb_cb only the portion of it which is used by the DSA core (the rest is available as private data to drivers). The DSA_SKB_CB and __DSA_SKB_CB helpers are supposed to help retrieve this pointer

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

2019-10-01 Thread John Fastabend
Andrii Nakryiko wrote: > 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. > > Signed-off-by: Andrii Nakryiko > --- > tools/testing/selftests/bpf/bpf_helpers.h | 8 > 1 fil

RE: [PATCH bpf-next 4/6] libbpf: add BPF_CORE_READ/BPF_CORE_READ_INTO helpers

2019-10-01 Thread John Fastabend
Andrii Nakryiko wrote: > Add few macros simplifying BCC-like multi-level probe reads, while also > emitting CO-RE relocations for each read. > > Signed-off-by: Andrii Nakryiko LGTM. Acked-by: John Fastabend

[PATCH v2 net] ptp_qoriq: Initialize the registers' spinlock before calling ptp_qoriq_settime

2019-10-01 Thread Vladimir Oltean
Because ptp_qoriq_settime is being called prior to spin_lock_init, the following stack trace can be seen at driver probe time: [2.269117] the code is fine but needs lockdep annotation. [2.274569] turning off the locking correctness validator. [2.280027] CPU: 1 PID: 1 Comm: swapper/0 No

Re: [RFC][PATCH bpf-next] libbpf: add bpf_object__open_{file,mem} w/ sized opts

2019-10-01 Thread Andrii Nakryiko
On Tue, Oct 1, 2019 at 9:48 AM Jesper Dangaard Brouer wrote: > > On Mon, 30 Sep 2019 09:42:39 -0700 > Andrii Nakryiko wrote: > > > diff --git a/tools/lib/bpf/libbpf_internal.h > > b/tools/lib/bpf/libbpf_internal.h > > index 2e83a34f8c79..1cf2cf8d80f3 100644 > > --- a/tools/lib/bpf/libbpf_interna

[PATCH v2 net 1/2] net: dsa: sja1105: Initialize the meta_lock

2019-10-01 Thread Vladimir Oltean
Otherwise, with CONFIG_DEBUG_SPINLOCK=y, this stack trace gets printed when enabling RX timestamping and receiving a PTP frame: [ 318.537078] INFO: trying to register non-static key. [ 318.542040] the code is fine but needs lockdep annotation. [ 318.547500] turning off the locking correctness v

[PATCH v2 net 2/2] net: dsa: sja1105: Fix sleeping while atomic in .port_hwtstamp_set

2019-10-01 Thread Vladimir Oltean
Currently this stack trace can be seen with CONFIG_DEBUG_ATOMIC_SLEEP=y: [ 41.568348] BUG: sleeping function called from invalid context at kernel/locking/mutex.c:909 [ 41.576757] in_atomic(): 1, irqs_disabled(): 0, pid: 208, name: ptp4l [ 41.583212] INFO: lockdep is turned off. [ 41.5871

[PATCH v2 net 0/2] SJA1105 DSA locking fixes for PTP

2019-10-01 Thread Vladimir Oltean
This series fixes the locking API usage problems spotted when compiling the kernel with CONFIG_DEBUG_ATOMIC_SLEEP=y and CONFIG_DEBUG_SPINLOCK=y. Vladimir Oltean (2): net: dsa: sja1105: Initialize the meta_lock net: dsa: sja1105: Fix sleeping while atomic in .port_hwtstamp_set drivers/net/dsa

Re: [RFC][PATCH bpf-next] libbpf: add bpf_object__open_{file,mem} w/ sized opts

2019-10-01 Thread Andrii Nakryiko
On Tue, Oct 1, 2019 at 1:42 AM Toke Høiland-Jørgensen wrote: > > Andrii Nakryiko writes: > > > Add new set of bpf_object__open APIs using new approach to optional > > parameters extensibility allowing simpler ABI compatibility approach. > > > > This patch demonstrates an approach to implementing

Re: BUG: sk_backlog.len can overestimate

2019-10-01 Thread Eric Dumazet
On 10/1/19 10:25 AM, John Ousterhout wrote: > On Tue, Oct 1, 2019 at 9:19 AM Eric Dumazet wrote: >> ... >> Sorry, I have no idea what is the problem you see. > > OK, let me try again from the start. Consider two values: > * sk->sk_backlog.len > * The actual number of bytes in buffers in the cu

Re: [PATCH net v2] ipv6: Handle race in addrconf_dad_work

2019-10-01 Thread Eric Dumazet
On 9/30/19 8:28 PM, David Ahern wrote: > From: David Ahern > > Rajendra reported a kernel panic when a link was taken down: > > [ 6870.263084] BUG: unable to handle kernel NULL pointer dereference at > 00a8 > [ 6870.271856] IP: [] __ipv6_ifa_notify+0x154/0x290 > > > Reviewed-

Re: Gentoo Linux 5.x - Tigon3

2019-10-01 Thread Michael Chan
On Tue, Oct 1, 2019 at 7:31 AM Rudolf Spring wrote: > > Hello - Since Kernel Version 5.0 (5.0.x/5.1.x/5.2.x and now 5.3.x) my > BCM57765 refuses to work correctly. The same system configuration works > without problems on the latest stable Gentoo 4.19.72 Kernel. So the changes > from 4.19 to 5.

[PATCH net-next] tcp: add ipv6_addr_v4mapped_loopback() helper

2019-10-01 Thread Eric Dumazet
tcp_twsk_unique() has a hard coded assumption about ipv4 loopback being 127/8 Lets instead use the standard ipv4_is_loopback() method, in a new ipv6_addr_v4mapped_loopback() helper. Signed-off-by: Eric Dumazet --- include/net/ipv6.h | 5 + net/ipv4/tcp_ipv4.c | 6 ++ 2 files changed, 7

Re: [PATCH net] net/rds: Fix error handling in rds_ib_add_one()

2019-10-01 Thread santosh . shilimkar
On 10/1/19 10:21 AM, Sudhakar Dindukurti wrote: From: Dotan Barak rds_ibdev:ipaddr_list and rds_ibdev:conn_list are initialized after allocation some resources such as protection domain. If allocation of such resources fail, then these uninitialized variables are accessed in rds_ib_dev_free() i

[PATCH net] net/rds: Fix error handling in rds_ib_add_one()

2019-10-01 Thread Sudhakar Dindukurti
From: Dotan Barak rds_ibdev:ipaddr_list and rds_ibdev:conn_list are initialized after allocation some resources such as protection domain. If allocation of such resources fail, then these uninitialized variables are accessed in rds_ib_dev_free() in failure path. This can potentially crash the sys

Re: BUG: sk_backlog.len can overestimate

2019-10-01 Thread John Ousterhout
On Tue, Oct 1, 2019 at 9:19 AM Eric Dumazet wrote: > ... > Sorry, I have no idea what is the problem you see. OK, let me try again from the start. Consider two values: * sk->sk_backlog.len * The actual number of bytes in buffers in the current backlog list Now consider a series of propositions:

Re: [PATCH net-next] net/rds: Use DMA memory pool allocation for rds_header

2019-10-01 Thread David Miller
From: Ka-Cheong Poon Date: Mon, 30 Sep 2019 02:08:00 -0700 > Currently, RDS calls ib_dma_alloc_coherent() to allocate a large piece > of contiguous DMA coherent memory to store struct rds_header for > sending/receiving packets. The memory allocated is then partitioned > into struct rds_header.

[PATCH net-next 2/2] ipconfig: Handle CONFIG_CIFS_ROOT option

2019-10-01 Thread Paulo Alcantara (SUSE)
The experimental root file system support in cifs.ko relies on ipconfig to set up the network stack and then accessing the SMB share that contains the rootfs files. Signed-off-by: Paulo Alcantara (SUSE) --- net/ipv4/ipconfig.c | 10 -- 1 file changed, 8 insertions(+), 2 deletions(-) dif

[PATCH net-next 0/2] Experimental SMB rootfs support

2019-10-01 Thread Paulo Alcantara (SUSE)
Hi, This patch series enables Linux to mount root file systems over the network by utilizing SMB protocol. Upstream commit 8eecd1c2e5bc ("cifs: Add support for root file systems") introduced a new CONFIG_CIFS_ROOT option, a virtual device (Root_CIFS) and a kernel cmdline parameter "cifsroot=" whi

[PATCH net-next 1/2] init: Support mounting root file systems over SMB

2019-10-01 Thread Paulo Alcantara (SUSE)
Add a new virtual device named /dev/cifs (0xfe) to tell the kernel to mount the root file system over the network by using SMB protocol. cifs_root_data() will be responsible to retrieve the parsed information of the new command-line option (cifsroot=) and then call do_mount_root() with the appropr

Re: [PATCH v2 net] devlink: Fix error handling in param and info_get dumpit cb

2019-10-01 Thread David Miller
From: Vasundhara Volam Date: Mon, 30 Sep 2019 11:52:21 +0530 > If any of the param or info_get op returns error, dumpit cb is > skipping to dump remaining params or info_get ops for all the > drivers. > > Fix to not return if any of the param/info_get op returns error > as not supported and cont

Re: [PATCH net] netfilter: drop bridge nf reset from nf_reset

2019-10-01 Thread Pablo Neira Ayuso
On Sun, Sep 29, 2019 at 08:54:03PM +0200, Florian Westphal wrote: > commit 174e23810cd31 > ("sk_buff: drop all skb extensions on free and skb scrubbing") made napi > recycle always drop skb extensions. The additional skb_ext_del() that is > performed via nf_reset on napi skb recycle is not needed

Re: [PATCH 0/3] Pine64+ specific hacks for RTL8211E Ethernet PHY

2019-10-01 Thread Andrew Lunn
On Tue, Oct 01, 2019 at 09:47:08AM -0700, Florian Fainelli wrote: > On 10/1/19 1:29 AM, Icenowy Zheng wrote: > > There're some Pine64+ boards known to have broken RTL8211E chips, and > > a hack is given by Pine64+, which is said to be from Realtek. > > > > This patchset adds the hack. > > > > The

[PATCH AUTOSEL 4.19 18/43] cdc_ncm: fix divide-by-zero caused by invalid wMaxPacketSize

2019-10-01 Thread Sasha Levin
From: Bjørn Mork [ Upstream commit 3fe4b3351301660653a2bc73f2226da0ebd2b95e ] Endpoints with zero wMaxPacketSize are not usable for transferring data. Ignore such endpoints when looking for valid in, out and status pipes, to make the driver more robust against invalid and meaningless descriptors

[PATCH AUTOSEL 4.19 16/43] net/sched: act_sample: don't push mac header on ip6gre ingress

2019-10-01 Thread Sasha Levin
From: Davide Caratti [ Upstream commit 92974a1d006ad8b30d53047c70974c9e065eb7df ] current 'sample' action doesn't push the mac header of ingress packets if they are received by a layer 3 tunnel (like gre or sit); but it forgot to check for gre over ipv6, so the following script: # tc q a dev $

Re: [PATCH net] net: sched: cbs: Avoid division by zero when calculating the port rate

2019-10-01 Thread David Miller
From: Vladimir Oltean Date: Sun, 29 Sep 2019 02:39:48 +0300 > As explained in the "net: sched: taprio: Avoid division by zero on > invalid link speed" commit, it is legal for the ethtool API to return > zero as a link speed. So guard against it to ensure we don't perform a > division by zero in k

[PATCH AUTOSEL 4.19 37/43] macsec: drop skb sk before calling gro_cells_receive

2019-10-01 Thread Sasha Levin
From: Xin Long [ Upstream commit ba56d8ce38c8252fff5b745db3899cf092578ede ] Fei Liu reported a crash when doing netperf on a topo of macsec dev over veth: [ 448.919128] refcount_t: underflow; use-after-free. [ 449.090460] Call trace: [ 449.092895] refcount_sub_and_test+0xb4/0xc0 [

Re: [PATCH net] net: sched: taprio: Avoid division by zero on invalid link speed

2019-10-01 Thread David Miller
From: Vladimir Oltean Date: Sun, 29 Sep 2019 02:37:22 +0300 > The check in taprio_set_picos_per_byte is currently not robust enough > and will trigger this division by zero, due to e.g. PHYLINK not setting > kset->base.speed when there is no PHY connected: ... > Russell King points out that the

[PATCH AUTOSEL 4.9 08/19] cdc_ncm: fix divide-by-zero caused by invalid wMaxPacketSize

2019-10-01 Thread Sasha Levin
From: Bjørn Mork [ Upstream commit 3fe4b3351301660653a2bc73f2226da0ebd2b95e ] Endpoints with zero wMaxPacketSize are not usable for transferring data. Ignore such endpoints when looking for valid in, out and status pipes, to make the driver more robust against invalid and meaningless descriptors

Re: [RFC][PATCH bpf-next] libbpf: add bpf_object__open_{file,mem} w/ sized opts

2019-10-01 Thread Jesper Dangaard Brouer
On Mon, 30 Sep 2019 09:42:39 -0700 Andrii Nakryiko wrote: > diff --git a/tools/lib/bpf/libbpf_internal.h b/tools/lib/bpf/libbpf_internal.h > index 2e83a34f8c79..1cf2cf8d80f3 100644 > --- a/tools/lib/bpf/libbpf_internal.h > +++ b/tools/lib/bpf/libbpf_internal.h > @@ -47,6 +47,12 @@ do {

Re: [PATCH v2] net: core: dev: replace state xoff flag comparison by netif_xmit_stopped method

2019-10-01 Thread David Miller
From: jcfara...@gmail.com Date: Tue, 1 Oct 2019 11:39:04 -0300 > From: Julio Faracco > > Function netif_schedule_queue() has a hardcoded comparison between queue > state and any xoff flag. This comparison does the same thing as method > netif_xmit_stopped(). In terms of code clarity, it is bett

  1   2   >