[PATCH v1 3/3] tlan: use generic power management

2020-07-29 Thread Vaibhav Gupta
Drivers using legacy power management .suspen()/.resume() callbacks have to manage PCI states and device's PM states themselves. They also need to take care of standard configuration registers. Switch to generic power management framework using a single "struct dev_pm_ops" variable to take the unn

[PATCH v1 1/3] sc92031: use generic power management

2020-07-29 Thread Vaibhav Gupta
Drivers using legacy power management .suspen()/.resume() callbacks have to manage PCI states and device's PM states themselves. They also need to take care of standard configuration registers. Switch to generic power management framework using a single "struct dev_pm_ops" variable to take the unn

[PATCH v1 2/3] sis900: use generic power management

2020-07-29 Thread Vaibhav Gupta
Drivers using legacy power management .suspen()/.resume() callbacks have to manage PCI states and device's PM states themselves. They also need to take care of standard configuration registers. Switch to generic power management framework using a single "struct dev_pm_ops" variable to take the unn

[PATCH v1 0/3] net: ethernet: use generic power management

2020-07-29 Thread Vaibhav Gupta
Linux Kernel Mentee: Remove Legacy Power Management. The purpose of this patch series is to upgrade power management in net ethernet drivers. This has been done by upgrading .suspend() and .resume() callbacks. The upgrade makes sure that the involvement of PCI Core does not change the order of op

[PATCH net] qtnfmac: Missing platform_device_unregister() on error in qtnf_core_mac_alloc()

2020-07-29 Thread Wang Hai
Add the missing platform_device_unregister() before return from qtnf_core_mac_alloc() in the error handling case. Fixes: 616f5701f4ab ("qtnfmac: assign each wiphy to its own virtual platform device") Reported-by: Hulk Robot Signed-off-by: Wang Hai --- drivers/net/wireless/quantenna/qtnfmac/cor

[PATCH v1 2/3] sis900: use generic power management

2020-07-29 Thread Vaibhav Gupta
Drivers using legacy power management .suspen()/.resume() callbacks have to manage PCI states and device's PM states themselves. They also need to take care of standard configuration registers. Switch to generic power management framework using a single "struct dev_pm_ops" variable to take the unn

[PATCH v1 3/3] tlan: use generic power management

2020-07-29 Thread Vaibhav Gupta
Drivers using legacy power management .suspen()/.resume() callbacks have to manage PCI states and device's PM states themselves. They also need to take care of standard configuration registers. Switch to generic power management framework using a single "struct dev_pm_ops" variable to take the unn

[PATCH v1 1/3] sc92031: use generic power management

2020-07-29 Thread Vaibhav Gupta
Drivers using legacy power management .suspen()/.resume() callbacks have to manage PCI states and device's PM states themselves. They also need to take care of standard configuration registers. Switch to generic power management framework using a single "struct dev_pm_ops" variable to take the unn

[PATCH v1 0/3] net: ethernet: use generic power management

2020-07-29 Thread Vaibhav Gupta
Linux Kernel Mentee: Remove Legacy Power Management. The purpose of this patch series is to upgrade power management in net ethernet drivers. This has been done by upgrading .suspend() and .resume() callbacks. The upgrade makes sure that the involvement of PCI Core does not change the order of op

[PATCH -next] bnxt_en: Remove superfluous memset()

2020-07-29 Thread Li Heng
Fixes coccicheck warning: ./drivers/net/ethernet/broadcom/bnxt/bnxt.c:3730:19-37: WARNING: dma_alloc_coherent use in stats -> hw_stats already zeroes out memory, so memset is not needed dma_alloc_coherent use in status already zeroes out memory, so memset is not needed Reported-by: Hulk Robot

Re: [PATCH net-next] liquidio: Remove unneeded cast from memory allocation

2020-07-29 Thread wanghai (M)
在 2020/7/28 23:54, Joe Perches 写道: On Tue, 2020-07-28 at 21:38 +0800, wanghai (M) wrote: Thanks for your explanation. I got it. Can it be modified like this? [] +++ b/drivers/net/ethernet/cavium/liquidio/octeon_device.c @@ -1152,11 +1152,8 @@ octeon_register_dispatch_fn(struct octeon_device

[PATCH net-next] liquidio: Replace vmalloc with kmalloc in octeon_register_dispatch_fn()

2020-07-29 Thread Wang Hai
The size of struct octeon_dispatch is too small, it is better to use kmalloc instead of vmalloc. Suggested-by: Joe Perches Signed-off-by: Wang Hai --- drivers/net/ethernet/cavium/liquidio/octeon_device.c | 11 --- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/drivers/net

Re: [PATCH net] net/sched: act_ct: fix miss set mru for ovs after defrag in act_ct

2020-07-29 Thread Cong Wang
On Wed, Jul 29, 2020 at 3:41 AM wrote: > diff --git a/include/net/sch_generic.h b/include/net/sch_generic.h > index c510b03..45401d5 100644 > --- a/include/net/sch_generic.h > +++ b/include/net/sch_generic.h > @@ -384,6 +384,7 @@ struct qdisc_skb_cb { > }; > #define QDISC_CB_PRIV_LEN 20 >

[PATCH 10/19] xfrm: interface: support IP6IP6 and IP6IP tunnels processing with .cb_handler

2020-07-29 Thread Steffen Klassert
From: Xin Long Similar to ip6_vti, IP6IP6 and IP6IP tunnels processing can easily be done with .cb_handler for xfrm interface. v1->v2: - no change. v2-v3: - enable it only when CONFIG_INET6_XFRM_TUNNEL is defined, to fix the build error, reported by kbuild test robot. Signed-off-by: Xin

[PATCH 18/19] ip6_vti: use IS_REACHABLE to avoid some compile errors

2020-07-29 Thread Steffen Klassert
From: Xin Long Naresh reported some compile errors: arm build failed due this error on linux-next 20200713 and 20200713 net/ipv6/ip6_vti.o: In function `vti6_rcv_tunnel': ip6_vti.c:(.text+0x1d20): undefined reference to `xfrm6_tunnel_spi_lookup' This happened when set CONFIG_IPV6_VTI=y a

[PATCH 06/19] ip_vti: support IPIP6 tunnel processing

2020-07-29 Thread Steffen Klassert
From: Xin Long For IPIP6 tunnel processing, the functions called will be the same as that for IPIP tunnel's. So reuse it and register it with family == AF_INET6. Signed-off-by: Xin Long Signed-off-by: Steffen Klassert --- net/ipv4/ip_vti.c | 16 ++-- 1 file changed, 14 insertions(

[PATCH 11/19] xfrm: interface: support IPIP and IPIP6 tunnels processing with .cb_handler

2020-07-29 Thread Steffen Klassert
From: Xin Long Similar to ip_vti, IPIP and IPIP6 tunnels processing can easily be done with .cb_handler for xfrm interface. v1->v2: - no change. v2-v3: - enable it only when CONFIG_INET_XFRM_TUNNEL is defined, to fix the build error, reported by kbuild test robot. Signed-off-by: Xin Lon

[PATCH 14/19] ip_vti: not register vti_ipip_handler twice

2020-07-29 Thread Steffen Klassert
From: Xin Long An xfrm_tunnel object is linked into the list when registering, so vti_ipip_handler can not be registered twice, otherwise its next pointer will be overwritten on the second time. So this patch is to define a new xfrm_tunnel object to register for AF_INET6. Fixes: e6ce64570f24 ("

[PATCH 15/19] ip6_vti: not register vti_ipv6_handler twice

2020-07-29 Thread Steffen Klassert
From: Xin Long An xfrm6_tunnel object is linked into the list when registering, so vti_ipv6_handler can not be registered twice, otherwise its next pointer will be overwritten on the second time. So this patch is to define a new xfrm6_tunnel object to register for AF_INET. Fixes: 2ab110cbb0c0 (

[PATCH 16/19] xfrm: interface: not xfrmi_ipv6/ipip_handler twice

2020-07-29 Thread Steffen Klassert
From: Xin Long As we did in the last 2 patches for vti(6), this patch is to define a new xfrm_tunnel object 'xfrmi_ipip6_handler' to register for AF_INET6, and a new xfrm6_tunnel object 'xfrmi_ip6ip_handler' to register for AF_INET. Signed-off-by: Xin Long Signed-off-by: Steffen Klassert ---

[PATCH 19/19] xfrm: Make the policy hold queue work with VTI.

2020-07-29 Thread Steffen Klassert
We forgot to support the xfrm policy hold queue when VTI was implemented. This patch adds everything we need so that we can use the policy hold queue together with VTI interfaces. Signed-off-by: Steffen Klassert --- net/ipv4/ip_vti.c | 6 +- net/ipv6/ip6_vti.c | 6 +- net/xfrm

[PATCH 17/19] xfrm: interface: use IS_REACHABLE to avoid some compile errors

2020-07-29 Thread Steffen Klassert
From: Xin Long kernel test robot reported some compile errors: ia64-linux-ld: net/xfrm/xfrm_interface.o: in function `xfrmi4_fini': net/xfrm/xfrm_interface.c:900: undefined reference to `xfrm4_tunnel_deregister' ia64-linux-ld: net/xfrm/xfrm_interface.c:901: undefined reference to `xfrm4_

[PATCH 13/19] xfrm interface: store xfrmi contexts in a hash by if_id

2020-07-29 Thread Steffen Klassert
From: Eyal Birger xfrmi_lookup() is called on every packet. Using a single list for looking up if_id becomes a bottleneck when having many xfrm interfaces. Signed-off-by: Eyal Birger Signed-off-by: Steffen Klassert --- net/xfrm/xfrm_interface.c | 29 - 1 file chang

[PATCH 04/19] tunnel6: add tunnel6_input_afinfo for ipip and ipv6 tunnels

2020-07-29 Thread Steffen Klassert
From: Xin Long This patch is to register a callback function tunnel6_rcv_cb with is_ipip set in a xfrm_input_afinfo object for tunnel6 and tunnel46. It will be called by xfrm_rcv_cb() from xfrm_input() when family is AF_INET6 and proto is IPPROTO_IPIP or IPPROTO_IPV6. v1->v2: - Fix a sparse w

[PATCH 01/19] xfrm: introduce oseq-may-wrap flag

2020-07-29 Thread Steffen Klassert
From: Petr Vaněk RFC 4303 in section 3.3.3 suggests to disable anti-replay for manually distributed ICVs in which case the sender does not need to monitor or reset the counter. However, the sender still increments the counter and when it reaches the maximum value, the counter rolls over back to z

pull request (net-next): ipsec-next 2020-07-30

2020-07-29 Thread Steffen Klassert
Please note that I did the first time now --no-ff merges of my testing branch into the master branch to include the [PATCH 0/n] message of a patchset. Please let me know if this is desirable, or if I should do it any different. 1) Introduce a oseq-may-wrap flag to disable anti-replay protection

[PATCH 09/19] ipcomp: assign if_id to child tunnel from parent tunnel

2020-07-29 Thread Steffen Klassert
From: Xin Long The child tunnel if_id will be used for xfrm interface's lookup when processing the IP(6)IP(6) packets in the next patches. Signed-off-by: Xin Long Signed-off-by: Steffen Klassert --- net/ipv4/ipcomp.c | 1 + net/ipv6/ipcomp6.c | 1 + 2 files changed, 2 insertions(+) diff --g

[PATCH 02/19] xfrm: add is_ipip to struct xfrm_input_afinfo

2020-07-29 Thread Steffen Klassert
From: Xin Long This patch is to add a new member is_ipip to struct xfrm_input_afinfo, to allow another group family of callback functions to be registered with is_ipip set. This will be used for doing a callback for struct xfrm(6)_tunnel of ipip/ipv6 tunnels in xfrm_input() by calling xfrm_rcv_c

[PATCH 05/19] ip_vti: support IPIP tunnel processing with .cb_handler

2020-07-29 Thread Steffen Klassert
From: Xin Long With tunnel4_input_afinfo added, IPIP tunnel processing in ip_vti can be easily done with .cb_handler. So replace the processing by calling ip_tunnel_rcv() with it. v1->v2: - no change. v2-v3: - enable it only when CONFIG_INET_XFRM_TUNNEL is defined, to fix the build error

[PATCH 03/19] tunnel4: add cb_handler to struct xfrm_tunnel

2020-07-29 Thread Steffen Klassert
From: Xin Long This patch is to register a callback function tunnel4_rcv_cb with is_ipip set in a xfrm_input_afinfo object for tunnel4 and tunnel64. It will be called by xfrm_rcv_cb() from xfrm_input() when family is AF_INET and proto is IPPROTO_IPIP or IPPROTO_IPV6. v1->v2: - Fix a sparse wa

[PATCH 07/19] ip6_vti: support IP6IP6 tunnel processing with .cb_handler

2020-07-29 Thread Steffen Klassert
From: Xin Long Similar to IPIP tunnel's processing, this patch is to support IP6IP6 tunnel processing with .cb_handler. v1->v2: - no change. v2-v3: - enable it only when CONFIG_INET6_XFRM_TUNNEL is defined, to fix the build error, reported by kbuild test robot. Signed-off-by: Xin Long

[PATCH 08/19] ip6_vti: support IP6IP tunnel processing

2020-07-29 Thread Steffen Klassert
From: Xin Long For IP6IP tunnel processing, the functions called will be the same as that for IP6IP6 tunnel's. So reuse it and register it with family == AF_INET. Signed-off-by: Xin Long Signed-off-by: Steffen Klassert --- net/ipv6/ip6_vti.c | 10 -- 1 file changed, 8 insertions(+), 2

[PATCH 12/19] xfrm interface: avoid xi lookup in xfrmi_decode_session()

2020-07-29 Thread Steffen Klassert
From: Eyal Birger The xfrmi context exists in the netdevice priv context. Avoid looking for it in a separate list. Signed-off-by: Eyal Birger Signed-off-by: Steffen Klassert --- net/xfrm/xfrm_interface.c | 23 +-- 1 file changed, 13 insertions(+), 10 deletions(-) diff --g

Re: [PATCH net-next v3 2/2] net: openvswitch: make masks cache size configurable

2020-07-29 Thread Tonghao Zhang
On Wed, Jul 29, 2020 at 9:27 PM Eelco Chaudron wrote: > > This patch makes the masks cache size configurable, or with > a size of 0, disable it. > > Reviewed-by: Paolo Abeni > Signed-off-by: Eelco Chaudron > --- > Changes in v3: > - Use is_power_of_2() function > - Use array_size() function >

Re: [PATCH bpf-next] libbpf: make destructors more robust by handling ERR_PTR(err) cases

2020-07-29 Thread Song Liu
On Wed, Jul 29, 2020 at 4:22 PM Andrii Nakryiko wrote: > > Most of libbpf "constructors" on failure return ERR_PTR(err) result encoded as > a pointer. It's a common mistake to eventually pass such malformed pointers > into xxx__destroy()/xxx__free() "destructors". So instead of fixing up > clean u

[PATCH] ravb: Fixed the problem that rmmod can not be done

2020-07-29 Thread Yuusuke Ashizuka
ravb is a module driver, but I cannot rmmod it after insmod it. ravb does mdio_init() at the time of probe, and module->refcnt is incremented by alloc_mdio_bitbang() called after that. Therefore, even if ifup is not performed, the driver is in use and rmmod cannot be performed. $ lsmod Module

Re: [PATCH net-next] Add Mellanox BlueField Gigabit Ethernet driver

2020-07-29 Thread kernel test robot
Hi David, Thank you for the patch! Perhaps something to improve: [auto build test WARNING on net-next/master] url: https://github.com/0day-ci/linux/commits/David-Thompson/Add-Mellanox-BlueField-Gigabit-Ethernet-driver/20200730-023011 base: https://git.kernel.org/pub/scm/linux/kernel/git/da

[PATCH][next] net/sched: act_pedit: Use flex_array_size() helper in memcpy()

2020-07-29 Thread Gustavo A. R. Silva
Make use of the flex_array_size() helper to calculate the size of a flexible array member within an enclosing structure. This helper offers defense-in-depth against potential integer overflows, while at the same time makes it explicitly clear that we are dealing with a flexible array member. Sign

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

2020-07-29 Thread Roman Gushchin
On Mon, Jul 27, 2020 at 10:59:33PM -0700, Andrii Nakryiko wrote: > 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 memloc

答复: [net-next 2/6] i40e: prefetch struct page of Rx buffer conditionally

2020-07-29 Thread Li,Rongqing
> -邮件原件- > 发件人: Jakub Kicinski [mailto:k...@kernel.org] > 发送时间: 2020年7月30日 5:20 > 收件人: Li,Rongqing > 抄送: Tony Nguyen ; da...@davemloft.net; > netdev@vger.kernel.org; nhor...@redhat.com; sassm...@redhat.com; > jeffrey.t.kirs...@intel.com; Andrew Bowers > 主题: Re: [net-next 2/6] i40e: pref

[FINAL REMINDER] LPC 2020 Networking and BPF Track CFP

2020-07-29 Thread David Miller
[ The deadline is this Sunday, please get your submissions in now! ] This is the FINAL reminder for the call for proposals for the networking and bpf track at the Linux Plumbers Conference on the wider internet, which will be happening on August 24th-28th, 2020. This year the technical committe

Re: [PATCH net-next] hinic: add generating mailbox random index support

2020-07-29 Thread luobin (L)
On 2020/7/30 6:03, Jakub Kicinski wrote: > On Wed, 29 Jul 2020 08:59:19 +0800 Luo bin wrote: >> add support to generate mailbox random id for VF to ensure that >> the mailbox message from VF is valid and PF should check whether >> the cmd from VF is supported before passing it to hw. > > This is h

Re: [RFC PATCH net-next v2 6/6] devlink: add overwrite mode to flash update

2020-07-29 Thread Jacob Keller
On 7/29/2020 4:16 PM, Jakub Kicinski wrote: > On Wed, 29 Jul 2020 15:49:05 -0700 Jacob Keller wrote: >> The security revision is tied into the management firmware image and >> would always be updated when an image is updated, but the minimum >> revision is only updated on an explicit request req

Re: [PATCH bpf-next v2] Documentation/bpf: Use valid and new links in index.rst

2020-07-29 Thread Tiezhu Yang
On 07/30/2020 05:06 AM, Song Liu wrote: On Wed, Jul 29, 2020 at 6:17 AM Tiezhu Yang wrote: There exists an error "404 Not Found" when I click the html link of "Documentation/networking/filter.rst" in the BPF documentation [1], fix it. Additionally, use the new links about "BPF and XDP Referenc

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

2020-07-29 Thread Daniel Borkmann
On 7/29/20 6:09 AM, Andrii Nakryiko wrote: 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

[PATCH bpf-next] libbpf: make destructors more robust by handling ERR_PTR(err) cases

2020-07-29 Thread Andrii Nakryiko
Most of libbpf "constructors" on failure return ERR_PTR(err) result encoded as a pointer. It's a common mistake to eventually pass such malformed pointers into xxx__destroy()/xxx__free() "destructors". So instead of fixing up clean up code in selftests and user programs, handle such error pointers

Re: [RFC PATCH net-next v2 6/6] devlink: add overwrite mode to flash update

2020-07-29 Thread Jakub Kicinski
On Wed, 29 Jul 2020 15:49:05 -0700 Jacob Keller wrote: > The security revision is tied into the management firmware image and > would always be updated when an image is updated, but the minimum > revision is only updated on an explicit request request. Does it have to be updated during FW flashing

Re: [PATCH bpf-next] selftests/bpf: don't destroy failed link

2020-07-29 Thread Daniel Borkmann
On 7/29/20 6:50 AM, Andrii Nakryiko wrote: Check that link is NULL or proper pointer before invoking bpf_link__destroy(). Not doing this causes crash in test_progs, when cg_storage_multi selftest fails. Cc: YiFei Zhu Fixes: 3573f384014f ("selftests/bpf: Test CGROUP_STORAGE behavior on shared eg

Re: [PATCH v4 bpf-next 3/4] bpf: Add kernel module with user mode driver that populates bpffs.

2020-07-29 Thread Daniel Borkmann
On 7/24/20 10:38 PM, Alexei Starovoitov wrote: From: Alexei Starovoitov Add kernel module with user mode driver that populates bpffs with BPF iterators. $ mount bpffs /my/bpffs/ -t bpf $ ls -la /my/bpffs/ total 4 drwxrwxrwt 2 root root0 Jul 2 00:27 . drwxr-xr-x 19 root root 4096 Jul 2 0

[PATCH bpf-next 0/5] BPF link force-detach support

2020-07-29 Thread Andrii Nakryiko
This patch set adds new BPF link operation, LINK_DETACH, allowing processes with BPF link FD to force-detach it from respective BPF hook, similarly how BPF link is auto-detached when such BPF hook (e.g., cgroup, net_device, netns, etc) is removed. This facility allows admin to forcefully undo BPF l

[PATCH bpf-next 3/5] selftests/bpf: add link detach tests for cgroup, netns, and xdp bpf_links

2020-07-29 Thread Andrii Nakryiko
Add bpf_link__detach() testing to selftests for cgroup, netns, and xdp bpf_links. Signed-off-by: Andrii Nakryiko --- .../selftests/bpf/prog_tests/cgroup_link.c| 20 +++- .../selftests/bpf/prog_tests/sk_lookup.c | 51 +-- .../selftests/bpf/prog_tests/xdp_link.c

[PATCH bpf-next 5/5] tools/bpftool: add documentation and bash-completion for `link detach`

2020-07-29 Thread Andrii Nakryiko
Add info on link detach sub-command to man page. Add detach to bash-completion as well. Signed-off-by: Andrii Nakryiko --- tools/bpf/bpftool/Documentation/bpftool-link.rst | 8 tools/bpf/bpftool/bash-completion/bpftool| 4 ++-- 2 files changed, 10 insertions(+), 2 deletions(-)

[PATCH bpf-next 4/5] tools/bpftool: add `link detach` subcommand

2020-07-29 Thread Andrii Nakryiko
Add ability to force-detach BPF link. Also add missing error message, if specified link ID is wrong. Signed-off-by: Andrii Nakryiko --- tools/bpf/bpftool/link.c | 35 ++- 1 file changed, 34 insertions(+), 1 deletion(-) diff --git a/tools/bpf/bpftool/link.c b/tool

[PATCH bpf-next 2/5] libbpf: add bpf_link detach APIs

2020-07-29 Thread Andrii Nakryiko
Add low-level bpf_link_detach() API. Also add higher-level bpf_link__detach() one. Signed-off-by: Andrii Nakryiko --- tools/include/uapi/linux/bpf.h | 5 + tools/lib/bpf/bpf.c| 10 ++ tools/lib/bpf/bpf.h| 2 ++ tools/lib/bpf/libbpf.c | 5 + tool

[PATCH bpf-next 1/5] bpf: add support for forced LINK_DETACH command

2020-07-29 Thread Andrii Nakryiko
Add LINK_DETACH command to force-detach bpf_link without destroying it. It has the same behavior as auto-detaching of bpf_link due to cgroup dying for bpf_cgroup_link or net_device being destroyed for bpf_xdp_link. In such case, bpf_link is still a valid kernel object, but is defuncts and doesn't h

Re: [PATCH net] selftests/bpf: add xdpdrv mode for test_xdp_redirect

2020-07-29 Thread Daniel Borkmann
On 7/29/20 11:06 PM, William Tu wrote: On Wed, Jul 29, 2020 at 1:59 PM Song Liu wrote: On Wed, Jul 29, 2020 at 1:59 AM Hangbin Liu wrote: This patch add xdpdrv mode for test_xdp_redirect.sh since veth has support native mode. After update here is the test result: ]# ./test_xdp_redirect.sh s

Re: [PATCH RFC net-next] net: phy: add Marvell PHY PTP support

2020-07-29 Thread Vladimir Oltean
On Wed, Jul 29, 2020 at 11:07:48PM +0100, Russell King - ARM Linux admin wrote: > > The way PHY PTP support is handled is _really_ not nice. > > If we have a phylib driver that supports timestamping, and a MAC driver > that also supports timestamping, then what we end up with is very > messed up.

Re: [PATCH bpf-next 1/2] bpf: expose socket storage to BPF_PROG_TYPE_CGROUP_SOCK

2020-07-29 Thread Daniel Borkmann
On 7/29/20 2:31 AM, Stanislav Fomichev wrote: This lets us use socket storage from the following hooks: * BPF_CGROUP_INET_SOCK_CREATE * BPF_CGROUP_INET_SOCK_RELEASE * BPF_CGROUP_INET4_POST_BIND * BPF_CGROUP_INET6_POST_BIND Using existing 'bpf_sk_storage_get_proto' doesn't work because second arg

[PATCH][next] mlxsw: spectrum_cnt: Use flex_array_size() helper in memcpy()

2020-07-29 Thread Gustavo A. R. Silva
Make use of the flex_array_size() helper to calculate the size of a flexible array member within an enclosing structure. This helper offers defense-in-depth against potential integer overflows, while at the same time makes it explicitly clear that we are dealing witha flexible array member. Also,

Re: [RFC PATCH net-next v2 6/6] devlink: add overwrite mode to flash update

2020-07-29 Thread Jacob Keller
On 7/22/2020 9:52 AM, Jakub Kicinski wrote: > On Wed, 22 Jul 2020 15:30:05 + Keller, Jacob E wrote: >> one by one and then omit the one(s) which is config (guessing which >> one that is based on the name). >> >> Wouldn't this be quite inconvenient? > > I see it as a

Re: [PATCH net] ibmvnic: Fix IRQ mapping disposal in error path

2020-07-29 Thread Thomas Falcon
On 7/29/20 5:28 PM, Jakub Kicinski wrote: On Wed, 29 Jul 2020 16:36:32 -0500 Thomas Falcon wrote: RX queue IRQ mappings are disposed in both the TX IRQ and RX IRQ error paths. Fix this and dispose of TX IRQ mappings correctly in case of an error. Signed-off-by: Thomas Falcon Thomas, please

Re: [PATCH net] ibmvnic: Fix IRQ mapping disposal in error path

2020-07-29 Thread David Miller
From: Thomas Falcon Date: Wed, 29 Jul 2020 16:36:32 -0500 > RX queue IRQ mappings are disposed in both the TX IRQ and RX IRQ > error paths. Fix this and dispose of TX IRQ mappings correctly in > case of an error. > > Signed-off-by: Thomas Falcon Applied with Fixes: tag added and queued up for

Re: [PATCH net] ibmvnic: Fix IRQ mapping disposal in error path

2020-07-29 Thread Jakub Kicinski
On Wed, 29 Jul 2020 16:36:32 -0500 Thomas Falcon wrote: > RX queue IRQ mappings are disposed in both the TX IRQ and RX IRQ > error paths. Fix this and dispose of TX IRQ mappings correctly in > case of an error. > > Signed-off-by: Thomas Falcon Thomas, please remember about Fixes tags (for networ

Re: [PATCH v4 bpf-next 1/4] bpf: Factor out bpf_link_get_by_id() helper.

2020-07-29 Thread Song Liu
On Fri, Jul 24, 2020 at 1:39 PM Alexei Starovoitov wrote: > > From: Alexei Starovoitov > > Refactor the code a bit to extract bpf_link_get_by_id() helper. The commit log doesn't match the code: bpf_link_get_by_id() vs. bpf_link_by_id(). > It's similar to existing bpf_prog_by_id(). > > Signed-of

Re: [PATCH RFC net-next] net: phy: add Marvell PHY PTP support

2020-07-29 Thread Russell King - ARM Linux admin
On Wed, Jul 29, 2020 at 02:28:32PM +0100, Russell King - ARM Linux admin wrote: > On Wed, Jul 29, 2020 at 06:19:32AM -0700, Richard Cochran wrote: > > On Wed, Jul 29, 2020 at 11:58:07AM +0100, Russell King - ARM Linux admin > > wrote: > > > How do we deal with this situation - from what I can see

Re: [PATCH net-next] hinic: add generating mailbox random index support

2020-07-29 Thread Jakub Kicinski
On Wed, 29 Jul 2020 08:59:19 +0800 Luo bin wrote: > add support to generate mailbox random id for VF to ensure that > the mailbox message from VF is valid and PF should check whether > the cmd from VF is supported before passing it to hw. This is hard to review. I don't see how the addition of hin

Re: [bpf PATCH v2 0/5] Fix sock_ops field read splat

2020-07-29 Thread Martin KaFai Lau
On Wed, Jul 29, 2020 at 09:22:36AM -0700, John Fastabend wrote: > Doing some refactoring resulted in a kernel splat when reading sock_ops > fields. > > Patch 1, has the details and proposed fix for sock_ops sk field access. > > Patch 2, has the details and proposed fix for reading sock_ops->sk fi

Re: [PATCH 1/1] netfilter: nat: add range checks for access to nf_nat_l[34]protos[]

2020-07-29 Thread Pablo Neira Ayuso
Hi Will, On Mon, Jul 27, 2020 at 05:57:20PM +, Will McVicker wrote: > The indexes to the nf_nat_l[34]protos arrays come from userspace. So we > need to make sure that before indexing the arrays, we verify the index > is within the array bounds in order to prevent an OOB memory access. > Here i

Re: [GIT PULL] 9p update for 5.8

2020-07-29 Thread pr-tracker-bot
The pull request you sent on Wed, 29 Jul 2020 08:33:06 +0200: > https://github.com/martinetd/linux tags/9p-for-5.8-2 has been merged into torvalds/linux.git: https://git.kernel.org/torvalds/c/21391520cbb597823050ac1bc343a0df3222ac90 Thank you! -- Deet-doot-dot, I am a bot. https://korg.wiki.ke

Re: [PATCH v8 bpf-next 01/13] selftests/bpf: Fix resolve_btfids test

2020-07-29 Thread Andrii Nakryiko
On Wed, Jul 29, 2020 at 1:07 PM Jiri Olsa wrote: > > On Tue, Jul 28, 2020 at 01:27:49PM -0700, Andrii Nakryiko wrote: > > On Wed, Jul 22, 2020 at 2:13 PM Jiri Olsa wrote: > > > > > > The linux/btf_ids.h header is now using CONFIG_DEBUG_INFO_BTF > > > config, so we need to have it defined when it'

Re: [bpf PATCH v2 5/5] bpf, selftests: Add tests to sock_ops for loading sk

2020-07-29 Thread Song Liu
On Wed, Jul 29, 2020 at 9:26 AM John Fastabend wrote: > [...] > > Notice it takes us an extra four instructions when src reg is the > same as dst reg. One to save the reg, two to restore depending on > the branch taken and a goto to jump over the second restore. > > Signed-off-by: John Fastabend

[PATCH net] ibmvnic: Fix IRQ mapping disposal in error path

2020-07-29 Thread Thomas Falcon
RX queue IRQ mappings are disposed in both the TX IRQ and RX IRQ error paths. Fix this and dispose of TX IRQ mappings correctly in case of an error. Signed-off-by: Thomas Falcon --- drivers/net/ethernet/ibm/ibmvnic.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/net

Re: [bpf PATCH v2 4/5] bpf, selftests: Add tests for sock_ops load with r9, r8.r7 registers

2020-07-29 Thread Song Liu
On Wed, Jul 29, 2020 at 9:24 AM John Fastabend wrote: > > Loads in sock_ops case when using high registers requires extra logic to > ensure the correct temporary value is used. We need to ensure the temp > register does not use either the src_reg or dst_reg. Lets add an asm > test to force the log

Re: [bpf PATCH v2 3/5] bpf, selftests: Add tests for ctx access in sock_ops with single register

2020-07-29 Thread Song Liu
On Wed, Jul 29, 2020 at 9:24 AM John Fastabend wrote: > [...] > > Signed-off-by: John Fastabend Acked-by: Song Liu > --- > .../testing/selftests/bpf/progs/test_tcpbpf_kern.c | 13 + > 1 file changed, 13 insertions(+) > > diff --git a/tools/testing/selftests/bpf/progs/test_tcpbp

Re: [bpf PATCH v2 2/5] bpf: sock_ops sk access may stomp registers when dst_reg = src_reg

2020-07-29 Thread Song Liu
On Wed, Jul 29, 2020 at 9:25 AM John Fastabend wrote: > > Similar to patch ("bpf: sock_ops ctx access may stomp registers") if the > src_reg = dst_reg when reading the sk field of a sock_ops struct we > generate xlated code, > > 53: (61) r9 = *(u32 *)(r9 +28) > 54: (15) if r9 == 0x0 goto pc+3

Re: [bpf PATCH v2 1/5] bpf: sock_ops ctx access may stomp registers in corner case

2020-07-29 Thread Song Liu
On Wed, Jul 29, 2020 at 9:24 AM John Fastabend wrote: > > I had a sockmap program that after doing some refactoring started spewing > this splat at me: [...] > least reported it so it must a fairly rare pattern. > > Fixes: 9b1f3d6e5af29 ("bpf: Refactor sock_ops_convert_ctx_access") > Signed-off-by

Re: [PATCH net] ptp: ptp_clockmatrix: update to support 4.8.7 firmware

2020-07-29 Thread Richard Cochran
On Tue, Jul 28, 2020 at 04:00:30PM -0400, min.li...@renesas.com wrote: > From: Min Li > > With 4.8.7 firmware, adjtime can change delta instead of absolute time, > which greately increases snap accuracy. PPS alignment doesn't have to > be set for every single TOD change. Other minor changes inclu

Re: [net-next 5/6] i40e, xsk: increase budget for AF_XDP path

2020-07-29 Thread Jakub Kicinski
On Wed, 29 Jul 2020 12:43:46 +0200 Björn Töpel wrote: > > Should this perhaps be a common things that drivers do? > > > > Should we define a "XSK_NAPI_WEIGHT_MULT 4" instead of hard coding the > > value in a driver? > > Yes, that's a good idea. I can generalize for the AF_XDP paths in the > othe

Re: [net-next 2/6] i40e: prefetch struct page of Rx buffer conditionally

2020-07-29 Thread Jakub Kicinski
On Wed, 29 Jul 2020 06:20:47 + Li,Rongqing wrote: > > Looks like something that belongs in a common header not (potentially > > multiple) C sources. > > Not clear, how should I change? Can you add something like: static inline void prefetch_page_address(struct page *page) { #if defined(WAN

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

2020-07-29 Thread Daniel Borkmann
On 7/29/20 7:48 PM, Andrii Nakryiko wrote: On Wed, Jul 29, 2020 at 7:29 AM Jakub Sitnicki wrote: On Wed, Jul 29, 2020 at 06:09 AM CEST, Andrii Nakryiko wrote: Add test validating that all inner maps are released properly after skeleton is destroyed. To ensure determinism, trigger kernel-side

Re: [PATCH v5 bpf-next 4/6] bpf, x64: rework pro/epilogue and tailcall handling in JIT

2020-07-29 Thread Maciej Fijalkowski
On Wed, Jul 29, 2020 at 06:10:44PM +0200, Maciej Fijalkowski wrote: > On Wed, Jul 29, 2020 at 12:07:52AM +0200, Daniel Borkmann wrote: > > On 7/24/20 7:35 PM, Maciej Fijalkowski wrote: > > > This commit serves two things: > > > 1) it optimizes BPF prologue/epilogue generation > > > 2) it makes poss

[RFC PATCH 3/3] ipv6/icmp: l3mdev: Perform icmp error route lookup on source device routing table

2020-07-29 Thread Mathieu Desnoyers
As per RFC4443, the destination address field for ICMPv6 error messages is copied from the source address field of the invoking packet. In configurations with Virtual Routing and Forwarding tables, looking up which routing table to use for sending ICMPv6 error messages is currently done by using t

[RFC PATCH 1/3] selftests: Add VRF icmp error route lookup test

2020-07-29 Thread Mathieu Desnoyers
From: Michael Jeanson The objective is to check that the incoming vrf routing table is selected to send an ICMP error back to the source when the ttl of a packet reaches 1 while it is forwarded between different vrfs. The first test sends a ping with a ttl of 1 from h1 to h2 and parses the outpu

[RFC PATCH 2/3] ipv4/icmp: l3mdev: Perform icmp error route lookup on source device routing table

2020-07-29 Thread Mathieu Desnoyers
As per RFC792, ICMP errors should be sent to the source host. However, in configurations with Virtual Routing and Forwarding tables, looking up which routing table to use is currently done by using the destination net_device. commit 9d1a6c4ea43e ("net: icmp_route_lookup should use rt dev to deter

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

2020-07-29 Thread Jakub Kicinski
On Wed, 29 Jul 2020 17:37:41 +0300 Moshe Shemesh wrote: > > The fact that the driver supports fw_live_patch, does not necessarily > > mean that the currently running FW can be live upgraded to the > > currently flashed one, right? > > That's correct, though the feature is supported, the firmware

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

2020-07-29 Thread Jakub Kicinski
On Wed, 29 Jul 2020 17:54:08 +0300 Moshe Shemesh wrote: > On 7/28/2020 11:06 PM, Jakub Kicinski wrote: > > On Tue, 28 Jul 2020 12:18:30 -0700 Jacob Keller wrote: > >> On 7/28/2020 11:44 AM, Jakub Kicinski wrote: > >>> From user perspective what's important is what the reset achieves (and > >>>

Re: [PATCH net] selftests/bpf: add xdpdrv mode for test_xdp_redirect

2020-07-29 Thread William Tu
On Wed, Jul 29, 2020 at 1:59 PM Song Liu wrote: > > On Wed, Jul 29, 2020 at 1:59 AM Hangbin Liu wrote: > > > > This patch add xdpdrv mode for test_xdp_redirect.sh since veth has > > support native mode. After update here is the test result: > > > > ]# ./test_xdp_redirect.sh > > selftests: test_xd

Re: [PATCH bpf-next v2] Documentation/bpf: Use valid and new links in index.rst

2020-07-29 Thread Song Liu
On Wed, Jul 29, 2020 at 6:17 AM Tiezhu Yang wrote: > > There exists an error "404 Not Found" when I click the html link of > "Documentation/networking/filter.rst" in the BPF documentation [1], > fix it. > > Additionally, use the new links about "BPF and XDP Reference Guide" > and "bpf(2)" to avoid

Re: [PATCH net] selftests/bpf: add xdpdrv mode for test_xdp_redirect

2020-07-29 Thread Song Liu
On Wed, Jul 29, 2020 at 1:59 AM Hangbin Liu wrote: > > This patch add xdpdrv mode for test_xdp_redirect.sh since veth has > support native mode. After update here is the test result: > > ]# ./test_xdp_redirect.sh > selftests: test_xdp_redirect xdpgeneric [PASS] > selftests: test_xdp_redirect xdpdr

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

2020-07-29 Thread Jakub Kicinski
On Wed, 29 Jul 2020 17:42:12 +0300 Moshe Shemesh wrote: > On 7/28/2020 3:59 AM, Jakub Kicinski wrote: > > 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

Re: [PATCH] net/mlx5e: fix bpf_prog refcnt leaks in mlx5e_alloc_rq

2020-07-29 Thread Saeed Mahameed
On Wed, 2020-07-29 at 13:28 -0700, David Miller wrote: > From: Saeed Mahameed > Date: Wed, 29 Jul 2020 19:02:15 + > > >> Fix this issue by jumping to the error handling path > >> err_rq_wq_destroy > >> when either function fails. > >> > > > > Fixes: 422d4c401edd ("net/mlx5e: RX, Split WQ ob

Re: [PATCH net-next] Add Mellanox BlueField Gigabit Ethernet driver

2020-07-29 Thread Jakub Kicinski
On Wed, 29 Jul 2020 14:29:15 -0400 David Thompson wrote: > This patch adds build and driver logic for the "mlxbf_gige" > Ethernet driver from Mellanox Technologies. Please fix these W=1 C=1 warnings: drivers/net/ethernet/mellanox/mlxbf_gige/mlxbf_gige_main.c:256:29: warning: Using plain integer

Re: [PATCH] netfilter: ip6tables: Remove redundant null checks

2020-07-29 Thread Pablo Neira Ayuso
Applied, thanks.

Re: [PATCH v2] netfilter: Replace HTTP links with HTTPS ones

2020-07-29 Thread Pablo Neira Ayuso
On Sat, Jul 25, 2020 at 07:02:25PM +0200, Alexander A. Klimov wrote: > Rationale: > Reduces attack surface on kernel devs opening the links for MITM > as HTTPS traffic is much harder to manipulate. Applied.

Re: [PATCH net-next] Add Mellanox BlueField Gigabit Ethernet driver

2020-07-29 Thread David Miller
From: David Thompson Date: Wed, 29 Jul 2020 19:41:30 + > It's been pointed out to me that this section is incomplete, and I apologize. ... David, do you have any idea what kind of burdon you create by quoting an entire HUGE patch just to add some commentary to a small portion? Take a look

Re: [PATCH] net/mlx5e: fix bpf_prog refcnt leaks in mlx5e_alloc_rq

2020-07-29 Thread David Miller
From: Saeed Mahameed Date: Wed, 29 Jul 2020 19:02:15 + > On Wed, 2020-07-29 at 20:33 +0800, Xin Xiong wrote: >> The function invokes bpf_prog_inc(), which increases the refcount of >> a >> bpf_prog object "rq->xdp_prog" if the object isn't NULL. >> >> The refcount leak issues take place in t

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

2020-07-29 Thread Jakub Sitnicki
On Wed, Jul 29, 2020 at 07:48 PM CEST, Andrii Nakryiko wrote: > On Wed, Jul 29, 2020 at 7:29 AM Jakub Sitnicki wrote: >> >> On Wed, Jul 29, 2020 at 06:09 AM CEST, Andrii Nakryiko wrote: [...] >> > +/* >> > + * Trigger synchronize_cpu() in kernel. >> >> Nit: synchronize_*r*cu(). > > welp, yeah >

Re: [PATCH net-next] fib: fix fib_rules_ops indirect calls wrappers

2020-07-29 Thread David Miller
From: Brian Vazquez Date: Wed, 29 Jul 2020 11:10:18 -0700 > This patch fixes: > commit b9aaec8f0be5 ("fib: use indirect call wrappers in the most common > fib_rules_ops") which didn't consider the case when > CONFIG_IPV6_MULTIPLE_TABLES is not set. > > Reported-by: Stephen Rothwell > Fixes: b9a

general protection fault in security_inode_getattr

2020-07-29 Thread syzbot
Hello, syzbot found the following issue on: HEAD commit:92ed3019 Linux 5.8-rc7 git tree: upstream console output: https://syzkaller.appspot.com/x/log.txt?x=140003ac90 kernel config: https://syzkaller.appspot.com/x/.config?x=84f076779e989e69 dashboard link: https://syzkaller.appspot

Re: [PATCH v8 bpf-next 09/13] bpf: Add d_path helper

2020-07-29 Thread Al Viro
On Wed, Jul 22, 2020 at 11:12:19PM +0200, Jiri Olsa wrote: > +BTF_SET_START(btf_whitelist_d_path) > +BTF_ID(func, vfs_truncate) > +BTF_ID(func, vfs_fallocate) > +BTF_ID(func, dentry_open) > +BTF_ID(func, vfs_getattr) > +BTF_ID(func, filp_close) > +BTF_SET_END(btf_whitelist_d_path) While we are at

  1   2   3   >