Re: [PATCH net-next] net: dsa: loop: Print when registration is successful

2020-07-08 Thread Vivien Didelot
for instance. > > Signed-off-by: Florian Fainelli Reviewed-by: Vivien Didelot

Re: vim: linux-kernel: Add "fallthrough" as a keyword

2020-06-09 Thread Vivien Didelot
Hi Joe, On Sat, 14 Mar 2020 12:08:40 -0700, Joe Perches wrote: > Add fallthrough as a keyword for source code highlighting as > fallthrough was added as a pseudo-keyword macro to replace the > various forms of switch/case /* fallthrough */ comments. > > Signed-off-by: Joe Perches > --- >

Re: [RFC net] net: dsa: Add missing reference counting

2020-05-05 Thread Vivien Didelot
hold and release the master at that time, > too. > > Fixes: 83c0afaec7b7 ("net: dsa: Add new binding implementation") > Signed-off-by: Florian Fainelli Reviewed-by: Vivien Didelot

[PATCH net-next v2 02/16] net: dsa: add ports list in the switch fabric

2019-10-21 Thread Vivien Didelot
ort structures, return -ENOMEM in case no structure is returned, even though this error cannot be reached yet. Signed-off-by: Vivien Didelot Reviewed-by: Florian Fainelli Reviewed-by: Andrew Lunn --- include/net/dsa.h | 5 + net/dsa/dsa2.c|

[PATCH net-next v2 08/16] net: dsa: use ports list to setup multiple master devices

2019-10-21 Thread Vivien Didelot
Now that we have a potential list of CPU ports, make use of it instead of only configuring the master device of an unique CPU port. Signed-off-by: Vivien Didelot --- net/dsa/dsa2.c | 22 +++--- 1 file changed, 15 insertions(+), 7 deletions(-) diff --git a/net/dsa/dsa2.c b/net

[PATCH net-next v2 11/16] net: dsa: mv88e6xxx: silently skip PVT ops

2019-10-21 Thread Vivien Didelot
Since mv88e6xxx_pvt_map is a static helper, no need to return -EOPNOTSUPP if the chip has no PVT, simply silently skip the operation. Signed-off-by: Vivien Didelot Reviewed-by: Florian Fainelli --- drivers/net/dsa/mv88e6xxx/chip.c | 11 +-- 1 file changed, 1 insertion(+), 10 deletions

[PATCH net-next v2 06/16] net: dsa: use ports list for routing table setup

2019-10-21 Thread Vivien Didelot
Use the new ports list instead of accessing the dsa_switch array of ports when iterating over DSA ports of a switch to set up the routing table. Signed-off-by: Vivien Didelot Reviewed-by: Florian Fainelli Reviewed-by: Andrew Lunn --- net/dsa/dsa2.c | 7 +++ 1 file changed, 3 insertions

[PATCH net-next v2 07/16] net: dsa: use ports list to find a port by node

2019-10-21 Thread Vivien Didelot
Use the new ports list instead of iterating over switches and their ports to find a port from a given node. Signed-off-by: Vivien Didelot Reviewed-by: Florian Fainelli --- net/dsa/dsa2.c | 17 +++-- 1 file changed, 3 insertions(+), 14 deletions(-) diff --git a/net/dsa/dsa2.c b/net

[PATCH net-next v2 05/16] net: dsa: use ports list to setup switches

2019-10-21 Thread Vivien Didelot
Use the new ports list instead of iterating over switches and their ports when setting up the switches and their ports. At the same time, provide setup states and messages for ports and switches as it is done for the trees. Signed-off-by: Vivien Didelot --- include/net/dsa.h | 4 ++ net/dsa

[PATCH net-next v2 13/16] net: dsa: mv88e6xxx: use ports list to map bridge

2019-10-21 Thread Vivien Didelot
-by: Vivien Didelot Reviewed-by: Florian Fainelli --- drivers/net/dsa/mv88e6xxx/chip.c | 39 +++- 1 file changed, 18 insertions(+), 21 deletions(-) diff --git a/drivers/net/dsa/mv88e6xxx/chip.c b/drivers/net/dsa/mv88e6xxx/chip.c index af8943142053..826ae82ed727 100644

[PATCH net-next v2 10/16] net: dsa: use ports list to setup default CPU port

2019-10-21 Thread Vivien Didelot
Use the new ports list instead of iterating over switches and their ports when setting up the default CPU port. Unassign it on teardown. Now that we can iterate over multiple CPU ports, remove dst->cpu_dp. At the same time, provide a better error message for CPU-less tree. Signed-off-by: Viv

[PATCH net-next v2 14/16] net: dsa: sja1105: register switch before assigning port private data

2019-10-21 Thread Vivien Didelot
the priv member of the dsa_port structures. Signed-off-by: Vivien Didelot --- drivers/net/dsa/sja1105/sja1105_main.c | 15 ++- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/drivers/net/dsa/sja1105/sja1105_main.c b/drivers/net/dsa/sja1105/sja1105_main.c index

[PATCH net-next v2 09/16] net: dsa: use ports list to find first CPU port

2019-10-21 Thread Vivien Didelot
Use the new ports list instead of iterating over switches and their ports when looking up the first CPU port in the tree. Signed-off-by: Vivien Didelot Reviewed-by: Florian Fainelli --- net/dsa/dsa2.c | 17 +++-- 1 file changed, 3 insertions(+), 14 deletions(-) diff --git a/net

[PATCH net-next v2 16/16] net: dsa: remove dsa_switch_alloc helper

2019-10-21 Thread Vivien Didelot
Now that ports are dynamically listed in the fabric, there is no need to provide a special helper to allocate the dsa_switch structure. This will give more flexibility to drivers to embed this structure as they wish in their private structure. Signed-off-by: Vivien Didelot Reviewed-by: Florian

[PATCH net-next v2 12/16] net: dsa: mv88e6xxx: use ports list to map port VLAN

2019-10-21 Thread Vivien Didelot
Instead of digging into the other dsa_switch structures of the fabric and relying too much on the dsa_to_port helper, use the new list of switch fabric ports to define the mask of the local ports allowed to receive frames from another port of the fabric. Signed-off-by: Vivien Didelot Reviewed

[PATCH net-next v2 04/16] net: dsa: use ports list to find slave

2019-10-21 Thread Vivien Didelot
Use the new ports list instead of iterating over switches and their ports when looking for a slave device from a given master interface. Signed-off-by: Vivien Didelot Reviewed-by: Florian Fainelli Reviewed-by: Andrew Lunn --- net/dsa/dsa_priv.h | 23 ++- 1 file changed, 6

[PATCH net-next v2 15/16] net: dsa: allocate ports on touch

2019-10-21 Thread Vivien Didelot
Allocate the struct dsa_port the first time it is accessed with dsa_port_touch, and remove the static dsa_port array from the dsa_switch structure. Signed-off-by: Vivien Didelot Reviewed-by: Florian Fainelli --- include/net/dsa.h | 2 -- net/dsa/dsa2.c| 16 ++-- 2 files

[PATCH net-next v2 00/16] net: dsa: turn arrays of ports into a list

2019-10-21 Thread Vivien Didelot
helper. Changes in v2: - use list_add_tail instead of list_add to respect ports order - use a single return statement for dsa_to_port - remove pr_info messages - put comments under appropriate branches - add Git tags from reviewers Vivien Didelot (16): net: dsa: use dsa_to_port helper ever

[PATCH net-next v2 03/16] net: dsa: use ports list in dsa_to_port

2019-10-21 Thread Vivien Didelot
Use the new ports list instead of accessing the dsa_switch array of ports in the dsa_to_port helper. Signed-off-by: Vivien Didelot Reviewed-by: Florian Fainelli Reviewed-by: Andrew Lunn --- include/net/dsa.h | 9 - 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/include

[PATCH net-next v2 01/16] net: dsa: use dsa_to_port helper everywhere

2019-10-21 Thread Vivien Didelot
Do not let the drivers access the ds->ports static array directly while there is a dsa_to_port helper for this purpose. At the same time, un-const this helper since the SJA1105 driver assigns the priv member of the returned dsa_port structure. Signed-off-by: Vivien Didelot Reviewed-by: Flor

Re: [PATCH net-next 02/16] net: dsa: add ports list in the switch fabric

2019-10-21 Thread Vivien Didelot
On Mon, 21 Oct 2019 14:37:40 +0200, Andrew Lunn wrote: > > +static struct dsa_port *dsa_port_touch(struct dsa_switch *ds, int index) > > +{ > > + struct dsa_switch_tree *dst = ds->dst; > > + struct dsa_port *dp; > > + > > + dp = >ports[index]; > > + > > + dp->ds = ds; > > + dp->index =

Re: [PATCH net-next 05/16] net: dsa: use ports list to setup switches

2019-10-21 Thread Vivien Didelot
On Mon, 21 Oct 2019 14:49:02 +0200, Andrew Lunn wrote: > On Sun, Oct 20, 2019 at 07:42:15PM -0700, Florian Fainelli wrote: > > > > > > On 10/19/2019 8:19 PM, Vivien Didelot wrote: > > > Use the new ports list instead of iterating over switches and their > >

Re: [PATCH net-next 01/16] net: dsa: use dsa_to_port helper everywhere

2019-10-21 Thread Vivien Didelot
Hi Andrew, On Mon, 21 Oct 2019 14:31:49 +0200, Andrew Lunn wrote: > On Sat, Oct 19, 2019 at 11:19:26PM -0400, Vivien Didelot wrote: > > Do not let the drivers access the ds->ports static array directly > > while there is a dsa_to_port helper for this purpose. > > > &

[PATCH net-next 10/16] net: dsa: use ports list to setup default CPU port

2019-10-19 Thread Vivien Didelot
Use the new ports list instead of iterating over switches and their ports when setting up the default CPU port. Unassign it on teardown. Now that we can iterate over multiple CPU ports, remove dst->cpu_dp. At the same time, provide a better error message for CPU-less tree. Signed-off-by: Viv

[PATCH net-next 01/16] net: dsa: use dsa_to_port helper everywhere

2019-10-19 Thread Vivien Didelot
Do not let the drivers access the ds->ports static array directly while there is a dsa_to_port helper for this purpose. At the same time, un-const this helper since the SJA1105 driver assigns the priv member of the returned dsa_port structure. Signed-off-by: Vivien Didelot --- drivers/net/

[PATCH net-next 09/16] net: dsa: use ports list to find first CPU port

2019-10-19 Thread Vivien Didelot
Use the new ports list instead of iterating over switches and their ports when looking up the first CPU port in the tree. Signed-off-by: Vivien Didelot --- net/dsa/dsa2.c | 17 +++-- 1 file changed, 3 insertions(+), 14 deletions(-) diff --git a/net/dsa/dsa2.c b/net/dsa/dsa2.c index

[PATCH net-next 04/16] net: dsa: use ports list to find slave

2019-10-19 Thread Vivien Didelot
Use the new ports list instead of iterating over switches and their ports when looking for a slave device from a given master interface. Signed-off-by: Vivien Didelot --- net/dsa/dsa_priv.h | 23 ++- 1 file changed, 6 insertions(+), 17 deletions(-) diff --git a/net/dsa

[PATCH net-next 08/16] net: dsa: use ports list to setup multiple master devices

2019-10-19 Thread Vivien Didelot
Now that we have a potential list of CPU ports, make use of it instead of only configuring the master device of an unique CPU port. Signed-off-by: Vivien Didelot --- net/dsa/dsa2.c | 22 +++--- 1 file changed, 15 insertions(+), 7 deletions(-) diff --git a/net/dsa/dsa2.c b/net

[PATCH net-next 07/16] net: dsa: use ports list to find a port by node

2019-10-19 Thread Vivien Didelot
Use the new ports list instead of iterating over switches and their ports to find a port from a given node. Signed-off-by: Vivien Didelot --- net/dsa/dsa2.c | 17 +++-- 1 file changed, 3 insertions(+), 14 deletions(-) diff --git a/net/dsa/dsa2.c b/net/dsa/dsa2.c index 84afeaeef141

[PATCH net-next 05/16] net: dsa: use ports list to setup switches

2019-10-19 Thread Vivien Didelot
Use the new ports list instead of iterating over switches and their ports when setting up the switches and their ports. At the same time, provide setup states and messages for ports and switches as it is done for the trees. Signed-off-by: Vivien Didelot --- include/net/dsa.h | 4 ++ net/dsa

[PATCH net-next 14/16] net: dsa: sja1105: register switch before assigning port private data

2019-10-19 Thread Vivien Didelot
the priv member of the dsa_port structures. Signed-off-by: Vivien Didelot --- drivers/net/dsa/sja1105/sja1105_main.c | 15 ++- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/drivers/net/dsa/sja1105/sja1105_main.c b/drivers/net/dsa/sja1105/sja1105_main.c index

[PATCH net-next 13/16] net: dsa: mv88e6xxx: use ports list to map bridge

2019-10-19 Thread Vivien Didelot
-by: Vivien Didelot --- drivers/net/dsa/mv88e6xxx/chip.c | 36 +--- 1 file changed, 15 insertions(+), 21 deletions(-) diff --git a/drivers/net/dsa/mv88e6xxx/chip.c b/drivers/net/dsa/mv88e6xxx/chip.c index af8943142053..8771f2525932 100644 --- a/drivers/net/dsa/mv88e6xxx

[PATCH net-next 12/16] net: dsa: mv88e6xxx: use ports list to map port VLAN

2019-10-19 Thread Vivien Didelot
Instead of digging into the other dsa_switch structures of the fabric and relying too much on the dsa_to_port helper, use the new list of switch fabric ports to define the mask of the local ports allowed to receive frames from another port of the fabric. Signed-off-by: Vivien Didelot

[PATCH net-next 15/16] net: dsa: allocate ports on touch

2019-10-19 Thread Vivien Didelot
Allocate the struct dsa_port the first time it is accessed with dsa_port_touch, and remove the static dsa_port array from the dsa_switch structure. Signed-off-by: Vivien Didelot --- include/net/dsa.h | 2 -- net/dsa/dsa2.c| 16 ++-- 2 files changed, 14 insertions(+), 4

[PATCH net-next 16/16] net: dsa: remove dsa_switch_alloc helper

2019-10-19 Thread Vivien Didelot
Now that ports are dynamically listed in the fabric, there is no need to provide a special helper to allocate the dsa_switch structure. This will give more flexibility to drivers to embed this structure as they wish in their private structure. Signed-off-by: Vivien Didelot --- drivers/net/dsa

[PATCH net-next 11/16] net: dsa: mv88e6xxx: silently skip PVT ops

2019-10-19 Thread Vivien Didelot
Since mv88e6xxx_pvt_map is a static helper, no need to return -EOPNOTSUPP if the chip has no PVT, simply silently skip the operation. Signed-off-by: Vivien Didelot --- drivers/net/dsa/mv88e6xxx/chip.c | 11 +-- 1 file changed, 1 insertion(+), 10 deletions(-) diff --git a/drivers/net

[PATCH net-next 06/16] net: dsa: use ports list for routing table setup

2019-10-19 Thread Vivien Didelot
Use the new ports list instead of accessing the dsa_switch array of ports when iterating over DSA ports of a switch to set up the routing table. Signed-off-by: Vivien Didelot --- net/dsa/dsa2.c | 7 +++ 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/net/dsa/dsa2.c b/net/dsa

[PATCH net-next 02/16] net: dsa: add ports list in the switch fabric

2019-10-19 Thread Vivien Didelot
ort structures, return -ENOMEM in case no structure is returned, even though this error cannot be reached yet. Signed-off-by: Vivien Didelot --- include/net/dsa.h | 5 + net/dsa/dsa2.c| 48 +-- 2 files changed, 47 insertions(+), 6 deleti

[PATCH net-next 03/16] net: dsa: use ports list in dsa_to_port

2019-10-19 Thread Vivien Didelot
Use the new ports list instead of accessing the dsa_switch array of ports in the dsa_to_port helper. Signed-off-by: Vivien Didelot --- include/net/dsa.h | 9 - 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/include/net/dsa.h b/include/net/dsa.h index 6ff6dfcdc61d

[PATCH net-next 00/16] net: dsa: turn arrays of ports into a list

2019-10-19 Thread Vivien Didelot
helper. Vivien Didelot (16): net: dsa: use dsa_to_port helper everywhere net: dsa: add ports list in the switch fabric net: dsa: use ports list in dsa_to_port net: dsa: use ports list to find slave net: dsa: use ports list to setup switches net: dsa: use ports list for routing table setup ne

Re: [PATCH net] net: dsa: b53: Do not clear existing mirrored port mask

2019-10-05 Thread Vivien Didelot
> Reported-by: Hubert Feurstein > Fixes: ed3af5fd08eb ("net: dsa: b53: Add support for port mirroring") > Signed-off-by: Florian Fainelli Reviewed-by: Vivien Didelot

Re: [PATCH] tty: serial: fsl_lpuart: Fix lpuart_flush_buffer()

2019-10-04 Thread Vivien Didelot
: serial: fsl_lpuart: Flush HW FIFOs in > .flush_buffer") > Signed-off-by: Andrey Smirnov This fixes the TTY on my ZII Devel Boards Rev B and C: Reported-by: Vivien Didelot Tested-by: Vivien Didelot Thank you! Vivien

Re: [PATCH] net: dsa: b53: Use the correct style for SPDX License Identifier

2019-09-21 Thread Vivien Didelot
files where > C++ style should be used) > > Changes made by using a script provided by Joe Perches here: > https://lkml.org/lkml/2019/2/7/46. > > Suggested-by: Joe Perches > Signed-off-by: Nishad Kamdar Reviewed-by: Vivien Didelot

Re: [PATCH] net: dsa: Use the correct style for SPDX License Identifier

2019-09-21 Thread Vivien Didelot
files where > C++ style should be used) > > Changes made by using a script provided by Joe Perches here: > https://lkml.org/lkml/2019/2/7/46. > > Suggested-by: Joe Perches > Signed-off-by: Nishad Kamdar Reviewed-by: Vivien Didelot

Re: [PATCH net-next 2/3] net: dsa: mv88e6xxx: extend PTP gettime function to read system clock

2019-08-19 Thread Vivien Didelot
On Mon, 19 Aug 2019 15:27:33 +0200, Andrew Lunn wrote: > > @@ -45,7 +45,8 @@ static int mv88e6xxx_smi_direct_write(struct > > mv88e6xxx_chip *chip, > > { > > int ret; > > > > - ret = mdiobus_write_nested(chip->bus, dev, reg, data); > > + ret = mdiobus_write_sts_nested(chip->bus, dev,

Re: [PATCH net v3] net: dsa: Check existence of .port_mdb_add callback before calling it

2019-08-11 Thread Vivien Didelot
[] > (notifier_call_chain+0x48/0x84) > corresponds to > > $ arm-linux-gnueabihf-addr2line -C -i -e vmlinux c08533ec > > linux/net/dsa/switch.c:156 > linux/net/dsa/switch.c:178 > linux/net/dsa/switch.c:328 > > Fixes: e6db98db8a95 ("net: dsa: add switch mdb bitmap functions") > Signed-off-by: Chen-Yu Tsai Thanks for your patience, Reviewed-by: Vivien Didelot

Re: [PATCH net-next] net: dsa: sja1105: remove set but not used variables 'tx_vid' and 'rx_vid'

2019-08-07 Thread Vivien Didelot
t; > Reported-by: Hulk Robot > Signed-off-by: YueHaibing Reviewed-by: Vivien Didelot

Re: [PATCH net v2] net: dsa: Check existence of .port_mdb_add callback before calling it

2019-08-06 Thread Vivien Didelot
Hi Chen-Yu, On Wed, 7 Aug 2019 11:18:28 +0800, Chen-Yu Tsai wrote: > On Wed, Aug 7, 2019 at 4:34 AM Vivien Didelot > wrote: > > > > Hi Chen-Yu, > > > > On Wed, 7 Aug 2019 01:49:37 +0800, Chen-Yu Tsai wrote: > > > On Wed, Aug 7, 2019 at 1:15 AM Vivien Di

Re: [PATCH net v2] net: dsa: Check existence of .port_mdb_add callback before calling it

2019-08-06 Thread Vivien Didelot
Hi Chen-Yu, On Wed, 7 Aug 2019 01:49:37 +0800, Chen-Yu Tsai wrote: > On Wed, Aug 7, 2019 at 1:15 AM Vivien Didelot > wrote: > > > > Hi Chen-Yu, > > > > On Tue, 6 Aug 2019 15:53:25 +0800, Chen-Yu Tsai wrote: > > > From: Chen-Yu Tsai > > > >

Re: [PATCH net v2] net: dsa: Check existence of .port_mdb_add callback before calling it

2019-08-06 Thread Vivien Didelot
Hi Chen-Yu, On Tue, 6 Aug 2019 15:53:25 +0800, Chen-Yu Tsai wrote: > From: Chen-Yu Tsai > > With the recent addition of commit 75dad2520fc3 ("net: dsa: b53: Disable > all ports on setup"), users of b53 (BCM53125 on Lamobo R1 in my case) > are forced to use the dsa subsystem to enable the

Re: [PATCH] net: bridge: Allow bridge to joing multicast groups

2019-08-01 Thread Vivien Didelot
Hi Horatiu, On Thu, 25 Jul 2019 13:44:04 +0200, Horatiu Vultur wrote: > There is no way to configure the bridge, to receive only specific link > layer multicast addresses. From the description of the command 'bridge > fdb append' is supposed to do that, but there was no way to notify the >

[PATCH net-next 2/5] net: dsa: mv88e6xxx: explicit entry passed to vtu_getnext

2019-08-01 Thread Vivien Didelot
of these two fields right before calling mv88e6xxx_vtu_getnext, as it is done in the mv88e6xxx_vtu_get wrapper. Signed-off-by: Vivien Didelot --- drivers/net/dsa/mv88e6xxx/chip.c | 21 - 1 file changed, 12 insertions(+), 9 deletions(-) diff --git a/drivers/net/dsa/mv88e6xxx/chip.c b

[PATCH net-next 5/5] net: dsa: mv88e6xxx: call vtu_getnext directly in vlan_add

2019-08-01 Thread Vivien Didelot
avoids programming the broadcast entries again when changing a port's membership, e.g. from tagged to untagged. At the same time, rename the helper using an old underscore convention. Signed-off-by: Vivien Didelot --- drivers/net/dsa/mv88e6xxx/chip.c | 93 +++- 1 file

[PATCH net-next 4/5] net: dsa: mv88e6xxx: call vtu_getnext directly in vlan_del

2019-08-01 Thread Vivien Didelot
-by: Vivien Didelot --- drivers/net/dsa/mv88e6xxx/chip.c | 21 +++-- 1 file changed, 15 insertions(+), 6 deletions(-) diff --git a/drivers/net/dsa/mv88e6xxx/chip.c b/drivers/net/dsa/mv88e6xxx/chip.c index 42ab57dbc790..50a6dbcc669c 100644 --- a/drivers/net/dsa/mv88e6xxx/chip.c +++ b

[PATCH net-next 3/5] net: dsa: mv88e6xxx: call vtu_getnext directly in db load/purge

2019-08-01 Thread Vivien Didelot
mv88e6xxx_vtu_getnext is simple enough to call it directly in the mv88e6xxx_port_db_load_purge function and explicit the return code expected by switchdev for software VLANs when an hardware VLAN does not exist. Signed-off-by: Vivien Didelot --- drivers/net/dsa/mv88e6xxx/chip.c | 31

[PATCH net-next 1/5] net: dsa: mv88e6xxx: lock mutex in vlan_prepare

2019-08-01 Thread Vivien Didelot
Lock the mutex in the mv88e6xxx_port_vlan_prepare function called by the DSA stack, instead of doing it in the internal mv88e6xxx_port_check_hw_vlan helper. Signed-off-by: Vivien Didelot --- drivers/net/dsa/mv88e6xxx/chip.c | 18 ++ 1 file changed, 6 insertions(+), 12 deletions

[PATCH net-next 0/5] net: dsa: mv88e6xxx: avoid some redundant VTU operations

2019-08-01 Thread Vivien Didelot
in hardware, the following debug message may be printed: [ 745.989884] mv88e6085 2188000.ethernet-1:00: p4: already a member of VLAN 42 Vivien Didelot (5): net: dsa: mv88e6xxx: lock mutex in vlan_prepare net: dsa: mv88e6xxx: explicit entry passed to vtu_getnext net: dsa: mv88e6xxx: call

Re: [PATCH net-next] net: dsa: mv88e6xxx: avoid some redundant vtu load/purge operations

2019-07-29 Thread Vivien Didelot
Hi Rasmus, On Mon, 22 Jul 2019 23:37:26 +, Rasmus Villemoes wrote: > We have an ERPS (Ethernet Ring Protection Switching) setup involving > mv88e6250 switches which we're in the process of switching to a BSP > based on the mainline driver. Breaking any link in the ring works as > expected,

Re: [PATCH net-next] net: dsa: mv88e6xxx: introduce helpers for handling chip->reg_lock

2019-06-20 Thread Vivien Didelot
ention and hold times of the mutex. Perhaps others want to do > something similar at some point, so this frees them from doing the > 'sed -i' yoga, and have a much smaller 'git diff' while fiddling. > > Signed-off-by: Rasmus Villemoes Reviewed-by: Vivien Didelot

[PATCH net-next v2 2/4] net: dsa: make cpu_dp non const

2019-06-14 Thread Vivien Didelot
A port may trigger operations on its dedicated CPU port, so using cpu_dp as const will raise warnings. Make cpu_dp non const. Signed-off-by: Vivien Didelot Reviewed-by: Florian Fainelli --- include/net/dsa.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/net/dsa.h

[PATCH net-next v2 0/4] net: dsa: use switchdev attr and obj handlers

2019-06-14 Thread Vivien Didelot
(where .orig_dev and .dev were originally the bridge device), even though that is of no use yet and skipped by this series. Changes in v2: Only VLAN and (non-host) MDB objects not directly targeting the slave device are unsupported at the moment, so only skip these cases. Vivien Didelot (4): net

[PATCH net-next v2 3/4] net: dsa: make dsa_slave_dev_check use const

2019-06-14 Thread Vivien Didelot
The switchdev handle helpers make use of a device checking helper requiring a const net_device. Make dsa_slave_dev_check compliant to this. Signed-off-by: Vivien Didelot Reviewed-by: Florian Fainelli --- net/dsa/slave.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git

[PATCH net-next v2 1/4] net: dsa: do not check orig_dev in vlan del

2019-06-14 Thread Vivien Didelot
and thus will be confusing. Signed-off-by: Vivien Didelot Reviewed-by: Florian Fainelli --- net/dsa/port.c | 9 - 1 file changed, 9 deletions(-) diff --git a/net/dsa/port.c b/net/dsa/port.c index 585b6b9a9433..d2b65e8dc60c 100644 --- a/net/dsa/port.c +++ b/net/dsa/port.c @@ -336,9

[PATCH net-next v2 4/4] net: dsa: use switchdev handle helpers

2019-06-14 Thread Vivien Didelot
, where orig_dev is the bridge, and dev is the slave. This can be used later to configure the hardware switches. Only VLAN and (port) MDB objects not directly targeting the slave device are unsupported at the moment, so skip this case in their respective case statements. Signed-off-by: Vivien Didelot

Re: [PATCH net-next 0/4] net: dsa: use switchdev attr and obj handlers

2019-06-13 Thread Vivien Didelot
Hi David, On Tue, 11 Jun 2019 17:47:43 -0400, Vivien Didelot wrote: > This series reduces boilerplate in the handling of switchdev attribute and > object operations by using the switchdev_handle_* helpers, which check the > targeted devices and recurse into their lower devices. >

[PATCH net-next 2/4] net: dsa: make cpu_dp non const

2019-06-11 Thread Vivien Didelot
A port may trigger operations on its dedicated CPU port, so using cpu_dp as const will raise warnings. Make cpu_dp non const. Signed-off-by: Vivien Didelot --- include/net/dsa.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/net/dsa.h b/include/net/dsa.h index

[PATCH net-next 1/4] net: dsa: do not check orig_dev in vlan del

2019-06-11 Thread Vivien Didelot
and thus confusing. Signed-off-by: Vivien Didelot --- net/dsa/port.c | 9 - 1 file changed, 9 deletions(-) diff --git a/net/dsa/port.c b/net/dsa/port.c index 70744fec9717..f83756eaf8a5 100644 --- a/net/dsa/port.c +++ b/net/dsa/port.c @@ -336,9 +336,6 @@ int dsa_port_vlan_add(struct

[PATCH net-next 0/4] net: dsa: use switchdev attr and obj handlers

2019-06-11 Thread Vivien Didelot
(where .orig_dev is the bridge device and .dev is the slave), even though that is of no use yet and skipped by this series. Vivien Didelot (4): net: dsa: do not check orig_dev in vlan del net: dsa: make cpu_dp non const net: dsa: make dsa_slave_dev_check use const net: dsa: use switchdev

[PATCH net-next 4/4] net: dsa: use switchdev handle helpers

2019-06-11 Thread Vivien Didelot
, where orig_dev is the bridge, and dev is the slave. This can be used later to configure bridge-wide attributes on the hardware switches. Signed-off-by: Vivien Didelot --- net/dsa/slave.c | 77 + 1 file changed, 33 insertions(+), 44 deletions(-) diff

[PATCH net-next 3/4] net: dsa: make dsa_slave_dev_check use const

2019-06-11 Thread Vivien Didelot
The switchdev handle helpers make use of a device checking helper requiring a const net_device. Make dsa_slave_dev_check compliant to this. Signed-off-by: Vivien Didelot --- net/dsa/slave.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/net/dsa/slave.c b/net/dsa/slave.c

Re: [PATCH net-next v3 01/10] net: dsa: mv88e6xxx: add mv88e6250_g1_ieee_pri_map

2019-06-03 Thread Vivien Didelot
Hi Rasmus, On Mon, 3 Jun 2019 14:42:12 +, Rasmus Villemoes wrote: > Quite a few of the existing supported chips that use > mv88e6085_g1_ieee_pri_map as ->ieee_pri_map (including, incidentally, > mv88e6085 itself) actually have a reset value of 0xfa50 in the > G1_IEEE_PRI register. > > The

Re: [PATCH] net: dsa: mv88e6xxx: make mv88e6xxx_g1_stats_wait static

2019-06-03 Thread Vivien Didelot
On Mon, 3 Jun 2019 08:04:09 +, Rasmus Villemoes wrote: > mv88e6xxx_g1_stats_wait has no users outside global1.c, so make it > static. > > Signed-off-by: Rasmus Villemoes Reviewed-by: Vivien Didelot

Re: [PATCH] net: dsa: mv88e6xxx: avoid error message on remove from VLAN 0

2019-05-31 Thread Vivien Didelot
hat returns -EOPNOTSUPP for zero vid. > > This patch changes mv88e6xxx_vtu_get() to also return -EOPNOTSUPP for > zero vid, then this error code is explicitly cleared in > dsa_slave_vlan_rx_kill_vid() and error message is no longer logged. > > Signed-off-by: Nikita Yushchenko Reviewed-by: Vivien Didelot

Re: [PATCH] net: dsa: mv88e6xxx: avoid error message on remove from VLAN 0

2019-05-31 Thread Vivien Didelot
Hi Florian, On Fri, 31 May 2019 09:34:03 -0700, Florian Fainelli wrote: > On 5/31/19 7:37 AM, Andrew Lunn wrote: > >> I'm not sure that I like the semantic of it, because the driver can > >> actually > >> support VID 0 per-se, only the kernel does not use VLAN 0. Thus I would > >> avoid > >>

Re: [PATCH] net: dsa: mv88e6xxx: avoid error message on remove from VLAN 0

2019-05-31 Thread Vivien Didelot
Hi Florian, On Fri, 31 May 2019 09:36:13 -0700, Florian Fainelli wrote: > > But VID 0 has a special meaning for the kernel, it means the port's private > > database (when it is isolated, non-bridged), it is not meant to be > > programmed > > in the switch. That's why I would've put that

Re: [PATCH] net: dsa: mv88e6xxx: avoid error message on remove from VLAN 0

2019-05-31 Thread Vivien Didelot
Hi Nikita, On Fri, 31 May 2019 17:46:29 +0300, Nikita Yushchenko wrote: > > > 31.05.2019 17:37, Andrew Lunn wrote: > >> I'm not sure that I like the semantic of it, because the driver can > >> actually > >> support VID 0 per-se, only the kernel does not use VLAN 0. Thus I would > >> avoid >

Re: [PATCH net-next] ethtool: do not use regs->len after ops->get_regs

2019-05-31 Thread Vivien Didelot
Hi Michal, On Fri, 31 May 2019 16:27:50 +0200, Michal Kubecek wrote: > On Fri, May 31, 2019 at 10:15:01AM -0400, Vivien Didelot wrote: > > Hi Michal, > > > > On Fri, 31 May 2019 08:54:32 +0200, Michal Kubecek wrote: > > > On Thu, May 30, 2019 at 07:54:50

Re: [PATCH] net: dsa: mv88e6xxx: avoid error message on remove from VLAN 0

2019-05-31 Thread Vivien Didelot
Hi Nikita, On Fri, 31 May 2019 10:35:14 +0300, Nikita Yushchenko wrote: > When non-bridged, non-vlan'ed mv88e6xxx port is moving down, error > message is logged: > > failed to kill vid 0081/0 for device eth_cu_1000_4 > > This is caused by call from __vlan_vid_del() with vin set to zero, over

Re: [PATCH net-next] ethtool: do not use regs->len after ops->get_regs

2019-05-31 Thread Vivien Didelot
Hi Michal, On Fri, 31 May 2019 08:54:32 +0200, Michal Kubecek wrote: > On Thu, May 30, 2019 at 07:54:50PM -0400, Vivien Didelot wrote: > > The kernel allocates a buffer of size ops->get_regs_len(), and pass > > it to the kernel driver via ops->g

[PATCH net-next] ethtool: do not use regs->len after ops->get_regs

2019-05-30 Thread Vivien Didelot
y the kernel driver, but ethtool_get_regs() must use the original regs->len given by userspace, up to ops->get_regs_len(), when copying the buffer. Also no need to check regbuf twice. Signed-off-by: Vivien Didelot --- net/core/ethtool.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)

Re: [PATCH net-next] ethtool: copy reglen to userspace

2019-05-30 Thread Vivien Didelot
Hi Michal, David, On Thu, 30 May 2019 11:26:30 -0700 (PDT), David Miller wrote: > From: Michal Kubecek > Date: Thu, 30 May 2019 10:27:22 +0200 > > > I believe this should be handled by ethtool_get_regs(), either by > > returning an error or by only copying data up to original regs.len > >

Re: [PATCH net v2] net: dsa: mv88e6xxx: fix handling of upper half of STATS_TYPE_PORT

2019-05-29 Thread Vivien Didelot
: Fix u64 statistics") > Signed-off-by: Rasmus Villemoes Correct, this 4-byte stat must be stored in the lower half of the 8-byte returned value: Reviewed-by: Vivien Didelot

Re: [PATCH] net: dsa: mv88e6xxx: fix handling of upper half of STATS_TYPE_PORT

2019-05-29 Thread Vivien Didelot
Hi Rasmus, Andrew, On Wed, 29 May 2019 06:42:53 +, Rasmus Villemoes wrote: > On 28/05/2019 15.44, Andrew Lunn wrote: > > On Tue, May 28, 2019 at 01:17:10PM +, Rasmus Villemoes wrote: > >> Currently, the upper half of a 4-byte STATS_TYPE_PORT statistic ends > >> up in bits 47:32 of the

[PATCH net-next] ethtool: copy reglen to userspace

2019-05-28 Thread Vivien Didelot
ethtool_get_regs() allocates a buffer of size reglen obtained from ops->get_regs_len(), thus only this value must be used when copying the buffer back to userspace. Also no need to check regbuf twice. Signed-off-by: Vivien Didelot --- net/core/ethtool.c | 2 +- 1 file changed, 1 insertion(+)

Re: [PATCH v2 5/5] net: dsa: add support for mv88e6250

2019-05-24 Thread Vivien Didelot
Hi Rasmus, On Fri, 24 May 2019 09:00:31 +, Rasmus Villemoes wrote: > This is a very rough attempt at adding support for the Marvell > 88E6250. The _info and _ops structures are based on those for 6240 (as > I have data sheets for both the 6240 and 6250), fixing the things that > I have

Re: [PATCH v2 4/5] net: dsa: mv88e6xxx: implement watchdog_ops for mv88e6250

2019-05-24 Thread Vivien Didelot
; > Signed-off-by: Rasmus Villemoes Clean patch, Reviewed-by: Vivien Didelot Thanks, Vivien

Re: [PATCH v2 3/5] net: dsa: implement vtu_getnext and vtu_loadpurge for mv88e6250

2019-05-24 Thread Vivien Didelot
r care about that > bit, it seems reasonable to not add the boilerplate to preserve it for > the 6250 (which would require adding a chip-specific vtu_op function, > or adding chip-quirks to the existing one). > > Reviewed-by: Andrew Lunn > Signed-off-by: Rasmus Villemoes Reviewed-by: Vivien Didelot

Re: [PATCH v2 2/5] net: dsa: prepare mv88e6xxx_g1_atu_op() for the mv88e6250

2019-05-24 Thread Vivien Didelot
bits in ATU control 13:12, but rather in ATU Operation > 9:8. So change the logic to prepare for supporting mv88e6250. > > Reviewed-by: Andrew Lunn > Signed-off-by: Rasmus Villemoes Reviewed-by: Vivien Didelot

Re: [PATCH v2 1/5] net: dsa: mv88e6xxx: introduce support for two chips using direct smi addressing

2019-05-24 Thread Vivien Didelot
== 0) > chip->smi_ops = _smi_direct_ops; > else if (chip->info->multi_chip) > chip->smi_ops = _smi_indirect_ops; Please submit respins (v2, v3, and so on) as independent threads, not as a reply to the previous version. Otherwise this looks good to me: Reviewed-by: Vivien Didelot Thanks, Vivien

Re: [RFC PATCH 1/5] net: dsa: mv88e6xxx: introduce support for two chips using direct smi addressing

2019-05-08 Thread Vivien Didelot
Hi Rasmus, On Wed, 8 May 2019 13:47:15 +0200, Andrew Lunn wrote: > > > > > > This works, but i think i prefer adding mv88e6xxx_smi_dual_chip_write, > > > mv88e6xxx_smi_dual_chip_read, and create a > > > mv88e6xxx_smi_single_chip_ops. > > > > Now that Vivien's "net: dsa: mv88e6xxx: refine SMI

Re: [RFC PATCH 2/5] net: dsa: mv88e6xxx: rename smi read/write functions

2019-05-06 Thread Vivien Didelot
Hi Rasmus, On Mon, 6 May 2019 05:57:11 +, Rasmus Villemoes wrote: > > I have a preparatory patch which does almost exactly that. I'm sending it > > to simplify this patchset. > > OK, I'll hold off sending a v2 until I see how 1/5 and 2/5 are obsoleted > by your patch(es). You may rebase

Re: [PATCH net-next] net: dsa: use struct_size() in devm_kzalloc()

2019-02-08 Thread Vivien Didelot
uct_size() helper: > > instance = alloc(struct_size(instance, entry, count), GFP_KERNEL) > > Notice that, in this case, variable size is not necessary, hence it is > removed. > > This code was detected with the help of Coccinelle. > > Signed-off-by: Gustavo A. R. Silva Reviewed-by: Vivien Didelot

Re: [PATCH net-next v3 11/12] net: dsa: Implement ndo_get_port_parent_id()

2019-02-06 Thread Vivien Didelot
gt;dst; > > + ppid->id_len = sizeof(dst->index); > + memcpy(>id, >index, ppid->id_len); > + > + return 0; > +} Finally this will give us a way to distinguish two ports with the same switch and port IDs on a system with two disjoint switch trees, thanks! Reviewed-by: Vivien Didelot

Re: [PATCH] net: dsa: Fix lockdep false positive splat

2019-02-05 Thread Vivien Didelot
xd8/0x138 > [ 23.288340] el0_svc_handler+0x24/0x80 > [ 23.292192] el0_svc+0x8/0xc > > This looks fairly harmless (no actual deadlock occurs), and is > fixed in a similar way to c6894dec8ea9 ("bridge: fix lockdep > addr_list_lock false positive splat") by putting the addr_list_lock > in its own lockdep class. > > Signed-off-by: Marc Zyngier Reviewed-by: Vivien Didelot

Re: [PATCH net-next v3] net: dsa: mv88e6xxx: Prevent suspend to RAM

2019-02-05 Thread Vivien Didelot
w to properly tell PM core that suspend to RAM isn't supported. If an error code different from -EAGAIN or -EBUSY is the way to go, I'm good with it: Reviewed-by: Vivien Didelot Thanks, Vivien

Re: [PATCH net-next v2 1/2] net: dsa: mv88e6xxx: Save switch rules

2019-01-30 Thread Vivien Didelot
Hi Miquèl, On Wed, 30 Jan 2019 10:46:06 +0100, Miquel Raynal wrote: > > > > Today, there is no S2RAM support for switches. First, I proposed to add > > > > suspend/resume callbacks to the mv88e6xxx driver - just enough to avoid > > > > crashing the kernel. > > > > > > Then i would suggest

Re: [PATCH net-next v2 1/2] net: dsa: mv88e6xxx: Save switch rules

2019-01-29 Thread Vivien Didelot
Hi Miquèl, On Tue, 29 Jan 2019 15:51:57 +0100, Andrew Lunn wrote: > > Today, there is no S2RAM support for switches. First, I proposed to add > > suspend/resume callbacks to the mv88e6xxx driver - just enough to avoid > > crashing the kernel. > > Then i would suggest the mv88e6xxx refuses the

Re: [PATCH 1/2] regulator: mc13xxx: Use lowercase regulator names to match the DT

2019-01-25 Thread Vivien Didelot
ix this by using a lowercase regulator name to match the DT node name. > > Fixes: c32569e358ad ("regulator: Use of_node_name_eq for node name > comparisons") > Reported-by: Vivien Didelot > Reported-by: Florian Fainelli > Cc: Liam Girdwood > Cc: Mark Brown > Signe

Re: [PATCH] of: Make of_node_name_eq() case insensitive

2019-01-24 Thread Vivien Didelot
this by use strncasecmp() since that makes sure the comparison is > case insensitive like what of_node_cmp() did. > > Reported-by: Vivien Didelot > Fixes: c32569e358ad ("regulator: Use of_node_name_eq for node name > comparisons") > Signed-off-by: Florian

Re: [PATCH net-next] net: dsa: mv88e6xxx: Add suspend/resume callbacks

2019-01-17 Thread Vivien Didelot
On Thu, 17 Jan 2019 10:00:46 -0800, Florian Fainelli wrote: > A possible approach could be to call the port_disable, port_enable > callbacks from dsa_slave_suspend() and dsa_slave_resume(), I might have > some patches doing that already somewhere. > >>> > >>> I expect it is also

  1   2   3   4   5   6   7   8   9   10   >