[PATCH net] ipv6: Fix suspicious RCU usage warning in ip6mr

2020-05-14 Thread madhuparnabhowmik10
From: Madhuparna Bhowmik This patch fixes the following warning: = WARNING: suspicious RCU usage 5.7.0-rc4-next-20200507-syzkaller #0 Not tainted - net/ipv6/ip6mr.c:124 RCU-list traversed in non-reader section!! ipmr_new_table() returns an

Re: [PATCH] Fix suspicious RCU usage warning

2020-05-14 Thread Madhuparna Bhowmik
On Wed, May 13, 2020 at 12:00:10PM -0700, David Miller wrote: > From: madhuparnabhowmi...@gmail.com > Date: Wed, 13 May 2020 11:46:10 +0530 > > > From: Madhuparna Bhowmik > > > > This patch fixes the following warning: > > > > = > > WARNING: suspicious RCU usage > >

RE: [EXT] Re: signal quality and cable diagnostic

2020-05-14 Thread Christian Herber
On Tue, May 12, 2020 at 10:22:01AM +0200, Oleksij Rempel wrote: > So I think we should pass raw SQI value to user space, at least in the > first implementation. > What do you think about this? Hi Oleksij, I had a check about the background of this SQI thing. The table you reference with concre

Re: [bpf-next PATCH 2/3] bpf: sk_msg helpers for probe_* and *current_task*

2020-05-14 Thread Yonghong Song
On 5/13/20 12:24 PM, John Fastabend wrote: Often it is useful when applying policy to know something about the task. If the administrator has CAP_SYS_ADMIN rights then they can use kprobe + sk_msg and link the two programs together to accomplish this. However, this is a bit clunky and also mea

Re: [bpf-next PATCH 3/3] bpf: sk_msg add get socket storage helpers

2020-05-14 Thread Yonghong Song
On 5/13/20 12:24 PM, John Fastabend wrote: Add helpers to use local socket storage. Signed-off-by: John Fastabend --- include/uapi/linux/bpf.h |2 ++ net/core/filter.c| 15 +++ 2 files changed, 17 insertions(+) diff --git a/include/uapi/linux/bpf.h b/include/ua

[PATCH net-next 0/2] Fixing compilation warnings and errors

2020-05-14 Thread Ayush Sawal
Patch 1: Fixes the warnings seen when compiling using sparse tool. Patch 2: Fixes a cocci check error introduced after commit 567be3a5d227 ("crypto: chelsio - Use multiple txq/rxq per tfm to process the requests"). Ayush Sawal (2): Crypto/chcr: Fixes compilations warnings Crypto/chcr: Fixes

[PATCH net-next 1/2] Crypto/chcr: Fixes compilations warnings

2020-05-14 Thread Ayush Sawal
This patch fixes the compilation warnings displayed by sparse tool for chcr driver. Signed-off-by: Ayush Sawal --- drivers/crypto/chelsio/chcr_algo.c | 8 drivers/crypto/chelsio/chcr_ipsec.c | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/drivers/crypto/chelsio/c

[PATCH net-next 2/2] Crypto/chcr: Fixes a cocci check error

2020-05-14 Thread Ayush Sawal
This fixes an error observed after running coccinile check. drivers/crypto/chelsio/chcr_algo.c:1462:5-8: Unneeded variable: "err". Return "0" on line 1480 This line is missed in the commit 567be3a5d227 ("crypto: chelsio - Use multiple txq/rxq per tfm to process the requests"). Fixes: 567be3a5d227

Re: [PATCH] KVM: MIPS/TLB: Remove Unneeded semicolon in tlb.c

2020-05-14 Thread Thomas Bogendoerfer
On Tue, Apr 28, 2020 at 02:32:45PM +0800, Jason Yan wrote: > Fix the following coccicheck warning: > > arch/mips/kvm/tlb.c:472:2-3: Unneeded semicolon > arch/mips/kvm/tlb.c:489:2-3: Unneeded semicolon > > Signed-off-by: Jason Yan > --- > arch/mips/kvm/tlb.c | 4 ++-- > 1 file changed, 2 inserti

[PATCH v3 10/15] net: ethernet: mtk-eth-mac: new driver

2020-05-14 Thread Bartosz Golaszewski
From: Bartosz Golaszewski This adds the driver for the MediaTek Ethernet MAC used on the MT8* SoC family. For now we only support full-duplex. Signed-off-by: Bartosz Golaszewski --- drivers/net/ethernet/mediatek/Kconfig |6 + drivers/net/ethernet/mediatek/Makefile |1 + driv

[PATCH v3 11/15] ARM64: dts: mediatek: add pericfg syscon to mt8516.dtsi

2020-05-14 Thread Bartosz Golaszewski
From: Bartosz Golaszewski This adds support for the PERICFG register range as a syscon. This will soon be used by the MediaTek Ethernet MAC driver for NIC configuration. Signed-off-by: Bartosz Golaszewski --- arch/arm64/boot/dts/mediatek/mt8516.dtsi | 5 + 1 file changed, 5 insertions(+)

[PATCH v3 15/15] ARM64: dts: mediatek: enable ethernet on pumpkin boards

2020-05-14 Thread Bartosz Golaszewski
From: Bartosz Golaszewski Add remaining properties to the ethernet node and enable it. Signed-off-by: Bartosz Golaszewski --- .../boot/dts/mediatek/pumpkin-common.dtsi | 18 ++ 1 file changed, 18 insertions(+) diff --git a/arch/arm64/boot/dts/mediatek/pumpkin-common.dtsi

[PATCH v3 07/15] net: move devres helpers into a separate source file

2020-05-14 Thread Bartosz Golaszewski
From: Bartosz Golaszewski There's currently only a single devres helper in net/ - devm variant of alloc_etherdev. Let's move it to net/devres.c with the intention of assing a second one: devm_register_netdev(). This new routine will need to know the address of the release function of devm_alloc_e

[PATCH v3 09/15] net: devres: provide devm_register_netdev()

2020-05-14 Thread Bartosz Golaszewski
From: Bartosz Golaszewski Provide devm_register_netdev() - a device resource managed variant of register_netdev(). This new helper will only work for net_device structs that are also already managed by devres. Signed-off-by: Bartosz Golaszewski --- .../driver-api/driver-model/devres.rst

[PATCH v3 13/15] ARM64: dts: mediatek: add an alias for ethernet0 for pumpkin boards

2020-05-14 Thread Bartosz Golaszewski
From: Bartosz Golaszewski Add the ethernet0 alias for ethernet so that u-boot can find this node and fill in the MAC address. Signed-off-by: Bartosz Golaszewski --- arch/arm64/boot/dts/mediatek/pumpkin-common.dtsi | 1 + 1 file changed, 1 insertion(+) diff --git a/arch/arm64/boot/dts/mediatek

[PATCH v3 12/15] ARM64: dts: mediatek: add the ethernet node to mt8516.dtsi

2020-05-14 Thread Bartosz Golaszewski
From: Bartosz Golaszewski Add the Ethernet MAC node to mt8516.dtsi. This defines parameters common to all the boards based on this SoC. Signed-off-by: Bartosz Golaszewski --- arch/arm64/boot/dts/mediatek/mt8516.dtsi | 12 1 file changed, 12 insertions(+) diff --git a/arch/arm64/b

[PATCH v3 06/15] Documentation: devres: add a missing section for networking helpers

2020-05-14 Thread Bartosz Golaszewski
From: Bartosz Golaszewski Add a new section for networking devres helpers to devres.rst and list the two existing devm functions. Signed-off-by: Bartosz Golaszewski --- Documentation/driver-api/driver-model/devres.rst | 4 1 file changed, 4 insertions(+) diff --git a/Documentation/driver

[PATCH v3 08/15] net: devres: define a separate devres structure for devm_alloc_etherdev()

2020-05-14 Thread Bartosz Golaszewski
From: Bartosz Golaszewski Not using a proxy structure to store struct net_device doesn't save anything in terms of compiled code size or memory usage but significantly decreases the readability of the code with all the pointer casting. Define struct net_device_devres and use it in devm_alloc_eth

[PATCH v3 05/15] net: ethernet: mediatek: remove unnecessary spaces from Makefile

2020-05-14 Thread Bartosz Golaszewski
From: Bartosz Golaszewski The Makefile formatting in the kernel tree usually doesn't use tabs, so remove them before we add a second driver. Signed-off-by: Bartosz Golaszewski --- drivers/net/ethernet/mediatek/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers

[PATCH v3 04/15] net: ethernet: mediatek: rename Kconfig prompt

2020-05-14 Thread Bartosz Golaszewski
From: Bartosz Golaszewski We'll soon by adding a second MediaTek Ethernet driver so modify the Kconfig prompt. Signed-off-by: Bartosz Golaszewski --- drivers/net/ethernet/mediatek/Kconfig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/net/ethernet/mediatek/Kconfig

[PATCH v3 14/15] ARM64: dts: mediatek: add ethernet pins for pumpkin boards

2020-05-14 Thread Bartosz Golaszewski
From: Bartosz Golaszewski Setup the pin control for the Ethernet MAC. Signed-off-by: Bartosz Golaszewski --- arch/arm64/boot/dts/mediatek/pumpkin-common.dtsi | 15 +++ 1 file changed, 15 insertions(+) diff --git a/arch/arm64/boot/dts/mediatek/pumpkin-common.dtsi b/arch/arm64/boot

[PATCH v3 03/15] dt-bindings: net: add a binding document for MediaTek Ethernet MAC

2020-05-14 Thread Bartosz Golaszewski
From: Bartosz Golaszewski This adds yaml DT bindings for the MediaTek Ethernet MAC present on the mt8* family of SoCs. Signed-off-by: Bartosz Golaszewski --- .../bindings/net/mediatek,eth-mac.yaml| 89 +++ 1 file changed, 89 insertions(+) create mode 100644 Documentati

[PATCH v3 00/15] mediatek: add support for MediaTek Ethernet MAC

2020-05-14 Thread Bartosz Golaszewski
From: Bartosz Golaszewski This adds support for the Ethernet Controller present on MediaTeK SoCs from the MT8* family. First we convert the existing DT bindings for the PERICFG controller to YAML and add a new compatible string for mt8516 variant of it. Then we add the DT bindings for the MAC.

[PATCH v3 02/15] dt-bindings: add new compatible to mediatek,pericfg

2020-05-14 Thread Bartosz Golaszewski
From: Bartosz Golaszewski The PERICFG controller is present on the MT8516 SoC. Add an appropriate compatible variant. Signed-off-by: Bartosz Golaszewski --- .../devicetree/bindings/arm/mediatek/mediatek,pericfg.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/Documentation/devic

[PATCH v3 01/15] dt-bindings: convert the binding document for mediatek PERICFG to yaml

2020-05-14 Thread Bartosz Golaszewski
From: Bartosz Golaszewski Convert the DT binding .txt file for MediaTek's peripheral configuration controller to YAML. There's one special case where the compatible has three positions. Otherwise, it's a pretty normal syscon. Signed-off-by: Bartosz Golaszewski --- .../arm/mediatek/mediatek,per

Re: [bpf-next PATCH 2/3] bpf: sk_msg helpers for probe_* and *current_task*

2020-05-14 Thread Daniel Borkmann
On 5/13/20 9:24 PM, John Fastabend wrote: Often it is useful when applying policy to know something about the task. If the administrator has CAP_SYS_ADMIN rights then they can use kprobe + sk_msg and link the two programs together to accomplish this. However, this is a bit clunky and also means w

Re: [PATCH 7/9] bpf: Compile the BTF id whitelist data in vmlinux

2020-05-14 Thread Jiri Olsa
On Wed, May 13, 2020 at 11:29:40AM -0700, Alexei Starovoitov wrote: SNIP > > diff --git a/scripts/link-vmlinux.sh b/scripts/link-vmlinux.sh > > index d09ab4afbda4..dee91c6bf450 100755 > > --- a/scripts/link-vmlinux.sh > > +++ b/scripts/link-vmlinux.sh > > @@ -130,16 +130,26 @@ gen_btf() > > i

RE: [PATCH 27/33] sctp: export sctp_setsockopt_bindx

2020-05-14 Thread David Laight
From: Marcelo Ricardo Leitner > Sent: 13 May 2020 19:01 > On Wed, May 13, 2020 at 08:26:42AM +0200, Christoph Hellwig wrote: > > And call it directly from dlm instead of going through kernel_setsockopt. > > The advantage on using kernel_setsockopt here is that sctp module will > only be loaded if

Re: [EXT] Re: signal quality and cable diagnostic

2020-05-14 Thread Oleksij Rempel
Hi Christian, On Thu, May 14, 2020 at 07:13:30AM +, Christian Herber wrote: > On Tue, May 12, 2020 at 10:22:01AM +0200, Oleksij Rempel wrote: > > > So I think we should pass raw SQI value to user space, at least in the > > first implementation. > > > What do you think about this? > > Hi Ole

RE: remove kernel_setsockopt and kernel_getsockopt

2020-05-14 Thread David Laight
From: Joe Perches > Sent: 13 May 2020 18:39 > On Wed, 2020-05-13 at 08:26 +0200, Christoph Hellwig wrote: > > this series removes the kernel_setsockopt and kernel_getsockopt > > functions, and instead switches their users to small functions that > > implement setting (or in one case getting) a sock

[PATCH bpf-next v2 00/14] Introduce AF_XDP buffer allocation API

2020-05-14 Thread Björn Töpel
Overview Driver adoption for AF_XDP has been slow. The amount of code required to proper support AF_XDP is substantial and the driver/core APIs are vague or even non-existing. Drivers have to manually adjust data offsets, updating AF_XDP handles differently for different modes (aligned/un

[PATCH bpf-next v2 01/14] xsk: move xskmap.c to net/xdp/

2020-05-14 Thread Björn Töpel
From: Björn Töpel The XSKMAP is partly implemented by net/xdp/xsk.c. Move xskmap.c from kernel/bpf/ to net/xdp/, which is the logical place for AF_XDP related code. Also, move AF_XDP struct definitions, and function declarations only used by AF_XDP internals into net/xdp/xsk.h. Signed-off-by: Bj

[PATCH bpf-next v2 03/14] xsk: move defines only used by AF_XDP internals to xsk.h

2020-05-14 Thread Björn Töpel
From: Björn Töpel Move the XSK_NEXT_PG_CONTIG_{MASK,SHIFT}, and XDP_UMEM_USES_NEED_WAKEUP defines from xdp_sock.h to the AF_XDP internal xsk.h file. Also, start using the BIT{,_ULL} macro instead of explicit shifts. Signed-off-by: Björn Töpel --- include/net/xdp_sock.h | 14 -- net

[PATCH bpf-next v2 02/14] xsk: move driver interface to xdp_sock_drv.h

2020-05-14 Thread Björn Töpel
From: Magnus Karlsson Move the AF_XDP zero-copy driver interface to its own include file called xdp_sock_drv.h. This, hopefully, will make it more clear for NIC driver implementors to know what functions to use for zero-copy support. Signed-off-by: Magnus Karlsson --- drivers/net/ethernet/inte

[PATCH bpf-next v2 07/14] i40e, xsk: migrate to new MEM_TYPE_XSK_BUFF_POOL

2020-05-14 Thread Björn Töpel
From: Björn Töpel Remove MEM_TYPE_ZERO_COPY in favor of the new MEM_TYPE_XSK_BUFF_POOL APIs. The AF_XDP zero-copy rx_bi ring is now simply a struct xdp_buff pointer. Cc: intel-wired-...@lists.osuosl.org Signed-off-by: Björn Töpel --- drivers/net/ethernet/intel/i40e/i40e_main.c | 19 +- driver

[PATCH bpf-next v2 06/14] i40e: separate kernel allocated rx_bi rings from AF_XDP rings

2020-05-14 Thread Björn Töpel
From: Björn Töpel Continuing the path to support MEM_TYPE_XSK_BUFF_POOL, the AF_XDP zero-copy/sk_buff rx_bi rings are now separate. Functions to properly allocate the different rings are added as well. Cc: intel-wired-...@lists.osuosl.org Signed-off-by: Björn Töpel --- drivers/net/ethernet/int

[PATCH bpf-next v2 08/14] ice, xsk: migrate to new MEM_TYPE_XSK_BUFF_POOL

2020-05-14 Thread Björn Töpel
From: Björn Töpel Remove MEM_TYPE_ZERO_COPY in favor of the new MEM_TYPE_XSK_BUFF_POOL APIs. Cc: intel-wired-...@lists.osuosl.org Signed-off-by: Maciej Fijalkowski Signed-off-by: Björn Töpel --- drivers/net/ethernet/intel/ice/ice_base.c | 16 +- drivers/net/ethernet/intel/ice/ice_txrx.h |

[PATCH bpf-next v2 05/14] i40e: refactor rx_bi accesses

2020-05-14 Thread Björn Töpel
From: Björn Töpel As a first step to migrate i40e to the new MEM_TYPE_XSK_BUFF_POOL APIs, code that accesses the rx_bi (SW/shadow ring) is refactored to use an accessor function. Cc: intel-wired-...@lists.osuosl.org Signed-off-by: Björn Töpel --- drivers/net/ethernet/intel/i40e/i40e_txrx.c | 1

[PATCH bpf-next v2 09/14] ixgbe, xsk: migrate to new MEM_TYPE_XSK_BUFF_POOL

2020-05-14 Thread Björn Töpel
From: Björn Töpel Remove MEM_TYPE_ZERO_COPY in favor of the new MEM_TYPE_XSK_BUFF_POOL APIs. v1->v2: Fixed xdp_buff data_end update. (Björn) Cc: intel-wired-...@lists.osuosl.org Signed-off-by: Björn Töpel --- drivers/net/ethernet/intel/ixgbe/ixgbe.h | 9 +- drivers/net/ethernet/intel/i

[PATCH bpf-next v2 12/14] xdp: simplify xdp_return_{frame,frame_rx_napi,buff}

2020-05-14 Thread Björn Töpel
From: Björn Töpel The xdp_return_{frame,frame_rx_napi,buff} function are never used, except in xdp_convert_zc_to_xdp_frame(), by the MEM_TYPE_XSK_BUFF_POOL memory type. To simplify and reduce code, change so that xdp_convert_zc_to_xdp_frame() calls xsk_buff_free() directly since the type is know

[PATCH bpf-next v2 04/14] xsk: introduce AF_XDP buffer allocation API

2020-05-14 Thread Björn Töpel
From: Björn Töpel In order to simplify AF_XDP zero-copy enablement for NIC driver developers, a new AF_XDP buffer allocation API is added. The implementation is based on a single core (single producer/consumer) buffer pool for the AF_XDP UMEM. A buffer is allocated using the xsk_buff_alloc() fun

[PATCH bpf-next v2 14/14] MAINTAINERS, xsk: update AF_XDP section after moves/adds

2020-05-14 Thread Björn Töpel
From: Björn Töpel Update MAINTAINERS to correctly mirror the current AF_XDP socket file layout. Also, add the AF_XDP files of libbpf. rfc->v1: Sorted file entries. (Joe) Cc: Joe Perches Signed-off-by: Björn Töpel --- MAINTAINERS | 6 +- 1 file changed, 5 insertions(+), 1 deletion(-) dif

[PATCH bpf-next v2 11/14] xsk: remove MEM_TYPE_ZERO_COPY and corresponding code

2020-05-14 Thread Björn Töpel
From: Björn Töpel There are no users of MEM_TYPE_ZERO_COPY. Remove all corresponding code, including the "handle" member of struct xdp_buff. rfc->v1: Fixed spelling in commit message. (Björn) Signed-off-by: Björn Töpel --- drivers/net/hyperv/netvsc_bpf.c | 1 - include/net/xdp.h

[PATCH bpf-next v2 10/14] mlx5, xsk: migrate to new MEM_TYPE_XSK_BUFF_POOL

2020-05-14 Thread Björn Töpel
From: Björn Töpel Use the new MEM_TYPE_XSK_BUFF_POOL API in lieu of MEM_TYPE_ZERO_COPY in mlx5e. It allows to drop a lot of code from the driver (which is now common in AF_XDP core and was related to XSK RX frame allocation, DMA mapping, etc.) and slightly improve performance. rfc->v1: Put back

[PATCH bpf-next v2 13/14] xsk: explicitly inline functions and move definitions

2020-05-14 Thread Björn Töpel
From: Björn Töpel In order to reduce the number of function calls, the struct xsk_buff_pool definition is moved to xsk_buff_pool.h. The functions xp_get_dma(), xp_dma_sync_for_cpu(), xp_dma_sync_for_device(), xp_validate_desc() and various helper functions are explicitly inlined. Further, move x

Re: signal quality and cable diagnostic

2020-05-14 Thread Christian Herber
On Tue, May 14, 2020 at 08:28:00AM +, Oleksij Rempel wrote: > On Thu, May 14, 2020 at 07:13:30AM +, Christian Herber wrote: > > On Tue, May 12, 2020 at 10:22:01AM +0200, Oleksij Rempel wrote: > > > > > So I think we should pass raw SQI value to user space, at least in the > > > first implem

Re: [PATCH 11/18] maccess: remove strncpy_from_unsafe

2020-05-14 Thread Masami Hiramatsu
On Wed, 13 May 2020 19:43:24 -0700 Linus Torvalds wrote: > On Wed, May 13, 2020 at 6:00 PM Masami Hiramatsu wrote: > > > > > But we should likely at least disallow it entirely on platforms where > > > we really can't - or pick one hardcoded choice. On sparc, you really > > > _have_ to specify on

RE: [PATCH 32/33] sctp: add sctp_sock_get_primary_addr

2020-05-14 Thread David Laight
From: Marcelo Ricardo Leitner > Sent: 13 May 2020 19:03 > > On Wed, May 13, 2020 at 08:26:47AM +0200, Christoph Hellwig wrote: > > Add a helper to directly get the SCTP_PRIMARY_ADDR sockopt from kernel > > space without going through a fake uaccess. > > Same comment as on the other dlm/sctp patch

[PATCH v2 net-next 07/11] net: qede: optional hw recovery procedure

2020-05-14 Thread Igor Russkikh
Driver has an ability to initiate a recovery process as a reaction to detected errors. But the codepath (recovery_process) was disabled and never active. Here we add ethtool private flag to allow user have the recovery procedure activated. We still do not enable this by default though, since in s

[PATCH v2 net-next 06/11] net: qed: attention clearing properties

2020-05-14 Thread Igor Russkikh
On different hardware events we have to respond differently, on some of hardware indications hw attention (error condition) should be cleared by the driver to continue normal functioning. Here we introduce attention clear flags, and put them on some important events (in aeu_descs). Signed-off-by:

[PATCH v2 net-next 04/11] net: qed: critical err reporting to management firmware

2020-05-14 Thread Igor Russkikh
On various critical errors, notification handler should also report the err information into the management firmware. MFW can interact with server/motherboard backend agents - these are used by server manufacturers to monitor server HW health. Thus, it is important for driver to report on any fau

[PATCH v2 net-next 08/11] net: qede: Implement ndo_tx_timeout

2020-05-14 Thread Igor Russkikh
From: Denis Bolotin Upon tx timeout detection we do disable carrier and print TX queue info on TX timeout. We then raise hw error condition and trigger service task to handle this. This handler will capture extra debug info and then optionally trigger recovery procedure to try restore function.

[PATCH v2 net-next 00/11] net: qed/qede: critical hw error handling

2020-05-14 Thread Igor Russkikh
FastLinQ devices as a complex systems may observe various hardware level error conditions, both severe and recoverable. Driver is able to detect and report this, but so far it only did trace/dmesg based reporting. Here we implement an extended hw error detection, service task handler captures a d

[PATCH v2 net-next 03/11] net: qed: invoke err notify on critical areas

2020-05-14 Thread Igor Russkikh
In a number of critical places not only debug trace should be printed, but the appropriate hw error condition should be raised and error handling/recovery should start. Introduce our new qed_hw_err_notify invocation in these places to record and indicate critical error conditions in hardware. Sig

[PATCH v2 net-next 02/11] net: qede: add hw err scheduled handler

2020-05-14 Thread Igor Russkikh
qede (ethernet level driver) registers a callback handler. This handler maintains eth dev state flags/bits to track error processing. It implements in place processing part for nonsleeping context (WARN_ON trigger), and a deferred (delayed work) part which triggers recovery process for recoverable

[PATCH v2 net-next 01/11] net: qed: adding hw_err states and handling

2020-05-14 Thread Igor Russkikh
Here we introduce qed device error tracking flags and error types. qed_hw_err_notify is an entrace point to report errors. It'll notify higher level drivers (qede/qedr/etc) to handle and recover the error. List of posible errors comes from hardware interfaces, but could be extended in future. Si

[PATCH v2 net-next 09/11] net: qed: introduce critical fan failure handler

2020-05-14 Thread Igor Russkikh
Fan failure is sent by firmware, driver reacts on this error with newly introduced notification path. It will collect dump and shut down the device to prevent physical breakage Signed-off-by: Ariel Elior Signed-off-by: Michal Kalderon Signed-off-by: Igor Russkikh --- drivers/net/ethernet/qlogi

[PATCH v2 net-next 11/11] net: qed: fix bad formatting

2020-05-14 Thread Igor Russkikh
On some adjacent code, fix bad code formatting Signed-off-by: Ariel Elior Signed-off-by: Michal Kalderon Signed-off-by: Igor Russkikh --- include/linux/qed/qed_if.h | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/include/linux/qed/qed_if.h b/include/linux/qed/qed_if.h

[PATCH v2 net-next 10/11] net: qed: introduce critical hardware error handler

2020-05-14 Thread Igor Russkikh
MCP may signal driver about generic critical failure. Driver has to collect mdump information (get_retain), it pushes that to logs and triggers generic notification on "hardware attention" event. Signed-off-by: Ariel Elior Signed-off-by: Michal Kalderon Signed-off-by: Igor Russkikh --- drivers

[PATCH v2 net-next 05/11] net: qed: cleanup debug related declarations

2020-05-14 Thread Igor Russkikh
Thats probably a legacy code had double declaration of some fields. Cleanup this, removing copy and fixing references. Signed-off-by: Ariel Elior Signed-off-by: Michal Kalderon Signed-off-by: Igor Russkikh --- drivers/net/ethernet/qlogic/qed/qed.h | 11 +++-- drivers/net/ethernet/qlo

RE: [PATCH 11/18] maccess: remove strncpy_from_unsafe

2020-05-14 Thread David Laight
From: Daniel Borkmann > Sent: 14 May 2020 00:59 > On 5/14/20 1:28 AM, Al Viro wrote: > > On Thu, May 14, 2020 at 12:36:28AM +0200, Daniel Borkmann wrote: > > > >>> So on say s390 TASK_SIZE_USUALLy is (-PAGE_SIZE), which means we'd alway > >>> try the user copy first, which seems odd. > >>> > >>> I'

[PATCH net] pppoe: only process PADT targeted at local interfaces

2020-05-14 Thread Guillaume Nault
We don't want to disconnect a session because of a stray PADT arriving while the interface is in promiscuous mode. Furthermore, multicast and broadcast packets make no sense here, so only PACKET_HOST is accepted. Reported-by: David Balažic Fixes: 1da177e4c3f4 ("Linux-2.6.12-rc2") Signed-off-by: G

Re: remove kernel_setsockopt and kernel_getsockopt

2020-05-14 Thread Christoph Hellwig
On Thu, May 14, 2020 at 08:29:30AM +, David Laight wrote: > You need to export functions that do most of the socket options > for all protocols. Only for those were we have users, and all those are covered.

Re: [PATCH 11/18] maccess: remove strncpy_from_unsafe

2020-05-14 Thread Daniel Borkmann
On 5/14/20 12:01 PM, David Laight wrote: [...] If it's not a stupid question why is a BPF program allowed to get into a situation where it might have an invalid kernel address. It all stinks of a hole that allows all of kernel memory to be read and copied to userspace. Now you might want to som

RE: remove kernel_setsockopt and kernel_getsockopt

2020-05-14 Thread David Laight
From: Christoph Hellwig > Only for those were we have users, and all those are covered. What do we tell all our users when our kernel SCTP code no longer works? It uses SO_REUSADDR, SCTP_EVENTS, SCTP_NODELAY, SCTP_STATUS, SCTP_INITMSG, IPV6_ONLY, SCTP_SOCKOPT_BINDX_ADD and SO_LINGER. We should pr

Re: [PATCH 11/18] maccess: remove strncpy_from_unsafe

2020-05-14 Thread Daniel Borkmann
On 5/14/20 11:44 AM, Masami Hiramatsu wrote: On Wed, 13 May 2020 19:43:24 -0700 Linus Torvalds wrote: On Wed, May 13, 2020 at 6:00 PM Masami Hiramatsu wrote: But we should likely at least disallow it entirely on platforms where we really can't - or pick one hardcoded choice. On sparc, you r

Re: [PATCH stable-5.4.y] net: dsa: Do not make user port errors fatal

2020-05-14 Thread Greg KH
On Wed, May 13, 2020 at 12:55:46PM -0700, David Miller wrote: > From: Florian Fainelli > Date: Wed, 13 May 2020 10:41:45 -0700 > > > commit 86f8b1c01a0a537a73d2996615133be63cdf75db upstream > > > > Prior to 1d27732f411d ("net: dsa: setup and teardown ports"), we would > > not treat failures to s

Re: [PATCH 29/33] rxrpc_sock_set_min_security_level

2020-05-14 Thread Christoph Hellwig
On Wed, May 13, 2020 at 02:13:07PM +0100, David Howells wrote: > Christoph Hellwig wrote: > > > +int rxrpc_sock_set_min_security_level(struct sock *sk, unsigned int val); > > + > > Looks good - but you do need to add this to Documentation/networking/rxrpc.txt > also, thanks. That file doesn't e

[PATCH 1/3] net: stmmac: gmac3: add auxiliary snapshot support

2020-05-14 Thread Olivier Dautricourt
From: Artem Panfilov This patch adds support for time stamping external inputs for GMAC3. The documentation defines 4 auxiliary snapshots ATSEN0 to ATSEN3 which can be toggled by writing the Timestamp Control Register. When the gmac detects a pps rising edge on one of it's auxiliary inputs, an

[PATCH 0/3] Patch series for a PTP Grandmaster use case using stmmac/gmac3 ptp clock

2020-05-14 Thread Olivier Dautricourt
This patch series covers a use case where an embedded system is disciplining an internal clock to a GNSS signal, which provides a stable frequency, and wants to act as a PTP Grandmaster by disciplining a ptp clock to this internal clock. In our setup a 10Mhz oscillator is frequency adjusted so tha

[PATCH 3/3] net: stmmac: Support coarse mode through ioctl

2020-05-14 Thread Olivier Dautricourt
This commit enables coarse correction mode for stmmac driver. The coarse mode allows to update the system time in one process. The required time adjustment is written in the Timestamp Update registers while the Sub-second increment register is programmed with the period of the clock, which is the

[PATCH 2/3] net: uapi: Add HWTSTAMP_FLAGS_ADJ_FINE/ADJ_COARSE

2020-05-14 Thread Olivier Dautricourt
This commit allows a user to specify a flag value for configuring timestamping through hwtsamp_config structure. New flags introduced: HWTSTAMP_FLAGS_NONE = 0 No flag specified: as it is of value 0, this will selects the default behavior for all the existing drivers and should not

Re: [PATCH 20/33] ipv4: add ip_sock_set_recverr

2020-05-14 Thread Christoph Hellwig
On Wed, May 13, 2020 at 02:00:43PM -0700, Joe Perches wrote: > On Wed, 2020-05-13 at 08:26 +0200, Christoph Hellwig wrote: > > Add a helper to directly set the IP_RECVERR sockopt from kernel space > > without going through a fake uaccess. > > This seems used only with true as the second arg. > Is

Re: remove kernel_setsockopt and kernel_getsockopt

2020-05-14 Thread 'Christoph Hellwig'
On Thu, May 14, 2020 at 10:26:41AM +, David Laight wrote: > From: Christoph Hellwig > > Only for those were we have users, and all those are covered. > > What do we tell all our users when our kernel SCTP code > no longer works? We only care about in-tree modules, just like for every other in

is it ok to always pull in sctp for dlm, was: Re: [PATCH 27/33] sctp: export sctp_setsockopt_bindx

2020-05-14 Thread Christoph Hellwig
On Wed, May 13, 2020 at 03:00:58PM -0300, Marcelo Ricardo Leitner wrote: > On Wed, May 13, 2020 at 08:26:42AM +0200, Christoph Hellwig wrote: > > And call it directly from dlm instead of going through kernel_setsockopt. > > The advantage on using kernel_setsockopt here is that sctp module will > o

[PATCH net-next v4 07/33] xdp: xdp_frame add member frame_sz and handle in convert_to_xdp_frame

2020-05-14 Thread Jesper Dangaard Brouer
Use hole in struct xdp_frame, when adding member frame_sz, which keeps same sizeof struct (32 bytes) Drivers ixgbe and sfc had bug cases where the necessary/expected tailroom was not reserved. This can lead to some hard to catch memory corruption issues. Having the drivers frame_sz this can be det

[PATCH net-next v4 00/33] XDP extend with knowledge of frame size

2020-05-14 Thread Jesper Dangaard Brouer
(Patchset based on net-next due to all the driver updates) V4: - Fixup checkpatch.pl issues - Collected more ACKs V3: - Fix issue on virtio_net patch spotted by Jason Wang - Adjust name for variable in mlx5 patch - Collected more ACKs V2: - Fix bug in mlx5 for XDP_PASS case - Collected nitpicks

[PATCH net-next v4 05/33] net: netsec: Add support for XDP frame size

2020-05-14 Thread Jesper Dangaard Brouer
From: Ilias Apalodimas This driver takes advantage of page_pool PP_FLAG_DMA_SYNC_DEV that can help reduce the number of cache-lines that need to be flushed when doing DMA sync for_device. Due to xdp_adjust_tail can grow the area accessible to the by the CPU (can possibly write into), then max syn

[PATCH net-next v4 06/33] net: XDP-generic determining XDP frame size

2020-05-14 Thread Jesper Dangaard Brouer
The SKB "head" pointer points to the data area that contains skb_shared_info, that can be found via skb_end_pointer(). Given xdp->data_hard_start have been established (basically pointing to skb->head), frame size is between skb_end_pointer() and data_hard_start, plus the size reserved to skb_share

[PATCH net-next v4 03/33] sfc: add XDP frame size

2020-05-14 Thread Jesper Dangaard Brouer
This driver uses RX page-split when possible. It was recently fixed in commit 86e85bf6981c ("sfc: fix XDP-redirect in this driver") to add needed tailroom for XDP-redirect. After the fix efx->rx_page_buf_step is the frame size, with enough head and tail-room for XDP-redirect. Signed-off-by: Jespe

[PATCH net-next v4 02/33] bnxt: add XDP frame size to driver

2020-05-14 Thread Jesper Dangaard Brouer
This driver uses full PAGE_SIZE pages when XDP is enabled. In case of XDP uses driver uses __bnxt_alloc_rx_page which does full page DMA-map. Thus, xdp_adjust_tail grow is DMA compliant for XDP_TX action that does DMA-sync. Cc: Michael Chan Cc: Andy Gospodarek Signed-off-by: Jesper Dangaard Bro

[PATCH net-next v4 09/33] veth: adjust hard_start offset on redirect XDP frames

2020-05-14 Thread Jesper Dangaard Brouer
When native XDP redirect into a veth device, the frame arrives in the xdp_frame structure. It is then processed in veth_xdp_rcv_one(), which can run a new XDP bpf_prog on the packet. Doing so requires converting xdp_frame to xdp_buff, but the tricky part is that xdp_frame memory area is located in

[PATCH net-next v4 04/33] mvneta: add XDP frame size to driver

2020-05-14 Thread Jesper Dangaard Brouer
This marvell driver mvneta uses PAGE_SIZE frames, which makes it really easy to convert. Driver updates rxq and now frame_sz once per NAPI call. This driver takes advantage of page_pool PP_FLAG_DMA_SYNC_DEV that can help reduce the number of cache-lines that need to be flushed when doing DMA sync

[PATCH net-next v4 01/33] xdp: add frame size to xdp_buff

2020-05-14 Thread Jesper Dangaard Brouer
XDP have evolved to support several frame sizes, but xdp_buff was not updated with this information. The frame size (frame_sz) member of xdp_buff is introduced to know the real size of the memory the frame is delivered in. When introducing this also make it clear that some tailroom is reserved/req

[PATCH net-next v4 08/33] xdp: cpumap redirect use frame_sz and increase skb_tailroom

2020-05-14 Thread Jesper Dangaard Brouer
Knowing the memory size backing the packet/xdp_frame data area, and knowing it already have reserved room for skb_shared_info, simplifies using build_skb significantly. With this change we no-longer lie about the SKB truesize, but more importantly a significant larger skb_tailroom is now provided,

[PATCH net-next v4 10/33] veth: xdp using frame_sz in veth driver

2020-05-14 Thread Jesper Dangaard Brouer
The veth driver can run XDP in "native" mode in it's own NAPI handler, and since commit 9fc8d518d9d5 ("veth: Handle xdp_frames in xdp napi ring") packets can come in two forms either xdp_frame or skb, calling respectively veth_xdp_rcv_one() or veth_xdp_rcv_skb(). For packets to arrive in xdp_frame

[PATCH net-next v4 13/33] qlogic/qede: add XDP frame size to driver

2020-05-14 Thread Jesper Dangaard Brouer
The driver qede uses a full page, when XDP is enabled. The drivers value in rx_buf_seg_size (struct qede_rx_queue) will be PAGE_SIZE when an XDP bpf_prog is attached. Cc: Ariel Elior Cc: gr-everest-linux...@marvell.com Signed-off-by: Jesper Dangaard Brouer --- drivers/net/ethernet/qlogic/qede/q

[PATCH net-next v4 15/33] ena: add XDP frame size to amazon NIC driver

2020-05-14 Thread Jesper Dangaard Brouer
Frame size ENA_PAGE_SIZE is limited to 16K on systems with larger PAGE_SIZE than 16K. Change ENA_XDP_MAX_MTU to also take into account the reserved tailroom. Cc: Arthur Kiyanovski Acked-by: Sameeh Jubran Signed-off-by: Jesper Dangaard Brouer --- drivers/net/ethernet/amazon/ena/ena_netdev.c |

[PATCH net-next v4 12/33] hv_netvsc: add XDP frame size to driver

2020-05-14 Thread Jesper Dangaard Brouer
The hyperv NIC driver does memory allocation and copy even without XDP. In XDP mode it will allocate a new page for each packet and copy over the payload, before invoking the XDP BPF-prog. The positive thing it that its easy to determine the xdp.frame_sz. The XDP implementation for hv_netvsc tran

[PATCH net-next v4 20/33] vhost_net: also populate XDP frame size

2020-05-14 Thread Jesper Dangaard Brouer
In vhost_net_build_xdp() the 'buf' that gets queued via an xdp_buff have embedded a struct tun_xdp_hdr (located at xdp->data_hard_start) which contains the buffer length 'buflen' (with tailroom for skb_shared_info). Also storing this buflen in xdp->frame_sz, does not obsolete struct tun_xdp_hdr, as

[PATCH net-next v4 17/33] net: thunderx: add XDP frame size

2020-05-14 Thread Jesper Dangaard Brouer
To help reviewers these are the defines related to RCV_FRAG_LEN #define DMA_BUFFER_LEN 1536 /* In multiples of 128bytes */ #define RCV_FRAG_LEN (SKB_DATA_ALIGN(DMA_BUFFER_LEN + NET_SKB_PAD) + \ SKB_DATA_ALIGN(sizeof(struct skb_shared_info))) Cc: Sunil Goutham Cc: Rob

[PATCH net-next v4 21/33] virtio_net: add XDP frame size in two code paths

2020-05-14 Thread Jesper Dangaard Brouer
The virtio_net driver is running inside the guest-OS. There are two XDP receive code-paths in virtio_net, namely receive_small() and receive_mergeable(). The receive_big() function does not support XDP. In receive_small() the frame size is available in buflen. The buffer backing these frames are a

[PATCH net-next v4 19/33] tun: add XDP frame size

2020-05-14 Thread Jesper Dangaard Brouer
The tun driver have two code paths for running XDP (bpf_prog_run_xdp). In both cases 'buflen' contains enough tailroom for skb_shared_info. Cc: Jason Wang Signed-off-by: Jesper Dangaard Brouer Acked-by: Michael S. Tsirkin Acked-by: Jason Wang --- drivers/net/tun.c |2 ++ 1 file changed, 2

[PATCH net-next v4 22/33] ixgbe: fix XDP redirect on archs with PAGE_SIZE above 4K

2020-05-14 Thread Jesper Dangaard Brouer
The ixgbe driver have another memory model when compiled on archs with PAGE_SIZE above 4096 bytes. In this mode it doesn't split the page in two halves, but instead increment rx_buffer->page_offset by truesize of packet (which include headroom and tailroom for skb_shared_info). This is done correc

[PATCH net-next v4 11/33] dpaa2-eth: add XDP frame size

2020-05-14 Thread Jesper Dangaard Brouer
The dpaa2-eth driver reserve some headroom used for hardware and software annotation area in RX/TX buffers. Thus, xdp.data_hard_start doesn't start at page boundary. When XDP is configured the area reserved via dpaa2_fd_get_offset(fd) is 448 bytes of which XDP have reserved 256 bytes. As frame_sz

[PATCH net-next v4 14/33] net: ethernet: ti: add XDP frame size to driver cpsw

2020-05-14 Thread Jesper Dangaard Brouer
The driver code cpsw.c and cpsw_new.c both use page_pool with default order-0 pages or their RX-pages. Cc: Grygorii Strashko Cc: Ilias Apalodimas Signed-off-by: Jesper Dangaard Brouer Reviewed-by: Grygorii Strashko --- drivers/net/ethernet/ti/cpsw.c |1 + drivers/net/ethernet/ti/cpsw_

[PATCH net-next v4 16/33] mlx4: add XDP frame size and adjust max XDP MTU

2020-05-14 Thread Jesper Dangaard Brouer
The mlx4 drivers size of memory backing the RX packet is stored in frag_stride. For XDP mode this will be PAGE_SIZE (normally 4096). For normal mode frag_stride is 2048. Also adjust MLX4_EN_MAX_XDP_MTU to take tailroom into account. Cc: Tariq Toukan Cc: Saeed Mahameed Signed-off-by: Jesper Dang

[PATCH net-next v4 18/33] nfp: add XDP frame size to netronome driver

2020-05-14 Thread Jesper Dangaard Brouer
The netronome nfp driver use PAGE_SIZE when xdp_prog is set, but xdp.data_hard_start begins at offset NFP_NET_RX_BUF_HEADROOM. Thus, adjust for this when setting xdp.frame_sz, as it counts from data_hard_start. When doing XDP_TX this driver is smart and instead of a full DMA-map does a DMA-sync on

[PATCH net-next v4 24/33] ixgbevf: add XDP frame size to VF driver

2020-05-14 Thread Jesper Dangaard Brouer
This patch mirrors the changes to ixgbe in previous patch. This VF driver doesn't support XDP_REDIRECT, but correct tailroom is still necessary for BPF-helper xdp_adjust_tail. In legacy-mode + larger PAGE_SIZE, due to lacking tailroom, we accept that xdp_adjust_tail shrink doesn't work. Cc: inte

[PATCH net-next v4 23/33] ixgbe: add XDP frame size to driver

2020-05-14 Thread Jesper Dangaard Brouer
This driver uses different memory models depending on PAGE_SIZE at compile time. For PAGE_SIZE 4K it uses page splitting, meaning for normal MTU frame size is 2048 bytes (and headroom 192 bytes). For larger MTUs the driver still use page splitting, by allocating order-1 pages (8192 bytes) for RX fr

  1   2   3   4   5   >