Re: [PATCH bpf-next v3 00/13] bpf: implement bpf iterator for map elements

2020-07-22 Thread Alexei Starovoitov
On Wed, Jul 22, 2020 at 11:15:33PM -0700, Yonghong Song wrote: > Bpf iterator has been implemented for task, task_file, > bpf_map, ipv6_route, netlink, tcp and udp so far. > > For map elements, there are two ways to traverse all elements from > user space: > 1. using BPF_MAP_GET_NEXT_KEY bpf sub

Re: [PATCH][next] wil6210: Avoid the use of one-element array

2020-07-22 Thread Kalle Valo
"Gustavo A. R. Silva" writes: > Friendly ping: who can take this? :) I'll take this if it's ok. I have been just busy due to vacation period. -- https://wireless.wiki.kernel.org/en/developers/documentation/submittingpatches

[PATCH bpf-next v3 10/13] selftests/bpf: add test for bpf hash map iterators

2020-07-22 Thread Yonghong Song
Two subtests are added. $ ./test_progs -n 4 ... #4/18 bpf_hash_map:OK #4/19 bpf_percpu_hash_map:OK ... Signed-off-by: Yonghong Song --- .../selftests/bpf/prog_tests/bpf_iter.c | 187 ++ .../bpf/progs/bpf_iter_bpf_hash_map.c | 100 ++ .../bpf/progs/

INFO: task hung in ovs_exit_net

2020-07-22 Thread syzbot
Hello, syzbot found the following issue on: HEAD commit:a6c0d093 net: explicitly include in net/c.. git tree: net-next console output: https://syzkaller.appspot.com/x/log.txt?x=179ee64090 kernel config: https://syzkaller.appspot.com/x/.config?x=2b7b67c0c1819c87 dashboard link: htt

Re: [PATCH v4 bpf-next 2/4] bpf: fail PERF_EVENT_IOC_SET_BPF when bpf_get_[stack|stackid] cannot work

2020-07-22 Thread Song Liu
> On Jul 22, 2020, at 10:55 PM, Alexei Starovoitov > wrote: > > On Wed, Jul 22, 2020 at 11:42:08AM -0700, Song Liu wrote: >> diff --git a/kernel/events/core.c b/kernel/events/core.c >> index 856d98c36f562..f77d009fcce95 100644 >> --- a/kernel/events/core.c >> +++ b/kernel/events/core.c >> @@

[PATCH bpf-next v3 06/13] bpf: implement bpf iterator for array maps

2020-07-22 Thread Yonghong Song
The bpf iterators for array and percpu array are implemented. Similar to hash maps, for percpu array map, bpf program will receive values from all cpus. Signed-off-by: Yonghong Song --- kernel/bpf/arraymap.c | 138 ++ kernel/bpf/map_iter.c | 6 +- 2 file

[PATCH bpf-next v3 08/13] tools/libbpf: add support for bpf map element iterator

2020-07-22 Thread Yonghong Song
Add map_fd to bpf_iter_attach_opts and flags to bpf_link_create_opts. Later on, bpftool or selftest will be able to create a bpf map element iterator by passing map_fd to the kernel during link creation time. Signed-off-by: Yonghong Song --- tools/lib/bpf/bpf.c| 1 + tools/lib/bpf/bpf.h

[PATCH bpf-next v3 04/13] bpf: implement bpf iterator for map elements

2020-07-22 Thread Yonghong Song
The bpf iterator for map elements are implemented. The bpf program will receive four parameters: bpf_iter_meta *meta: the meta data bpf_map *map:the bpf_map whose elements are traversed void *key: the key of one element void *value: the value of the same element H

[PATCH bpf-next v3 05/13] bpf: implement bpf iterator for hash maps

2020-07-22 Thread Yonghong Song
The bpf iterators for hash, percpu hash, lru hash and lru percpu hash are implemented. During link time, bpf_iter_reg->check_target() will check map type and ensure the program access key/value region is within the map defined key/value size limit. For percpu hash and lru hash maps, the bpf progra

[PATCH bpf-next v3 13/13] selftests/bpf: add a test for out of bound rdonly buf access

2020-07-22 Thread Yonghong Song
If the bpf program contains out of bound access w.r.t. a particular map key/value size, the verification will be still okay, e.g., it will be accepted by verifier. But it will be rejected during link_create time. A test is added here to ensure link_create failure did happen if out of bound access h

[PATCH bpf-next v3 07/13] bpf: implement bpf iterator for sock local storage map

2020-07-22 Thread Yonghong Song
The bpf iterator for bpf sock local storage map is implemented. User space interacts with sock local storage map with fd as a key and storage value. In kernel, passing fd to the bpf program does not really make sense. In this case, the sock itself is passed to bpf program. Signed-off-by: Yonghong

[PATCH bpf-next v3 01/13] bpf: refactor bpf_iter_reg to have separate seq_info member

2020-07-22 Thread Yonghong Song
There is no functionality change for this patch. Struct bpf_iter_reg is used to register a bpf_iter target, which includes information for both prog_load, link_create and seq_file creation. This patch puts fields related seq_file creation into a different structure. This will be useful for map ele

[PATCH bpf-next v3 12/13] selftests/bpf: add a test for bpf sk_storage_map iterator

2020-07-22 Thread Yonghong Song
Added one test for bpf sk_storage_map_iterator. $ ./test_progs -n 4 ... #4/22 bpf_sk_storage_map:OK ... Signed-off-by: Yonghong Song --- .../selftests/bpf/prog_tests/bpf_iter.c | 72 +++ .../bpf/progs/bpf_iter_bpf_sk_storage_map.c | 34 + 2 files changed,

[PATCH bpf-next v3 03/13] bpf: support readonly/readwrite buffers in verifier

2020-07-22 Thread Yonghong Song
Readonly and readwrite buffer register states are introduced. Totally four states, PTR_TO_RDONLY_BUF[_OR_NULL] and PTR_TO_RDWR_BUF[_OR_NULL] are supported. As suggested by their respective names, PTR_TO_RDONLY_BUF[_OR_NULL] are for readonly buffers and PTR_TO_RDWR_BUF[_OR_NULL] for read/write buffe

[PATCH bpf-next v3 00/13] bpf: implement bpf iterator for map elements

2020-07-22 Thread Yonghong Song
Bpf iterator has been implemented for task, task_file, bpf_map, ipv6_route, netlink, tcp and udp so far. For map elements, there are two ways to traverse all elements from user space: 1. using BPF_MAP_GET_NEXT_KEY bpf subcommand to get elements one by one. 2. using BPF_MAP_LOOKUP_BATCH bp

[PATCH bpf-next v3 11/13] selftests/bpf: add test for bpf array map iterators

2020-07-22 Thread Yonghong Song
Two subtests are added. $ ./test_progs -n 4 ... #4/20 bpf_array_map:OK #4/21 bpf_percpu_array_map:OK ... The bpf_array_map subtest also tested bpf program changing array element values and send key/value to user space through bpf_seq_write() interface. Signed-off-by: Yonghong Song ---

[PATCH bpf-next v3 09/13] tools/bpftool: add bpftool support for bpf map element iterator

2020-07-22 Thread Yonghong Song
The optional parameter "map MAP" can be added to "bpftool iter" command to create a bpf iterator for map elements. For example, bpftool iter pin ./prog.o /sys/fs/bpf/p1 map id 333 For map element bpf iterator "map MAP" parameter is required. Otherwise, bpf link creation will return an error. Qu

[PATCH bpf-next v3 02/13] bpf: refactor to provide aux info to bpf_iter_init_seq_priv_t

2020-07-22 Thread Yonghong Song
This patch refactored target bpf_iter_init_seq_priv_t callback function to accept additional information. This will be needed in later patches for map element targets since a particular map should be passed to traverse elements for that particular map. In the future, other information may be passed

[PATCH 05/26] net: switch copy_bpf_fprog_from_user to sockptr_t

2020-07-22 Thread Christoph Hellwig
Pass a sockptr_t to prepare for set_fs-less handling of the kernel pointer from bpf-cgroup. Signed-off-by: Christoph Hellwig --- include/linux/filter.h | 3 ++- net/core/filter.c | 6 +++--- net/core/sock.c| 6 -- net/packet/af_packet.c | 4 ++-- 4 files changed, 11 insertions(+

[PATCH 03/26] bpfilter: reject kernel addresses

2020-07-22 Thread Christoph Hellwig
The bpfilter user mode helper processes the optval address using process_vm_readv. Don't send it kernel addresses fed under set_fs(KERNEL_DS) as that won't work. Signed-off-by: Christoph Hellwig --- net/bpfilter/bpfilter_kern.c | 4 1 file changed, 4 insertions(+) diff --git a/net/bpfilte

[PATCH 04/26] net: add a new sockptr_t type

2020-07-22 Thread Christoph Hellwig
Add a uptr_t type that can hold a pointer to either a user or kernel memory region, and simply helpers to copy to and from it. Signed-off-by: Christoph Hellwig --- include/linux/sockptr.h | 104 1 file changed, 104 insertions(+) create mode 100644 includ

[PATCH 09/26] net/xfrm: switch xfrm_user_policy to sockptr_t

2020-07-22 Thread Christoph Hellwig
Pass a sockptr_t to prepare for set_fs-less handling of the kernel pointer from bpf-cgroup. Signed-off-by: Christoph Hellwig --- include/net/xfrm.h | 8 +--- net/ipv4/ip_sockglue.c | 3 ++- net/ipv6/ipv6_sockglue.c | 3 ++- net/xfrm/xfrm_state.c| 6 +++--- 4 files changed, 12 ins

[PATCH 07/26] net: switch sock_set_timeout to sockptr_t

2020-07-22 Thread Christoph Hellwig
Pass a sockptr_t to prepare for set_fs-less handling of the kernel pointer from bpf-cgroup. Signed-off-by: Christoph Hellwig --- net/core/sock.c | 15 +-- 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/net/core/sock.c b/net/core/sock.c index 5b55bc9397f282..8b9eddaff86

[PATCH 01/26] bpfilter: fix up a sparse annotation

2020-07-22 Thread Christoph Hellwig
The __user doesn't make sense when casting to an integer type, just switch to a uintptr_t cast which also removes the need for the __force. Signed-off-by: Christoph Hellwig --- net/bpfilter/bpfilter_kern.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/net/bpfilter/bpfilter_

[PATCH 08/26] net: switch sock_set_timeout to sockptr_t

2020-07-22 Thread Christoph Hellwig
Pass a sockptr_t to prepare for set_fs-less handling of the kernel pointer from bpf-cgroup. Signed-off-by: Christoph Hellwig --- include/net/sock.h | 3 ++- net/core/sock.c | 26 -- net/mptcp/protocol.c | 6 -- net/socket.c | 3 ++- 4 files changed,

[PATCH 02/26] net/bpfilter: split __bpfilter_process_sockopt

2020-07-22 Thread Christoph Hellwig
Split __bpfilter_process_sockopt into a low-level send request routine and the actual setsockopt hook to split the init time ping from the actual setsockopt processing. Signed-off-by: Christoph Hellwig --- net/bpfilter/bpfilter_kern.c | 51 +++- 1 file changed, 27

get rid of the address_space override in setsockopt v2

2020-07-22 Thread Christoph Hellwig
Hi Dave, setsockopt is the last place in architecture-independ code that still uses set_fs to force the uaccess routines to operate on kernel pointers. This series adds a new sockptr_t type that can contained either a kernel or user pointer, and which has accessors that do the right thing, and th

[PATCH 13/26] bpfilter: switch bpfilter_ip_set_sockopt to sockptr_t

2020-07-22 Thread Christoph Hellwig
This is mostly to prepare for cleaning up the callers, as bpfilter by design can't handle kernel pointers. Signed-off-by: Christoph Hellwig --- include/linux/bpfilter.h | 6 +++--- net/bpfilter/bpfilter_kern.c | 6 +++--- net/ipv4/bpfilter/sockopt.c | 8 net/ipv4/ip_sockglue.c

[PATCH 11/26] netfilter: switch xt_copy_counters to sockptr_t

2020-07-22 Thread Christoph Hellwig
Pass a sockptr_t to prepare for set_fs-less handling of the kernel pointer from bpf-cgroup. Signed-off-by: Christoph Hellwig --- include/linux/netfilter/x_tables.h | 4 ++-- net/ipv4/netfilter/arp_tables.c| 7 +++ net/ipv4/netfilter/ip_tables.c | 7 +++ net/ipv6/netfilter/ip6_

[PATCH 12/26] netfilter: switch nf_setsockopt to sockptr_t

2020-07-22 Thread Christoph Hellwig
Pass a sockptr_t to prepare for set_fs-less handling of the kernel pointer from bpf-cgroup. Signed-off-by: Christoph Hellwig --- include/linux/netfilter.h | 6 -- net/bridge/netfilter/ebtables.c | 37 +++-- net/decnet/af_decnet.c | 3 ++- net/ipv4

[PATCH 20/26] net/ipv6: factor out a ipv6_set_opt_hdr helper

2020-07-22 Thread Christoph Hellwig
Factour out a helper to set the IPv6 option headers from do_ipv6_setsockopt. Signed-off-by: Christoph Hellwig --- net/ipv6/ipv6_sockglue.c | 150 +++ 1 file changed, 75 insertions(+), 75 deletions(-) diff --git a/net/ipv6/ipv6_sockglue.c b/net/ipv6/ipv6_sockg

[PATCH 21/26] net/ipv6: switch do_ipv6_setsockopt to sockptr_t

2020-07-22 Thread Christoph Hellwig
Pass a sockptr_t to prepare for set_fs-less handling of the kernel pointer from bpf-cgroup. Signed-off-by: Christoph Hellwig --- net/ipv6/ipv6_sockglue.c | 66 1 file changed, 33 insertions(+), 33 deletions(-) diff --git a/net/ipv6/ipv6_sockglue.c b/net/

[PATCH 16/26] net/ipv4: switch do_ip_setsockopt to sockptr_t

2020-07-22 Thread Christoph Hellwig
Pass a sockptr_t to prepare for set_fs-less handling of the kernel pointer from bpf-cgroup. Signed-off-by: Christoph Hellwig --- net/ipv4/ip_sockglue.c | 68 -- 1 file changed, 33 insertions(+), 35 deletions(-) diff --git a/net/ipv4/ip_sockglue.c b/net/ip

[PATCH 19/26] net/ipv6: switch ipv6_flowlabel_opt to sockptr_t

2020-07-22 Thread Christoph Hellwig
Pass a sockptr_t to prepare for set_fs-less handling of the kernel pointer from bpf-cgroup. Note that the get case is pretty weird in that it actually copies data back to userspace from setsockopt. Signed-off-by: Christoph Hellwig --- include/net/ipv6.h | 2 +- net/ipv6/ip6_flowlabel.c |

Re: [RFC 2/7] ath10k: Add support to process rx packet in thread

2020-07-22 Thread Rajkumar Manoharan
On 2020-07-22 06:00, Felix Fietkau wrote: On 2020-07-22 14:55, Johannes Berg wrote: On Wed, 2020-07-22 at 14:27 +0200, Felix Fietkau wrote: I'm considering testing a different approach (with mt76 initially): - Add a mac80211 rx function that puts processed skbs into a list instead of handing t

[PATCH 17/26] net/ipv6: switch ip6_mroute_setsockopt to sockptr_t

2020-07-22 Thread Christoph Hellwig
Pass a sockptr_t to prepare for set_fs-less handling of the kernel pointer from bpf-cgroup. Signed-off-by: Christoph Hellwig --- include/linux/mroute6.h | 8 net/ipv6/ip6mr.c | 17 + net/ipv6/ipv6_sockglue.c | 3 ++- 3 files changed, 15 insertions(+), 13 delet

[PATCH 22/26] net/udp: switch udp_lib_setsockopt to sockptr_t

2020-07-22 Thread Christoph Hellwig
Pass a sockptr_t to prepare for set_fs-less handling of the kernel pointer from bpf-cgroup. Signed-off-by: Christoph Hellwig --- include/net/udp.h | 2 +- net/ipv4/udp.c| 7 --- net/ipv6/udp.c| 3 ++- 3 files changed, 7 insertions(+), 5 deletions(-) diff --git a/include/net/udp.h b/

[PATCH 15/26] net/ipv4: merge ip_options_get and ip_options_get_from_user

2020-07-22 Thread Christoph Hellwig
Use the sockptr_t type to merge the versions. Signed-off-by: Christoph Hellwig --- include/net/ip.h | 5 ++--- net/ipv4/ip_options.c | 43 +++--- net/ipv4/ip_sockglue.c | 7 --- 3 files changed, 17 insertions(+), 38 deletions(-) diff --git a/incl

[PATCH 23/26] net/tcp: switch ->md5_parse to sockptr_t

2020-07-22 Thread Christoph Hellwig
Pass a sockptr_t to prepare for set_fs-less handling of the kernel pointer from bpf-cgroup. Signed-off-by: Christoph Hellwig --- include/net/tcp.h | 2 +- net/ipv4/tcp.c | 3 ++- net/ipv4/tcp_ipv4.c | 4 ++-- net/ipv6/tcp_ipv6.c | 4 ++-- 4 files changed, 7 insertions(+), 6 deletions(-)

[PATCH 24/26] net/tcp: switch do_tcp_setsockopt to sockptr_t

2020-07-22 Thread Christoph Hellwig
Pass a sockptr_t to prepare for set_fs-less handling of the kernel pointer from bpf-cgroup. Signed-off-by: Christoph Hellwig --- net/ipv4/tcp.c | 34 -- 1 file changed, 16 insertions(+), 18 deletions(-) diff --git a/net/ipv4/tcp.c b/net/ipv4/tcp.c index 49bf15c27

[PATCH 25/26] net: pass a sockptr_t into ->setsockopt

2020-07-22 Thread Christoph Hellwig
Rework the remaining setsockopt code to pass a sockptr_t instead of a plain user pointer. This removes the last remaining set_fs(KERNEL_DS) outside of architecture specific code. Signed-off-by: Christoph Hellwig Acked-by: Stefan Schmidt [ieee802154] --- crypto/af_alg.c

[PATCH 18/26] net/ipv6: split up ipv6_flowlabel_opt

2020-07-22 Thread Christoph Hellwig
Split ipv6_flowlabel_opt into a subfunction for each action and a small wrapper. Signed-off-by: Christoph Hellwig --- net/ipv6/ip6_flowlabel.c | 311 +-- 1 file changed, 167 insertions(+), 144 deletions(-) diff --git a/net/ipv6/ip6_flowlabel.c b/net/ipv6/ip6_

[PATCH 26/26] net: optimize the sockptr_t for unified kernel/user address spaces

2020-07-22 Thread Christoph Hellwig
For architectures like x86 and arm64 we don't need the separate bit to indicate that a pointer is a kernel pointer as the address spaces are unified. That way the sockptr_t can be reduced to a union of two pointers, which leads to nicer calling conventions. The only caveat is that we need to chec

[PATCH 10/26] netfilter: remove the unused user argument to do_update_counters

2020-07-22 Thread Christoph Hellwig
Signed-off-by: Christoph Hellwig --- net/bridge/netfilter/ebtables.c | 9 - 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/net/bridge/netfilter/ebtables.c b/net/bridge/netfilter/ebtables.c index fe13108af1f542..12f8929667bf43 100644 --- a/net/bridge/netfilter/ebtables.c +++

[PATCH 06/26] net: switch sock_setbindtodevice to sockptr_t

2020-07-22 Thread Christoph Hellwig
Pass a sockptr_t to prepare for set_fs-less handling of the kernel pointer from bpf-cgroup. Signed-off-by: Christoph Hellwig --- net/core/sock.c | 7 +++ 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/net/core/sock.c b/net/core/sock.c index 71fc7e4ddd0648..5b55bc9397f282 10064

[PATCH 14/26] net/ipv4: switch ip_mroute_setsockopt to sockptr_t

2020-07-22 Thread Christoph Hellwig
Pass a sockptr_t to prepare for set_fs-less handling of the kernel pointer from bpf-cgroup. Signed-off-by: Christoph Hellwig --- include/linux/mroute.h | 5 +++-- net/ipv4/ip_sockglue.c | 3 ++- net/ipv4/ipmr.c| 14 +++--- 3 files changed, 12 insertions(+), 10 deletions(-) dif

Re: [PATCH v4 bpf-next 2/4] bpf: fail PERF_EVENT_IOC_SET_BPF when bpf_get_[stack|stackid] cannot work

2020-07-22 Thread Alexei Starovoitov
On Wed, Jul 22, 2020 at 11:42:08AM -0700, Song Liu wrote: > diff --git a/kernel/events/core.c b/kernel/events/core.c > index 856d98c36f562..f77d009fcce95 100644 > --- a/kernel/events/core.c > +++ b/kernel/events/core.c > @@ -9544,6 +9544,24 @@ static int perf_event_set_bpf_handler(struct > perf_ev

Re: [PATCH bpf-next v2 01/13] bpf: refactor bpf_iter_reg to have separate seq_info member

2020-07-22 Thread Yonghong Song
On 7/22/20 10:38 PM, Alexei Starovoitov wrote: On Wed, Jul 22, 2020 at 11:49:45AM -0700, Yonghong Song wrote: diff --git a/kernel/bpf/map_iter.c b/kernel/bpf/map_iter.c index 8a7af11b411f..5812dd465c49 100644 --- a/kernel/bpf/map_iter.c +++ b/kernel/bpf/map_iter.c @@ -85,17 +85,21 @@ static c

RE: [PATCH devicetree 3/4] powerpc: dts: t1040rdb: put SGMII PHY under &mdio0 label

2020-07-22 Thread Madalin Bucur (OSS)
> -Original Message- > From: Vladimir Oltean > Sent: Wednesday, July 22, 2020 8:24 PM > To: robh...@kernel.org; shawn...@kernel.org; m...@ellerman.id.au; > devicet...@vger.kernel.org > Cc: b...@kernel.crashing.org; pau...@samba.org; linuxppc- > d...@lists.ozlabs.org; linux-ker...@vger.kern

Re: [PATCH bpf-next v2 01/13] bpf: refactor bpf_iter_reg to have separate seq_info member

2020-07-22 Thread Alexei Starovoitov
On Wed, Jul 22, 2020 at 11:49:45AM -0700, Yonghong Song wrote: > diff --git a/kernel/bpf/map_iter.c b/kernel/bpf/map_iter.c > index 8a7af11b411f..5812dd465c49 100644 > --- a/kernel/bpf/map_iter.c > +++ b/kernel/bpf/map_iter.c > @@ -85,17 +85,21 @@ static const struct seq_operations bpf_map_seq_ops

Re: [PATCH bpf-next 0/2] Fix BPF socket lookup with reuseport groups with connections

2020-07-22 Thread Alexei Starovoitov
On Wed, Jul 22, 2020 at 9:59 AM Kuniyuki Iwashima wrote: > > From: Jakub Sitnicki > Date: Wed, 22 Jul 2020 18:17:18 +0200 > > This mini series contains a fix for a bug noticed when analyzing a reported > > merge conflict between bpf-next and net tree [0]. > > > > Apart from fixing a corner-ca

Re: [PATCH bpf-next] tools/bpftool: strip BPF .o files before skeleton generation

2020-07-22 Thread Alexei Starovoitov
On Wed, Jul 22, 2020 at 1:21 AM Quentin Monnet wrote: > > On 22/07/2020 05:38, Andrii Nakryiko wrote: > > Strip away DWARF info from .bpf.o files, before generating BPF skeletons. > > This reduces bpftool binary size from 3.43MB to 2.58MB. > > > > Signed-off-by: Andrii Nakryiko > Acked-by: Quenti

Re: [RFC PATCH] net: dsa: microchip: delete dead code

2020-07-22 Thread Helmut Grohne
Hi Andrew, On Wed, Jul 22, 2020 at 04:39:53PM +0200, Andrew Lunn wrote: > This patch probably is correct. But it is not obviously correct, > because there are so many changes at once. Please could you break it > up. >From my pov, it is less a question of whether it is correct, but whether it goes

Re: [PATCH V3 3/6] vDPA: implement vq IRQ allocate/free helpers in vDPA core

2020-07-22 Thread Jason Wang
On 2020/7/22 下午6:08, Zhu Lingshan wrote: +/* + * Request irq for a vq, setup irq offloading if its a vhost_vdpa vq. + * This function should be only called through setting virtio DRIVER_OK. + * If you want to request irq during probe, you should use raw APIs + * like request_irq() or devm_reque

RE: [EXT] Re: [PATCH v3 2/2] net: dsa: ocelot: Add support for QinQ Operation

2020-07-22 Thread Hongbo Wang
> Instead of writing a long email, let me just say this. > I ran your commands on 2 random network cards (not ocelot/felix ports). > They don't produce the same results as you. In fact, no frame with VLAN > 111 C-TAG is forwarded (or received) at all by the bridge, not to mention that > no VLAN 100

[PATCH 4/4] net: dsa: mv88e6xxx: Use chip-wide max frame size for MTU

2020-07-22 Thread Chris Packham
Some of the chips in the mv88e6xxx family don't support jumbo configuration per port. But they do have a chip-wide max frame size that can be used. Use this to approximate the behaviour of configuring a port based MTU. Signed-off-by: Chris Packham --- The only hardware I have access to uses a 88

[PATCH 0/4] net: dsa: mv88e6xxx: port mtu support

2020-07-22 Thread Chris Packham
This series connects up the mv88e6xxx switches to the dsa infrastructure for configuring the port MTU. The first patch is also a bug fix which might be a candiatate for stable. Chris Packham (4): net: dsa: mv88e6xxx: MV88E6097 does not support jumbo configuration net: dsa: mv88e6xxx: Support j

[PATCH 2/4] net: dsa: mv88e6xxx: Support jumbo configuration on 6190/6190X

2020-07-22 Thread Chris Packham
The MV88E6190 and MV88E6190X both support per port jumbo configuration just like the other GE switches. Install the appropriate ops. Signed-off-by: Chris Packham --- I'm including this change in my series for completeness. Looking at the datasheets I think this is an unintentional omission but I

[PATCH 3/4] net: dsa: mv88e6xxx: Implement .port_change_mtu/.port_max_mtu

2020-07-22 Thread Chris Packham
Add implementations for the mv88e6xxx switches to connect with the generic dsa operations for configuring the port MTU. Signed-off-by: Chris Packham --- drivers/net/dsa/mv88e6xxx/chip.c | 26 ++ 1 file changed, 26 insertions(+) diff --git a/drivers/net/dsa/mv88e6xxx/chip

[PATCH 1/4] net: dsa: mv88e6xxx: MV88E6097 does not support jumbo configuration

2020-07-22 Thread Chris Packham
The MV88E6097 chip does not support configuring jumbo frames. Prior to commit 5f430d65 only the 6352, 6351, 6165 and 6320 chips configured jumbo mode. The refactor accidentally added the function for the 6097. Remove the erroneous function pointer assignment. Fixes: 5f430d65 ("net: dsa: mv

Re: [RFC 11/11] scsi: storvsc: Support PAGE_SIZE larger than 4K

2020-07-22 Thread Boqun Feng
On Thu, Jul 23, 2020 at 02:26:00AM +, Michael Kelley wrote: > From: boqun.f...@gmail.com Sent: Wednesday, July 22, > 2020 6:52 PM > > > > On Thu, Jul 23, 2020 at 12:13:07AM +, Michael Kelley wrote: > > > From: Boqun Feng Sent: Monday, July 20, 2020 6:42 > > > PM > > > > > > > > Hyper-V

Re: [PATCH v3] cxgb4: add missing release on skb in uld_send()

2020-07-22 Thread David Miller
From: Navid Emamdoost Date: Wed, 22 Jul 2020 21:58:39 -0500 > In the implementation of uld_send(), the skb is consumed on all > execution paths except one. Release skb when returning NET_XMIT_DROP. > > Signed-off-by: Navid Emamdoost Applied, thank you.

[PATCH v3] cxgb4: add missing release on skb in uld_send()

2020-07-22 Thread Navid Emamdoost
In the implementation of uld_send(), the skb is consumed on all execution paths except one. Release skb when returning NET_XMIT_DROP. Signed-off-by: Navid Emamdoost --- v3: - fixed the base problem, and used kfree_skb --- drivers/net/ethernet/chelsio/cxgb4/sge.c | 1 + 1 file changed, 1

Re: [PATCH net] openvswitch: fix drop over mtu packet after defrag in act_ct

2020-07-22 Thread wenxu
Hi paulb & Pravin, Could you review for this patch> Thanks. BR wenxu On 7/21/2020 11:09 AM, we...@ucloud.cn wrote: > From: wenxu > > When openvswitch conntrack offload with act_ct action. Fragment packets > defrag in the ingress tc act_ct action and miss the next chain. Then the > packet pas

Re: [PATCH net-next] Documentation: networking: Clarify switchdev devices behavior

2020-07-22 Thread Randy Dunlap
Hi, This mostly looks good to me. I have a few edits below. On 7/22/20 3:52 PM, Florian Fainelli wrote: > This patch provides details on the expected behavior of switchdev > enabled network devices when operating in a "stand alone" mode, as well > as when being bridge members. This clarifies a n

RE: [RFC 11/11] scsi: storvsc: Support PAGE_SIZE larger than 4K

2020-07-22 Thread Michael Kelley
From: boqun.f...@gmail.com Sent: Wednesday, July 22, 2020 6:52 PM > > On Thu, Jul 23, 2020 at 12:13:07AM +, Michael Kelley wrote: > > From: Boqun Feng Sent: Monday, July 20, 2020 6:42 PM > > > > > > Hyper-V always use 4k page size (HV_HYP_PAGE_SIZE), so when > > > communicating with Hyper-V

Re: linux-next: manual merge of the bpf-next tree with the net tree

2020-07-22 Thread Stephen Rothwell
Hi all, On Wed, 22 Jul 2020 13:21:43 +1000 Stephen Rothwell wrote: > > Today's linux-next merge of the bpf-next tree got conflicts in: > > net/ipv4/udp.c > net/ipv6/udp.c > > between commit: > > efc6b6f6c311 ("udp: Improve load balancing for SO_REUSEPORT.") > > from the net tree and co

linux-next: manual merge of the net-next tree with the net tree

2020-07-22 Thread Stephen Rothwell
Hi all, Today's linux-next merge of the net-next tree got a conflict in: drivers/net/netdevsim/netdev.c between commit: 2c9d8e01f0c6 ("netdevsim: fix unbalaced locking in nsim_create()") from the net tree and commit: 424be63ad831 ("netdevsim: add UDP tunnel port offload support") from

答复: [PATCH,v2] ipvlan: add the check of ip header checksum

2020-07-22 Thread Guodeqing (A)
Because ipvlan will do the ip forward, it will do a route lookup.if the ihl of the ip header is smaller than 5, this cause ip_fast_csum access the illegal address. -邮件原件- 发件人: Eric Dumazet [mailto:eduma...@google.com] 发送时间: Thursday, July 23, 2020 0:30 收件人: Guodeqing (A) 抄送: David Mill

答复: [PATCH,v2] ipvlan: add the check of ip header checksum

2020-07-22 Thread Guodeqing (A)
I am sorry, the mail is not sent to you directly; If do the following test,this will cause a panic in a arm64 VM. this can be reproduced easily. Linux osc 5.8.0-rc6+ #3 SMP Thu Jul 23 01:40:47 UTC 2020 aarch64 The programs included with the Debian GNU/Linux system are free software; the exact

[Patch net] geneve: fix an uninitialized value in geneve_changelink()

2020-07-22 Thread Cong Wang
geneve_nl2info() sets 'df' conditionally, so we have to initialize it by copying the value from existing geneve device in geneve_changelink(). Fixes: 56c09de347e4 ("geneve: allow changing DF behavior after creation") Reported-by: syzbot+7ebc2e088af5e4c0c...@syzkaller.appspotmail.com Cc: Sabrina Du

[PATCH v3 bpf-next] fold test_current_pid_tgid_new_ns into test_progs.

2020-07-22 Thread Carlos Neira
Changes from V2: - Test not creating a new namespace has been included in test_progs. - Test creating a new pid namespace has been added as a standalone test. Signed-off-by: Carlos Neira --- tools/testing/selftests/bpf/.gitignore| 2 +- tools/testing/selftests/bpf/Makefile |

Re: [RFC 11/11] scsi: storvsc: Support PAGE_SIZE larger than 4K

2020-07-22 Thread boqun . feng
On Thu, Jul 23, 2020 at 12:13:07AM +, Michael Kelley wrote: > From: Boqun Feng Sent: Monday, July 20, 2020 6:42 PM > > > > Hyper-V always use 4k page size (HV_HYP_PAGE_SIZE), so when > > communicating with Hyper-V, a guest should always use HV_HYP_PAGE_SIZE > > as the unit for page related da

Re: [PATCH][next] net: qed_hsi.h: Avoid the use of one-element array

2020-07-22 Thread Gustavo A. R. Silva
On 7/22/20 20:13, David Miller wrote: > From: "Gustavo A. R. Silva" > Date: Wed, 22 Jul 2020 13:58:52 -0500 > >> One-element arrays are being deprecated[1]. Replace the one-element >> array with a simple value type '__le32 reserved1'[2], once it seems >> this is just a placeholder for alignmen

Re: [RFC 09/11] HID: hyperv: Make ringbuffer at least take two pages

2020-07-22 Thread boqun . feng
On Wed, Jul 22, 2020 at 11:36:15PM +, Michael Kelley wrote: > From: Boqun Feng Sent: Monday, July 20, 2020 6:42 PM > > > > When PAGE_SIZE > HV_HYP_PAGE_SIZE, we need the ringbuffer size to be at > > least 2 * PAGE_SIZE: one page for the header and at least one page of > > the data part (becau

Re: [PATCH v2 net-next 00/15] qed, qede: improve chain API and add XDP_REDIRECT support

2020-07-22 Thread David Miller
From: Alexander Lobakin Date: Thu, 23 Jul 2020 01:10:30 +0300 > This series adds missing XDP_REDIRECT case handling in QLogic Everest > Ethernet driver with all necessary prerequisites and ops. > QEDE Tx relies heavily on chain API, so make sure it is in its best > at first. > > v2 (from [1]): >

Re: [PATCH net] net: atlantic: fix PTP on AQC10X

2020-07-22 Thread David Miller
From: Mark Starovoytov Date: Wed, 22 Jul 2020 22:09:58 +0300 > From: Egor Pomozov > > This patch fixes PTP on AQC10X. > PTP support on AQC10X requires FW involvement and FW configures the > TPS data arb mode itself. > So we must make sure driver doesn't touch TPS data arb mode on AQC10x > if PT

Re: [PATCH v2] cxgb4: add missing release on skb in uld_send()

2020-07-22 Thread David Miller
From: Navid Emamdoost Date: Wed, 22 Jul 2020 13:57:21 -0500 > In the implementation of uld_send(), the skb is consumed on all > execution paths except one. Release skb when returning NET_XMIT_DROP. > > Signed-off-by: Navid Emamdoost > --- > changes in v2: > - using kfree_skb() based on Da

Re: [PATCH][next] net: qed_hsi.h: Avoid the use of one-element array

2020-07-22 Thread David Miller
From: "Gustavo A. R. Silva" Date: Wed, 22 Jul 2020 13:58:52 -0500 > One-element arrays are being deprecated[1]. Replace the one-element > array with a simple value type '__le32 reserved1'[2], once it seems > this is just a placeholder for alignment. > > [1] https://github.com/KSPP/linux/issues/7

Re: [PATCH][next] bna: bfi.h: Avoid the use of one-element array

2020-07-22 Thread David Miller
From: "Gustavo A. R. Silva" Date: Wed, 22 Jul 2020 13:50:24 -0500 > One-element arrays are being deprecated[1]. Replace the one-element > array with a simple value type 'u8 rsvd'[2], once it seems this is > just a placeholder for alignment. > > [1] https://github.com/KSPP/linux/issues/79 > [2] h

Re: [PATCH][next] tg3: Avoid the use of one-element array

2020-07-22 Thread David Miller
From: "Gustavo A. R. Silva" Date: Wed, 22 Jul 2020 13:43:58 -0500 > One-element arrays are being deprecated[1]. Replace the one-element > array with a simple value type 'u32 reserved2'[2], once it seems > this is just a placeholder for alignment. > > [1] https://github.com/KSPP/linux/issues/79 >

Re: [PATCH][next] ionic: fix memory leak of object 'lid'

2020-07-22 Thread David Miller
From: Colin King Date: Wed, 22 Jul 2020 18:40:03 +0100 > From: Colin Ian King > > Currently when netdev fails to allocate the error return path > fails to free the allocated object 'lid'. Fix this by setting > err to the return error code and jumping to a new label that > performs the kfree of

Re: [PATCH v2 net-next 00/10] l2tp: cleanup checkpatch.pl warnings

2020-07-22 Thread David Miller
From: Tom Parkin Date: Wed, 22 Jul 2020 17:32:04 +0100 > l2tp hasn't been kept up to date with the static analysis checks offered > by checkpatch.pl. > > This series addresses a range of minor issues which don't involve large > changes to code structure. The changes include: > > * tweaks to u

Re: [Linux-kernel-mentees] [PATCH net] AX.25: Prevent out-of-bounds read in ax25_sendmsg()

2020-07-22 Thread David Miller
From: Peilin Ye Date: Wed, 22 Jul 2020 12:05:12 -0400 > Checks on `addr_len` and `usax->sax25_ndigis` are insufficient. > ax25_sendmsg() can go out of bounds when `usax->sax25_ndigis` equals to 7 > or 8. Fix it. > > It is safe to remove `usax->sax25_ndigis > AX25_MAX_DIGIS`, since > `addr_len` i

Re: [PATCH net-next] devlink: Always use user_ptr[0] for devlink and simplify post_doit

2020-07-22 Thread David Miller
From: Parav Pandit Date: Wed, 22 Jul 2020 18:57:11 +0300 > Currently devlink instance is searched on all doit() operations. > But it is optionally stored into user_ptr[0]. This requires > rediscovering devlink again doing post_doit(). > > Few devlink commands related to port shared buffers needs

Re: [net-next 1/5] ice: add the virtchnl handler for AdminQ command

2020-07-22 Thread Jakub Kicinski
On Thu, 23 Jul 2020 00:37:29 + Venkataramanan, Anirudh wrote: > Can you please clarify how you (and the community) define bifurcated > driver? No amount of clarification from me will change the fact that you need this for DPDK.

Re: [PATCH net 0/2] sctp: shrink stream outq in the right place

2020-07-22 Thread David Miller
From: Xin Long Date: Wed, 22 Jul 2020 23:52:10 +0800 > Patch 1 is an improvement, and Patch 2 is a bug fix. Series applied, and queued up for -stable, thank you.

[PATCH v2 bpf-next 8/9] bpf: selftests: tcp header options

2020-07-22 Thread Martin KaFai Lau
This patch adds tests for the new bpf tcp header option feature. test_tcp_hdr_options.c: - It tests header option writing and parsing in 3WHS, normal regular connection establishment, fastopen, and syncookie. - In syncookie, the passive side's bpf prog is asking the active side to resend its

[PATCH v2 bpf-next 9/9] tcp: bpf: Optionally store mac header in TCP_SAVE_SYN

2020-07-22 Thread Martin KaFai Lau
This patch is adapted from Eric's patch in an earlier discussion [1]. The TCP_SAVE_SYN currently only stores the network header and tcp header. This patch allows it to optionally store the mac header also if the setsockopt's optval is 2. It requires one more bit for the "save_syn" bit field in t

[PATCH v2 bpf-next 4/9] tcp: Add unknown_opt arg to tcp_parse_options

2020-07-22 Thread Martin KaFai Lau
In the latter patch, the bpf prog only wants to be called to handle a header option if that particular header option cannot be handled by the kernel. This unknown option could be written by the peer's bpf-prog. It could also be a new standard option that the running kernel does not support it whil

[PATCH v2 bpf-next 7/9] bpf: selftests: Add fastopen_connect to network_helpers

2020-07-22 Thread Martin KaFai Lau
This patch adds a fastopen_connect() helper which will be used in a latter test. Signed-off-by: Martin KaFai Lau --- tools/testing/selftests/bpf/network_helpers.c | 37 +++ tools/testing/selftests/bpf/network_helpers.h | 2 + 2 files changed, 39 insertions(+) diff --git a/tools

[PATCH v2 bpf-next 5/9] bpf: sock_ops: Change some members of sock_ops_kern from u32 to u8

2020-07-22 Thread Martin KaFai Lau
A latter patch needs to add a few pointers and a few u8 to sock_ops_kern. Hence, this patch saves some spaces by moving some of the existing members from u32 to u8 so that the latter patch can still fit everything in a cacheline. Signed-off-by: Martin KaFai Lau --- include/linux/filter.h | 4 +

[PATCH v2 bpf-next 3/9] tcp: bpf: Add TCP_BPF_RTO_MIN for bpf_setsockopt

2020-07-22 Thread Martin KaFai Lau
This patch adds bpf_setsockopt(TCP_BPF_RTO_MIN) to allow bpf prog to set the min rto of a connection. It could be used together with the earlier patch which has added bpf_setsockopt(TCP_BPF_DELACK_MAX). A latter seltest patch will communicate the max delay ack in a bpf tcp header option and then

[PATCH v2 bpf-next 2/9] tcp: bpf: Add TCP_BPF_DELACK_MAX setsockopt

2020-07-22 Thread Martin KaFai Lau
This change is mostly from an internal patch and adapts it from sysctl config to the bpf_setsockopt setup. The bpf_prog can set the max delay ack by using bpf_setsockopt(TCP_BPF_DELACK_MAX). This max delay ack can be communicated to its peer through bpf header option. The receiving peer can then

[PATCH v2 bpf-next 6/9] bpf: tcp: Allow bpf prog to write and parse TCP header option

2020-07-22 Thread Martin KaFai Lau
The earlier effort in BPF-TCP-CC allows the TCP Congestion Control algorithm to be written in BPF. It opens up opportunities to allow a faster turnaround time in testing/releasing new congestion control ideas to production environment. The same flexibility can be extended to writing TCP header op

[PATCH v2 bpf-next 1/9] tcp: Use a struct to represent a saved_syn

2020-07-22 Thread Martin KaFai Lau
The TCP_SAVE_SYN has both the network header and tcp header. The total length of the saved syn packet is currently stored in the first 4 bytes (u32) of an array and the actual packet data is stored after that. A latter patch will add a bpf helper that allows to get the tcp header alone from the sa

[PATCH v2 bpf-next 0/9] BPF TCP header options

2020-07-22 Thread Martin KaFai Lau
The earlier effort in BPF-TCP-CC allows the TCP Congestion Control algorithm to be written in BPF. It opens up opportunities to allow a faster turnaround time in testing/releasing new congestion control ideas to production environment. The same flexibility can be extended to writing TCP header op

Re: [PATCH v6] hv_netvsc: add support for vlans in AF_PACKET mode

2020-07-22 Thread David Miller
From: Sriram Krishnan Date: Wed, 22 Jul 2020 21:08:44 +0530 > Vlan tagged packets are getting dropped when used with DPDK that uses > the AF_PACKET interface on a hyperV guest. > > The packet layer uses the tpacket interface to communicate the vlans > information to the upper layers. On Rx path,

Re: [PATCH net-next] mptcp: zero token hash at creation time.

2020-07-22 Thread David Miller
From: Paolo Abeni Date: Wed, 22 Jul 2020 17:20:50 +0200 > Otherwise the 'chain_len' filed will carry random values, > some token creation calls will fail due to excessive chain > length, causing unexpected fallback to TCP. > > Fixes: 2c5ebd001d4f ("mptcp: refactor token container") > Reviewed-by

Re: [Linux-kernel-mentees] [PATCH net] AX.25: Fix out-of-bounds read in ax25_connect()

2020-07-22 Thread David Miller
From: Peilin Ye Date: Wed, 22 Jul 2020 11:19:01 -0400 > Checks on `addr_len` and `fsa->fsa_ax25.sax25_ndigis` are insufficient. > ax25_connect() can go out of bounds when `fsa->fsa_ax25.sax25_ndigis` > equals to 7 or 8. Fix it. > > This issue has been reported as a KMSAN uninit-value bug, becaus

  1   2   3   4   5   >