Re: [bpf-next PATCH 2/3] samples/bpf: make xdp_fwd more practically usable via devmap lookup

2019-08-07 Thread Jesper Dangaard Brouer
On Wed, 7 Aug 2019 11:04:17 -0700 Y Song wrote: > On Wed, Aug 7, 2019 at 5:37 AM Jesper Dangaard Brouer > wrote: > > > > This address the TODO in samples/bpf/xdp_fwd_kern.c, which points out > > that the chosen egress index should be checked for existence in the > > devmap. This can now be done

Re: [PATCH bpf-next 1/3] bpf: support cloning sk storage on accept()

2019-08-07 Thread Martin Lau
On Wed, Aug 07, 2019 at 08:47:18AM -0700, Stanislav Fomichev wrote: > Add new helper bpf_sk_storage_clone which optionally clones sk storage > and call it from bpf_sk_storage_clone. Reuse the gap in > bpf_sk_storage_elem to store clone/non-clone flag. > > Cc: Martin KaFai Lau > Signed-off-by: Sta

Re: [PATCH net-next] net: openvswitch: Set OvS recirc_id from tc chain index

2019-08-07 Thread Paul Blakey
On 8/7/2019 6:00 PM, Marcelo Ricardo Leitner wrote: > On Wed, Aug 07, 2019 at 03:08:42PM +0300, Paul Blakey wrote: >> Offloaded OvS datapath rules are translated one to one to tc rules, >> for example the following simplified OvS rule: >> >> recirc_id(0),in_port(dev1),eth_type(0x0800),ct_state(-tr

Re: [PATCH 11/17] qca: no need to check return value of debugfs_create functions

2019-08-07 Thread Michael Heimpold
Am Dienstag, 6. August 2019, 18:11:22 CEST schrieb Greg Kroah-Hartman: > When calling debugfs functions, there is no need to ever check the > return value. The function can work or not, but the code logic should > never do something different based on this. > > Cc: "David S. Miller" > Cc: Stefan

[PATCH v2] team: Add vlan tx offload to hw_enc_features

2019-08-07 Thread YueHaibing
We should also enable team's vlan tx offload in hw_enc_features, pass the vlan packets to the slave devices with vlan tci, let the slave handle vlan tunneling offload implementation. Fixes: 3268e5cb494d ("team: Advertise tunneling offload features") Signed-off-by: YueHaibing --- v2: fix commit lo

Re: [PATCH net] net: phy: rtl8211f: do a double read to get real time link status

2019-08-07 Thread Yonglong Liu
On 2019/8/8 14:11, Heiner Kallweit wrote: > On 08.08.2019 03:15, Yonglong Liu wrote: >> >> >> On 2019/8/8 0:47, Heiner Kallweit wrote: >>> On 07.08.2019 15:16, Yonglong Liu wrote: [ 27.232781] hns3 :bd:00.3 eth7: net open [ 27.237303] 8021q: adding VLAN 0 to HW filter on device

Re: [PATCH v2 2/2] tcp: Update TCP_BASE_MSS comment

2019-08-07 Thread Eric Dumazet
On 8/8/19 1:52 AM, Josh Hunt wrote: > TCP_BASE_MSS is used as the default initial MSS value when MTU probing is > enabled. Update the comment to reflect this. > > Suggested-by: Neal Cardwell > Signed-off-by: Josh Hunt > --- Signed-off-by: Eric Dumazet

Re: [PATCH v2 1/2] tcp: add new tcp_mtu_probe_floor sysctl

2019-08-07 Thread Eric Dumazet
On 8/8/19 1:52 AM, Josh Hunt wrote: > The current implementation of TCP MTU probing can considerably > underestimate the MTU on lossy connections allowing the MSS to get down to > 48. We have found that in almost all of these cases on our networks these > paths can handle much larger MTUs meanin

Re: [PATCH net] net: phy: rtl8211f: do a double read to get real time link status

2019-08-07 Thread Heiner Kallweit
On 08.08.2019 03:15, Yonglong Liu wrote: > > > On 2019/8/8 0:47, Heiner Kallweit wrote: >> On 07.08.2019 15:16, Yonglong Liu wrote: >>> [ 27.232781] hns3 :bd:00.3 eth7: net open >>> [ 27.237303] 8021q: adding VLAN 0 to HW filter on device eth7 >>> [ 27.242972] IPv6: ADDRCONF(NETDEV_CHAN

Re: [PATCH bpf-next] btf: expose BTF info through sysfs

2019-08-07 Thread Greg KH
On Wed, Aug 07, 2019 at 11:38:21AM -0700, Andrii Nakryiko wrote: > Make .BTF section allocated and expose its contents through sysfs. Ah, found the original of this, sorry for the noise on the previous response... Still need Documentation/ABI/ entries though :) thanks, greg k-h

Re: [PATCH v2 bpf-next] btf: expose BTF info through sysfs

2019-08-07 Thread Greg KH
On Thu, Aug 08, 2019 at 04:24:25AM +, Yonghong Song wrote: > > > On 8/7/19 5:32 PM, Andrii Nakryiko wrote: > > Make .BTF section allocated and expose its contents through sysfs. Was this original patch not on bpf@vger? I can't find it in my archive. Anyway... > > /sys/kernel/btf directory

Re: [PATCH net 1/2] mlxsw: spectrum: Fix error path in mlxsw_sp_module_init()

2019-08-07 Thread Jesse Brandeburg
On Wed, 31 Jul 2019 09:33:14 +0300 Ido Schimmel wrote: > From: Jiri Pirko > > In case of sp2 pci driver registration fail, fix the error path to > start with sp1 pci driver unregister. > > Fixes: c3ab435466d5 ("mlxsw: spectrum: Extend to support Spectrum-2 ASIC") > Signed-off-by: Jiri Pirko >

Re: [PATCH net 2/2] mlxsw: spectrum_buffers: Further reduce pool size on Spectrum-2

2019-08-07 Thread Jesse Brandeburg
On Wed, 31 Jul 2019 09:33:15 +0300 Ido Schimmel wrote: > From: Petr Machata > > In commit e891ce1dd2a5 ("mlxsw: spectrum_buffers: Reduce pool size on > Spectrum-2"), pool size was reduced to mitigate a problem in port buffer > usage of ports split four ways. It turns out that this work around d

Re: [PATCH v5 bpf-next] BPF: helpers: New helper to obtain namespace data from current task

2019-08-07 Thread Yonghong Song
On 8/7/19 6:22 PM, Carlos Antonio Neira Bustos wrote: > The code has been modified to avoid syscalls that could sleep. > Please let me know if any other modification is needed. > > From be0384c0fa209a78c1567936e8db4e35b9a7c0f8 Mon Sep 17 00:00:00 2001 > From: Carlos > Date: Wed, 7 Aug 2019 20:

Re: [PATCH v5 bpf-next] BPF: helpers: New helper to obtain namespace data from current task

2019-08-07 Thread Yonghong Song
On 8/7/19 6:22 PM, Carlos Antonio Neira Bustos wrote: > The code has been modified to avoid syscalls that could sleep. > Please let me know if any other modification is needed. > > From be0384c0fa209a78c1567936e8db4e35b9a7c0f8 Mon Sep 17 00:00:00 2001 > From: Carlos > Date: Wed, 7 Aug 2019 20:

Re: [patch net-next rfc 2/7] net: introduce name_node struct to be used in hashlist

2019-08-07 Thread kbuild test robot
Hi Jiri, I love your patch! Yet something to improve: [auto build test ERROR on net-next/master] url: https://github.com/0day-ci/linux/commits/Jiri-Pirko/net-introduce-alternative-names-for-network-interfaces/20190720-094639 config: arc-defconfig (attached as .config) compiler: arc-elf-gcc (

Re: [PATCH v2 bpf-next] btf: expose BTF info through sysfs

2019-08-07 Thread Yonghong Song
On 8/7/19 5:32 PM, Andrii Nakryiko wrote: > Make .BTF section allocated and expose its contents through sysfs. > > /sys/kernel/btf directory is created to contain all the BTFs present > inside kernel. Currently there is only kernel's main BTF, represented as > /sys/kernel/btf/kernel file. Once k

Slow internet? Don't miss out on this WiFi booster

2019-08-07 Thread Lester Hardy
Internet providers make big money by overcharging you for faster internet lines. Could this little device really be the one solution that we've all been waiting for? Frequency: 2.4Ghz Wireless Rate: 300Mbps Interface: 1 10/100Mbps WAN/LAN RJ45 Ports Amazing new technology find out here! http://

RE: [PATCH net-next] r8169: allocate rx buffers using alloc_pages_node

2019-08-07 Thread Hayes Wang
> From: Heiner Kallweit [mailto:hkallwe...@gmail.com] > Sent: Thursday, August 08, 2019 3:38 AM > To: nic_swsd; David Miller > Cc: netdev@vger.kernel.org > Subject: [PATCH net-next] r8169: allocate rx buffers using alloc_pages_node > > We allocate 16kb per rx buffer, so we can avoid some overhead

Re: [PATCH bpf-next] tools/bpf: fix core_reloc.c compilation error

2019-08-07 Thread Alexei Starovoitov
On Wed, Aug 7, 2019 at 5:42 PM Yonghong Song wrote: > > On my local machine, I have the following compilation errors: > = > In file included from prog_tests/core_reloc.c:3:0: > ./progs/core_reloc_types.h:517:46: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or > ‘__attribute__’ before ‘fancy_char_

[PATCH v5 bpf-next] BPF: helpers: New helper to obtain namespace data from current task

2019-08-07 Thread Carlos Antonio Neira Bustos
The code has been modified to avoid syscalls that could sleep. Please let me know if any other modification is needed. >From be0384c0fa209a78c1567936e8db4e35b9a7c0f8 Mon Sep 17 00:00:00 2001 From: Carlos Date: Wed, 7 Aug 2019 20:04:30 -0400 Subject: [PATCH] [PATCH v5 bpf-next] BPF: New helper to

[PATCH bpf-next] tools/bpf: fix core_reloc.c compilation error

2019-08-07 Thread Yonghong Song
On my local machine, I have the following compilation errors: = In file included from prog_tests/core_reloc.c:3:0: ./progs/core_reloc_types.h:517:46: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘fancy_char_ptr_t’ typedef const char * const volatile restrict fancy_char_p

High-Speed WiFi Booster Takes the World By Storm

2019-08-07 Thread Julie Rogers
Internet providers make big money by overcharging you for faster internet lines. Could this little device really be the one solution that we've all been waiting for? Frequency: 2.4Ghz Wireless Rate: 300Mbps Interface: 1 10/100Mbps WAN/LAN RJ45 Ports Amazing new technology find out here! http://

Re: [PATCH bpf-next 1/3] bpf: support cloning sk storage on accept()

2019-08-07 Thread Yonghong Song
On 8/7/19 5:05 PM, Stanislav Fomichev wrote: > On 08/07, Yonghong Song wrote: >> >> >> On 8/7/19 8:47 AM, Stanislav Fomichev wrote: >>> Add new helper bpf_sk_storage_clone which optionally clones sk storage >>> and call it from bpf_sk_storage_clone. Reuse the gap in >>> bpf_sk_storage_elem to sto

Re: [PATCH bpf-next 3/3] selftests/bpf: add sockopt clone/inheritance test

2019-08-07 Thread Stanislav Fomichev
On 08/07, Yonghong Song wrote: > > > On 8/7/19 8:47 AM, Stanislav Fomichev wrote: > > Add a test that calls setsockopt on the listener socket which triggers > > BPF program. This BPF program writes to the sk storage and sets > > clone flag. Make sure that sk storage is cloned for a newly > > acce

[PATCH V38 23/29] bpf: Restrict bpf when kernel lockdown is in confidentiality mode

2019-08-07 Thread Matthew Garrett
From: David Howells bpf_read() and bpf_read_str() could potentially be abused to (eg) allow private keys in kernel memory to be leaked. Disable them if the kernel has been locked down in confidentiality mode. Suggested-by: Alexei Starovoitov Signed-off-by: Matthew Garrett Reviewed-by: Kees Coo

Re: [PATCH bpf-next 1/3] bpf: support cloning sk storage on accept()

2019-08-07 Thread Stanislav Fomichev
On 08/07, Yonghong Song wrote: > > > On 8/7/19 8:47 AM, Stanislav Fomichev wrote: > > Add new helper bpf_sk_storage_clone which optionally clones sk storage > > and call it from bpf_sk_storage_clone. Reuse the gap in > > bpf_sk_storage_elem to store clone/non-clone flag. > > > > Cc: Martin KaFai

[PATCH net v3] net/tls: prevent skb_orphan() from leaking TLS plain text with offload

2019-08-07 Thread Jakub Kicinski
sk_validate_xmit_skb() and drivers depend on the sk member of struct sk_buff to identify segments requiring encryption. Any operation which removes or does not preserve the original TLS socket such as skb_orphan() or skb_clone() will cause clear text leaks. Make the TCP socket underlying an offloa

[PATCH v2 2/2] tcp: Update TCP_BASE_MSS comment

2019-08-07 Thread Josh Hunt
TCP_BASE_MSS is used as the default initial MSS value when MTU probing is enabled. Update the comment to reflect this. Suggested-by: Neal Cardwell Signed-off-by: Josh Hunt --- include/net/tcp.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/net/tcp.h b/include/net/t

[PATCH v2 1/2] tcp: add new tcp_mtu_probe_floor sysctl

2019-08-07 Thread Josh Hunt
The current implementation of TCP MTU probing can considerably underestimate the MTU on lossy connections allowing the MSS to get down to 48. We have found that in almost all of these cases on our networks these paths can handle much larger MTUs meaning the connections are being artificially limite

Re: [PATCH bpf-next 3/3] selftests/bpf: add sockopt clone/inheritance test

2019-08-07 Thread Yonghong Song
On 8/7/19 8:47 AM, Stanislav Fomichev wrote: > Add a test that calls setsockopt on the listener socket which triggers > BPF program. This BPF program writes to the sk storage and sets > clone flag. Make sure that sk storage is cloned for a newly > accepted connection. > > We have two cloned maps

Re: [PATCH bpf-next 2/3] bpf: sync bpf.h to tools/

2019-08-07 Thread Yonghong Song
On 8/7/19 8:47 AM, Stanislav Fomichev wrote: > Sync new sk storage clone flag. > > Cc: Martin KaFai Lau > Signed-off-by: Stanislav Fomichev Acked-by: Yonghong Song > --- > tools/include/uapi/linux/bpf.h | 1 + > 1 file changed, 1 insertion(+) > > diff --git a/tools/include/uapi/linux/bp

Re: [PATCH bpf-next 1/3] bpf: support cloning sk storage on accept()

2019-08-07 Thread Yonghong Song
On 8/7/19 8:47 AM, Stanislav Fomichev wrote: > Add new helper bpf_sk_storage_clone which optionally clones sk storage > and call it from bpf_sk_storage_clone. Reuse the gap in > bpf_sk_storage_elem to store clone/non-clone flag. > > Cc: Martin KaFai Lau > Signed-off-by: Stanislav Fomichev I t

Re: [PATCH net v2] net/tls: prevent skb_orphan() from leaking TLS plain text with offload

2019-08-07 Thread Jakub Kicinski
On Wed, 7 Aug 2019 14:46:23 -0400, Willem de Bruijn wrote: > > > > @@ -984,6 +984,9 @@ ssize_t do_tcp_sendpages(struct sock *sk, struct > > > > page *page, int offset, > > > > if (!skb) > > > > goto wait_for_memory; > > > > > > > > +#ifdef CO

Re: [PATCH v6 bpf-next 04/14] libbpf: implement BPF CO-RE offset relocation algorithm

2019-08-07 Thread Andrii Nakryiko
On Wed, Aug 7, 2019 at 3:16 PM Alexei Starovoitov wrote: > > On Wed, Aug 07, 2019 at 02:39:51PM -0700, Andrii Nakryiko wrote: > > This patch implements the core logic for BPF CO-RE offsets relocations. > > Every instruction that needs to be relocated has corresponding > > bpf_offset_reloc as part

Re: [PATCH v6 bpf-next 04/14] libbpf: implement BPF CO-RE offset relocation algorithm

2019-08-07 Thread Alexei Starovoitov
On Wed, Aug 07, 2019 at 02:39:51PM -0700, Andrii Nakryiko wrote: > This patch implements the core logic for BPF CO-RE offsets relocations. > Every instruction that needs to be relocated has corresponding > bpf_offset_reloc as part of BTF.ext. Relocations are performed by trying > to match recorded

[PATCH v6 bpf-next 12/14] selftests/bpf: add CO-RE relocs ptr-as-array tests

2019-08-07 Thread Andrii Nakryiko
Add test validating correct relocation handling for cases where pointer to something is used as an array. E.g.: int *ptr = ...; int x = ptr[42]; Signed-off-by: Andrii Nakryiko Acked-by: Song Liu --- .../selftests/bpf/prog_tests/core_reloc.c | 20 + .../bpf/progs/btf__core_r

[PATCH v6 bpf-next 13/14] selftests/bpf: add CO-RE relocs ints tests

2019-08-07 Thread Andrii Nakryiko
Add various tests validating handling compatible/incompatible integer types. Signed-off-by: Andrii Nakryiko Acked-by: Song Liu --- .../selftests/bpf/prog_tests/core_reloc.c | 40 +++ .../bpf/progs/btf__core_reloc_ints.c | 3 + .../bpf/progs/btf__core_reloc_ints___bool.c |

[PATCH v6 bpf-next 09/14] selftests/bpf: add CO-RE relocs array tests

2019-08-07 Thread Andrii Nakryiko
Add tests for various array handling/relocation scenarios. Signed-off-by: Andrii Nakryiko Acked-by: Song Liu --- .../selftests/bpf/prog_tests/core_reloc.c | 41 ++ .../bpf/progs/btf__core_reloc_arrays.c| 3 + .../btf__core_reloc_arrays___diff_arr_dim.c | 3 + ...btf__cor

[PATCH v6 bpf-next 10/14] selftests/bpf: add CO-RE relocs enum/ptr/func_proto tests

2019-08-07 Thread Andrii Nakryiko
Test CO-RE relocation handling of ints, enums, pointers, func protos, etc. Signed-off-by: Andrii Nakryiko Acked-by: Song Liu --- .../selftests/bpf/prog_tests/core_reloc.c | 36 ++ .../bpf/progs/btf__core_reloc_primitives.c| 3 + ...f__core_reloc_primitives___diff_enum_def.c |

[PATCH v6 bpf-next 11/14] selftests/bpf: add CO-RE relocs modifiers/typedef tests

2019-08-07 Thread Andrii Nakryiko
Add tests validating correct handling of various combinations of typedefs and const/volatile/restrict modifiers. Signed-off-by: Andrii Nakryiko Acked-by: Song Liu --- .../selftests/bpf/prog_tests/core_reloc.c | 27 +++ .../bpf/progs/btf__core_reloc_mods.c | 3 + .../progs/btf_

[PATCH v6 bpf-next 14/14] selftests/bpf: add CO-RE relocs misc tests

2019-08-07 Thread Andrii Nakryiko
Add tests validating few edge-cases of capturing offset relocations. Signed-off-by: Andrii Nakryiko --- .../selftests/bpf/prog_tests/core_reloc.c | 19 +++ .../bpf/progs/btf__core_reloc_misc.c | 5 ++ .../selftests/bpf/progs/core_reloc_types.h| 25 .../bpf/progs/te

[PATCH v6 bpf-next 08/14] selftests/bpf: add CO-RE relocs nesting tests

2019-08-07 Thread Andrii Nakryiko
Add a bunch of test validating correct handling of nested structs/unions. Signed-off-by: Andrii Nakryiko Acked-by: Song Liu --- .../selftests/bpf/prog_tests/core_reloc.c | 39 +++ .../bpf/progs/btf__core_reloc_nesting.c | 3 + .../btf__core_reloc_nesting___anon_embed.c| 3 +

[PATCH v6 bpf-next 07/14] selftests/bpf: add CO-RE relocs struct flavors tests

2019-08-07 Thread Andrii Nakryiko
Add tests verifying that BPF program can use various struct/union "flavors" to extract data from the same target struct/union. Signed-off-by: Andrii Nakryiko Acked-by: Song Liu --- .../selftests/bpf/prog_tests/core_reloc.c | 34 ++ .../bpf/progs/btf__core_reloc_flavors.c | 3

[PATCH v6 bpf-next 06/14] selftests/bpf: add CO-RE relocs testing setup

2019-08-07 Thread Andrii Nakryiko
Add CO-RE relocation test runner. Add one simple test validating that libbpf's logic for searching for kernel image and loading BTF out of it works. Signed-off-by: Andrii Nakryiko Acked-by: Song Liu --- .../selftests/bpf/prog_tests/core_reloc.c | 129 ++ .../bpf/progs/test_c

[PATCH v6 bpf-next 05/14] selftests/bpf: add BPF_CORE_READ relocatable read macro

2019-08-07 Thread Andrii Nakryiko
Add BPF_CORE_READ macro used in tests to do bpf_core_read(), which automatically captures offset relocation. Signed-off-by: Andrii Nakryiko --- tools/testing/selftests/bpf/bpf_helpers.h | 20 1 file changed, 20 insertions(+) diff --git a/tools/testing/selftests/bpf/bpf_help

[PATCH v6 bpf-next 02/14] libbpf: convert libbpf code to use new btf helpers

2019-08-07 Thread Andrii Nakryiko
Simplify code by relying on newly added BTF helper functions. Signed-off-by: Andrii Nakryiko --- tools/lib/bpf/btf.c | 181 ++- tools/lib/bpf/btf_dump.c | 138 ++--- tools/lib/bpf/libbpf.c | 60 +++-- 3 files changed, 15

[PATCH v6 bpf-next 00/14] CO-RE offset relocations

2019-08-07 Thread Andrii Nakryiko
This patch set implements central part of CO-RE (Compile Once - Run Everywhere, see [0] and [1] for slides and video): relocating fields offsets. Most of the details are written down as comments to corresponding parts of the code. Patch #1 adds a bunch of commonly useful btf_xxx helpers to simplif

[PATCH v6 bpf-next 01/14] libbpf: add helpers for working with BTF types

2019-08-07 Thread Andrii Nakryiko
Add lots of frequently used helpers that simplify working with BTF types. Signed-off-by: Andrii Nakryiko --- tools/lib/bpf/btf.h | 178 1 file changed, 178 insertions(+) diff --git a/tools/lib/bpf/btf.h b/tools/lib/bpf/btf.h index 88a52ae56fc6..2604d

[PATCH v6 bpf-next 04/14] libbpf: implement BPF CO-RE offset relocation algorithm

2019-08-07 Thread Andrii Nakryiko
This patch implements the core logic for BPF CO-RE offsets relocations. Every instruction that needs to be relocated has corresponding bpf_offset_reloc as part of BTF.ext. Relocations are performed by trying to match recorded "local" relocation spec against potentially many compatible "target" type

[PATCH v6 bpf-next 03/14] libbpf: add .BTF.ext offset relocation section loading

2019-08-07 Thread Andrii Nakryiko
Add support for BPF CO-RE offset relocations. Add section/record iteration macros for .BTF.ext. These macro are useful for iterating over each .BTF.ext record, either for dumping out contents or later for BPF CO-RE relocation handling. To enable other parts of libbpf to work with .BTF.ext contents

Re: [RFC] implicit per-namespace devlink instance to set kernel resource limitations

2019-08-07 Thread David Ahern
On 8/7/19 12:49 PM, Jakub Kicinski wrote: > Perhaps I'm misinterpreting your point there. yes, this thread is getting out of hand. I am not pushing for an in-kernel, fib resource controller. Jiri wants to remove the existing devlink resource code from netdevsim into a standalone driver, code that

[PATCH v5 bpf-next 05/14] selftests/bpf: add BPF_CORE_READ relocatable read macro

2019-08-07 Thread Andrii Nakryiko
Add BPF_CORE_READ macro used in tests to do bpf_core_read(), which automatically captures offset relocation. Signed-off-by: Andrii Nakryiko --- tools/testing/selftests/bpf/bpf_helpers.h | 20 1 file changed, 20 insertions(+) diff --git a/tools/testing/selftests/bpf/bpf_help

[PATCH v5 bpf-next 13/14] selftests/bpf: add CO-RE relocs ints tests

2019-08-07 Thread Andrii Nakryiko
Add various tests validating handling compatible/incompatible integer types. Signed-off-by: Andrii Nakryiko Acked-by: Song Liu --- .../selftests/bpf/prog_tests/core_reloc.c | 40 +++ .../bpf/progs/btf__core_reloc_ints.c | 3 + .../bpf/progs/btf__core_reloc_ints___bool.c |

[PATCH v5 bpf-next 12/14] selftests/bpf: add CO-RE relocs ptr-as-array tests

2019-08-07 Thread Andrii Nakryiko
Add test validating correct relocation handling for cases where pointer to something is used as an array. E.g.: int *ptr = ...; int x = ptr[42]; Signed-off-by: Andrii Nakryiko Acked-by: Song Liu --- .../selftests/bpf/prog_tests/core_reloc.c | 20 + .../bpf/progs/btf__core_r

[PATCH v5 bpf-next 03/14] libbpf: add .BTF.ext offset relocation section loading

2019-08-07 Thread Andrii Nakryiko
Add support for BPF CO-RE offset relocations. Add section/record iteration macros for .BTF.ext. These macro are useful for iterating over each .BTF.ext record, either for dumping out contents or later for BPF CO-RE relocation handling. To enable other parts of libbpf to work with .BTF.ext contents

[PATCH v5 bpf-next 00/14] CO-RE offset relocations

2019-08-07 Thread Andrii Nakryiko
This patch set implements central part of CO-RE (Compile Once - Run Everywhere, see [0] and [1] for slides and video): relocating fields offsets. Most of the details are written down as comments to corresponding parts of the code. Patch #1 adds a bunch of commonly useful btf_xxx helpers to simplif

[PATCH v5 bpf-next 10/14] selftests/bpf: add CO-RE relocs enum/ptr/func_proto tests

2019-08-07 Thread Andrii Nakryiko
Test CO-RE relocation handling of ints, enums, pointers, func protos, etc. Signed-off-by: Andrii Nakryiko Acked-by: Song Liu --- .../selftests/bpf/prog_tests/core_reloc.c | 36 ++ .../bpf/progs/btf__core_reloc_primitives.c| 3 + ...f__core_reloc_primitives___diff_enum_def.c |

[PATCH v5 bpf-next 06/14] selftests/bpf: add CO-RE relocs testing setup

2019-08-07 Thread Andrii Nakryiko
Add CO-RE relocation test runner. Add one simple test validating that libbpf's logic for searching for kernel image and loading BTF out of it works. Signed-off-by: Andrii Nakryiko Acked-by: Song Liu --- .../selftests/bpf/prog_tests/core_reloc.c | 129 ++ .../bpf/progs/test_c

[PATCH v5 bpf-next 11/14] selftests/bpf: add CO-RE relocs modifiers/typedef tests

2019-08-07 Thread Andrii Nakryiko
Add tests validating correct handling of various combinations of typedefs and const/volatile/restrict modifiers. Signed-off-by: Andrii Nakryiko Acked-by: Song Liu --- .../selftests/bpf/prog_tests/core_reloc.c | 27 +++ .../bpf/progs/btf__core_reloc_mods.c | 3 + .../progs/btf_

[PATCH v5 bpf-next 08/14] selftests/bpf: add CO-RE relocs nesting tests

2019-08-07 Thread Andrii Nakryiko
Add a bunch of test validating correct handling of nested structs/unions. Signed-off-by: Andrii Nakryiko Acked-by: Song Liu --- .../selftests/bpf/prog_tests/core_reloc.c | 39 +++ .../bpf/progs/btf__core_reloc_nesting.c | 3 + .../btf__core_reloc_nesting___anon_embed.c| 3 +

[PATCH v5 bpf-next 07/14] selftests/bpf: add CO-RE relocs struct flavors tests

2019-08-07 Thread Andrii Nakryiko
Add tests verifying that BPF program can use various struct/union "flavors" to extract data from the same target struct/union. Signed-off-by: Andrii Nakryiko Acked-by: Song Liu --- .../selftests/bpf/prog_tests/core_reloc.c | 34 ++ .../bpf/progs/btf__core_reloc_flavors.c | 3

[PATCH v5 bpf-next 02/14] libbpf: convert libbpf code to use new btf helpers

2019-08-07 Thread Andrii Nakryiko
Simplify code by relying on newly added BTF helper functions. Signed-off-by: Andrii Nakryiko --- tools/lib/bpf/btf.c | 181 ++- tools/lib/bpf/btf_dump.c | 138 ++--- tools/lib/bpf/libbpf.c | 60 +++-- 3 files changed, 15

[PATCH v5 bpf-next 09/14] selftests/bpf: add CO-RE relocs array tests

2019-08-07 Thread Andrii Nakryiko
Add tests for various array handling/relocation scenarios. Signed-off-by: Andrii Nakryiko Acked-by: Song Liu --- .../selftests/bpf/prog_tests/core_reloc.c | 41 ++ .../bpf/progs/btf__core_reloc_arrays.c| 3 + .../btf__core_reloc_arrays___diff_arr_dim.c | 3 + ...btf__cor

[PATCH v5 bpf-next 01/14] libbpf: add helpers for working with BTF types

2019-08-07 Thread Andrii Nakryiko
Add lots of frequently used helpers that simplify working with BTF types. Signed-off-by: Andrii Nakryiko --- tools/lib/bpf/btf.h | 176 1 file changed, 176 insertions(+) diff --git a/tools/lib/bpf/btf.h b/tools/lib/bpf/btf.h index 88a52ae56fc6..03767

[PATCH v5 bpf-next 14/14] selftests/bpf: add CO-RE relocs misc tests

2019-08-07 Thread Andrii Nakryiko
Add tests validating few edge-cases of capturing offset relocations. Signed-off-by: Andrii Nakryiko --- .../selftests/bpf/prog_tests/core_reloc.c | 19 +++ .../bpf/progs/btf__core_reloc_misc.c | 5 ++ .../selftests/bpf/progs/core_reloc_types.h| 25 .../bpf/progs/te

[PATCH v5 bpf-next 04/14] libbpf: implement BPF CO-RE offset relocation algorithm

2019-08-07 Thread Andrii Nakryiko
This patch implements the core logic for BPF CO-RE offsets relocations. Every instruction that needs to be relocated has corresponding bpf_offset_reloc as part of BTF.ext. Relocations are performed by trying to match recorded "local" relocation spec against potentially many compatible "target" type

Re: [v3,1/4] tools: bpftool: add net attach command to attach XDP on interface

2019-08-07 Thread Jakub Kicinski
On Wed, 7 Aug 2019 11:25:06 +0900, Daniel T. Lee wrote: > By this commit, using `bpftool net attach`, user can attach XDP prog on > interface. New type of enum 'net_attach_type' has been made, as stated at > cover-letter, the meaning of 'attach' is, prog will be attached on interface. > > With 'o

Re: [v3,2/4] tools: bpftool: add net detach command to detach XDP on interface

2019-08-07 Thread Maciej Fijalkowski
On Wed, 7 Aug 2019 13:12:17 -0700 Y Song wrote: > On Wed, Aug 7, 2019 at 11:30 AM Maciej Fijalkowski > wrote: > > > > On Wed, 7 Aug 2019 10:02:04 -0700 > > Y Song wrote: > > > > > On Tue, Aug 6, 2019 at 7:25 PM Daniel T. Lee > > > wrote: > > > > > > > > By this commit, using `bpftool net

Re: [v3,2/4] tools: bpftool: add net detach command to detach XDP on interface

2019-08-07 Thread Y Song
On Wed, Aug 7, 2019 at 11:30 AM Maciej Fijalkowski wrote: > > On Wed, 7 Aug 2019 10:02:04 -0700 > Y Song wrote: > > > On Tue, Aug 6, 2019 at 7:25 PM Daniel T. Lee wrote: > > > > > > By this commit, using `bpftool net detach`, the attached XDP prog can > > > be detached. Detaching the BPF prog wi

Re: [PATCH v4 bpf-next 02/14] libbpf: convert libbpf code to use new btf helpers

2019-08-07 Thread Andrii Nakryiko
On Wed, Aug 7, 2019 at 1:01 PM Alexei Starovoitov wrote: > > On 8/7/19 12:59 PM, Andrii Nakryiko wrote: > > On Wed, Aug 7, 2019 at 12:30 PM Alexei Starovoitov > > wrote: > >> > >> On Tue, Aug 06, 2019 at 10:37:54PM -0700, Andrii Nakryiko wrote: > >>> Simplify code by relying on newly added BTF he

Re: [PATCH v4 bpf-next 02/14] libbpf: convert libbpf code to use new btf helpers

2019-08-07 Thread Alexei Starovoitov
On 8/7/19 12:59 PM, Andrii Nakryiko wrote: > On Wed, Aug 7, 2019 at 12:30 PM Alexei Starovoitov > wrote: >> >> On Tue, Aug 06, 2019 at 10:37:54PM -0700, Andrii Nakryiko wrote: >>> Simplify code by relying on newly added BTF helper functions. >>> >>> Signed-off-by: Andrii Nakryiko >> .. >>> >>> -

Re: [PATCH v4 bpf-next 02/14] libbpf: convert libbpf code to use new btf helpers

2019-08-07 Thread Andrii Nakryiko
On Wed, Aug 7, 2019 at 12:30 PM Alexei Starovoitov wrote: > > On Tue, Aug 06, 2019 at 10:37:54PM -0700, Andrii Nakryiko wrote: > > Simplify code by relying on newly added BTF helper functions. > > > > Signed-off-by: Andrii Nakryiko > .. > > > > - for (i = 0, vsi = (struct btf_var_secinfo *)(t

[PATCH net 1/2] net sched: update skbedit action for batched events operations

2019-08-07 Thread Roman Mashak
Add get_fill_size() routine used to calculate the action size when building a batch of events. Fixes: ca9b0e27e ("pkt_action: add new action skbedit") Signed-off-by: Roman Mashak --- net/sched/act_skbedit.c | 12 1 file changed, 12 insertions(+) diff --git a/net/sched/act_skbedit.c

[PATCH net 0/2] Fix batched event generation for skbedit action

2019-08-07 Thread Roman Mashak
When adding or deleting a batch of entries, the kernel sends up to TCA_ACT_MAX_PRIO (defined to 32 in kernel) entries in an event to user space. However it does not consider that the action sizes may vary and require different skb sizes. For example, consider the following script adding 32 entries

[PATCH net 2/2] tc-testing: updated skbedit action tests with batch create/delete

2019-08-07 Thread Roman Mashak
Update TDC tests with cases varifying ability of TC to install or delete batches of skbedit actions. Signed-off-by: Roman Mashak --- .../tc-testing/tc-tests/actions/skbedit.json | 47 ++ 1 file changed, 47 insertions(+) diff --git a/tools/testing/selftests/tc-testing/t

Re: [PATCH net v2] net/tls: prevent skb_orphan() from leaking TLS plain text with offload

2019-08-07 Thread Willem de Bruijn
On Wed, Aug 7, 2019 at 2:47 PM Willem de Bruijn wrote: > > On Wed, Aug 7, 2019 at 2:01 PM Jakub Kicinski > wrote: > > > > On Wed, 7 Aug 2019 12:59:00 -0400, Willem de Bruijn wrote: > > > On Wed, Aug 7, 2019 at 2:06 AM Jakub Kicinski wrote: > > > > diff --git a/net/core/sock.c b/net/core/sock.c >

Re: [PATCH v4 bpf-next 01/14] libbpf: add helpers for working with BTF types

2019-08-07 Thread Andrii Nakryiko
On Wed, Aug 7, 2019 at 12:31 PM Alexei Starovoitov wrote: > > On Tue, Aug 06, 2019 at 10:37:53PM -0700, Andrii Nakryiko wrote: > > Add lots of frequently used helpers that simplify working with BTF > > types. > > > > Signed-off-by: Andrii Nakryiko > .. > > +/* get bitfield size of a member, assum

Why is this WiFi booster so popular across the World?

2019-08-07 Thread Horace Harrington
Internet providers make big money by overcharging you for faster internet lines. Could this little device really be the one solution that we've all been waiting for? Frequency: 2.4Ghz Wireless Rate: 300Mbps Interface: 1 10/100Mbps WAN/LAN RJ45 Ports Amazing new technology find out here! http://

[PATCH net-next] r8169: allocate rx buffers using alloc_pages_node

2019-08-07 Thread Heiner Kallweit
We allocate 16kb per rx buffer, so we can avoid some overhead by using alloc_pages_node directly instead of bothering kmalloc_node. Due to this change buffers are page-aligned now, therefore the alignment check can be removed. Signed-off-by: Heiner Kallweit --- drivers/net/ethernet/realtek/r8169

Re: [PATCH net] netdevsim: Restore per-network namespace accounting for fib entries

2019-08-07 Thread David Ahern
On 8/7/19 7:07 AM, Jiri Pirko wrote: > > Yeah. I believe it was a mistake to add it in the first place. Abuses > netdevsim for something it is not. I'm fine to use devlink the way you > want to after we conclude 2), but outside netdevsim. > > Again, netdevsim is there for config api testing purpo

Re: [PATCH v4 bpf-next 01/14] libbpf: add helpers for working with BTF types

2019-08-07 Thread Alexei Starovoitov
On Tue, Aug 06, 2019 at 10:37:53PM -0700, Andrii Nakryiko wrote: > Add lots of frequently used helpers that simplify working with BTF > types. > > Signed-off-by: Andrii Nakryiko .. > +/* get bitfield size of a member, assuming t is BTF_KIND_STRUCT or > + * BTF_KIND_UNION. If member is not a bitfi

Re: [PATCH v4 bpf-next 02/14] libbpf: convert libbpf code to use new btf helpers

2019-08-07 Thread Alexei Starovoitov
On Tue, Aug 06, 2019 at 10:37:54PM -0700, Andrii Nakryiko wrote: > Simplify code by relying on newly added BTF helper functions. > > Signed-off-by: Andrii Nakryiko .. > > - for (i = 0, vsi = (struct btf_var_secinfo *)(t + 1); > - i < vars; i++, vsi++) { > + for (i = 0, vsi = (v

Re: [v3,2/4] tools: bpftool: add net detach command to detach XDP on interface

2019-08-07 Thread Jakub Kicinski
On Wed, 7 Aug 2019 10:02:04 -0700, Y Song wrote: > -bash-4.4$ sudo ./bpftool net detach x dev v2 > -bash-4.4$ sudo ./bpftool net > xdp: > v1(4) driver id 1172 > > tc: > eth0(2) clsact/ingress fbflow_icmp id 29 act [] > eth0(2) clsact/egress cls_fg_dscp_section id 27 act [] > eth0(2) clsact/egress

[PATCH RFC] net: phy: add support for clause 37 auto-negotiation

2019-08-07 Thread Heiner Kallweit
This patch adds support for clause 37 1000Base-X auto-negotiation. It's compile-tested only as I don't have fiber equipment. Signed-off-by: Heiner Kallweit --- drivers/net/phy/phy_device.c | 139 +++ include/linux/phy.h | 5 ++ 2 files changed, 144 inse

Re: [PATCH iproute2-next v2] ip tunnel: add json output

2019-08-07 Thread David Ahern
On 8/2/19 11:38 AM, Andrea Claudi wrote: > Add json support on iptunnel and ip6tunnel. > The plain text output format should remain the same. > > Signed-off-by: Andrea Claudi > --- > Changes since v1: > * Use print_color_* for ifname and ip addresses; > * Use print_null() instead of print_bool(

Re: [PATCH iproute2-next] rdma: Add driver QP type string

2019-08-07 Thread David Ahern
On 8/4/19 2:07 AM, Gal Pressman wrote: > RDMA resource tracker now tracks driver QPs as well, add driver QP type > string to qp_types_to_str function. > > Signed-off-by: Gal Pressman > --- > rdma/res.c | 6 -- > 1 file changed, 4 insertions(+), 2 deletions(-) > applied to iproute2-next. Th

Re: [RFC] implicit per-namespace devlink instance to set kernel resource limitations

2019-08-07 Thread Jakub Kicinski
On Tue, 6 Aug 2019 21:10:40 -0600, David Ahern wrote: > On 8/6/19 8:59 PM, Andrew Lunn wrote: > > However, zoom out a bit, from networking to the whole kernel. In > > general, across the kernel as a whole, resource management is done > > with cgroups. cgroups is the consistent operational model acr

Re: [RFC] implicit per-namespace devlink instance to set kernel resource limitations

2019-08-07 Thread Jakub Kicinski
On Tue, 6 Aug 2019 20:33:47 -0600, David Ahern wrote: > Some time back supported was added for devlink 'resources'. The idea is > that hardware (mlxsw) has limited resources (e.g., memory) that can be > allocated in certain ways (e.g., kvd for mlxsw) thus implementing > restrictions on the number o

Re: [PATCH net v2] net/tls: prevent skb_orphan() from leaking TLS plain text with offload

2019-08-07 Thread Willem de Bruijn
On Wed, Aug 7, 2019 at 2:01 PM Jakub Kicinski wrote: > > On Wed, 7 Aug 2019 12:59:00 -0400, Willem de Bruijn wrote: > > On Wed, Aug 7, 2019 at 2:06 AM Jakub Kicinski wrote: > > > diff --git a/net/core/sock.c b/net/core/sock.c > > > index d57b0cc995a0..0f9619b0892f 100644 > > > --- a/net/core/sock.

Re: [v3,2/4] tools: bpftool: add net detach command to detach XDP on interface

2019-08-07 Thread Maciej Fijalkowski
On Wed, 7 Aug 2019 10:02:04 -0700 Y Song wrote: > On Tue, Aug 6, 2019 at 7:25 PM Daniel T. Lee wrote: > > > > By this commit, using `bpftool net detach`, the attached XDP prog can > > be detached. Detaching the BPF prog will be done through libbpf > > 'bpf_set_link_xdp_fd' with the progfd set to

Re: [bpf-next PATCH 3/3] samples/bpf: xdp_fwd explain bpf_fib_lookup return codes

2019-08-07 Thread Y Song
On Wed, Aug 7, 2019 at 5:38 AM Jesper Dangaard Brouer wrote: > > Make it clear that this XDP program depend on the network > stack to do the ARP resolution. This is connected with the > BPF_FIB_LKUP_RET_NO_NEIGH return code from bpf_fib_lookup(). > > Another common mistake (seen via XDP-tutorial)

Re: [bpf-next PATCH 2/3] samples/bpf: make xdp_fwd more practically usable via devmap lookup

2019-08-07 Thread Y Song
On Wed, Aug 7, 2019 at 5:37 AM Jesper Dangaard Brouer wrote: > > This address the TODO in samples/bpf/xdp_fwd_kern.c, which points out > that the chosen egress index should be checked for existence in the > devmap. This can now be done via taking advantage of Toke's work in > commit 0cdbb4b09a06 (

Re: [PATCH net v2] net/tls: prevent skb_orphan() from leaking TLS plain text with offload

2019-08-07 Thread Jakub Kicinski
On Wed, 7 Aug 2019 12:59:00 -0400, Willem de Bruijn wrote: > On Wed, Aug 7, 2019 at 2:06 AM Jakub Kicinski wrote: > > diff --git a/net/core/sock.c b/net/core/sock.c > > index d57b0cc995a0..0f9619b0892f 100644 > > --- a/net/core/sock.c > > +++ b/net/core/sock.c > > @@ -1992,6 +1992,20 @@ void skb_se

Re: [bpf-next PATCH 1/3] samples/bpf: xdp_fwd rename devmap name to be xdp_tx_ports

2019-08-07 Thread Y Song
On Wed, Aug 7, 2019 at 5:37 AM Jesper Dangaard Brouer wrote: > > The devmap name 'tx_port' came from a copy-paste from xdp_redirect_map > which only have a single TX port. Change name to xdp_tx_ports > to make it more descriptive. > > Signed-off-by: Jesper Dangaard Brouer Acked-by: Yonghong Song

Re: [bpf-next PATCH 3/3] samples/bpf: xdp_fwd explain bpf_fib_lookup return codes

2019-08-07 Thread David Ahern
On 8/7/19 6:36 AM, Jesper Dangaard Brouer wrote: > Make it clear that this XDP program depend on the network > stack to do the ARP resolution. This is connected with the > BPF_FIB_LKUP_RET_NO_NEIGH return code from bpf_fib_lookup(). > > Another common mistake (seen via XDP-tutorial) is that users

Re: [bpf-next PATCH 2/3] samples/bpf: make xdp_fwd more practically usable via devmap lookup

2019-08-07 Thread David Ahern
On 8/7/19 6:36 AM, Jesper Dangaard Brouer wrote: > This address the TODO in samples/bpf/xdp_fwd_kern.c, which points out > that the chosen egress index should be checked for existence in the > devmap. This can now be done via taking advantage of Toke's work in > commit 0cdbb4b09a06 ("devmap: Allow

Re: [bpf-next PATCH 1/3] samples/bpf: xdp_fwd rename devmap name to be xdp_tx_ports

2019-08-07 Thread David Ahern
On 8/7/19 6:36 AM, Jesper Dangaard Brouer wrote: > The devmap name 'tx_port' came from a copy-paste from xdp_redirect_map > which only have a single TX port. Change name to xdp_tx_ports > to make it more descriptive. > > Signed-off-by: Jesper Dangaard Brouer > --- > samples/bpf/xdp_fwd_kern.c |

Re: [v3,2/4] tools: bpftool: add net detach command to detach XDP on interface

2019-08-07 Thread Y Song
On Tue, Aug 6, 2019 at 7:25 PM Daniel T. Lee wrote: > > By this commit, using `bpftool net detach`, the attached XDP prog can > be detached. Detaching the BPF prog will be done through libbpf > 'bpf_set_link_xdp_fd' with the progfd set to -1. > > Signed-off-by: Daniel T. Lee > --- > tools/bpf/bp

Re: [PATCH net v2] net/tls: prevent skb_orphan() from leaking TLS plain text with offload

2019-08-07 Thread Willem de Bruijn
On Wed, Aug 7, 2019 at 2:06 AM Jakub Kicinski wrote: > > sk_validate_xmit_skb() and drivers depend on the sk member of > struct sk_buff to identify segments requiring encryption. > Any operation which removes or does not preserve the original TLS > socket such as skb_orphan() or skb_clone() will c

  1   2   >