Re: [RFC PATCH v2 15/21] net/tcp: add MSG_NETDMA flag for sendmsg()

2020-07-27 Thread Christoph Hellwig
On Mon, Jul 27, 2020 at 07:17:51PM -0700, Eric Dumazet wrote: > > The thing is, the existing zero copy code is zero-copy to /host/ memory, > > which is not the same thing as zero-copy to other memory areas. > > You have to really explain what difference it makes, and why current > stuff can not be

[PATCH] usb: hso: check for return value in hso_serial_common_create()

2020-07-27 Thread Rustam Kovhaev
in case of an error tty_register_device_attr() returns ERR_PTR(), add IS_ERR() check Reported-and-tested-by: syzbot+67b2bd0e34f952d03...@syzkaller.appspotmail.com Link: https://syzkaller.appspot.com/bug?extid=67b2bd0e34f952d0321e Signed-off-by: Rustam Kovhaev --- drivers/net/usb/hso.c | 5 -

Re: [RFC PATCH v2 21/21] netgpu/nvidia: add Nvidia plugin for netgpu

2020-07-27 Thread Christoph Hellwig
On Mon, Jul 27, 2020 at 06:48:12PM -0700, Jonathan Lemon wrote: > I'm aware that Nvidia code is maintained outside the tree, so this last > patch may better placed there; I included it here so reviewers can see > how things work. Sorry dude, but with statements like this you really disqualify your

[PATCH] kprobes: fix NULL pointer dereference at kprobe_ftrace_handler

2020-07-27 Thread Muchun Song
We found a case of kernel panic on our server. The stack trace is as follows(omit some irrelevant information): BUG: kernel NULL pointer dereference, address: 0080 RIP: 0010:kprobe_ftrace_handler+0x5e/0xe0 RSP: 0018:b512c6550998 EFLAGS: 00010282 RAX: RBX: f

[PATCH 1/4] netfilter: arp_tables: restore a SPDX identifier

2020-07-27 Thread Christoph Hellwig
This was accidentally removed in an unrelated commit. Fixes: c2f12630c60f ("netfilter: switch nf_setsockopt to sockptr_t") Signed-off-by: Christoph Hellwig --- net/ipv4/netfilter/arp_tables.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/net/ipv4/netfilter/arp_tables.c b/ne

[PATCH 4/4] net: improve the user pointer check in init_user_sockptr

2020-07-27 Thread Christoph Hellwig
Make sure not just the pointer itself but the whole range lies in the user address space. For that pass the length and then use the access_ok helper to do the check. Fixes: 6d04fe15f78a ("net: optimize the sockptr_t for unified kernel/user address spaces") Reported-by: David Laight Signed-off-b

[PATCH 2/4] net: make sockptr_is_null strict aliasing safe

2020-07-27 Thread Christoph Hellwig
While the kernel in general is not strict aliasing safe we can trivially do that in sockptr_is_null without affecting code generation, so always check the actually assigned union member. Reported-by: Jan Engelhardt Signed-off-by: Christoph Hellwig --- include/linux/sockptr.h | 4 +++- 1 file ch

[PATCH 0/4 net-next] sockptr_t fixes

2020-07-27 Thread Christoph Hellwig
Hi Dave, a bunch of fixes for the sockptr_t conversion

[PATCH 3/4] net: remove sockptr_advance

2020-07-27 Thread Christoph Hellwig
sockptr_advance never properly worked. Replace it with _offset variants of copy_from_sockptr and copy_to_sockptr. Fixes: ba423fdaa589 ("net: add a new sockptr_t type") Reported-by: Jason A. Donenfeld Reported-by: Ido Schimmel Signed-off-by: Christoph Hellwig Acked-by: Jason A. Donenfeld Teste

Re: [PATCH] can: m_can: Set device to software init mode before closing

2020-07-27 Thread Faiz Abbas
Hi, On 16/07/20 9:53 am, Faiz Abbas wrote: > There might be some requests pending in the buffer when the > interface close sequence occurs. In some devices, these > pending requests might lead to the module not shutting down > properly when m_can_clk_stop() is called. > > Therefore, move the devi

Re: [Linux-kernel-mentees] [PATCH net v2] xdp: Prevent kernel-infoleak in xsk_getsockopt()

2020-07-27 Thread Song Liu
> On Jul 27, 2020, at 11:13 PM, Björn Töpel wrote: > > On Tue, 28 Jul 2020 at 07:37, Peilin Ye wrote: >> >> xsk_getsockopt() is copying uninitialized stack memory to userspace when >> `extra_stats` is `false`. Fix it. >> >> Fixes: 8aa5a33578e9 ("xsk: Add new statistics") >> Suggested-by: Dan

Re: [PATCH bpf-next v2 34/35] bpf: samples: do not touch RLIMIT_MEMLOCK

2020-07-27 Thread Song Liu
On Mon, Jul 27, 2020 at 12:26 PM Roman Gushchin wrote: > > Since bpf is not using rlimit memlock for the memory accounting > and control, do not change the limit in sample applications. > > Signed-off-by: Roman Gushchin Acked-by: Song Liu > --- [...] > samples/bpf/xdp_rxq_info_user.c | 6

Re: [Linux-kernel-mentees] [PATCH net v2] xdp: Prevent kernel-infoleak in xsk_getsockopt()

2020-07-27 Thread Björn Töpel
On Tue, 28 Jul 2020 at 07:37, Peilin Ye wrote: > > xsk_getsockopt() is copying uninitialized stack memory to userspace when > `extra_stats` is `false`. Fix it. > > Fixes: 8aa5a33578e9 ("xsk: Add new statistics") > Suggested-by: Dan Carpenter > Signed-off-by: Peilin Ye > --- Acked-by: Björn Töpe

Re: [PATCH bpf-next v2 32/35] bpf: selftests: delete bpf_rlimit.h

2020-07-27 Thread Song Liu
> On Jul 27, 2020, at 11:06 PM, Andrii Nakryiko > wrote: > > On Mon, Jul 27, 2020 at 12:25 PM Roman Gushchin wrote: >> >> As rlimit-based memory accounting is not used by bpf anymore, >> there are no more reasons to play with memlock rlimit. >> >> Delete bpf_rlimit.h which contained a code

Re: [PATCH bpf-next v2 35/35] perf: don't touch RLIMIT_MEMLOCK

2020-07-27 Thread Andrii Nakryiko
On Mon, Jul 27, 2020 at 12:21 PM Roman Gushchin wrote: > > Since bpf stopped using memlock rlimit to limit the memory usage, > there is no more reason for perf to alter its own limit. > > Signed-off-by: Roman Gushchin > --- Cc'd Armaldo, but I'm guessing it's a similar situation that latest perf

Re: [PATCH bpf-next v2 33/35] bpf: selftests: don't touch RLIMIT_MEMLOCK

2020-07-27 Thread Andrii Nakryiko
On Mon, Jul 27, 2020 at 12:21 PM Roman Gushchin wrote: > > Since bpf is not using memlock rlimit for memory accounting, > there are no more reasons to bump the limit. > > Signed-off-by: Roman Gushchin > --- Similarly for bench, it's a tool that's not coupled with the latest kernel version, it wi

Re: [PATCH bpf-next v2 32/35] bpf: selftests: delete bpf_rlimit.h

2020-07-27 Thread Andrii Nakryiko
On Mon, Jul 27, 2020 at 12:25 PM Roman Gushchin wrote: > > As rlimit-based memory accounting is not used by bpf anymore, > there are no more reasons to play with memlock rlimit. > > Delete bpf_rlimit.h which contained a code to bump the limit. > > Signed-off-by: Roman Gushchin > --- We run test_

Re: [PATCH bpf-next v2 31/35] bpf: runqslower: don't touch RLIMIT_MEMLOCK

2020-07-27 Thread Andrii Nakryiko
On Mon, Jul 27, 2020 at 12:24 PM Roman Gushchin wrote: > > Since bpf is not using memlock rlimit for memory accounting, > there are no more reasons to bump the limit. > > Signed-off-by: Roman Gushchin > --- > tools/bpf/runqslower/runqslower.c | 16 > 1 file changed, 16 deletions

Re: [PATCH bpf-next v2 27/35] bpf: eliminate rlimit-based memory accounting infra for bpf maps

2020-07-27 Thread Song Liu
On Mon, Jul 27, 2020 at 10:58 PM Andrii Nakryiko wrote: > > On Mon, Jul 27, 2020 at 10:47 PM Song Liu wrote: > > > > On Mon, Jul 27, 2020 at 12:26 PM Roman Gushchin wrote: > > > > > > Remove rlimit-based accounting infrastructure code, which is not used > > > anymore. > > > > > > Signed-off-by:

Re: [PATCH bpf-next v2 30/35] bpf: bpftool: do not touch RLIMIT_MEMLOCK

2020-07-27 Thread Andrii Nakryiko
On Mon, Jul 27, 2020 at 12:21 PM Roman Gushchin wrote: > > Since bpf stopped using memlock rlimit to limit the memory usage, > there is no more reason for bpftool to alter its own limits. > > Signed-off-by: Roman Gushchin > --- This can't be removed either, due to old kernel support. We probably

Re: [PATCH bpf-next v2 30/35] bpf: bpftool: do not touch RLIMIT_MEMLOCK

2020-07-27 Thread Song Liu
On Mon, Jul 27, 2020 at 12:21 PM Roman Gushchin wrote: > > Since bpf stopped using memlock rlimit to limit the memory usage, > there is no more reason for bpftool to alter its own limits. > > Signed-off-by: Roman Gushchin I think we will need feature check for memcg based accounting. Thanks, So

Re: [PATCH bpf-next v2 29/35] bpf: libbpf: cleanup RLIMIT_MEMLOCK usage

2020-07-27 Thread Andrii Nakryiko
On Mon, Jul 27, 2020 at 4:15 PM Roman Gushchin wrote: > > On Mon, Jul 27, 2020 at 03:05:11PM -0700, Andrii Nakryiko wrote: > > On Mon, Jul 27, 2020 at 12:21 PM Roman Gushchin wrote: > > > > > > As bpf is not using memlock rlimit for memory accounting anymore, > > > let's remove the related code f

Re: [PATCH bpf-next v2 27/35] bpf: eliminate rlimit-based memory accounting infra for bpf maps

2020-07-27 Thread Andrii Nakryiko
On Mon, Jul 27, 2020 at 10:47 PM Song Liu wrote: > > On Mon, Jul 27, 2020 at 12:26 PM Roman Gushchin wrote: > > > > Remove rlimit-based accounting infrastructure code, which is not used > > anymore. > > > > Signed-off-by: Roman Gushchin > [...] > > > > static void bpf_map_put_uref(struct bpf_ma

Re: [PATCH bpf-next v2 22/35] bpf: eliminate rlimit-based memory accounting for bpf ringbuffer

2020-07-27 Thread Andrii Nakryiko
On Mon, Jul 27, 2020 at 12:21 PM Roman Gushchin wrote: > > Do not use rlimit-based memory accounting for bpf ringbuffer. > It has been replaced with the memcg-based memory accounting. > > bpf_ringbuf_alloc() can't return anything except ERR_PTR(-ENOMEM) > and a valid pointer, so to simplify the co

Re: [PATCH bpf-next v2 28/35] bpf: eliminate rlimit-based memory accounting for bpf progs

2020-07-27 Thread Song Liu
On Mon, Jul 27, 2020 at 12:21 PM Roman Gushchin wrote: > > Do not use rlimit-based memory accounting for bpf progs. It has been > replaced with memcg-based memory accounting. > > Signed-off-by: Roman Gushchin Acked-by: Song Liu

Re: [PATCH iproute2] tc: Add space after format specifier

2020-07-27 Thread Briana Oursler
On Mon, 2020-07-27 at 22:20 -0700, Briana Oursler wrote: > Add space after format specifier in print_string call. Fixes broken > qdisc tests within tdc testing suite. Per suggestion from Petr > Machata, > remove a space and change spacing in tc/q_event.c to complete the > fix. > > Tested fix in td

Re: linux-next: Tree for Jul 27 (kernel/bpf/syscall.o)

2020-07-27 Thread Andrii Nakryiko
On Mon, Jul 27, 2020 at 11:58 AM Randy Dunlap wrote: > > On 7/27/20 6:23 AM, Stephen Rothwell wrote: > > Hi all, > > > > Changes since 20200724: > > > > on i386: > when CONFIG_XPS is not set/enabled: > > ld: kernel/bpf/syscall.o: in function `__do_sys_bpf': > syscall.c:(.text+0x4482): undefined re

Re: [PATCH bpf-next v2 27/35] bpf: eliminate rlimit-based memory accounting infra for bpf maps

2020-07-27 Thread Song Liu
On Mon, Jul 27, 2020 at 12:26 PM Roman Gushchin wrote: > > Remove rlimit-based accounting infrastructure code, which is not used > anymore. > > Signed-off-by: Roman Gushchin [...] > > static void bpf_map_put_uref(struct bpf_map *map) > @@ -541,7 +484,7 @@ static void bpf_map_show_fdinfo(struct s

Re: [PATCH bpf-next v2 26/35] bpf: eliminate rlimit-based memory accounting for xskmap maps

2020-07-27 Thread Song Liu
On Mon, Jul 27, 2020 at 12:21 PM Roman Gushchin wrote: > > Do not use rlimit-based memory accounting for xskmap maps. > It has been replaced with the memcg-based memory accounting. > > Signed-off-by: Roman Gushchin Acked-by: Song Liu > --- > net/xdp/xskmap.c | 10 +- > 1 file changed

Re: [PATCH bpf-next v2 25/35] bpf: eliminate rlimit-based memory accounting for socket storage maps

2020-07-27 Thread Song Liu
On Mon, Jul 27, 2020 at 12:26 PM Roman Gushchin wrote: > > Do not use rlimit-based memory accounting for socket storage maps. > It has been replaced with the memcg-based memory accounting. > > Signed-off-by: Roman Gushchin Acked-by: Song Liu > --- > net/core/bpf_sk_storage.c | 11 ---

Re: [PATCH bpf-next v2 23/35] bpf: eliminate rlimit-based memory accounting for sockmap and sockhash maps

2020-07-27 Thread Song Liu
On Mon, Jul 27, 2020 at 12:21 PM Roman Gushchin wrote: > > Do not use rlimit-based memory accounting for sockmap and sockhash maps. > It has been replaced with the memcg-based memory accounting. > > Signed-off-by: Roman Gushchin Acked-by: Song Liu > --- > net/core/sock_map.c | 33 ++--

Re: [PATCH bpf-next v2 24/35] bpf: eliminate rlimit-based memory accounting for stackmap maps

2020-07-27 Thread Song Liu
On Mon, Jul 27, 2020 at 12:22 PM Roman Gushchin wrote: > > Do not use rlimit-based memory accounting for stackmap maps. > It has been replaced with the memcg-based memory accounting. > > Signed-off-by: Roman Gushchin Acked-by: Song Liu > --- > kernel/bpf/stackmap.c | 16 +++- > 1

[Linux-kernel-mentees] [PATCH net v2] xdp: Prevent kernel-infoleak in xsk_getsockopt()

2020-07-27 Thread Peilin Ye
xsk_getsockopt() is copying uninitialized stack memory to userspace when `extra_stats` is `false`. Fix it. Fixes: 8aa5a33578e9 ("xsk: Add new statistics") Suggested-by: Dan Carpenter Signed-off-by: Peilin Ye --- Doing `= {};` is sufficient since currently `struct xdp_statistics` is defined as fo

Re: [PATCH bpf-next v2 22/35] bpf: eliminate rlimit-based memory accounting for bpf ringbuffer

2020-07-27 Thread Song Liu
On Mon, Jul 27, 2020 at 12:22 PM Roman Gushchin wrote: > > Do not use rlimit-based memory accounting for bpf ringbuffer. > It has been replaced with the memcg-based memory accounting. > > bpf_ringbuf_alloc() can't return anything except ERR_PTR(-ENOMEM) > and a valid pointer, so to simplify the co

Re: [PATCH bpf-next v2 21/35] bpf: eliminate rlimit-based memory accounting for reuseport_array maps

2020-07-27 Thread Song Liu
On Mon, Jul 27, 2020 at 12:23 PM Roman Gushchin wrote: > > Do not use rlimit-based memory accounting for reuseport_array maps. > It has been replaced with the memcg-based memory accounting. > > Signed-off-by: Roman Gushchin Acked-by: Song Liu > --- > kernel/bpf/reuseport_array.c | 12 ++--

Re: [PATCH bpf-next v2 20/35] bpf: eliminate rlimit-based memory accounting for queue_stack_maps maps

2020-07-27 Thread Song Liu
On Mon, Jul 27, 2020 at 12:25 PM Roman Gushchin wrote: > > Do not use rlimit-based memory accounting for queue_stack maps. > It has been replaced with the memcg-based memory accounting. > > Signed-off-by: Roman Gushchin Acked-by: Song Liu > --- > kernel/bpf/queue_stack_maps.c | 16 ---

Re: [PATCH bpf-next v2 18/35] bpf: eliminate rlimit-based memory accounting for hashtab maps

2020-07-27 Thread Song Liu
On Mon, Jul 27, 2020 at 12:21 PM Roman Gushchin wrote: > > Do not use rlimit-based memory accounting for hashtab maps. > It has been replaced with the memcg-based memory accounting. > > Signed-off-by: Roman Gushchin Acked-by: Song Liu > --- > kernel/bpf/hashtab.c | 19 +-- > 1

Re: [PATCH bpf-next v2 19/35] bpf: eliminate rlimit-based memory accounting for lpm_trie maps

2020-07-27 Thread Song Liu
On Mon, Jul 27, 2020 at 12:25 PM Roman Gushchin wrote: > > Do not use rlimit-based memory accounting for lpm_trie maps. > It has been replaced with the memcg-based memory accounting. > > Signed-off-by: Roman Gushchin Acked-by: Song Liu > --- > kernel/bpf/lpm_trie.c | 13 - > 1 fil

Re: [PATCH bpf-next v2 16/35] bpf: eliminate rlimit-based memory accounting for cgroup storage maps

2020-07-27 Thread Song Liu
On Mon, Jul 27, 2020 at 12:21 PM Roman Gushchin wrote: > > Do not use rlimit-based memory accounting for cgroup storage maps. > It has been replaced with the memcg-based memory accounting. > > Signed-off-by: Roman Gushchin Acked-by: Song Liu > --- > kernel/bpf/local_storage.c | 21 +--

Re: [PATCH bpf-next v2 17/35] bpf: eliminate rlimit-based memory accounting for devmap maps

2020-07-27 Thread Song Liu
On Mon, Jul 27, 2020 at 12:20 PM Roman Gushchin wrote: > > Do not use rlimit-based memory accounting for devmap maps. > It has been replaced with the memcg-based memory accounting. > > Signed-off-by: Roman Gushchin Acked-by: Song Liu > --- > kernel/bpf/devmap.c | 18 ++ > 1 fi

Re: [PATCH bpf-next v2 15/35] bpf: eliminate rlimit-based memory accounting for cpumap maps

2020-07-27 Thread Song Liu
On Mon, Jul 27, 2020 at 12:22 PM Roman Gushchin wrote: > > Do not use rlimit-based memory accounting for cpumap maps. > It has been replaced with the memcg-based memory accounting. > > Signed-off-by: Roman Gushchin Acked-by: Song Liu > --- > kernel/bpf/cpumap.c | 16 +--- > 1 file

Re: [PATCH bpf-next v2 14/35] bpf: eliminate rlimit-based memory accounting for bpf_struct_ops maps

2020-07-27 Thread Song Liu
On Mon, Jul 27, 2020 at 12:26 PM Roman Gushchin wrote: > > Do not use rlimit-based memory accounting for bpf_struct_ops maps. > It has been replaced with the memcg-based memory accounting. > > Signed-off-by: Roman Gushchin Acked-by: Song Liu

Re: [PATCH net-next RFC 00/13] Add devlink reload level option

2020-07-27 Thread Vasundhara Volam
On Mon, Jul 27, 2020 at 4:36 PM Moshe Shemesh wrote: > > Introduce new option on devlink reload API to enable the user to select the > reload level required. Complete support for all levels in mlx5. > The following reload levels are supported: > driver: Driver entities re-instantiation only. >

Re: [Linux-kernel-mentees] [PATCH net] xdp: Prevent kernel-infoleak in xsk_getsockopt()

2020-07-27 Thread Peilin Ye
On Mon, Jul 27, 2020 at 10:07:20PM -0700, Song Liu wrote: > On Mon, Jul 27, 2020 at 7:30 PM Peilin Ye wrote: > > > > xsk_getsockopt() is copying uninitialized stack memory to userspace when > > `extra_stats` is `false`. Fix it by initializing `stats` with memset(). > > > > Cc: sta...@vger.kernel.o

Re: [PATCH] drivers/net/wan/lapbether: Use needed_headroom instead of hard_header_len

2020-07-27 Thread Cong Wang
Hello, On Mon, Jul 27, 2020 at 12:41 PM Xie He wrote: > > Hi Cong Wang, > > I'm wishing to change a driver from using "hard_header_len" to using > "needed_headroom" to declare its needed headroom. I submitted a patch > and it is decided it needs to be reviewed. I see you participated in > "hard_h

[PATCH iproute2] tc: Add space after format specifier

2020-07-27 Thread Briana Oursler
Add space after format specifier in print_string call. Fixes broken qdisc tests within tdc testing suite. Per suggestion from Petr Machata, remove a space and change spacing in tc/q_event.c to complete the fix. Tested fix in tdc using: ./tdc.py -c qdisc All qdisc RED tests return ok. Fixes: d0e4

Re: [Linux-kernel-mentees] [PATCH net] xdp: Prevent kernel-infoleak in xsk_getsockopt()

2020-07-27 Thread Song Liu
On Mon, Jul 27, 2020 at 7:30 PM Peilin Ye wrote: > > xsk_getsockopt() is copying uninitialized stack memory to userspace when > `extra_stats` is `false`. Fix it by initializing `stats` with memset(). > > Cc: sta...@vger.kernel.org 8aa5a33578e9 is not in stable branches yet, so we don't need to Cc

Re: [PATCH] bpf: Add bpf_ktime_get_real_ns

2020-07-27 Thread Andrii Nakryiko
On Mon, Jul 27, 2020 at 4:35 PM wrote: > > From: Ashkan Nikravesh > > The existing bpf helper functions to get timestamp return the time > elapsed since system boot. This timestamp is not particularly useful > where epoch timestamp is required or more than one server is involved > and time sync i

Re: [PATCH bpf-next v2 01/35] bpf: memcg-based memory accounting for bpf progs

2020-07-27 Thread Song Liu
On Mon, Jul 27, 2020 at 5:08 PM Roman Gushchin wrote: > > On Mon, Jul 27, 2020 at 03:11:42PM -0700, Song Liu wrote: > > On Mon, Jul 27, 2020 at 12:20 PM Roman Gushchin wrote: > > > > > > Include memory used by bpf programs into the memcg-based accounting. > > > This includes the memory used by pr

[PATCH v1] farsync: use generic power management

2020-07-27 Thread Vaibhav Gupta
The .suspend() and .resume() callbacks are not defined for this driver. Still, their power management structure follows the legacy framework. To bring it under the generic framework, simply remove the binding of callbacks from "struct pci_driver". Change code indentation from space to tab in "stru

[PATCH V4 1/6] vhost: introduce vhost_vring_call

2020-07-27 Thread Zhu Lingshan
This commit introduces struct vhost_vring_call which replaced raw struct eventfd_ctx *call_ctx in struct vhost_virtqueue. Besides eventfd_ctx, it contains a spin lock and an irq_bypass_producer in its structure. Signed-off-by: Zhu Lingshan Suggested-by: Jason Wang --- drivers/vhost/vdpa.c | 4

[PATCH V4 6/6] irqbypass: do not start cons/prod when failed connect

2020-07-27 Thread Zhu Lingshan
If failed to connect, there is no need to start consumer nor producer. Signed-off-by: Zhu Lingshan Suggested-by: Jason Wang --- virt/lib/irqbypass.c | 16 ++-- 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/virt/lib/irqbypass.c b/virt/lib/irqbypass.c index 28fda42e47

[PATCH V4 4/6] vhost_vdpa: implement IRQ offloading in vhost_vdpa

2020-07-27 Thread Zhu Lingshan
This patch introduce a set of functions for setup/unsetup and update irq offloading respectively by register/unregister and re-register the irq_bypass_producer. With these functions, this commit can setup/unsetup irq offloading through setting DRIVER_OK/!DRIVER_OK, and update irq offloading throug

[PATCH V4 5/6] ifcvf: implement vdpa_config_ops.get_vq_irq()

2020-07-27 Thread Zhu Lingshan
This commit implemented vdpa_config_ops.get_vq_irq() in ifcvf, and initialized vq irq to -EINVAL. So that ifcvf can report irq number of a vq, or -EINVAL if the vq is not assigned an irq number. Signed-off-by: Zhu Lingshan Suggested-by: Jason Wang --- drivers/vdpa/ifcvf/ifcvf_main.c | 18 ++

[PATCH V4 0/6] IRQ offloading for vDPA

2020-07-27 Thread Zhu Lingshan
This series intends to implement IRQ offloading for vhost_vdpa. By the feat of irq forwarding facilities like posted interrupt on X86, irq bypass can help deliver interrupts to vCPU directly. vDPA devices have dedicated hardware backends like VFIO pass-throughed devices. So it would be possible

[PATCH V4 2/6] kvm: detect assigned device via irqbypass manager

2020-07-27 Thread Zhu Lingshan
vDPA devices has dedicated backed hardware like passthrough-ed devices. Then it is possible to setup irq offloading to vCPU for vDPA devices. Thus this patch tries to manipulated assigned device counters by kvm_arch_start/end_assignment() in irqbypass manager, so that assigned devices could be dete

[PATCH V4 3/6] vDPA: add get_vq_irq() in vdpa_config_ops

2020-07-27 Thread Zhu Lingshan
This commit adds a new function get_vq_irq() in struct vdpa_config_ops, which will return the irq number of a virtqueue. Signed-off-by: Zhu Lingshan Suggested-by: Jason Wang --- include/linux/vdpa.h | 6 ++ 1 file changed, 6 insertions(+) diff --git a/include/linux/vdpa.h b/include/linux/v

Re: Question Print Formatting iproute2

2020-07-27 Thread Briana Oursler
On Mon, 2020-07-27 at 16:47 -0700, Stephen Hemminger wrote: > On Sun, 26 Jul 2020 21:46:16 -0700 > Briana Oursler wrote: > > > I have a patch I've written to address a format specifier change > > that > > breaks some tests in tc-testing, but I wanted to ask about the > > change > > and for some g

Re: Question Print Formatting iproute2

2020-07-27 Thread Briana Oursler
On Mon, 2020-07-27 at 21:31 +0200, Petr Machata wrote: > Briana Oursler writes: > > > I git bisected and found d0e450438571("tc: q_red: Add support for > > qevents "mark" and "early_drop"), the commit that introduced the > > formatting change causing the break. > > > > - print_string(PRINT

Re: [PATCH] [net/ipv6] ip6_output: Add ipv6_pinfo null check

2020-07-27 Thread Cong Wang
On Mon, Jul 27, 2020 at 7:14 PM Gaurav Singh wrote: > > Add return to fix build issue. Haven't reproduced this issue at > my end. > > My hypothesis is this: In function: ip6_xmit(), we have > const struct ipv6_pinfo *np = inet6_sk(sk); which returns NULL. > > Further down the function, there's a c

Re: [PATCH] perf record: Set PERF_RECORD_SAMPLE if attr->freq is set.

2020-07-27 Thread Athira Rajeev
> On 27-Jul-2020, at 12:29 PM, Ian Rogers wrote: > > From: David Sharp > > evsel__config() would only set PERF_RECORD_SAMPLE if it set attr->freq Hi Ian, Commit message says PERF_RECORD_SAMPLE. But since we are setting period here, it has to say “PERF_SAMPLE_PERIOD” ? Thanks Athira >

Re: [RFC PATCH v2 15/21] net/tcp: add MSG_NETDMA flag for sendmsg()

2020-07-27 Thread Jonathan Lemon
On Mon, Jul 27, 2020 at 07:17:51PM -0700, Eric Dumazet wrote: > On Mon, Jul 27, 2020 at 7:11 PM Jonathan Lemon > wrote: > > > > On Mon, Jul 27, 2020 at 10:44:59AM -0700, Eric Dumazet wrote: > > > On Mon, Jul 27, 2020 at 10:35 AM Jonathan Lemon > > > wrote: > > > > > > > > On Mon, Jul 27, 2020 at

[Linux-kernel-mentees] [PATCH net] xdp: Prevent kernel-infoleak in xsk_getsockopt()

2020-07-27 Thread Peilin Ye
xsk_getsockopt() is copying uninitialized stack memory to userspace when `extra_stats` is `false`. Fix it by initializing `stats` with memset(). Cc: sta...@vger.kernel.org Fixes: 8aa5a33578e9 ("xsk: Add new statistics") Suggested-by: Dan Carpenter Signed-off-by: Peilin Ye --- net/xdp/xsk.c | 2

[PATCH net 2/5] net: hns3: fix a TX timeout issue

2020-07-27 Thread Huazhong Tan
From: Yonglong Liu When the queue depth and queue parameters are modified, there is a low probability that TX timeout occurs. The two operations cause the link to be down or up when the watchdog is still working. All queues are stopped when the link is down. After the carrier is on, all queues ar

[PATCH net 5/5] net: hns3: fix for VLAN config when reset failed

2020-07-27 Thread Huazhong Tan
From: Guojia Liao When device is resetting or reset failed, firmware is unable to handle mailbox. VLAN should not be configured in this case. Fixes: fe4144d47eef ("net: hns3: sync VLAN filter entries when kill VLAN ID failed") Signed-off-by: Guojia Liao Signed-off-by: Huazhong Tan --- driver

[PATCH net 3/5] net: hns3: add reset check for VF updating port based VLAN

2020-07-27 Thread Huazhong Tan
From: Jian Shen Currently hclgevf_update_port_base_vlan_info() may be called when VF is resetting, which may cause hns3_nic_net_open() being called twice unexpectedly. So fix it by adding a reset check for it, and extend critical region for rntl_lock in hclgevf_update_port_base_vlan_info(). Fi

[PATCH net 1/5] net: hns3: fix desc filling bug when skb is expanded or lineared

2020-07-27 Thread Huazhong Tan
From: Yunsheng Lin The linear and frag data part may be changed when the skb is expanded or lineared in skb_cow_head() or skb_checksum_help(), which is called by hns3_fill_skb_desc(), so the linear len return by skb_headlen() before the calling of hns3_fill_skb_desc() is unreliable. Move hns3_fi

[PATCH net 4/5] net: hns3: fix aRFS FD rules leftover after add a user FD rule

2020-07-27 Thread Huazhong Tan
From: Guojia Liao When user had created a FD rule, all the aRFS rules should be clear up. HNS3 process flow as below: 1.get spin lock of fd_ruls_list 2.clear up all aRFS rules 3.release lock 4.get spin lock of fd_ruls_list 5.creat a rules 6.release lock; There is a short period of time between s

[PATCH net 0/5] net: hns3: fixes for -net

2020-07-27 Thread Huazhong Tan
There are some bugfixes for the HNS3 ethernet driver. patch#1 fixes a desc filling bug, patch#2 fixes a false TX timeout issue, and patch#3~#5 fixes some bugs related to VLAN and FD. Guojia Liao (2): net: hns3: fix aRFS FD rules leftover after add a user FD rule net: hns3: fix for VLAN config

Re: [RFC PATCH v2 14/21] net/tcp: add netgpu ioctl setting up zero copy RX queues

2020-07-27 Thread Jonathan Lemon
On Mon, Jul 27, 2020 at 03:44:37PM -0700, Jonathan Lemon wrote: > From: Jonathan Lemon > > Netgpu delivers iovecs to userspace for incoming data, but the > destination queue must be attached to the socket. Do this via > and ioctl call on the socket itself. > > Signed-off-by: Jonathan Lemon > -

[PATCH] [net/ipv6] ip6_output: Add ipv6_pinfo null check

2020-07-27 Thread Gaurav Singh
Add return to fix build issue. Haven't reproduced this issue at my end. My hypothesis is this: In function: ip6_xmit(), we have const struct ipv6_pinfo *np = inet6_sk(sk); which returns NULL. Further down the function, there's a check: if (np) hlimit = hp->htop_limit Further, we have a call ip

Re: [RFC PATCH v2 15/21] net/tcp: add MSG_NETDMA flag for sendmsg()

2020-07-27 Thread Jonathan Lemon
On Mon, Jul 27, 2020 at 10:44:59AM -0700, Eric Dumazet wrote: > On Mon, Jul 27, 2020 at 10:35 AM Jonathan Lemon > wrote: > > > > On Mon, Jul 27, 2020 at 09:09:48AM -0700, Eric Dumazet wrote: > > > On Mon, Jul 27, 2020 at 8:56 AM Jonathan Lemon > > > wrote: > > > > > > > > On Mon, Jul 27, 2020 at

[PATCH][for v4.4 only] udp: drop corrupt packets earlier to avoid data corruption

2020-07-27 Thread Dexuan Cui
The v4.4 stable kernel lacks this bugfix: commit 327868212381 ("make skb_copy_datagram_msg() et.al. preserve ->msg_iter on error"). As a result, the v4.4 kernel can deliver corrupt data to the application when a corrupt UDP packet is closely followed by a valid UDP packet: the same invocation of t

Re: [RFC PATCH v2 21/21] netgpu/nvidia: add Nvidia plugin for netgpu

2020-07-27 Thread Jonathan Lemon
On Mon, Jul 27, 2020 at 08:24:25PM +0200, Christoph Hellwig wrote: > On Mon, Jul 27, 2020 at 10:00:03AM -0700, Jonathan Lemon wrote: > > On Mon, Jul 27, 2020 at 09:35:09AM +0200, Christoph Hellwig wrote: > > > Seriously? If you only even considered this is something reasonable > > > to do you shou

[PATCH] mwifiex: don't call del_timer_sync() on uninitialized timer

2020-07-27 Thread Tetsuo Handa
syzbot is reporting that del_timer_sync() is called from mwifiex_usb_cleanup_tx_aggr() from mwifiex_unregister_dev() without checking timer_setup() from mwifiex_usb_tx_init() was called [1]. Since mwifiex_usb_prepare_tx_aggr_skb() is calling del_timer() if is_hold_timer_set == true, use the same co

Re: [PATCH bpf-next] selftests/bpf: add new bpf_iter context structs to fix build on old kernels

2020-07-27 Thread Yonghong Song
On 7/27/20 4:33 PM, Andrii Nakryiko wrote: Add bpf_iter__bpf_map_elem and bpf_iter__bpf_sk_storage_map to bpf_iter.h Cc: Yonghong Song Fixes: 3b1c420bd882 ("selftests/bpf: Add a test for bpf sk_storage_map iterator") Fixes: 2a7c2fff7dd6 ("selftests/bpf: Add test for bpf hash map iterators")

[PATCH net-next] ice: mark PM functions as __maybe_unused

2020-07-27 Thread Wei Yongjun
In certain configurations without power management support, the following warnings happen: drivers/net/ethernet/intel/ice/ice_main.c:4214:12: warning: 'ice_resume' defined but not used [-Wunused-function] 4214 | static int ice_resume(struct device *dev) |^~ drivers/net/

Re: [PATCH bpf-next] udp, bpf: Ignore connections in reuseport group after BPF sk lookup

2020-07-27 Thread Martin KaFai Lau
On Sun, Jul 26, 2020 at 02:02:28PM +0200, Jakub Sitnicki wrote: > When BPF sk lookup invokes reuseport handling for the selected socket, it > should ignore the fact that reuseport group can contain connected UDP > sockets. With BPF sk lookup this is not relevant as we are not scoring > sockets to f

RE: [PATCH v13 2/9] arm/arm64: KVM: Advertise KVM UID to guests via SMCCC

2020-07-27 Thread Jianyong Wu
> -Original Message- > From: Will Deacon > Sent: Monday, July 27, 2020 7:38 PM > To: Jianyong Wu > Cc: netdev@vger.kernel.org; yangbo...@nxp.com; john.stu...@linaro.org; > t...@linutronix.de; pbonz...@redhat.com; sean.j.christopher...@intel.com; > m...@kernel.org; richardcoch...@gmail.

Re: [PATCH net-next RFC 10/13] net/mlx5: Add devlink param enable_remote_dev_reset support

2020-07-27 Thread Jakub Kicinski
On Mon, 27 Jul 2020 14:02:30 +0300 Moshe Shemesh wrote: > static void mlx5_sync_reset_request_event(struct work_struct *work) > { > struct mlx5_fw_reset *fw_reset = container_of(work, struct > mlx5_fw_reset, > reset_request_work); >

Re: [PATCH net-next RFC 09/13] devlink: Add enable_remote_dev_reset generic parameter

2020-07-27 Thread Jakub Kicinski
On Mon, 27 Jul 2020 14:02:29 +0300 Moshe Shemesh wrote: > The enable_remote_dev_reset devlink param flags that the host admin > allows device resets that can be initiated by other hosts. This > parameter is useful for setups where a device is shared by different > hosts, such as multi-host setup. O

Re: [PATCH net-next RFC 01/13] devlink: Add reload level option to devlink reload command

2020-07-27 Thread Jakub Kicinski
On Mon, 27 Jul 2020 14:02:21 +0300 Moshe Shemesh wrote: > Add devlink reload level to allow the user to request a specific reload > level. The level parameter is optional, if not specified then driver's > default reload level is used (backward compatible). Please don't leave space for driver-speci

Re: [PATCH net-next RFC 02/13] devlink: Add reload levels data to dev get

2020-07-27 Thread Jakub Kicinski
On Mon, 27 Jul 2020 14:02:22 +0300 Moshe Shemesh wrote: > Expose devlink reload supported levels and driver's default level to the > user through devlink dev get command. > > Examples: > $ devlink dev show > pci/:82:00.0: > reload_levels_info: > default_level driver > supported_level

[vhost:vhost 38/45] include/linux/vdpa.h:43:21: error: expected ':', ',', ';', '}' or '__attribute__' before '.' token

2020-07-27 Thread kernel test robot
tree: https://git.kernel.org/pub/scm/linux/kernel/git/mst/vhost.git vhost head: 84d40e4b4bc64456abf5ef5663871053b40e84ac commit: fee8fe6bd8ccacd27e963b71b4f943be3721779e [38/45] vdpa: make sure set_features in invoked for legacy config: m68k-randconfig-r022-20200727 (attached as .config

Re: [PATCH v8 bpf-next 02/13] tools resolve_btfids: Add support for set symbols

2020-07-27 Thread Andrii Nakryiko
On Wed, Jul 22, 2020 at 2:13 PM Jiri Olsa wrote: > > The set symbol does not have the unique number suffix, > so we need to give it a special parsing function. > > This was omitted in the first batch, because there was > no set support yet, so it slipped in the testing. > > Signed-off-by: Jiri Ols

[PATCH v3 bpf 2/2] selftests/bpf: extend map-in-map selftest to detect memory leaks

2020-07-27 Thread Andrii Nakryiko
Add test validating that all inner maps are released properly after skeleton is destroyed. To ensure determinism, trigger kernel-side synchronize_rcu() before checking map existence by their IDs. Signed-off-by: Andrii Nakryiko --- .../selftests/bpf/prog_tests/btf_map_in_map.c | 124 +

[PATCH v3 bpf 1/2] bpf: fix map leak in HASH_OF_MAPS map

2020-07-27 Thread Andrii Nakryiko
Fix HASH_OF_MAPS bug of not putting inner map pointer on bpf_map_elem_update() operation. This is due to per-cpu extra_elems optimization, which bypassed free_htab_elem() logic doing proper clean ups. Make sure that inner map is put properly in optimized case as well. Fixes: 8c290e60fa2a ("bpf: fi

Re: [PATCH bpf-next v2 01/35] bpf: memcg-based memory accounting for bpf progs

2020-07-27 Thread Roman Gushchin
On Mon, Jul 27, 2020 at 03:11:42PM -0700, Song Liu wrote: > On Mon, Jul 27, 2020 at 12:20 PM Roman Gushchin wrote: > > > > Include memory used by bpf programs into the memcg-based accounting. > > This includes the memory used by programs itself, auxiliary data > > and statistics. > > > > Signed-of

Re: [PATCH bpf-next v2 13/35] bpf: eliminate rlimit-based memory accounting for arraymap maps

2020-07-27 Thread Song Liu
On Mon, Jul 27, 2020 at 12:26 PM Roman Gushchin wrote: > > Do not use rlimit-based memory accounting for arraymap maps. > It has been replaced with the memcg-based memory accounting. > > Signed-off-by: Roman Gushchin Acked-by: Song Liu > --- > kernel/bpf/arraymap.c | 24 --

Re: [PATCH][next] ath11k: Use fallthrough pseudo-keyword

2020-07-27 Thread Joe Perches
On Tue, 2020-07-28 at 09:44 +1000, Julian Calaby wrote: > Hi Joe, > > On Tue, Jul 28, 2020 at 5:48 AM Joe Perches wrote: > > On Mon, 2020-07-27 at 14:44 -0500, Gustavo A. R. Silva wrote: > > > Replace the existing /* fall through */ comments and its variants with > > > the new pseudo-keyword macr

Re: [PATCH bpf-next v2 12/35] bpf: refine memcg-based memory accounting for xskmap maps

2020-07-27 Thread Song Liu
On Mon, Jul 27, 2020 at 12:25 PM Roman Gushchin wrote: > > Extend xskmap memory accounting to include the memory taken by > the xsk_map_node structure. > > Signed-off-by: Roman Gushchin Acked-by: Song Liu > --- > net/xdp/xskmap.c | 3 ++- > 1 file changed, 2 insertions(+), 1 deletion(-) > > d

Re: [PATCH bpf-next v2 11/35] bpf: refine memcg-based memory accounting for sockmap and sockhash maps

2020-07-27 Thread Song Liu
On Mon, Jul 27, 2020 at 12:27 PM Roman Gushchin wrote: > > Include internal metadata into the memcg-based memory accounting. > Also include the memory allocated on updating an element. > > Signed-off-by: Roman Gushchin Acked-by: Song Liu > --- > net/core/sock_map.c | 7 --- > 1 file chang

Re: [PATCH bpf-next v2 10/35] bpf: memcg-based memory accounting for socket storage maps

2020-07-27 Thread Song Liu
On Mon, Jul 27, 2020 at 12:28 PM Roman Gushchin wrote: > > Account memory used by the socket storage. > > Signed-off-by: Roman Gushchin Acked-by: Song Liu > --- > net/core/bpf_sk_storage.c | 12 +++- > 1 file changed, 7 insertions(+), 5 deletions(-) > > diff --git a/net/core/bpf_sk_st

Re: [PATCH bpf-next v2 09/35] bpf: memcg-based memory accounting for bpf ringbuffer

2020-07-27 Thread Song Liu
On Mon, Jul 27, 2020 at 12:22 PM Roman Gushchin wrote: > > Enable the memcg-based memory accounting for the memory used by > the bpf ringbuffer. > > Signed-off-by: Roman Gushchin Acked-by: Song Liu > --- > kernel/bpf/ringbuf.c | 9 + > 1 file changed, 5 insertions(+), 4 deletions(-) >

Re: [PATCH bpf-next v2 08/35] bpf: memcg-based memory accounting for lpm_trie maps

2020-07-27 Thread Song Liu
On Mon, Jul 27, 2020 at 12:22 PM Roman Gushchin wrote: > > Include lpm trie and lpm trie node objects into the memcg-based memory > accounting. > > Signed-off-by: Roman Gushchin Acked-by: Song Liu > --- > kernel/bpf/lpm_trie.c | 4 ++-- > 1 file changed, 2 insertions(+), 2 deletions(-) > > di

Re: [PATCH] bpf: Add bpf_ktime_get_real_ns

2020-07-27 Thread Song Liu
On Mon, Jul 27, 2020 at 4:35 PM wrote: > > From: Ashkan Nikravesh > > The existing bpf helper functions to get timestamp return the time > elapsed since system boot. This timestamp is not particularly useful > where epoch timestamp is required or more than one server is involved > and time sync i

Re: Question Print Formatting iproute2

2020-07-27 Thread Stephen Hemminger
On Sun, 26 Jul 2020 21:46:16 -0700 Briana Oursler wrote: > I have a patch I've written to address a format specifier change that > breaks some tests in tc-testing, but I wanted to ask about the change > and for some guidance with respect to how formatters are approached in > iproute2. > > On a

Re: [PATCH][next] ath11k: Use fallthrough pseudo-keyword

2020-07-27 Thread Julian Calaby
Hi Joe, On Tue, Jul 28, 2020 at 5:48 AM Joe Perches wrote: > > On Mon, 2020-07-27 at 14:44 -0500, Gustavo A. R. Silva wrote: > > Replace the existing /* fall through */ comments and its variants with > > the new pseudo-keyword macro fallthrough[1]. Also, remove unnecessary > > fall-through markin

Re: [PATCH iproute2] bridge: fdb: the 'dynamic' option in the show/get commands

2020-07-27 Thread Stephen Hemminger
On Mon, 27 Jul 2020 16:26:07 +0300 Anton Danilov wrote: > In most of cases a user wants to see only the dynamic mac addresses > in the fdb output. But currently the 'fdb show' displays tons of > various self entries, those only waste the output without any useful > goal. > > New option 'dynamic'

Re: [PATCH iproute2] mptcp: show all endpoints when no ID is specified

2020-07-27 Thread Stephen Hemminger
On Fri, 24 Jul 2020 14:17:18 +0200 Matthieu Baerts wrote: > According to 'ip mptcp help', 'endpoint show' can accept no argument: > > ip mptcp endpoint show [ id ID ] > > It makes sense to print all endpoints when no filter is used. > > So here if the following command is used, all endpoints

  1   2   3   4   5   6   >