Re: [PATCH mlx5-next v7 1/4] PCI: Add a sysfs file to change the MSI-X table size of SR-IOV VFs

2021-03-01 Thread Greg Kroah-Hartman
On Mon, Mar 01, 2021 at 09:55:21AM +0200, Leon Romanovsky wrote: > From: Leon Romanovsky > > A typical cloud provider SR-IOV use case is to create many VFs for use by > guest VMs. The VFs may not be assigned to a VM until a customer requests a > VM of a certain size, e.g., number of CPUs. A VF ma

Re: [PATCH net] net: phy: ti: take into account all possible interrupt sources

2021-03-01 Thread Ioana Ciornei
On Sun, Feb 28, 2021 at 12:00:27PM -0800, Jakub Kicinski wrote: > On Fri, 26 Feb 2021 17:30:20 +0200 Ioana Ciornei wrote: > > diff --git a/drivers/net/phy/dp83822.c b/drivers/net/phy/dp83822.c > > index be1224b4447b..f7a2ec150e54 100644 > > --- a/drivers/net/phy/dp83822.c > > +++ b/drivers/net/phy/

Re: [RFC PATCH net 1/2] nexthop: Do not flush blackhole nexthops when loopback goes down

2021-03-01 Thread Ido Schimmel
On Sun, Feb 28, 2021 at 04:40:13PM -0700, David Ahern wrote: > LGTM. I suggest submitting without the RFC. > > Reviewed-by: David Ahern Thanks, David. Will let it go through regression and submit later this week.

Re: [PATCH v2 1/3] lockdep: add lockdep_assert_not_held()

2021-03-01 Thread Peter Zijlstra
On Fri, Feb 26, 2021 at 02:16:12PM -0700, Shuah Khan wrote: > On 2/26/21 2:07 PM, Peter Zijlstra wrote: > > On Fri, Feb 26, 2021 at 10:52:13AM -0700, Shuah Khan wrote: > > > + /* avoid false negative lockdep_assert_not_held() > > > + * and lockdep_assert_held() > > > + */

Re: [PATCH mlx5-next v7 1/4] PCI: Add a sysfs file to change the MSI-X table size of SR-IOV VFs

2021-03-01 Thread Leon Romanovsky
On Mon, Mar 01, 2021 at 09:14:42AM +0100, Greg Kroah-Hartman wrote: > On Mon, Mar 01, 2021 at 09:55:21AM +0200, Leon Romanovsky wrote: > > From: Leon Romanovsky > > > > A typical cloud provider SR-IOV use case is to create many VFs for use by > > guest VMs. The VFs may not be assigned to a VM unti

Re: [PATCH mlx5-next v7 1/4] PCI: Add a sysfs file to change the MSI-X table size of SR-IOV VFs

2021-03-01 Thread Greg Kroah-Hartman
On Mon, Mar 01, 2021 at 10:32:09AM +0200, Leon Romanovsky wrote: > On Mon, Mar 01, 2021 at 09:14:42AM +0100, Greg Kroah-Hartman wrote: > > On Mon, Mar 01, 2021 at 09:55:21AM +0200, Leon Romanovsky wrote: > > > From: Leon Romanovsky > > > > > > A typical cloud provider SR-IOV use case is to create

Re: [PATCH v3 0/3] Add lockdep_assert_not_held()

2021-03-01 Thread Peter Zijlstra
On Fri, Feb 26, 2021 at 05:06:57PM -0700, Shuah Khan wrote: > Shuah Khan (3): > lockdep: add lockdep_assert_not_held() > lockdep: add lockdep lock state defines > ath10k: detect conf_mutex held ath10k_drain_tx() calls Thanks!

cleanup unused or almost unused IOMMU APIs and the FSL PAMU driver

2021-03-01 Thread Christoph Hellwig
Hi all, there are a bunch of IOMMU APIs that are entirely unused, or only used as a private communication channel between the FSL PAMU driver and it's only consumer, the qbman portal driver. So this series drops a huge chunk of entirely unused FSL PAMU functionality, then drops all kinds of unuse

[PATCH 01/17] iommu: remove the unused domain_window_disable method

2021-03-01 Thread Christoph Hellwig
domain_window_disable is wired up by fsl_pamu, but never actually called. Signed-off-by: Christoph Hellwig --- drivers/iommu/fsl_pamu_domain.c | 48 - include/linux/iommu.h | 2 -- 2 files changed, 50 deletions(-) diff --git a/drivers/iommu/fsl_pamu_do

[PATCH 02/17] iommu/fsl_pamu: remove fsl_pamu_get_domain_attr

2021-03-01 Thread Christoph Hellwig
None of the values returned by this function are ever queried. Also remove the DOMAIN_ATTR_FSL_PAMUV1 enum value that is not otherwise used. Signed-off-by: Christoph Hellwig --- drivers/iommu/fsl_pamu_domain.c | 30 -- include/linux/iommu.h | 4 2 fil

[PATCH 03/17] iommu/fsl_pamu: remove support for setting DOMAIN_ATTR_GEOMETRY

2021-03-01 Thread Christoph Hellwig
The default geometry is the same as the one set by qman_port given that FSL_PAMU depends on having 64-bit physical and thus DMA addresses. Remove the support to update the geometry and remove the now pointless geom_size field. Signed-off-by: Christoph Hellwig --- drivers/iommu/fsl_pamu_domain.c

[PATCH 04/17] iommu/fsl_pamu: merge iommu_alloc_dma_domain into fsl_pamu_domain_alloc

2021-03-01 Thread Christoph Hellwig
Keep the functionality to allocate the domain together. Signed-off-by: Christoph Hellwig --- drivers/iommu/fsl_pamu_domain.c | 34 ++--- 1 file changed, 10 insertions(+), 24 deletions(-) diff --git a/drivers/iommu/fsl_pamu_domain.c b/drivers/iommu/fsl_pamu_domain.c i

[PATCH 06/17] iommu/fsl_pamu: remove ->domain_window_enable

2021-03-01 Thread Christoph Hellwig
The only thing that fsl_pamu_window_enable does for the current caller is to fill in the prot value in the only dma_window structure, and to propagate a few values from the iommu_domain_geometry struture into the dma_window. Remove the dma_window entirely, hardcode the prot value and otherwise use

[PATCH 05/17] iommu/fsl_pamu: remove support for multiple windows

2021-03-01 Thread Christoph Hellwig
The only domains allocated forces use of a single window. Remove all the code related to multiple window support, as well as the need for qman_portal to force a single window. Remove the now unused DOMAIN_ATTR_WINDOWS iommu_attr. Signed-off-by: Christoph Hellwig --- drivers/iommu/fsl_pamu.c

[PATCH 07/17] iommu/fsl_pamu: replace DOMAIN_ATTR_FSL_PAMU_STASH with a direct call

2021-03-01 Thread Christoph Hellwig
Add a fsl_pamu_configure_l1_stash API that qman_portal can call directly instead of indirecting through the iommu attr API. Signed-off-by: Christoph Hellwig --- arch/powerpc/include/asm/fsl_pamu_stash.h | 12 +++- drivers/iommu/fsl_pamu_domain.c | 16 +++- drivers/i

[PATCH 08/17] iommu/fsl_pamu: merge pamu_set_liodn and map_liodn

2021-03-01 Thread Christoph Hellwig
Merge the two fuctions that configure the ppaace into a single coherent function. I somehow doubt we need the two pamu_config_ppaace calls, but keep the existing behavior just to be on the safe side. Signed-off-by: Christoph Hellwig --- drivers/iommu/fsl_pamu_domain.c | 65 +

Re: [PATCH v3 0/3] Add lockdep_assert_not_held()

2021-03-01 Thread Kalle Valo
Peter Zijlstra writes: > On Fri, Feb 26, 2021 at 05:06:57PM -0700, Shuah Khan wrote: >> Shuah Khan (3): >> lockdep: add lockdep_assert_not_held() >> lockdep: add lockdep lock state defines >> ath10k: detect conf_mutex held ath10k_drain_tx() calls > > Thanks! Via which tree should these go?

[PATCH 10/17] iommu/fsl_pamu: enable the liodn when attaching a device

2021-03-01 Thread Christoph Hellwig
Instead of a separate call to enable all devices from the list, just enablde the liodn one the device is attached to the iommu domain. This also remove the DOMAIN_ATTR_FSL_PAMU_ENABLE iommu_attr. Signed-off-by: Christoph Hellwig --- drivers/iommu/fsl_pamu_domain.c | 47 ++---

[PATCH 09/17] iommu/fsl_pamu: merge handle_attach_device into fsl_pamu_attach_device

2021-03-01 Thread Christoph Hellwig
No good reason to split this functionality over two functions. Signed-off-by: Christoph Hellwig --- drivers/iommu/fsl_pamu_domain.c | 59 +++-- 1 file changed, 20 insertions(+), 39 deletions(-) diff --git a/drivers/iommu/fsl_pamu_domain.c b/drivers/iommu/fsl_pamu_dom

[PATCH 11/17] iommu/fsl_pamu: remove the snoop_id field

2021-03-01 Thread Christoph Hellwig
The snoop_id is always set to ~(u32)0. Signed-off-by: Christoph Hellwig --- drivers/iommu/fsl_pamu_domain.c | 5 ++--- drivers/iommu/fsl_pamu_domain.h | 1 - 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/iommu/fsl_pamu_domain.c b/drivers/iommu/fsl_pamu_domain.c index 21c

[PATCH 14/17] iommu: remove DOMAIN_ATTR_DMA_USE_FLUSH_QUEUE

2021-03-01 Thread Christoph Hellwig
Use explicit methods for setting and querying the information instead. Also remove the now unused iommu_domain_get_attr functionality. Signed-off-by: Christoph Hellwig --- drivers/iommu/amd/iommu.c | 23 ++--- drivers/iommu/arm/arm-smmu-v3/arm-smmu-v3.c | 47 ++

[PATCH 13/17] iommu: remove DOMAIN_ATTR_GEOMETRY

2021-03-01 Thread Christoph Hellwig
The geometry information can be trivially queried from the iommu_domain struture. Signed-off-by: Christoph Hellwig --- drivers/iommu/iommu.c | 20 +++- drivers/soc/fsl/qbman/qman_portal.c | 1 + drivers/vfio/vfio_iommu_type1.c | 26 -- d

[PATCH 12/17] iommu: remove DOMAIN_ATTR_PAGING

2021-03-01 Thread Christoph Hellwig
DOMAIN_ATTR_PAGING is never used. Signed-off-by: Christoph Hellwig --- drivers/iommu/iommu.c | 5 - include/linux/iommu.h | 1 - 2 files changed, 6 deletions(-) diff --git a/drivers/iommu/iommu.c b/drivers/iommu/iommu.c index b212bf0261820b..9a4cda390993e6 100644 --- a/drivers/iommu/iommu.c

[PATCH 15/17] iommu: remove DOMAIN_ATTR_NESTING

2021-03-01 Thread Christoph Hellwig
Signed-off-by: Christoph Hellwig --- drivers/iommu/arm/arm-smmu-v3/arm-smmu-v3.c | 40 ++--- drivers/iommu/arm/arm-smmu/arm-smmu.c | 30 ++-- drivers/iommu/intel/iommu.c | 28 +-- drivers/iommu/iommu.c | 8 +

[PATCH 17/17] iommu: remove iommu_domain_set_attr

2021-03-01 Thread Christoph Hellwig
Signed-off-by: Christoph Hellwig --- drivers/iommu/iommu.c | 17 - include/linux/iommu.h | 27 --- 2 files changed, 44 deletions(-) diff --git a/drivers/iommu/iommu.c b/drivers/iommu/iommu.c index 8490aefd4b41f8..b04e6cefe8520d 100644 --- a/drivers/iommu/i

[PATCH 16/17] iommu: remove DOMAIN_ATTR_IO_PGTABLE_CFG

2021-03-01 Thread Christoph Hellwig
Signed-off-by: Christoph Hellwig --- drivers/gpu/drm/msm/adreno/adreno_gpu.c | 2 +- drivers/iommu/arm/arm-smmu/arm-smmu.c | 40 +++-- drivers/iommu/iommu.c | 9 ++ include/linux/iommu.h | 9 +- 4 files changed, 29 insertions(+)

Re: [PATCH mlx5-next v7 1/4] PCI: Add a sysfs file to change the MSI-X table size of SR-IOV VFs

2021-03-01 Thread Leon Romanovsky
On Mon, Mar 01, 2021 at 09:37:17AM +0100, Greg Kroah-Hartman wrote: > On Mon, Mar 01, 2021 at 10:32:09AM +0200, Leon Romanovsky wrote: > > On Mon, Mar 01, 2021 at 09:14:42AM +0100, Greg Kroah-Hartman wrote: > > > On Mon, Mar 01, 2021 at 09:55:21AM +0200, Leon Romanovsky wrote: > > > > From: Leon Ro

Re: [PATCH 10/11] pragma once: delete few backslashes

2021-03-01 Thread Ido Schimmel
On Sun, Feb 28, 2021 at 08:05:14PM +0300, Alexey Dobriyan wrote: > From 251ca5673886b5bb0a42004944290b9d2b267a4a Mon Sep 17 00:00:00 2001 > From: Alexey Dobriyan > Date: Fri, 19 Feb 2021 13:37:24 +0300 > Subject: [PATCH 10/11] pragma once: delete few backslashes > > Some macros contain one backsl

Re: [PATCH net-next RFC v4] net: hdlc_x25: Queue outgoing LAPB frames

2021-03-01 Thread Xie He
On Sun, Feb 28, 2021 at 10:56 PM Martin Schiller wrote: > > >> Also, I have a hard time assessing if such a wrap is really > >> enforceable. > > > > Sorry. I don't understand what you mean. What "wrap" are you referring > > to? > > I mean the change from only one hdlc interface to both hdlc and >

Re: [PATCH v3 0/3] Add lockdep_assert_not_held()

2021-03-01 Thread Peter Zijlstra
On Mon, Mar 01, 2021 at 10:45:32AM +0200, Kalle Valo wrote: > Peter Zijlstra writes: > > > On Fri, Feb 26, 2021 at 05:06:57PM -0700, Shuah Khan wrote: > >> Shuah Khan (3): > >> lockdep: add lockdep_assert_not_held() > >> lockdep: add lockdep lock state defines > >> ath10k: detect conf_mutex

Re: [PATCH] net/mlx5e: fix mlx5e_tc_tun_update_header_ipv6 dummy definition

2021-03-01 Thread Vlad Buslov
On Thu 25 Feb 2021 at 14:54, Arnd Bergmann wrote: > From: Arnd Bergmann > > The alternative implementation of this function in a header file > is declared as a global symbol, and gets added to every .c file > that includes it, which leads to a link error: > > arm-linux-gnueabi-ld: drivers/net/eth

Re: [PATCH bpf 2/4] nsfs: add an ioctl to discover the network namespace cookie

2021-03-01 Thread Christian Brauner
On Wed, Feb 10, 2021 at 12:04:23PM +, Lorenz Bauer wrote: > Network namespaces have a globally unique non-zero identifier aka a > cookie, in line with socket cookies. Add an ioctl to retrieve the > cookie from user space without going via BPF. > > Cc: linux-...@vger.kernel.org > Signed-off-by:

Re: [PATCH mellanox-tree] net/mlx5: prevent an integer underflow in mlx5_perout_configure()

2021-03-01 Thread Eran Ben Elisha
On 2/19/2021 11:57 AM, Dan Carpenter wrote: The value of "sec" comes from the user. Negative values will lead to shift wrapping inside the perout_conf_real_time() function and triggger a UBSan warning. Add a check and return -EINVAL to prevent that from happening. Fixes: 432119de33d9 ("net/

[PATCH bpf-next v3 2/5] bpf: add PROG_TEST_RUN support for sk_lookup programs

2021-03-01 Thread Lorenz Bauer
Allow to pass sk_lookup programs to PROG_TEST_RUN. User space provides the full bpf_sk_lookup struct as context. Since the context includes a socket pointer that can't be exposed to user space we define that PROG_TEST_RUN returns the cookie of the selected socket or zero in place of the socket poin

[PATCH bpf-next v3 0/5] PROG_TEST_RUN support for sk_lookup programs

2021-03-01 Thread Lorenz Bauer
We don't have PROG_TEST_RUN support for sk_lookup programs at the moment. So far this hasn't been a problem, since we can run our tests in a separate network namespace. For benchmarking it's nice to have PROG_TEST_RUN, so I've gone and implemented it. Based on discussion on the v1 I've dropped sup

[PATCH bpf-next v3 1/5] bpf: consolidate shared test timing code

2021-03-01 Thread Lorenz Bauer
Share the timing / signal interruption logic between different implementations of PROG_TEST_RUN. There is a change in behaviour as well. We check the loop exit condition before checking for pending signals. This resolves an edge case where a signal arrives during the last iteration. Instead of abor

[PATCH bpf-next v3 3/5] selftests: bpf: convert sk_lookup ctx access tests to PROG_TEST_RUN

2021-03-01 Thread Lorenz Bauer
Convert the selftests for sk_lookup narrow context access to use PROG_TEST_RUN instead of creating actual sockets. This ensures that ctx is populated correctly when using PROG_TEST_RUN. Assert concrete values since we now control remote_ip and remote_port. Signed-off-by: Lorenz Bauer --- .../se

[PATCH bpf-next v3 4/5] selftests: bpf: check that PROG_TEST_RUN repeats as requested

2021-03-01 Thread Lorenz Bauer
Extend a simple prog_run test to check that PROG_TEST_RUN adheres to the requested repetitions. Convert it to use BPF skeleton. Signed-off-by: Lorenz Bauer --- .../selftests/bpf/prog_tests/prog_run_xattr.c | 51 +++ 1 file changed, 42 insertions(+), 9 deletions(-) diff --git a/t

[PATCH bpf-next v3 5/5] selftests: bpf: don't run sk_lookup in verifier tests

2021-03-01 Thread Lorenz Bauer
sk_lookup doesn't allow setting data_in for bpf_prog_run. This doesn't play well with the verifier tests, since they always set a 64 byte input buffer. Allow not running verifier tests by setting bpf_test.runs to a negative value and don't run the ctx access case for sk_lookup. We have dedicated ct

[RFC V2 resend net-next 0/3] net: stmmac: implement clocks management

2021-03-01 Thread Joakim Zhang
This patch set tries to implement clocks management, and takes i.MX platform as an example. --- ChangeLogs: V1->V2: * change to pm runtime mechanism. * rename function: _enable() -> _config() * take MDIO bus into account, it needs clocks when interface is closed.

[RFC V2 resend net-next 1/3] net: stmmac: add clocks management for gmac driver

2021-03-01 Thread Joakim Zhang
This patch intends to add clocks management for stmmac driver: If CONFIG_PM enabled: 1. Keep clocks disabled after driver probed. 2. Enable clocks when up the net device, and disable clocks when down the net device. If CONFIG_PM disabled: Keep clocks always enabled after driver probed. Note: 1.

[RFC V2 resend net-next 3/3] net: stmmac: dwmac-imx: add platform level clocks management for i.MX

2021-03-01 Thread Joakim Zhang
Split clocks settings from init callback into clks_config callback, which could support platform level clocks management. Signed-off-by: Joakim Zhang --- .../net/ethernet/stmicro/stmmac/dwmac-imx.c | 60 +++ 1 file changed, 36 insertions(+), 24 deletions(-) diff --git a/driver

[RFC V2 resend net-next 2/3] net: stmmac: add platform level clocks management

2021-03-01 Thread Joakim Zhang
This patch intends to add platform level clocks management. Some platforms may have their own special clocks, they also need to be managed dynamically. If you want to manage such clocks, please implement clks_config callback. Signed-off-by: Joakim Zhang --- drivers/net/ethernet/stmicro/stmmac/st

Re: [PATCH RFC leds + net-next 2/7] leds: trigger: netdev: simplify the driver by using bit field members

2021-03-01 Thread Pavel Machek
On Fri 2020-10-30 12:44:30, Marek Behún wrote: > Use bit fields members in struct led_netdev_data instead of one mode > member and set_bit/clear_bit/test_bit functions. These functions are > suitable for longer or variable length bit arrays. They also provide atomicity guarantees. If you can expla

Re: [PATCH mellanox-tree] net/mlx5: prevent an integer underflow in mlx5_perout_configure()

2021-03-01 Thread Dan Carpenter
On Mon, Mar 01, 2021 at 12:12:34PM +0200, Eran Ben Elisha wrote: > > > On 2/19/2021 11:57 AM, Dan Carpenter wrote: > > The value of "sec" comes from the user. Negative values will lead to > > shift wrapping inside the perout_conf_real_time() function and triggger > > a UBSan warning. > > > > Ad

Re: [PATCH RFC leds + net-next 3/7] leds: trigger: add API for HW offloading of triggers

2021-03-01 Thread Pavel Machek
Hi! > If the trigger with given configuration cannot be offloaded, the method > should return -EOPNOTSUPP, in which case the trigger must blink the LED > in SW. > > Signed-off-by: Marek Behún > + > +If the second argument (enable) to the trigger_offload() method is false, any > +active HW offlo

[PATCH bpf-next 0/2] load-acquire/store-release semantics for AF_XDP rings

2021-03-01 Thread Björn Töpel
This two-patch series introduces load-acquire/store-release semantics for the AF_XDP rings. For most contemporary architectures, this is more effective than a SPSC ring based on smp_{r,w,}mb() barriers. More importantly, load-acquire/store-release semantics make the ring code easier to follow. Th

[PATCH bpf-next 1/2] xsk: update rings for load-acquire/store-release semantics

2021-03-01 Thread Björn Töpel
From: Björn Töpel Currently, the AF_XDP rings uses smp_{r,w,}mb() fences on the kernel-side. By updating the rings for load-acquire/store-release semantics, the full barrier on the consumer side can be replaced with improved performance as a nice side-effect. Note that this change does *not* req

[PATCH bpf-next 2/2] libbpf, xsk: add libbpf_smp_store_release libbpf_smp_load_acquire

2021-03-01 Thread Björn Töpel
From: Björn Töpel Now that the AF_XDP rings have load-acquire/store-release semantics, move libbpf to that as well. The library-internal libbpf_smp_{load_acquire,store_release} are only valid for 32-bit words on ARM64. Also, remove the barriers that are no longer in use. Signed-off-by: Björn T

Re: [PATCH RFC leds + net-next 4/7] leds: trigger: netdev: support HW offloading

2021-03-01 Thread Pavel Machek
Hi! > Add support for HW offloading of the netdev trigger. > > We need to change spinlock to mutex, because if spinlock is used, the > trigger_offload() method cannot sleep, which can happen for ethernet > PHYs. Is that bugfix or just needed for offloading? Should be separate patch in any case.

[PATCH] esp4: Simplify the calculation of variables

2021-03-01 Thread Jiapeng Chong
Fix the following coccicheck warnings: ./net/ipv4/esp4.c:757:16-18: WARNING !A || A && B is equivalent to !A || B. Reported-by: Abaci Robot Signed-off-by: Jiapeng Chong --- net/ipv4/esp4.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/net/ipv4/esp4.c b/net/ipv4/esp4.c ind

Re: [PATCH RFC leds + net-next 5/7] net: phy: add simple incrementing phyindex member to phy_device struct

2021-03-01 Thread Pavel Machek
On Fri 2020-10-30 12:44:33, Marek Behún wrote: > Add a new integer member phyindex to struct phy_device. This member is > unique for every phy_device. Atomic incrementation occurs in > phy_device_register. > > This can be used for example in LED sysfs API. The LED subsystem names > each LED in for

Re: [PATCH RFC leds + net-next 6/7] net: phy: add support for LEDs connected to ethernet PHYs

2021-03-01 Thread Pavel Machek
HI! > Many an ethernet PHY chip has pins dedicated for LEDs. On some PHYs it > can be configured via registers whether the LED should be ON, OFF, or > whether its state should depend on events within the chip (link, rx/tx > activity and so on). > > Add support for probing such LEDs. > > A PHY dr

[PATCH iproute2-next 1/4] devlink: Use library provided string processing APIs

2021-03-01 Thread Parav Pandit
User helper routines provided by library for counting slash and splitting string on delimiter. Signed-off-by: Parav Pandit Reviewed-by: Jiri Pirko --- devlink/devlink.c | 43 +-- 1 file changed, 9 insertions(+), 34 deletions(-) diff --git a/devlink/devli

[PATCH iproute2-next 0/4] devlink: Use utils helpers

2021-03-01 Thread Parav Pandit
This series uses utils helper for socket operations, string processing and print error messages. Patch summary: Patch-1 uses utils library helper for string split and string search Patch-2 extends library for socket receive operation Patch-3 converts devlink to use socket helpers from utlis librar

RE: [PATCH net v4 1/1] can: can_skb_set_owner(): fix ref counting if socket was closed before setting skb ownership

2021-03-01 Thread Joakim Zhang
> -Original Message- > From: Oleksij Rempel > Sent: 2021年2月26日 17:25 > To: m...@pengutronix.de; David S. Miller ; Jakub > Kicinski ; Oliver Hartkopp ; > Robin van der Gracht > Cc: Oleksij Rempel ; Andre Naujoks > ; Eric Dumazet ; > ker...@pengutronix.de; linux-...@vger.kernel.org; netdev

[PATCH iproute2-next 3/4] devlink: Use generic socket helpers from library

2021-03-01 Thread Parav Pandit
User generic socket helpers from library for netlink generic socket access. Signed-off-by: Parav Pandit Reviewed-by: Jiri Pirko --- devlink/devlink.c | 314 ++ devlink/mnlg.c| 121 ++ devlink/mnlg.h| 13 +- 3 files changed, 16

[PATCH iproute2-next 4/4] devlink: Add error print when unknown values specified

2021-03-01 Thread Parav Pandit
When user specifies either unknown flavour or unknown state during devlink port commands, return appropriate error message. Signed-off-by: Parav Pandit --- devlink/devlink.c | 8 ++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/devlink/devlink.c b/devlink/devlink.c index ea

[PATCH iproute2-next 2/4] utils: Introduce helper routines for generic socket recv

2021-03-01 Thread Parav Pandit
Introduce helper for generic socket receive helper and introduce helper to build command with custom family and version. Use API in subsequent devlink patch. Signed-off-by: Parav Pandit Reviewed-by: Jiri Pirko --- include/mnl_utils.h | 6 ++ lib/mnl_utils.c | 25 +-

Re: [PATCH v3 0/3] Add lockdep_assert_not_held()

2021-03-01 Thread Kalle Valo
Peter Zijlstra writes: > On Mon, Mar 01, 2021 at 10:45:32AM +0200, Kalle Valo wrote: >> Peter Zijlstra writes: >> >> > On Fri, Feb 26, 2021 at 05:06:57PM -0700, Shuah Khan wrote: >> >> Shuah Khan (3): >> >> lockdep: add lockdep_assert_not_held() >> >> lockdep: add lockdep lock state defines

Re: [PATCH RFC leds + net-next 7/7] net: phy: marvell: support LEDs connected on Marvell PHYs

2021-03-01 Thread Pavel Machek
Hi! > Add support for controlling the LEDs connected to several families of > Marvell PHYs via Linux LED API. These families currently are: 88E1112, > 88E1116R, 88E1118, 88E1121R, 88E1149R, 88E1240, 88E1318S, 88E1340S, > 88E1510, 88E1545 and 88E1548P. > > This does not yet add support for compoun

[PATCH v3 net 0/8] Fixes for NXP ENETC driver

2021-03-01 Thread Vladimir Oltean
From: Vladimir Oltean This contains an assorted set of fixes collected over the past 2 weeks on the enetc driver. Some are related to VLAN processing, some to physical link settings, some are fixups of previous hardware workarounds, and some are simply zero-day data path bugs that for some reason

[PATCH v3 net 1/8] net: enetc: don't overwrite the RSS indirection table when initializing

2021-03-01 Thread Vladimir Oltean
From: Vladimir Oltean After the blamed patch, all RX traffic gets hashed to CPU 0 because the hashing indirection table set up in: enetc_pf_probe -> enetc_alloc_si_resources -> enetc_configure_si -> enetc_setup_default_rss_table is overwritten later in: enetc_pf_probe -> enetc_init_po

[PATCH v3 net 2/8] net: enetc: initialize RFS/RSS memories for unused ports too

2021-03-01 Thread Vladimir Oltean
From: Vladimir Oltean Michael reports that since linux-next-20210211, the AER messages for ECC errors have started reappearing, and this time they can be reliably reproduced with the first ping on one of his LS1028A boards. $ ping 1[ 33.258069] pcieport :00:1f.0: AER: Multiple Corrected er

[PATCH v3 net 5/8] net: enetc: don't disable VLAN filtering in IFF_PROMISC mode

2021-03-01 Thread Vladimir Oltean
From: Vladimir Oltean Quoting from the blamed commit: In promiscuous mode, it is more intuitive that all traffic is received, including VLAN tagged traffic. It appears that it is necessary to set the flag in PSIPVMR for that to be the case, so VLAN promiscuous mode is also tempor

[PATCH v3 net 6/8] net: enetc: force the RGMII speed and duplex instead of operating in inband mode

2021-03-01 Thread Vladimir Oltean
From: Vladimir Oltean The ENETC port 0 MAC supports in-band status signaling coming from a PHY when operating in RGMII mode, and this feature is enabled by default. It has been reported that RGMII is broken in fixed-link, and that is not surprising considering the fact that no PHY is attached to

[PATCH v3 net 7/8] net: enetc: remove bogus write to SIRXIDR from enetc_setup_rxbdr

2021-03-01 Thread Vladimir Oltean
From: Vladimir Oltean The Station Interface Receive Interrupt Detect Register (SIRXIDR) contains a 16-bit wide mask of 'interrupt detected' events for each ring associated with a port. Bit i is write-1-to-clean for RX ring i. I have no explanation whatsoever how this line of code came to be inse

[PATCH v3 net 4/8] net: enetc: fix incorrect TPID when receiving 802.1ad tagged packets

2021-03-01 Thread Vladimir Oltean
From: Vladimir Oltean When the enetc ports have rx-vlan-offload enabled, they report a TPID of ETH_P_8021Q regardless of what was actually in the packet. When rx-vlan-offload is disabled, packets have the proper TPID. Fix this inconsistency by finishing the TODO left in the code. Fixes: d4fd0404

[PATCH v3 net 3/8] net: enetc: take the MDIO lock only once per NAPI poll cycle

2021-03-01 Thread Vladimir Oltean
From: Vladimir Oltean The workaround for the ENETC MDIO erratum caused a performance degradation of 82 Kpps (seen with IP forwarding of two 1Gbps streams of 64B packets). This is due to excessive locking and unlocking in the fast path, which can be avoided. By taking the MDIO read-side lock only

[PATCH v3 net 8/8] net: enetc: keep RX ring consumer index in sync with hardware

2021-03-01 Thread Vladimir Oltean
From: Vladimir Oltean The RX rings have a producer index owned by hardware, where newly received frame buffers are placed, and a consumer index owned by software, where newly allocated buffers are placed, in expectation of hardware being able to place frame data in them. Hardware increments the

pull-request: can 2021-03-01

2021-03-01 Thread Marc Kleine-Budde
-fot-net' (2021-02-28 12:04:02 -0800) are available in the Git repository at: git://git.kernel.org/pub/scm/linux/kernel/git/mkl/linux-can.git tags/linux-can-fixes-for-5.12-20210301 for you to fetch changes up to 2712625200ed69c642b9abc3a403830c4643364c: can: tcan4x5x: tcan4x5x_init()

[net 1/6] can: flexcan: assert FRZ bit in flexcan_chip_freeze()

2021-03-01 Thread Marc Kleine-Budde
From: Joakim Zhang Assert HALT bit to enter freeze mode, there is a premise that FRZ bit is asserted. This patch asserts FRZ bit in flexcan_chip_freeze, although the reset value is 1b'1. This is a prepare patch, later patch will invoke flexcan_chip_freeze() to enter freeze mode, which polling fre

[net 2/6] can: flexcan: enable RX FIFO after FRZ/HALT valid

2021-03-01 Thread Marc Kleine-Budde
From: Joakim Zhang RX FIFO enable failed could happen when do system reboot stress test: [0.303958] flexcan 5a8d.can: 5a8d.can supply xceiver not found, using dummy regulator [0.304281] flexcan 5a8d.can (unnamed net_device) (uninitialized): Could not enable RX FIFO, unsuppo

[net 6/6] can: tcan4x5x: tcan4x5x_init(): fix initialization - clear MRAM before entering Normal Mode

2021-03-01 Thread Marc Kleine-Budde
From: Torin Cooper-Bennun This patch prevents a potentially destructive race condition. The device is fully operational on the bus after entering Normal Mode, so zeroing the MRAM after entering this mode may lead to loss of information, e.g. new received messages. This patch fixes the problem by

[net 4/6] can: mcp251xfd: revert "can: mcp251xfd: add BQL support"

2021-03-01 Thread Marc Kleine-Budde
In the following 4 patches | 99842c9685ab can: dev: can_rx_offload_get_echo_skb(): extend to return can frame length | 9420e1d495e2 can: dev: can_get_echo_skb(): extend to return can frame length | 1dcb6e57db83 can: dev: can_put_echo_skb(): extend to handle frame_len | f0ef72febc9a can: dev: exte

[net 5/6] can: skb: can_skb_set_owner(): fix ref counting if socket was closed before setting skb ownership

2021-03-01 Thread Marc Kleine-Budde
From: Oleksij Rempel There are two ref count variables controlling the free()ing of a socket: - struct sock::sk_refcnt - which is changed by sock_hold()/sock_put() - struct sock::sk_wmem_alloc - which accounts the memory allocated by the skbs in the send path. In case there are still TX skbs o

[net 3/6] can: flexcan: invoke flexcan_chip_freeze() to enter freeze mode

2021-03-01 Thread Marc Kleine-Budde
From: Joakim Zhang Invoke flexcan_chip_freeze() to enter freeze mode, since need poll freeze mode acknowledge. Fixes: e955cead03117 ("CAN: Add Flexcan CAN controller driver") Link: https://lore.kernel.org/r/20210218110037.16591-4-qiangqing.zh...@nxp.com Signed-off-by: Joakim Zhang Signed-off-by

Re: [PATCH] xfrm: Use actual socket sk instead of skb socket for xfrm_output_resume

2021-03-01 Thread Steffen Klassert
On Mon, Mar 01, 2021 at 05:02:08PM +1300, Evan Nimmo wrote: > A situation can occur where the interface bound to the sk is different > to the interface bound to the sk attached to the skb. The interface > bound to the sk is the correct one however this information is lost inside > xfrm_output2 and

Re: [PATCH v2] xfrm: Fix incorrect types in assignment

2021-03-01 Thread Steffen Klassert
On Sat, Feb 20, 2021 at 11:18:23AM +0800, Yang Li wrote: > Fix the following sparse warnings: > net/xfrm/xfrm_policy.c:1303:22: warning: incorrect type in assignment > (different address spaces) > > Reported-by: Abaci Robot > Signed-off-by: Yang Li Please add a proper 'Fixes' tag so that it can

Re: rename the command ip

2021-03-01 Thread Phil Sutter
On Mon, Mar 01, 2021 at 08:20:33AM +0200, Leon Romanovsky wrote: > On Sun, Feb 28, 2021 at 10:39:14PM +0100, Phil Sutter wrote: > > William, > > > > [Cc'ing netdev list as that's the place to discuss iproute2 > > development.] > > <...> > > > > IMPORTANT NOTICE: The contents of this email and any

Re: [PATCH v2 bpf-next] bpf: devmap: move drop error path to devmap for XDP_REDIRECT

2021-03-01 Thread Shay Agroskin
Jesper Dangaard Brouer writes: On Sun, 28 Feb 2021 23:27:25 +0100 Lorenzo Bianconi wrote: > > drops = bq->count - sent; > > -out: > > - bq->count = 0; > > + if (unlikely(drops > 0)) { > > + /* If not all frames have been > > transmitted, it is our > > + * resp

Re: [PATCH v2 3/6] can: c_can: fix control interface used by c_can_do_tx

2021-03-01 Thread Marc Kleine-Budde
On 28.02.2021 11:35:31, Dario Binacchi wrote: > > On 25.02.2021 22:51:52, Dario Binacchi wrote: > > > According to commit 640916db2bf7 ("can: c_can: Make it SMP safe") let RX > > > use > > > IF1 (i.e. IF_RX) and TX use IF2 (i.e. IF_TX). > > > > Is this a fix? > > > > I think that If I consider

Re: [PATCH v3 5/6] can: c_can: prepare to up the message objects number

2021-03-01 Thread Marc Kleine-Budde
On 28.02.2021 11:38:54, Dario Binacchi wrote: [...] > @@ -730,7 +728,7 @@ static void c_can_do_tx(struct net_device *dev) > while ((idx = ffs(pend))) { > idx--; > pend &= ~(1 << idx); > - obj = idx + C_CAN_MSG_OBJ_TX_FIRST; > + obj = idx +

KMSAN: uninit-value in dgram_sendmsg

2021-03-01 Thread syzbot
Hello, syzbot found the following issue on: HEAD commit:29ad81a1 arch/x86: add missing include to sparsemem.h git tree: https://github.com/google/kmsan.git master console output: https://syzkaller.appspot.com/x/log.txt?x=13b86466d0 kernel config: https://syzkaller.appspot.com/x/.co

Re: [PATCH v2 5/6] can: c_can: prepare to up the message objects number

2021-03-01 Thread Marc Kleine-Budde
On 28.02.2021 11:18:13, Dario Binacchi wrote: > > > + u32 msg_obj_rx_mask; > > > > Is this variable big enough after you've extended the driver to use 64 > > mailboxes? > > Yes. I have kept the message assignment policy unchanged, they are equally > divided between reception and transmission. Th

Re: [PATCH v2 bpf-next] bpf: devmap: move drop error path to devmap for XDP_REDIRECT

2021-03-01 Thread Ioana Ciornei
On Sat, Feb 27, 2021 at 12:04:13PM +0100, Lorenzo Bianconi wrote: > We want to change the current ndo_xdp_xmit drop semantics because > it will allow us to implement better queue overflow handling. > This is working towards the larger goal of a XDP TX queue-hook. > Move XDP_REDIRECT error path hand

Driver i40e have XDP-redirect bug

2021-03-01 Thread Jesper Dangaard Brouer
Hi i40e-people + XDP-feature-people, The driver i40e have a XDP-redirect bug, where is it partly broken. It can transmit a redirected xdp_frame (from another driver). But broken when redirecting a xdp_frame that is received by the driver itself. This reminds me about lacking XDP-features, as thi

Re: [PATCH v2 bpf-next] bpf: devmap: move drop error path to devmap for XDP_REDIRECT

2021-03-01 Thread Ilias Apalodimas
Hi Lorenzo for the netsec driver Reviewed-by: Ilias Apalodimas On Sat, Feb 27, 2021 at 12:04:13PM +0100, Lorenzo Bianconi wrote: > We want to change the current ndo_xdp_xmit drop semantics because > it will allow us to implement better queue overflow handling. > This is working towards the larg

[PATCH] docs: networking: bonding.rst Fix a typo in bonding.rst

2021-03-01 Thread Masanari Iida
This patch fixes a spelling typo in bonding.rst. Signed-off-by: Masanari Iida --- Documentation/networking/bonding.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Documentation/networking/bonding.rst b/Documentation/networking/bonding.rst index 5f690f0ad0e4..62f2aab8eaec

Re: [PATCH rdma-next] RDMA: Support more than 255 rdma ports

2021-03-01 Thread Jason Gunthorpe
On Mon, Mar 01, 2021 at 09:04:20AM +0200, Leon Romanovsky wrote: > @@ -884,7 +884,7 @@ static void gid_table_reserve_default(struct ib_device > *ib_dev, u8 port, > > static void gid_table_release_one(struct ib_device *ib_dev) > { > - unsigned int p; > + u32 p; > > rdma_for_each_p

Re: [RFC net-next 1/2] net: dsa: add Realtek RTL8366S switch tag

2021-03-01 Thread Linus Walleij
On Sun, Feb 28, 2021 at 12:32 PM DENG Qingfang wrote: > On Sun, Feb 28, 2021 at 7:47 AM Linus Walleij > wrote: > > > > I names the previous protocol "RTL4 A" after a 4-byte tag > > with protocol indicted as "A", what about naming this > > "RTL2 9" in the same vein? It will be good if some other

Re: [PATCH v3 5/6] can: c_can: prepare to up the message objects number

2021-03-01 Thread Marc Kleine-Budde
On 01.03.2021 12:38:05, Marc Kleine-Budde wrote: > On 28.02.2021 11:38:54, Dario Binacchi wrote: > [...] > > > @@ -730,7 +728,7 @@ static void c_can_do_tx(struct net_device *dev) > > while ((idx = ffs(pend))) { > > idx--; > > pend &= ~(1 << idx); > > - obj = i

Re: [PATCH] net/core/skbuff.c: __netdev_alloc_skb fix when len is greater than KMALLOC_MAX_SIZE

2021-03-01 Thread Eric Dumazet
On 2/26/21 8:11 PM, Pavel Skripkin wrote: > syzbot found WARNING in __alloc_pages_nodemask()[1] when order >= MAX_ORDER. > It was caused by __netdev_alloc_skb(), which doesn't check len value after > adding NET_SKB_PAD. > Order will be >= MAX_ORDER and passed to __alloc_pages_nodemask() if size

[PATCH RFC V2 net-next 1/2] net: page_pool: refactor dma_map into own function page_pool_dma_map

2021-03-01 Thread Jesper Dangaard Brouer
In preparation for next patch, move the dma mapping into its own function, as this will make it easier to follow the changes. V2: make page_pool_dma_map return boolean (Ilias) Signed-off-by: Jesper Dangaard Brouer --- net/core/page_pool.c | 45 ++--- 1

[PATCH RFC V2 net-next 2/2] net: page_pool: use alloc_pages_bulk in refill code path

2021-03-01 Thread Jesper Dangaard Brouer
There are cases where the page_pool need to refill with pages from the page allocator. Some workloads cause the page_pool to release pages instead of recycling these pages. For these workload it can improve performance to bulk alloc pages from the page-allocator to refill the alloc cache. For XDP

[PATCH RFC V2 net-next 0/2] Use bulk order-0 page allocator API for page_pool

2021-03-01 Thread Jesper Dangaard Brouer
This is a followup to Mel Gorman's patchset: - Message-Id: <20210224102603.19524-1-mgor...@techsingularity.net> - https://lore.kernel.org/netdev/20210224102603.19524-1-mgor...@techsingularity.net/ Showing page_pool usage of the API for alloc_pages_bulk(). Maybe Mel Gorman will/can carry these

[PATCH net 2/3] net: dsa: rtl4_a: Drop skb_cow_head()

2021-03-01 Thread Linus Walleij
The DSA core already provides the tag headroom, drop this. Fixes: 86dd9868b878 ("net: dsa: tag_rtl4_a: Support also egress tags") Reported-by: Andrew Lunn Reported-by: DENG Qingfang Cc: Mauri Sandberg Signed-off-by: Linus Walleij --- net/dsa/tag_rtl4_a.c | 2 -- 1 file changed, 2 deletions(-)

[PATCH net 3/3] net: dsa: rtl4_a: Syntax fixes

2021-03-01 Thread Linus Walleij
Some errors spotted in the initial patch: use reverse christmas tree for nice code looks and fix a spelling mistake. Reported-by: Andrew Lunn Reported-by: DENG Qingfang Cc: Mauri Sandberg Signed-off-by: Linus Walleij --- net/dsa/tag_rtl4_a.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deleti

[PATCH net 1/3] net: dsa: rtl4_a: Pad using __skb_put_padto()

2021-03-01 Thread Linus Walleij
The eth_skb_pad() function will cause a double free on failure since dsa_slave_xmit() will try to free the frame if we return NULL. Fix this by using __skb_put_padto() instead. Fixes: 86dd9868b878 ("net: dsa: tag_rtl4_a: Support also egress tags") Reported-by: DENG Qingfang Cc: Mauri Sandberg Si

Re: [PATCH v3 net 8/8] net: enetc: keep RX ring consumer index in sync with hardware

2021-03-01 Thread Vladimir Oltean
On Mon, Mar 01, 2021 at 01:18:18PM +0200, Vladimir Oltean wrote: > The simpler thing would be to put the write to the consumer index into > enetc_refill_rx_ring directly, but there are issues with the MDIO > locking: in the NAPI poll code we have the enetc_lock_mdio() taken from > top-level and we

  1   2   >