Re: net/sonic: Fix some resource leaks in error handling paths

2020-05-10 Thread Markus Elfring
> If you can't determine when the bug was introduced, I might be able to determine also this information. > how can you criticise a patch for the lack of a Fixes tag? I dared to point two details out for the discussed patch. >> To which commit would you like to refer to for the proposed adjus

Re: [PATCH] net/davicom: Add SOC to dm9000 to initialize SROM_BANK clock.

2020-05-10 Thread Sascha Hauer
On Sun, May 10, 2020 at 07:02:13PM +0800, zhoubo...@foxmail.com wrote: > From: To-run-away > > Increase the use of dm9000 to initialize the SROM_BANK clock in the SOC, > otherwise the chip will not work. The dm9000 doesn't have anything called SROM in it. You have to describe the clock input pin

Re: [net-next PATCH v3 4/5] net: phy: Introduce fwnode_get_phy_id()

2020-05-10 Thread Calvin Johnson
Thanks Andrew and Jeremy for the detailed discussion! On Fri, May 08, 2020 at 08:13:01PM +0200, Andrew Lunn wrote: > > > It does have a numeric version defined for EISA types. OTOH I suspect that > > > your right. If there were a "PHY\VEN_ID&ID_" definition, it may > > > not > > > be idea

[PATCH v1 net-next 3/3] net: dsa: felix: add support Credit Based Shaper(CBS) for hardware offload

2020-05-10 Thread Xiaoliang Yang
VSC9959 hardware support the Credit Based Shaper(CBS) which part of the IEEE-802.1Qav. This patch support sch_cbs set for VSC9959. Signed-off-by: Xiaoliang Yang --- drivers/net/dsa/ocelot/felix_vsc9959.c | 52 +- 1 file changed, 51 insertions(+), 1 deletion(-) diff --git

[PATCH v1 net-next 0/3] net: dsa: felix: tc taprio and CBS offload support

2020-05-10 Thread Xiaoliang Yang
This patch series support tc taprio and CBS hardware offload according to IEEE 802.1Qbv and IEEE-802.1Qav on VSC9959. Xiaoliang Yang (3): net: dsa: felix: qos classified based on pcp net: dsa: felix: Configure Time-Aware Scheduler via taprio offload net: dsa: felix: add support Credit Based

[PATCH v1 net-next 2/3] net: dsa: felix: Configure Time-Aware Scheduler via taprio offload

2020-05-10 Thread Xiaoliang Yang
Ocelot VSC9959 switch supports time-based egress shaping in hardware according to IEEE 802.1Qbv. This patch add support for TAS configuration on egress port of VSC9959 switch. Felix driver is an instance of Ocelot family, with a DSA front-end. The patch uses tc taprio hardware offload to setup TAS

[PATCH v1 net-next 1/3] net: dsa: felix: qos classified based on pcp

2020-05-10 Thread Xiaoliang Yang
Set the default QoS Classification based on PCP and DEI of vlan tag, after that, frames can be Classified to different Qos based on PCP tag. If there is no vlan tag or vlan ignored, use port default Qos. Signed-off-by: Xiaoliang Yang --- drivers/net/dsa/ocelot/felix.c | 6 ++ driver

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

2020-05-10 Thread Masami Hiramatsu
On Wed, 6 May 2020 08:22:19 +0200 Christoph Hellwig wrote: > All three callers really should try the explicit kernel and user > copies instead. One has already deprecated the somewhat dangerous > either kernel or user address concept, the other two still need to > follow up eventually. > > Sig

Re: [RFC PATCH net] net: flow_offload: simplify hw stats check handling

2020-05-10 Thread Jiri Pirko
Fri, May 08, 2020 at 01:48:20AM CEST, k...@kernel.org wrote: >On Thu, 7 May 2020 18:46:43 +0200 Pablo Neira Ayuso wrote: >> On Thu, May 07, 2020 at 04:49:15PM +0100, Edward Cree wrote: >> > On 07/05/2020 16:32, Pablo Neira Ayuso wrote: >> > > On Thu, May 07, 2020 at 03:59:09PM +0100, Edward Cree

Re: [RFC v2] current devlink extension plan for NICs

2020-05-10 Thread Jiri Pirko
Sun, May 10, 2020 at 06:30:59PM CEST, dave.t...@gmail.com wrote: >On Sun, May 10, 2020 at 7:46 AM Jiri Pirko wrote: >> >> Hello guys. >> >> Anyone has any opinion on the proposal? Or should I take it as a silent >> agreement? :) >> >> We would like to go ahead and start sending patchsets. > >I got

Re: [PATCH 12/15] maccess: always use strict semantics for probe_kernel_read

2020-05-10 Thread Masami Hiramatsu
On Mon, 11 May 2020 14:05:36 +0900 Masami Hiramatsu wrote: > Hi Christoph, > > At first, thank you for your work on cleaning up these functions! > > On Wed, 6 May 2020 08:22:20 +0200 > Christoph Hellwig wrote: > > > Except for historical confusion in the kprobes/uprobes and bpf tracers > > t

Re: [PATCH 12/15] maccess: always use strict semantics for probe_kernel_read

2020-05-10 Thread Masami Hiramatsu
Hi Christoph, At first, thank you for your work on cleaning up these functions! On Wed, 6 May 2020 08:22:20 +0200 Christoph Hellwig wrote: > Except for historical confusion in the kprobes/uprobes and bpf tracers > there is no good reason to ever allow user memory accesses from > probe_kernel_r

[PATCH 06/19] ipv4: do compat setsockopt for MCAST_MSFILTER directly

2020-05-10 Thread Al Viro
From: Al Viro Parallel to what the native setsockopt() does, except that unlike the native setsockopt() we do not use memdup_user() - we want the sockaddr_storage fields properly aligned, so we allocate 4 bytes more and copy compat_group_filter at the offset 4, which yields the proper alignments.

[PATCH 04/19] get rid of compat_mc_getsockopt()

2020-05-10 Thread Al Viro
From: Al Viro now we can do MCAST_MSFILTER in compat ->getsockopt() without playing silly buggers with copying things back and forth. We can form a native struct group_filter (sans the variable-length tail) on stack, pass that + pointer to the tail of original request to the helper doing the bulk

[PATCH 01/19] lift compat definitions of mcast [sg]etsockopt requests into net/compat.h

2020-05-10 Thread Al Viro
From: Al Viro We want to get rid of compat_mc_[sg]etsockopt() and to have that stuff handled without compat_alloc_user_space(), extra copying through userland, etc. To do that we'll need ipv4 and ipv6 instances of ->compat_[sg]etsockopt() to manipulate the 32bit variants of mcast requests, so we

[PATCH 03/19] ip*_mc_gsfget(): lift copyout of struct group_filter into callers

2020-05-10 Thread Al Viro
From: Al Viro pass the userland pointer to the array in its tail, so that part gets copied out by our functions; copyout of everything else is done in the callers. Rationale: reuse for compat; the array is the same in native and compat, the layout of parts before it is different for compat. Sig

[PATCH 13/19] get rid of compat_mc_setsockopt()

2020-05-10 Thread Al Viro
From: Al Viro not used anymore Signed-off-by: Al Viro --- include/net/compat.h | 4 --- net/compat.c | 90 2 files changed, 94 deletions(-) diff --git a/include/net/compat.h b/include/net/compat.h index b6043e759cde..2de4dfcdc11f 1

[PATCH 15/19] atm: separate ATM_GETNAMES handling from the rest of atm_dev_ioctl()

2020-05-10 Thread Al Viro
From: Al Viro atm_dev_ioctl() does copyin in two different ways - one for ATM_GETNAMES, another for everything else. Start with separating the former into a new helper (atm_getnames()). The next step will be to lift the copyin into the callers. Signed-off-by: Al Viro --- net/atm/ioctl.c

[PATCH 19/19] atm: switch do_atmif_sioc() to direct use of atm_dev_ioctl()

2020-05-10 Thread Al Viro
From: Al Viro Signed-off-by: Al Viro --- net/atm/ioctl.c | 25 - 1 file changed, 4 insertions(+), 21 deletions(-) diff --git a/net/atm/ioctl.c b/net/atm/ioctl.c index 52f2c77e656f..838ebf0cabbf 100644 --- a/net/atm/ioctl.c +++ b/net/atm/ioctl.c @@ -286,30 +286,13 @@ sta

[PATCH 07/19] ip6_mc_msfilter(): pass the address list separately

2020-05-10 Thread Al Viro
From: Al Viro that way we'll be able to reuse it for compat case Signed-off-by: Al Viro --- include/net/ipv6.h | 3 ++- net/ipv6/ipv6_sockglue.c | 2 +- net/ipv6/mcast.c | 7 --- 3 files changed, 7 insertions(+), 5 deletions(-) diff --git a/include/net/ipv6.h b/include/net/i

[PATCH 11/19] ipv6: take handling of group_source_req options into a helper

2020-05-10 Thread Al Viro
From: Al Viro Signed-off-by: Al Viro --- net/ipv6/ipv6_sockglue.c | 65 +++- 1 file changed, 36 insertions(+), 29 deletions(-) diff --git a/net/ipv6/ipv6_sockglue.c b/net/ipv6/ipv6_sockglue.c index b386a2b3668c..fc525ad9ed3c 100644 --- a/net/ipv6/ipv

[PATCH 14/19] batadv_socket_read(): get rid of pointless access_ok()

2020-05-10 Thread Al Viro
From: Al Viro address is passed only to copy_to_user() Signed-off-by: Al Viro --- net/batman-adv/icmp_socket.c | 3 --- 1 file changed, 3 deletions(-) diff --git a/net/batman-adv/icmp_socket.c b/net/batman-adv/icmp_socket.c index ccb535c77e5d..8bdabc03b0b2 100644 --- a/net/batman-adv/icmp_soc

[PATCH 09/19] ipv[46]: do compat setsockopt for MCAST_{JOIN,LEAVE}_GROUP directly

2020-05-10 Thread Al Viro
From: Al Viro direct parallel to the way these two are handled in the native ->setsockopt() instances - the helpers that do the real work are already separated and can be reused as-is in this case. Signed-off-by: Al Viro --- net/ipv4/ip_sockglue.c | 31 +++ net/ip

[PATCH 12/19] handle the group_source_req options directly

2020-05-10 Thread Al Viro
From: Al Viro Native ->setsockopt() handling of these options (MCAST_..._SOURCE_GROUP and MCAST_{,UN}BLOCK_SOURCE) consists of copyin + call of a helper that does the actual work. The only change needed for ->compat_setsockopt() is a slightly different copyin - the helpers can be reused as-is.

[PATCH 05/19] set_mcast_msfilter(): take the guts of setsockopt(MCAST_MSFILTER) into a helper

2020-05-10 Thread Al Viro
From: Al Viro Signed-off-by: Al Viro --- net/ipv4/ip_sockglue.c | 73 +++--- 1 file changed, 40 insertions(+), 33 deletions(-) diff --git a/net/ipv4/ip_sockglue.c b/net/ipv4/ip_sockglue.c index 6bdaf43236ea..8c14a474870d 100644 --- a/net/ipv4/ip_sock

[PATCH 18/19] atm: lift copyin from atm_dev_ioctl()

2020-05-10 Thread Al Viro
From: Al Viro Signed-off-by: Al Viro --- net/atm/ioctl.c | 25 - net/atm/resources.c | 35 +-- net/atm/resources.h | 4 ++-- 3 files changed, 31 insertions(+), 33 deletions(-) diff --git a/net/atm/ioctl.c b/net/atm/ioctl.c index fdd0

[PATCH 10/19] ipv4: take handling of group_source_req options into a helper

2020-05-10 Thread Al Viro
From: Al Viro Signed-off-by: Al Viro --- net/ipv4/ip_sockglue.c | 83 ++ 1 file changed, 44 insertions(+), 39 deletions(-) diff --git a/net/ipv4/ip_sockglue.c b/net/ipv4/ip_sockglue.c index 937f39906419..4f412b0bdda4 100644 --- a/net/ipv4/ip_sock

[PATCH 16/19] atm: move copyin from atm_getnames() into the caller

2020-05-10 Thread Al Viro
From: Al Viro Signed-off-by: Al Viro --- net/atm/ioctl.c | 19 ++- net/atm/resources.c | 19 +-- net/atm/resources.h | 2 +- 3 files changed, 20 insertions(+), 20 deletions(-) diff --git a/net/atm/ioctl.c b/net/atm/ioctl.c index 0b4b07740fe4..e239cebf48da 1

[PATCH 17/19] atm: switch do_atm_iobuf() to direct use of atm_getnames()

2020-05-10 Thread Al Viro
From: Al Viro ... and sod the compat_alloc_user_space() with its complications Signed-off-by: Al Viro --- net/atm/ioctl.c | 25 +++-- 1 file changed, 3 insertions(+), 22 deletions(-) diff --git a/net/atm/ioctl.c b/net/atm/ioctl.c index e239cebf48da..fdd0e3434523 100644 ---

[PATCH 08/19] ipv6: do compat setsockopt for MCAST_MSFILTER directly

2020-05-10 Thread Al Viro
From: Al Viro similar to the ipv4 counterpart of that patch - the same trick used to align the tail array properly. Signed-off-by: Al Viro --- net/ipv6/ipv6_sockglue.c | 48 +++- 1 file changed, 47 insertions(+), 1 deletion(-) diff --git a/net/ipv6/

[PATCH 02/19] compat_ip{,v6}_setsockopt(): enumerate MCAST_... options explicitly

2020-05-10 Thread Al Viro
From: Al Viro We want to check if optname is among the MCAST_... ones; do that as an explicit switch. Signed-off-by: Al Viro --- net/ipv4/ip_sockglue.c | 10 +- net/ipv6/ipv6_sockglue.c | 10 +- 2 files changed, 18 insertions(+), 2 deletions(-) diff --git a/net/ipv4/ip_sockg

[RFC][PATCHES] uaccess-related stuff in net/*

2020-05-10 Thread Al Viro
Assorted uaccess-related work in net/*. First, there's getting rid of compat_alloc_user_space() mess in MCAST_... [gs]etsockopt() - no need to play with copying to/from temporary object on userland stack, etc., when ->compat_[sg]etsockopt() instances in question can easly do everything wit

Re: [PATCH net v3] hinic: fix a bug of ndo_stop

2020-05-10 Thread Jakub Kicinski
On Sun, 10 May 2020 19:01:08 + Luo bin wrote: > if some function in ndo_stop interface returns failure because of > hardware fault, must go on excuting rest steps rather than return > failure directly, otherwise will cause memory leak.And bump the > timeout for SET_FUNC_STATE to ensure that cmd

Re: [PATCH v4 resend net-next 0/4] Cross-chip bridging for disjoint DSA trees

2020-05-10 Thread Jakub Kicinski
On Sun, 10 May 2020 19:37:39 +0300 Vladimir Oltean wrote: > From: Vladimir Oltean > > This series adds support for boards where DSA switches of multiple types > are cascaded together. Actually this type of setup was brought up before > on netdev, and it looks like utilizing disjoint trees is the

Re: [PATCH net-next 0/5] net: hns3: misc updates for -next

2020-05-10 Thread Jakub Kicinski
On Sat, 9 May 2020 17:27:36 +0800 Huazhong Tan wrote: > This patchset includes some misc updates for the HNS3 ethernet driver. > > #1 & #2 add two cleanups. > #3 provides an interface for the client to query the CMDQ's status. > #4 adds a little optimization about debugfs. > #5 prevents 1000M auto

Re: [PATCH net-next 3/5] net: hns3: provide .get_cmdq_stat interface for the client

2020-05-10 Thread Jakub Kicinski
On Mon, 11 May 2020 08:13:06 +0800 tanhuazhong wrote: > On 2020/5/10 4:48, Jakub Kicinski wrote: > > On Sat, 9 May 2020 17:27:39 +0800 Huazhong Tan wrote: > >> diff --git a/drivers/net/ethernet/hisilicon/hns3/hnae3.h > >> b/drivers/net/ethernet/hisilicon/hns3/hnae3.h > >> index 5602bf2..7506cab

[PATCH net v3] hinic: fix a bug of ndo_stop

2020-05-10 Thread Luo bin
if some function in ndo_stop interface returns failure because of hardware fault, must go on excuting rest steps rather than return failure directly, otherwise will cause memory leak.And bump the timeout for SET_FUNC_STATE to ensure that cmd won't return failure when hw is busy. Otherwise hw may st

Re: [PATCH net v2] hinic: fix a bug of ndo_stop

2020-05-10 Thread luobin (L)
Will fix. Thanks. On 2020/5/10 6:37, Jakub Kicinski wrote: On Fri, 8 May 2020 20:19:33 + Luo bin wrote: if some function in ndo_stop interface returns failure because of hardware fault, must go on excuting rest steps rather than return failure directly, otherwise will cause memory leak.And

Re: [PATCH] net/mlx5: Replace zero-length array with flexible-array

2020-05-10 Thread Saeed Mahameed
On Thu, 2020-05-07 at 13:59 -0500, Gustavo A. R. Silva wrote: > The current codebase makes use of the zero-length array language > extension to the C90 standard, but the preferred mechanism to declare > variable-length types such as these ones is a flexible array > member[1][2], > introduced in C99

Re: net/sonic: Fix some resource leaks in error handling paths

2020-05-10 Thread Finn Thain
On Sun, 10 May 2020, Markus Elfring wrote: > > > > Do you know when these bugs were introduced? > > I suggest to take another look at a provided tag “Fixes”. If you can't determine when the bug was introduced, how can you criticise a patch for the lack of a Fixes tag? > To which commit would y

Re: [PATCH net-next 3/5] net: hns3: provide .get_cmdq_stat interface for the client

2020-05-10 Thread tanhuazhong
On 2020/5/10 4:48, Jakub Kicinski wrote: On Sat, 9 May 2020 17:27:39 +0800 Huazhong Tan wrote: This patch provides a new interface for the client to query whether CMDQ is ready to work. Signed-off-by: Huazhong Tan diff --git a/drivers/net/ethernet/hisilicon/hns3/hnae3.h b/drivers/net/et

Re: [PATCH v2] do not typedef socklen_t on Android

2020-05-10 Thread Pablo Neira Ayuso
On Sat, May 09, 2020 at 12:23:56PM -0700, Maciej Żenczykowski wrote: > From: Maciej Żenczykowski > > This is present in bionic header files regardless of compiler > being used (likely clang) Applied, thanks.

Re: [PATCH RFC v2 02/11] dt-bindings: net: dwmac-meson: Document the "timing-adjustment" clock

2020-05-10 Thread Martin Blumenstingl
Hello Rob, On Fri, May 1, 2020 at 11:53 PM Martin Blumenstingl wrote: > > Hi Rob, > > On Fri, May 1, 2020 at 11:09 PM Rob Herring wrote: > > > > On Wed, 29 Apr 2020 22:16:35 +0200, Martin Blumenstingl wrote: > > > The PRG_ETHERNET registers can add an RX delay in RGMII mode. This > > > requires

Re: [PATCH net] netfilter: flowtable: Fix expired flow not being deleted from software

2020-05-10 Thread Pablo Neira Ayuso
On Wed, May 06, 2020 at 02:27:29PM +0300, Paul Blakey wrote: > Once a flow is considered expired, it is marked as DYING, and > scheduled a delete from hardware. The flow will be deleted from > software, in the next gc_step after hardware deletes the flow > (and flow is marked DEAD). Till that happe

Re: [PATCH net] netfilter: flowtable: Add pending bit for offload work

2020-05-10 Thread Pablo Neira Ayuso
Hi, On Wed, May 06, 2020 at 02:24:39PM +0300, Paul Blakey wrote: > Gc step can queue offloaded flow del work or stats work. > Those work items can race each other and a flow could be freed > before the stats work is executed and querying it. > To avoid that, add a pending bit that if a work exists

Re: [PATCH 06/15] netfilter: conntrack: avoid gcc-10 zero-length-bounds warning

2020-05-10 Thread Pablo Neira Ayuso
On Thu, Apr 30, 2020 at 11:30:48PM +0200, Arnd Bergmann wrote: > gcc-10 warns around a suspicious access to an empty struct member: > > net/netfilter/nf_conntrack_core.c: In function '__nf_conntrack_alloc': > net/netfilter/nf_conntrack_core.c:1522:9: warning: array subscript 0 is > outside the bo

Re: [PATCH net] netfilter: nf_conntrack_pptp: prevent buffer overflows in debug code

2020-05-10 Thread Pablo Neira Ayuso
Hi Dan, On Wed, May 06, 2020 at 01:17:53PM +0300, Dan Carpenter wrote: > Smatch complains that the value for "cmd" comes from the network and > can't be trusted. The value is actually checked at the end of these > functions so I just copied that here as well. I'm attaching another patch, it's ba

Re: [PATCH net-next] checkpatch: warn about uses of ENOTSUPP

2020-05-10 Thread Joe Perches
On Sun, 2020-05-10 at 11:51 -0700, Jakub Kicinski wrote: > ENOTSUPP often feels like the right error code to use, but it's > in fact not a standard Unix error. E.g.: It is SUSv3 though. > $ python > > > > import errno > > > > errno.errorcode[errno.ENOTSUPP] > Traceback (most recent call last): >

Re: [PATCH net-next v4 00/10] Ethernet Cable test support

2020-05-10 Thread Jakub Kicinski
On Sun, 10 May 2020 21:12:29 +0200 Andrew Lunn wrote: > any copper Ethernet PHY have support for performing diagnostics of > the cable. Are the cable shorted, broken, not plugged into anything at > the other end? And they can report roughly how far along the cable any > fault is. > > Add infrastru

Re: [PATCH net-next] checkpatch: warn about uses of ENOTSUPP

2020-05-10 Thread Jakub Kicinski
On Sun, 10 May 2020 21:04:32 +0200 Andrew Lunn wrote: > On Sun, May 10, 2020 at 11:51:48AM -0700, Jakub Kicinski wrote: > > ENOTSUPP often feels like the right error code to use, but it's > > in fact not a standard Unix error. E.g.: > > Hi Jakub > > You said ENOTSUPP is for NFS? Would it make s

Re: [PATCH net-next v4 1/1] net: phy: Send notifier when starting the cable test

2020-05-10 Thread Andrew Lunn
On Sun, May 10, 2020 at 09:12:31PM +0200, Andrew Lunn wrote: > Given that it takes time to run a cable test, send a notify message at > the start, as well as when it is completed. Arg! This patch does not belong in the series! Andrew

[PATCH net-next v4 10/10] net: phy: Send notifier when starting the cable test

2020-05-10 Thread Andrew Lunn
Given that it takes time to run a cable test, send a notify message at the start, as well as when it is completed. v3: EMSGSIZE when ethnl_bcastmsg_put() fails Print an error message on failure, since this is a void function. Signed-off-by: Andrew Lunn Reviewed-by: Michal Kubecek Reviewed-by: F

[PATCH net-next v4 06/10] net: ethtool: Add infrastructure for reporting cable test results

2020-05-10 Thread Andrew Lunn
Provide infrastructure for PHY drivers to report the cable test results. A netlink skb is associated to the phydev. Helpers will be added which can add results to this skb. Once the test has finished the results are sent to user space. When netlink ethtool is not part of the kernel configuration

[PATCH net-next v4 08/10] net: phy: marvell: Add cable test support

2020-05-10 Thread Andrew Lunn
The Marvell PHYs have a couple of different register sets for performing cable tests. Page 7 provides the simplest to use. v3: s/mavell/marvell/g Remove include of Signed-off-by: Andrew Lunn Reviewed-by: Florian Fainelli --- drivers/net/phy/marvell.c | 201

[PATCH net-next v4 04/10] net: ethtool: Add attributes for cable test reports

2020-05-10 Thread Andrew Lunn
Add the attributes needed to report cable test results to userspace. The reports are expected to be per twisted pair. A nested property per pair can report the result of the cable test. A nested property can also report the length of the cable to any fault. v2: Grammar fixes Change length from u16

[PATCH net-next v4 07/10] net: ethtool: Add helpers for reporting test results

2020-05-10 Thread Andrew Lunn
The PHY drivers can use these helpers for reporting the results. The results get translated into netlink attributes which are added to the pre-allocated skbuf. v3: Poison phydev->skb Return -EMSGSIZE when ethnl_bcastmsg_put() fails Return valid error code when nla_nest_start() fails Use u8 for res

[PATCH net-next v4 02/10] net: phy: Add support for polling cable test

2020-05-10 Thread Andrew Lunn
Some PHYs are not capable of generating interrupts when a cable test finished. They do however support interrupts for normal operations, like link up/down. As such, the PHY state machine would normally not poll the PHY. Add support for indicating the PHY state machine must poll the PHY when perfor

[PATCH net-next v4 01/10] net: phy: Add cable test support to state machine

2020-05-10 Thread Andrew Lunn
Running a cable test is desruptive to normal operation of the PHY and can take a 5 to 10 seconds to complete. The RTNL lock cannot be held for this amount of time, and add a new state to the state machine for running a cable test. The driver is expected to implement two functions. The first is use

[PATCH net-next v4 09/10] net: phy: Put interface into oper testing during cable test

2020-05-10 Thread Andrew Lunn
Since running a cable test is disruptive, put the interface into operative state testing while the test is running. Signed-off-by: Andrew Lunn Reviewed-by: Florian Fainelli Reviewed-by: Michal Kubecek --- drivers/net/phy/phy.c | 12 +++- 1 file changed, 11 insertions(+), 1 deletion(-)

[PATCH net-next v4 03/10] net: ethtool: netlink: Add support for triggering a cable test

2020-05-10 Thread Andrew Lunn
Add new ethtool netlink calls to trigger the starting of a PHY cable test. Add Kconfig'ury to ETHTOOL_NETLINK so that PHYLIB is not a module when ETHTOOL_NETLINK is builtin, which would result in kernel linking errors. v2: Remove unwanted white space change Remove ethnl_cable_test_act_ops and use

[PATCH net-next v4 00/10] Ethernet Cable test support

2020-05-10 Thread Andrew Lunn
any copper Ethernet PHY have support for performing diagnostics of the cable. Are the cable shorted, broken, not plugged into anything at the other end? And they can report roughly how far along the cable any fault is. Add infrastructure in ethtool and phylib support for triggering a cable test an

[PATCH net-next v4 05/10] net: ethtool: Make helpers public

2020-05-10 Thread Andrew Lunn
Make some helpers for building ethtool netlink messages available outside the compilation unit, so they can be used for building messages which are not simple get/set. Signed-off-by: Andrew Lunn Reviewed-by: Michal Kubecek --- net/ethtool/netlink.c | 4 ++-- net/ethtool/netlink.h | 2 ++ 2 file

[PATCH net-next v4 1/1] net: phy: Send notifier when starting the cable test

2020-05-10 Thread Andrew Lunn
Given that it takes time to run a cable test, send a notify message at the start, as well as when it is completed. v3: EMSGSIZE when ethnl_bcastmsg_put() fails Print an error message on failure, since this is a void function. Signed-off-by: Andrew Lunn Reviewed-by: Michal Kubecek Reviewed-by: F

Re: [PATCH net-next] checkpatch: warn about uses of ENOTSUPP

2020-05-10 Thread Andrew Lunn
On Sun, May 10, 2020 at 11:51:48AM -0700, Jakub Kicinski wrote: > ENOTSUPP often feels like the right error code to use, but it's > in fact not a standard Unix error. E.g.: Hi Jakub You said ENOTSUPP is for NFS? Would it make sense to special case fs/nfs* files and not warn there? I assume that w

[PATCH v2] x86: Optimise x86 IP checksum code

2020-05-10 Thread David Laight
Performance improvements to the amd64 IP checksum code. Summing to alternate registers almost doubles the performace (probably from 4 to 6.2 bytes/clock) on Ivy Bridge cpu. Loop carrying the carry flag improves Haswell from 7 to 8 bytes/clock. Older cpu will still approach 4 bytes/clock. All achiev

[PATCH net-next] checkpatch: warn about uses of ENOTSUPP

2020-05-10 Thread Jakub Kicinski
ENOTSUPP often feels like the right error code to use, but it's in fact not a standard Unix error. E.g.: $ python >>> import errno >>> errno.errorcode[errno.ENOTSUPP] Traceback (most recent call last): File "", line 1, in AttributeError: module 'errno' has no attribute 'ENOTSUPP' There were nu

Re: [PATCH net] net: dsa: loop: Add module soft dependency

2020-05-10 Thread Jakub Kicinski
On Sat, 9 May 2020 16:45:44 -0700 Florian Fainelli wrote: > There is a soft dependency against dsa_loop_bdinfo.ko which sets up the > MDIO device registration, since there are no symbols referenced by > dsa_loop.ko, there is no automatic loading of dsa_loop_bdinfo.ko which > is needed. > > Fixes:

Re: [PATCH net-next v3 06/10] net: ethtool: Add infrastructure for reporting cable test results

2020-05-10 Thread Jakub Kicinski
On Sun, 10 May 2020 20:22:52 +0200 Andrew Lunn wrote: > > Sorry Andrew, would you mind doing one more quick spin? :( > > No problem. Thanks! > > More importantly we should not use the ENOTSUPP error code, AFAIU it's > > for NFS, it's not a standard error code and user space struggles to > > tr

Re: [PATCH net-next v3 06/10] net: ethtool: Add infrastructure for reporting cable test results

2020-05-10 Thread Andrew Lunn
On Sun, May 10, 2020 at 11:00:13AM -0700, Jakub Kicinski wrote: > On Sun, 10 May 2020 18:07:58 +0200 Andrew Lunn wrote: > > On Sun, May 10, 2020 at 05:12:26PM +0200, Michal Kubecek wrote: > > > On Sat, May 09, 2020 at 06:28:47PM +0200, Andrew Lunn wrote: > > > > Provide infrastructure for PHY dri

Re: [PATCH net-next 0/4] net: phy: broadcom: cable tester support

2020-05-10 Thread Jakub Kicinski
On Sun, 10 May 2020 00:37:10 +0200 Michael Walle wrote: > Add cable tester support for the Broadcom PHYs. Support for it was > developed on a BCM54140 Quad PHY which RDB register access. > > If there is a link partner the results are not as good as with an open > cable. I guess we could retry if t

Re: [PATCH] net: usb: qmi_wwan: remove redundant assignment to variable status

2020-05-10 Thread Jakub Kicinski
On Sat, 9 May 2020 22:57:56 +0100 Colin King wrote: > From: Colin Ian King > > The variable status is being initializeed with a value that is never read > and it is being updated later with a new value. The initialization > is redundant and can be removed. > > Addresses-Coverity: ("Unused value

Re: [PATCH] dsa: sja1105: fix semicolon.cocci warnings

2020-05-10 Thread Jakub Kicinski
On Sun, 10 May 2020 20:26:56 +0800 kbuild test robot wrote: > From: kbuild test robot > > drivers/net/dsa/sja1105/sja1105_ethtool.c:481:11-12: Unneeded semicolon > > > Remove unneeded semicolon. > > Generated by: scripts/coccinelle/misc/semicolon.cocci > > Fixes: ae1804de93f6 ("dsa: sja1105:

Re: [PATCH net-next v3 06/10] net: ethtool: Add infrastructure for reporting cable test results

2020-05-10 Thread Jakub Kicinski
On Sun, 10 May 2020 18:07:58 +0200 Andrew Lunn wrote: > On Sun, May 10, 2020 at 05:12:26PM +0200, Michal Kubecek wrote: > > On Sat, May 09, 2020 at 06:28:47PM +0200, Andrew Lunn wrote: > > > Provide infrastructure for PHY drivers to report the cable test > > > results. A netlink skb is associate

Re: [PATCH bpf-next v4 12/21] bpf: add PTR_TO_BTF_ID_OR_NULL support

2020-05-10 Thread Yonghong Song
On 5/10/20 9:11 AM, Alexei Starovoitov wrote: On Sat, May 9, 2020 at 10:19 PM Yonghong Song wrote: On 5/9/20 5:50 PM, Alexei Starovoitov wrote: On Sat, May 09, 2020 at 10:59:12AM -0700, Yonghong Song wrote: diff --git a/kernel/bpf/btf.c b/kernel/bpf/btf.c index a2cfba89a8e1..c490fbde22d

Re: [PATCH bpf-next v4 16/21] tools/libbpf: add bpf_iter support

2020-05-10 Thread Yonghong Song
On 5/10/20 9:09 AM, Alexei Starovoitov wrote: On Sat, May 9, 2020 at 10:07 PM Yonghong Song wrote: On 5/9/20 5:35 PM, Alexei Starovoitov wrote: On Sat, May 09, 2020 at 10:59:17AM -0700, Yonghong Song wrote: @@ -6891,6 +6897,7 @@ static int bpf_object__collect_st_ops_relos(struct bpf_ob

[PATCH net-next 00/15] Traffic support for dsa_8021q in vlan_filtering=1 mode

2020-05-10 Thread Vladimir Oltean
From: Vladimir Oltean This series is an attempt to support as much as possible in terms of traffic I/O from the network stack with the only dsa_8021q user thus far, sja1105. The hardware doesn't support pushing a second VLAN tag to packets that are already tagged, so our only option is to combin

[PATCH net-next 07/15] net: dsa: sja1105: exit sja1105_vlan_filtering when called multiple times

2020-05-10 Thread Vladimir Oltean
From: Vladimir Oltean VLAN filtering is a global property for sja1105, and that means that we rely on the DSA core to not call us more than once. But we need to introduce some per-port state for the tagger, namely the xmit_tpid, and the best place to do that is where the xmit_tpid changes, namel

[PATCH net-next 01/15] net: dsa: provide an option for drivers to always receive bridge VLANs

2020-05-10 Thread Vladimir Oltean
From: Russell King DSA assumes that a bridge which has vlan filtering disabled is not vlan aware, and ignores all vlan configuration. However, the kernel software bridge code allows configuration in this state. This causes the kernel's idea of the bridge vlan state and the hardware state to disa

[PATCH net-next 03/15] net: dsa: sja1105: keep the VLAN awareness state in a driver variable

2020-05-10 Thread Vladimir Oltean
From: Vladimir Oltean Soon we'll add a third operating mode to the driver. Introduce a vlan_state to make things more easy to manage, and use it where applicable. Signed-off-by: Vladimir Oltean --- drivers/net/dsa/sja1105/sja1105.h | 6 ++ drivers/net/dsa/sja1105/sja1105_main.c | 16

[PATCH net-next 05/15] net: dsa: sja1105: save/restore VLANs using a delta commit method

2020-05-10 Thread Vladimir Oltean
From: Vladimir Oltean Managing the VLAN table that is present in hardware will become very difficult once we add a third operating state (best_effort_vlan_filtering). That is because correct cleanup (not too little, not too much) becomes virtually impossible, when VLANs can be added from the brid

[PATCH net-next 02/15] net: dsa: tag_8021q: introduce a vid_is_dsa_8021q helper

2020-05-10 Thread Vladimir Oltean
From: Vladimir Oltean This function returns a boolean denoting whether the VLAN passed as argument is part of the 1024-3071 range that the dsa_8021q tagging scheme uses. Signed-off-by: Vladimir Oltean --- include/linux/dsa/8021q.h | 7 +++ net/dsa/tag_8021q.c | 7 +++ 2 files cha

[PATCH net-next 04/15] net: dsa: sja1105: deny alterations of dsa_8021q VLANs from the bridge

2020-05-10 Thread Vladimir Oltean
From: Vladimir Oltean At the moment, this can never happen. The 2 modes that we operate in do not permit that: - SJA1105_VLAN_UNAWARE: we are guarded from bridge VLANs added by the user by the DSA core. We will later lift this restriction by setting ds->vlan_bridge_vtu = true, and that is

[PATCH net-next 09/15] net: dsa: tag_8021q: support up to 8 VLANs per port using sub-VLANs

2020-05-10 Thread Vladimir Oltean
From: Vladimir Oltean For switches that support VLAN retagging, such as sja1105, we extend dsa_8021q by encoding a "sub-VLAN" into the remaining 3 free bits in the dsa_8021q tag. A sub-VLAN is nothing more than a number in the range 0-7, which serves as an index into a per-port driver lookup tab

[PATCH net-next 12/15] net: dsa: sja1105: add packing ops for the Retagging Table

2020-05-10 Thread Vladimir Oltean
From: Vladimir Oltean The Retagging Table is an optional feature that allows the switch to match frames against a {ingress port, egress port, vid} rule and change their VLAN ID. The retagged frames are by default clones of the original ones (since the hardware-foreseen use case was to mirror traf

[PATCH net-next 15/15] docs: net: dsa: sja1105: document the best_effort_vlan_filtering option

2020-05-10 Thread Vladimir Oltean
From: Vladimir Oltean Signed-off-by: Vladimir Oltean --- .../networking/devlink-params-sja1105.txt | 27 +++ Documentation/networking/dsa/sja1105.rst | 211 +++--- 2 files changed, 212 insertions(+), 26 deletions(-) create mode 100644 Documentation/networking/devlink-para

[PATCH net-next 11/15] net: dsa: sja1105: add a new best_effort_vlan_filtering devlink parameter

2020-05-10 Thread Vladimir Oltean
From: Vladimir Oltean This devlink parameter enables the handling of DSA tags when enslaved to a bridge with vlan_filtering=1. There are very good reasons to want this, but there are also very good reasons for not enabling it by default. So a devlink param named best_effort_vlan_filtering, curren

[PATCH net-next 13/15] net: dsa: sja1105: implement a common frame memory partitioning function

2020-05-10 Thread Vladimir Oltean
From: Vladimir Oltean There are 2 different features that require some reserved frame memory space: VLAN retagging and virtual links. Create a central function that modifies the static config and ensures frame memory is never overcommitted. Signed-off-by: Vladimir Oltean --- drivers/net/dsa/sj

[PATCH net-next 10/15] net: dsa: tag_sja1105: implement sub-VLAN decoding

2020-05-10 Thread Vladimir Oltean
Create a subvlan_map as part of each port's tagger private structure. This keeps reverse mappings of bridge-to-dsa_8021q VLAN retagging rules. Note that as of this patch, this piece of code is never engaged, due to the fact that the driver hasn't installed any retagging rule, so we'll always see p

[PATCH net-next 08/15] net: dsa: sja1105: prepare tagger for handling DSA tags and VLAN simultaneously

2020-05-10 Thread Vladimir Oltean
From: Vladimir Oltean In VLAN-unaware mode, sja1105 uses VLAN tags with a custom TPID of 0xdadb. While in the yet-to-be introduced best_effort_vlan_filtering mode, it needs to work with normal VLAN TPID values. A complication arises when we must transmit a VLAN-tagged packet to the switch when i

[PATCH net-next 06/15] net: dsa: sja1105: allow VLAN configuration from the bridge in all states

2020-05-10 Thread Vladimir Oltean
From: Vladimir Oltean Let the DSA core call our .port_vlan_add methods every time the bridge layer requests so. We will deal internally with saving/restoring VLANs depending on our VLAN awareness state. Signed-off-by: Vladimir Oltean --- drivers/net/dsa/sja1105/sja1105_main.c | 1 + 1 file cha

[PATCH net-next 14/15] net: dsa: sja1105: implement VLAN retagging for dsa_8021q sub-VLANs

2020-05-10 Thread Vladimir Oltean
From: Vladimir Oltean Expand the delta commit procedure for VLANs with additional logic for treating bridge_vlans in the newly introduced operating mode, SJA1105_VLAN_BEST_EFFORT. For every bridge VLAN on every user port, a sub-VLAN index is calculated and retagging rules are installed towards a

[PATCH v4 resend net-next 2/4] net: dsa: permit cross-chip bridging between all trees in the system

2020-05-10 Thread Vladimir Oltean
From: Vladimir Oltean One way of utilizing DSA is by cascading switches which do not all have compatible taggers. Consider the following real-life topology: +---+ | LS1028A

[PATCH v4 resend net-next 1/4] net: bridge: allow enslaving some DSA master network devices

2020-05-10 Thread Vladimir Oltean
From: Vladimir Oltean Commit 8db0a2ee2c63 ("net: bridge: reject DSA-enabled master netdevices as bridge members") added a special check in br_if.c in order to check for a DSA master network device with a tagging protocol configured. This was done because back then, such devices, once enslaved in

[PATCH v4 resend net-next 3/4] net: dsa: introduce a dsa_switch_find function

2020-05-10 Thread Vladimir Oltean
From: Vladimir Oltean Somewhat similar to dsa_tree_find, dsa_switch_find returns a dsa_switch structure pointer by searching for its tree index and switch index (the parameters from dsa,member). To be used, for example, by drivers who implement .crosschip_bridge_join and need a reference to the o

[PATCH v4 resend net-next 0/4] Cross-chip bridging for disjoint DSA trees

2020-05-10 Thread Vladimir Oltean
From: Vladimir Oltean This series adds support for boards where DSA switches of multiple types are cascaded together. Actually this type of setup was brought up before on netdev, and it looks like utilizing disjoint trees is the way to go: https://lkml.org/lkml/2019/7/7/225 The trouble with dis

[PATCH v4 resend net-next 4/4] net: dsa: sja1105: implement cross-chip bridging operations

2020-05-10 Thread Vladimir Oltean
From: Vladimir Oltean sja1105 uses dsa_8021q for DSA tagging, a format which is VLAN at heart and which is compatible with cascading. A complete description of this tagging format is in net/dsa/tag_8021q.c, but a quick summary is that each external-facing port tags incoming frames with a unique p

Re: [RFC v2] current devlink extension plan for NICs

2020-05-10 Thread Dave Taht
On Sun, May 10, 2020 at 7:46 AM Jiri Pirko wrote: > > Hello guys. > > Anyone has any opinion on the proposal? Or should I take it as a silent > agreement? :) > > We would like to go ahead and start sending patchsets. I gotta say that the whole thing makes my head really hurt, and while this conve

Re: [PATCH bpf-next v4 21/21] tools/bpf: selftests: add bpf_iter selftests

2020-05-10 Thread Alexei Starovoitov
On Sat, May 9, 2020 at 10:01 PM Yonghong Song wrote: > > > > On 5/9/20 5:34 PM, Alexei Starovoitov wrote: > > On Sat, May 09, 2020 at 10:59:23AM -0700, Yonghong Song wrote: > >> +static volatile const __u32 ret1; > >> + > >> +SEC("iter/bpf_map") > >> +int dump_bpf_map(struct bpf_iter__bpf_map *ctx

Re: [PATCH bpf-next v4 12/21] bpf: add PTR_TO_BTF_ID_OR_NULL support

2020-05-10 Thread Alexei Starovoitov
On Sat, May 9, 2020 at 10:19 PM Yonghong Song wrote: > > > > On 5/9/20 5:50 PM, Alexei Starovoitov wrote: > > On Sat, May 09, 2020 at 10:59:12AM -0700, Yonghong Song wrote: > >> diff --git a/kernel/bpf/btf.c b/kernel/bpf/btf.c > >> index a2cfba89a8e1..c490fbde22d4 100644 > >> --- a/kernel/bpf/btf.

Re: [PATCH bpf-next v4 16/21] tools/libbpf: add bpf_iter support

2020-05-10 Thread Alexei Starovoitov
On Sat, May 9, 2020 at 10:07 PM Yonghong Song wrote: > > > > On 5/9/20 5:35 PM, Alexei Starovoitov wrote: > > On Sat, May 09, 2020 at 10:59:17AM -0700, Yonghong Song wrote: > >> @@ -6891,6 +6897,7 @@ static int bpf_object__collect_st_ops_relos(struct > >> bpf_object *obj, > >> > >> #define BTF_

  1   2   >