[PATCH net-next v2 06/17] net: dsa: mv88e6xxx: rework ATU Load/Purge

2017-03-11 Thread Vivien Didelot
{fid_write,op_wait,op,data_write,mac_write} functions won't need to be exposed in the end so for the moment keep their counterparts _mv88e6xxx_atu_{wait,cmd,data_write,mac_write} as is, since they are still used by other ATU operations. Signed-off-by: Vivien Didelot --- drivers/net/dsa/mv88e6xxx/c

[PATCH net-next v2 13/17] net: dsa: mv88e6xxx: rework port mode setup

2017-03-11 Thread Vivien Didelot
helper to setup a port's mode depending on its nature. Define PORT_ETH_TYPE_DEFAULT for the 0x9100 reset value of port E Type. Signed-off-by: Vivien Didelot --- drivers/net/dsa/mv88e6xxx/chip.c | 120 +++--- drivers/net/dsa/mv88e6xxx/mv88e6xxx.h | 1 + 2

[PATCH net-next v2 10/17] net: dsa: mv88e6xxx: rename new FID helper

2017-03-11 Thread Vivien Didelot
Rename the _mv88e6xxx_fid_new helper to mv88e6xxx_atu_new to get rid of the old underscore prefix naming convention and be consistent with the rest of the chip-wide ATU API. Signed-off-by: Vivien Didelot Reviewed-by: Andrew Lunn --- drivers/net/dsa/mv88e6xxx/chip.c | 4 ++-- 1 file changed, 2

[PATCH net-next v2 11/17] net: dsa: mv88e6xxx: rename the port vector member

2017-03-11 Thread Vivien Didelot
Not all Marvell switch chips support port trunking, which is embedded in the port vector data for ATU operations. Rename the portv_trunkid member of the mv88e6xxx_atu_entry structure to portvec to be more concise and consistent with the different chips. Signed-off-by: Vivien Didelot Reviewed-by

[PATCH net-next v2 09/17] net: dsa: mv88e6xxx: rework ATU Remove

2017-03-11 Thread Vivien Didelot
* functions are now unused as well as the MV88E6XXX_FLAG_G1_ATU_FID flag, thus remove them. Signed-off-by: Vivien Didelot --- drivers/net/dsa/mv88e6xxx/chip.c| 140 +++- drivers/net/dsa/mv88e6xxx/global1.h | 2 + drivers/net/dsa/mv88e6xxx/global1_atu.c | 29

[PATCH net-next v2 16/17] net: dsa: mv88e6xxx: add port priority override op

2017-03-11 Thread Vivien Didelot
olete mv88e6xxx_6320_family helper. Signed-off-by: Vivien Didelot Reviewed-by: Andrew Lunn --- drivers/net/dsa/mv88e6xxx/chip.c | 39 +++ drivers/net/dsa/mv88e6xxx/mv88e6xxx.h | 1 + drivers/net/dsa/mv88e6xxx/port.c | 7 +++ drivers/net/dsa/mv88e6xxx/port.h

[PATCH net-next v2 05/17] net: dsa: mv88e6xxx: enable ATU Learn2All

2017-03-11 Thread Vivien Didelot
The ATU Learn2All feature allows newly learnt addresses to be spanned on ports marked as "Message Port", currently all DSA ports. This commit enables this feature which is necessary and quite convenient for multi-chip switch fabrics. Signed-off-by: Vivien Didelot --- drivers/net/dsa

[PATCH net-next v2 12/17] net: dsa: add dsa_is_normal_port helper

2017-03-11 Thread Vivien Didelot
Introduce a dsa_is_normal_port helper to check if a given port is a normal user port as opposed to a CPU port or DSA link. Signed-off-by: Vivien Didelot --- include/net/dsa.h | 5 + 1 file changed, 5 insertions(+) diff --git a/include/net/dsa.h b/include/net/dsa.h index 4e13e695f025

[PATCH net-next v2 00/17] net: dsa: mv88e6xxx: rework ATU support

2017-03-11 Thread Vivien Didelot
nused MV88E6XXX_FLAG_G1_ATU_FID flag - add dsa_is_normal_port helper Vivien Didelot (17): net: dsa: mv88e6xxx: add port mask helper net: dsa: mv88e6xxx: move ATU ageing time setter net: dsa: mv88e6xxx: add ATU setup helper net: dsa: mv88e6xxx: setup message ports net: dsa: mv88e6xxx: enable ATU Learn2All

[PATCH net-next v2 07/17] net: dsa: mv88e6xxx: rework ATU GetNext

2017-03-11 Thread Vivien Didelot
them. Signed-off-by: Vivien Didelot --- drivers/net/dsa/mv88e6xxx/chip.c| 140 drivers/net/dsa/mv88e6xxx/global1.h | 2 + drivers/net/dsa/mv88e6xxx/global1_atu.c | 66 +++ 3 files changed, 84 insertions(+), 124 deletions(-) diff --git

[PATCH net-next v2 01/17] net: dsa: mv88e6xxx: add port mask helper

2017-03-11 Thread Vivien Didelot
Add a mv88e6xxx_port_mask() helper to get the bitmask of ports in a switch chip, that will be used in several features. Signed-off-by: Vivien Didelot Reviewed-by: Andrew Lunn --- drivers/net/dsa/mv88e6xxx/mv88e6xxx.h | 5 + drivers/net/dsa/mv88e6xxx/port.c | 2 +- 2 files changed, 6

[PATCH net-next v2 08/17] net: dsa: mv88e6xxx: rework ATU Flush

2017-03-11 Thread Vivien Didelot
Add a fresh documented implementation of the ATU Flush/Move operation. Use it to replace the current ATU Flush operation. _mv88e6xxx_atu_flush_move is still used by the Move operation so keep it until the Move operation is refactored in a next commit. Signed-off-by: Vivien Didelot --- drivers

[PATCH net-next v2 04/17] net: dsa: mv88e6xxx: setup message ports

2017-03-11 Thread Vivien Didelot
ned-off-by: Vivien Didelot --- drivers/net/dsa/mv88e6xxx/chip.c | 12 drivers/net/dsa/mv88e6xxx/mv88e6xxx.h | 1 + drivers/net/dsa/mv88e6xxx/port.c | 18 ++ drivers/net/dsa/mv88e6xxx/port.h | 2 ++ 4 files changed, 29 insertions(+), 4 deletions(-) di

[PATCH net-next v2 15/17] net: dsa: mv88e6xxx: add port ATU learn limit op

2017-03-11 Thread Vivien Didelot
Add a new operation to disable the limiting of learnt MAC addresses. Setting such limit is not likely to be used soon, so provide a port_disable_learn_limit operation directly. This can be changed later for port_set_learn_limit when we'll need it. Signed-off-by: Vivien Didelot Review

[PATCH net-next v2 14/17] net: dsa: mv88e6xxx: fix port egress flooding mode

2017-03-11 Thread Vivien Didelot
ns incorrect ones to some chip models. Fix that with two implementation references (6185 and 6352 that I currently have) of a port_set_egress_floods operation (as named in datasheets). Old chips such as 88E6060 don't have egress flooding mode, so don't error out if the operation is not

Re: [PATCH net-next 04/14] net: dsa: mv88e6xxx: rework ATU Load/Purge

2017-03-11 Thread Vivien Didelot
Hi Andrew, Andrew Lunn writes: > On Thu, Mar 09, 2017 at 06:33:14PM -0500, Vivien Didelot wrote: >> All Marvell switch chips have an ATU accessed using the same Global (1) >> register layout. Only the handling of the FID differs as more bits were >> necessary to support mo

[PATCH net-next 01/14] net: dsa: mv88e6xxx: add port mask helper

2017-03-09 Thread Vivien Didelot
Add a mv88e6xxx_port_mask() helper to get the bitmask of ports in a switch chip, that will be used in several features. Signed-off-by: Vivien Didelot Reviewed-by: Andrew Lunn --- drivers/net/dsa/mv88e6xxx/mv88e6xxx.h | 5 + drivers/net/dsa/mv88e6xxx/port.c | 2 +- 2 files changed, 6

[PATCH net-next 03/14] net: dsa: mv88e6xxx: setup ATU Learn2All

2017-03-09 Thread Vivien Didelot
Marvell switch chips which can be interconnected have an ATU Learn2All feature which allows chosen ports to also learn newly added addresses. Enable this feature and mark the DSA links as so called "Message Ports". Signed-off-by: Vivien Didelot --- drivers/net/dsa/mv88e6xxx/chip.c

[PATCH net-next 09/14] net: dsa: mv88e6xxx: rename the port vector member

2017-03-09 Thread Vivien Didelot
Not all Marvell switch chips support port trunking, which is embedded in the port vector data for ATU operations. Rename the portv_trunkid member of the mv88e6xxx_atu_entry structure to portvec to be more concise and consistent with the different chips. Signed-off-by: Vivien Didelot

[PATCH net-next 05/14] net: dsa: mv88e6xxx: rework ATU GetNext

2017-03-09 Thread Vivien Didelot
to loop when getting a single ATU entry. So remove the mv88e6xxx_atu_get helper and add a simpler snippet in mv88e6xxx_port_db_load_purge to lookup a given MAC address. Signed-off-by: Vivien Didelot --- drivers/net/dsa/mv88e6xxx/chip.c| 140 drivers/net

[PATCH net-next 08/14] net: dsa: mv88e6xxx: rename new FID helper

2017-03-09 Thread Vivien Didelot
Rename the _mv88e6xxx_fid_new helper to mv88e6xxx_atu_new to get rid of the old underscore prefix naming convention and be consistent with the rest of the chip-wide ATU API. Signed-off-by: Vivien Didelot --- drivers/net/dsa/mv88e6xxx/chip.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions

[PATCH net-next 14/14] etherdevice: remove unused eth_addr_greater

2017-03-09 Thread Vivien Didelot
eth_addr_greater() was introduced for the mv88e6xxx driver, but is not used anymore. There is no other user, thus remove this function. Signed-off-by: Vivien Didelot --- include/linux/etherdevice.h | 15 --- 1 file changed, 15 deletions(-) diff --git a/include/linux/etherdevice.h b

[PATCH net-next 04/14] net: dsa: mv88e6xxx: rework ATU Load/Purge

2017-03-09 Thread Vivien Didelot
All Marvell switch chips have an ATU accessed using the same Global (1) register layout. Only the handling of the FID differs as more bits were necessary to support more and more databases. Add and use a fresh documented implementation of the ATU Load/Purge. Signed-off-by: Vivien Didelot

[PATCH net-next 07/14] net: dsa: mv88e6xxx: rework ATU Remove

2017-03-09 Thread Vivien Didelot
4-bit, while 6390 use 5-bit. Thus add a new atu_move_port_mask member in the info structure to describe the presence and variant of ATU Move operation. Note that the ATU Move operation is not documented in the 6185 datasheet but the chip does support the operation. Signed-off-by: Vivien Didelot

[PATCH net-next 00/14] net: dsa: mv88e6xxx: rework ATU support

2017-03-09 Thread Vivien Didelot
nally remove the eth_addr_greater which was only used by mv88e6xxx. Vivien Didelot (14): net: dsa: mv88e6xxx: add port mask helper net: dsa: mv88e6xxx: move ATU ageing time setter net: dsa: mv88e6xxx: setup ATU Learn2All net: dsa: mv88e6xxx: rework ATU Load/Purge net: dsa: mv88e6xxx: rewor

[PATCH net-next 11/14] net: dsa: mv88e6xxx: fix port egress flooding mode

2017-03-09 Thread Vivien Didelot
ns incorrect ones to some chip models. Fix that with two implementation references (6185 and 6352 that I currently have) of a port_set_egress_floods operation (as named in datasheets). Old chips such as 88E6060 don't have egress flooding mode, so don't error out if the operation is not

[PATCH net-next 13/14] net: dsa: mv88e6xxx: add port priority override op

2017-03-09 Thread Vivien Didelot
olete mv88e6xxx_6320_family helper. Signed-off-by: Vivien Didelot --- drivers/net/dsa/mv88e6xxx/chip.c | 39 +++ drivers/net/dsa/mv88e6xxx/mv88e6xxx.h | 1 + drivers/net/dsa/mv88e6xxx/port.c | 7 +++ drivers/net/dsa/mv88e6xxx/port.h | 1 + 4 files change

[PATCH net-next 12/14] net: dsa: mv88e6xxx: add port ATU learn limit op

2017-03-09 Thread Vivien Didelot
Add a new operation to disable the limiting of learnt MAC addresses. Setting such limit is not likely to be used soon, so provide a port_disable_learn_limit operation directly. This can be changed later for port_set_learn_limit when we'll need it. Signed-off-by: Vivien Didelot --- driver

[PATCH net-next 10/14] net: dsa: mv88e6xxx: rework port mode setup

2017-03-09 Thread Vivien Didelot
helper to setup a port's mode depending on its nature. This way all related bits are written regardless of the port mode. Signed-off-by: Vivien Didelot --- drivers/net/dsa/mv88e6xxx/chip.c | 118 +-- 1 file changed, 64 insertions(+), 54 deletions(-) diff --

[PATCH net-next 06/14] net: dsa: mv88e6xxx: rework ATU Flush

2017-03-09 Thread Vivien Didelot
Add a fresh documented implementation of the ATU Flush/Move operation. Use it to replace the current ATU Flush operation. Signed-off-by: Vivien Didelot --- drivers/net/dsa/mv88e6xxx/chip.c| 22 +--- drivers/net/dsa/mv88e6xxx/global1.h | 1 + drivers/net/dsa

[PATCH net-next 02/14] net: dsa: mv88e6xxx: move ATU ageing time setter

2017-03-09 Thread Vivien Didelot
Move the ATU ageing time setter code in the new global1_atu.c file, and add an mv88e6xxx_atu_setup helper to configure and initialize the ATU. Signed-off-by: Vivien Didelot --- drivers/net/dsa/mv88e6xxx/Makefile | 1 + drivers/net/dsa/mv88e6xxx/chip.c| 42

Re: [PATCH net-next v2 2/6] net: dsa: mv88e6xxx: move ATU code in its own file

2017-02-17 Thread Vivien Didelot
Hi Andrew, Andrew Lunn writes: > This seems to be more than renaming a few functions. There looks to be > real changes here. I think these changes should be split out into a > separate patch with an explanation what is being changed. Keep this > patch for plain renames. > > It would also be easi

[PATCH net-next v2 4/6] net: dsa: mv88e6xxx: move VTU code to its own file

2017-02-17 Thread Vivien Didelot
layout. This commit prepares the addition for VTU ops by providing 6185 and 6352 variant of the VTU operations. Support for new chip can be easily added. Signed-off-by: Vivien Didelot --- drivers/net/dsa/mv88e6xxx/Makefile | 1 + drivers/net/dsa/mv88e6xxx/chip.c| 462

[PATCH net-next v2 5/6] net: dsa: mv88e6xxx: add VTU ops

2017-02-17 Thread Vivien Didelot
Because there are several variant of the VTU operations and because checking for the presence of an STU is not enough, add new ops to the info structure to describe the VTU operations that a chip supports. Signed-off-by: Vivien Didelot --- drivers/net/dsa/mv88e6xxx/chip.c | 58

[PATCH net-next v2 3/6] net: dsa: mv88e6xxx: add support for 6390 ATU Move

2017-02-17 Thread Vivien Didelot
The 6390 family of Marvell chips uses 5 bits to describe the ToPort and FromPort values of PortVec in the ATU Move operation, while older switches use 0xf. Add an atu_move_port_mask member in the info structure to describe that. Signed-off-by: Vivien Didelot --- drivers/net/dsa/mv88e6xxx

[PATCH net-next v2 0/6] net: dsa: mv88e6xxx: 88E6390 ATU/VTU

2017-02-17 Thread Vivien Didelot
variable err in 5/6, spotted by kbuild bot. Vivien Didelot (6): net: dsa: mv88e6xxx: add port mask helper net: dsa: mv88e6xxx: move ATU code in its own file net: dsa: mv88e6xxx: add support for 6390 ATU Move net: dsa: mv88e6xxx: move VTU code to its own file net: dsa: mv88e6xxx: add VTU

[PATCH net-next v2 6/6] net: dsa: mv88e6xxx: add support for 6390 VTU

2017-02-17 Thread Vivien Didelot
The 6390 family of chips use only 2 of the 3 VTU Data registers to pack the MemberTag and PortState VLAN data. This means that they must be written or read before or after each VTU/STU operations. Implement this variant to add support for VTU with such chips. Signed-off-by: Vivien Didelot

[PATCH net-next v2 2/6] net: dsa: mv88e6xxx: move ATU code in its own file

2017-02-17 Thread Vivien Didelot
Move the Global (1) ATU related code in its own file, and export the necessary primitives. Use that opportunity to provide a cleaner API for the ATU, by renaming a few underscore prefixed functions, and members of the mv88e6xxx_atu_entry structures. Signed-off-by: Vivien Didelot --- drivers

[PATCH net-next v2 1/6] net: dsa: mv88e6xxx: add port mask helper

2017-02-17 Thread Vivien Didelot
Add a mv88e6xxx_port_mask() helper to get the bitmask of ports in a switch chip, that will be used in several features. Signed-off-by: Vivien Didelot --- drivers/net/dsa/mv88e6xxx/mv88e6xxx.h | 5 + drivers/net/dsa/mv88e6xxx/port.c | 2 +- 2 files changed, 6 insertions(+), 1 deletion

[PATCH net-next 6/6] net: dsa: mv88e6xxx: add support for 6390 VTU

2017-02-16 Thread Vivien Didelot
The 6390 family of chips use only 2 of the 3 VTU Data registers to pack the MemberTag and PortState VLAN data. This means that they must be written or read before or after each VTU/STU operations. Implement this variant to add support for VTU with such chips. Signed-off-by: Vivien Didelot

[PATCH net-next 2/6] net: dsa: mv88e6xxx: move ATU code in its own file

2017-02-16 Thread Vivien Didelot
Move the Global (1) ATU related code in its own file, and export the necessary primitives. Use that opportunity to provide a cleaner API for the ATU, by renaming a few underscore prefixed functions, and members of the mv88e6xxx_atu_entry structures. Signed-off-by: Vivien Didelot --- drivers

[PATCH net-next 4/6] net: dsa: mv88e6xxx: move VTU code to its own file

2017-02-16 Thread Vivien Didelot
layout. This commit prepares the addition for VTU ops by providing 6185 and 6352 variant of the VTU operations. Support for new chip can be easily added. Signed-off-by: Vivien Didelot --- drivers/net/dsa/mv88e6xxx/Makefile | 1 + drivers/net/dsa/mv88e6xxx/chip.c| 462

[PATCH net-next 1/6] net: dsa: mv88e6xxx: add port mask helper

2017-02-16 Thread Vivien Didelot
Add a mv88e6xxx_port_mask() helper to get the bitmask of ports in a switch chip, that will be used in several features. Signed-off-by: Vivien Didelot --- drivers/net/dsa/mv88e6xxx/mv88e6xxx.h | 5 + drivers/net/dsa/mv88e6xxx/port.c | 2 +- 2 files changed, 6 insertions(+), 1 deletion

[PATCH net-next 0/6] net: dsa: mv88e6xxx: 88E6390 ATU/VTU

2017-02-16 Thread Vivien Didelot
This series adds support to 88E6390 for the ATU (MAC address databases) and VTU (VLAN databases), as well as providing a cleaner API for both. The 6390 family of Marvell switch chip handles the ATU Move operation differently and has a different usage of the VTU Data registers. Vivien Didelot (6

[PATCH net-next 5/6] net: dsa: mv88e6xxx: add VTU ops

2017-02-16 Thread Vivien Didelot
Because there are several variant of the VTU operations and because checking for the presence of an STU is not enough, add new ops to the info structure to describe the VTU operations that a chip supports. Signed-off-by: Vivien Didelot --- drivers/net/dsa/mv88e6xxx/chip.c | 54

[PATCH net-next 3/6] net: dsa: mv88e6xxx: add support for 6390 ATU Move

2017-02-16 Thread Vivien Didelot
The 6390 family of Marvell chips uses 5 bits to describe the ToPort and FromPort values of PortVec in the ATU Move operation, while older switches use 0xf. Add an atu_move_port_mask member in the info structure to describe that. Signed-off-by: Vivien Didelot --- drivers/net/dsa/mv88e6xxx

Re: [PATCH net-next 6/6] net: dsa: introduce bridge notifier

2017-02-04 Thread Vivien Didelot
Hi Andrew, Andrew Lunn writes: >> +#define DSA_NOTIFIER_BRIDGE_JOIN1 >> +#define DSA_NOTIFIER_BRIDGE_LEAVE 2 > > Is one notifier per event sufficient? Yes. What a switch chip in a fabric needs to know is what action is currently triggered on another chip, so that it can re

Re: [PATCH net-next 2/6] net: dsa: simplify netdevice events handling

2017-02-04 Thread Vivien Didelot
Hi Florian, Florian Fainelli writes: >> -if (dsa_slave_dev_check(dev)) >> -return dsa_slave_port_event(dev, event, ptr); >> +if (dev->netdev_ops != &dsa_slave_netdev_ops) >> +return NOTIFY_DONE; > > Why not keep the dsa_slave_dev_check() here? I dropped it becaus

[PATCH net-next 1/6] net: dsa: move netdevice notifier registration

2017-02-03 Thread Vivien Didelot
Move the netdevice notifier block register code in slave.c and provide helpers for dsa.c to register and unregister it. At the same time, check for errors since (un)register_netdevice_notifier may fail. Signed-off-by: Vivien Didelot --- net/dsa/dsa.c | 10 -- net/dsa/dsa_priv.h

[PATCH net-next 6/6] net: dsa: introduce bridge notifier

2017-02-03 Thread Vivien Didelot
A slave device will now notify the switch fabric once its port is bridged or unbridged, instead of calling directly its switch operations. This code allows propagating cross-chip bridging events in the fabric. Signed-off-by: Vivien Didelot --- include/net/dsa.h | 10 ++ net/dsa/slave.c

[PATCH net-next 3/6] net: dsa: rollback bridging on error

2017-02-03 Thread Vivien Didelot
When an error is returned during the bridging of a port in a NETDEV_CHANGEUPPER event, net/core/dev.c rolls back the operation. Be consistent and unassign dp->bridge_dev when this happens. In the meantime, add comments to document this behavior. Signed-off-by: Vivien Didelot --- net/

[PATCH net-next 4/6] net: dsa: change state setter scope

2017-02-03 Thread Vivien Didelot
The scope of the functions inside net/dsa/slave.c must be the slave net_device pointer. Change to state setter helper accordingly to simplify callers. Signed-off-by: Vivien Didelot --- net/dsa/slave.c | 15 +-- 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/net/dsa

[PATCH net-next 0/6] net: dsa: add fabric notifier

2017-02-03 Thread Vivien Didelot
note that non-switchdev events do not support rolling-back switch-wide operations. We'll have to work on closer integration with switchdev for that, like introducing new attributes or objects, to benefit from the prepare and commit phases. Vivien Didelot (6): net: dsa: move netdevice not

[PATCH net-next 5/6] net: dsa: add switch notifier

2017-02-03 Thread Vivien Didelot
be caught. Signed-off-by: Vivien Didelot --- include/net/dsa.h | 7 +++ net/dsa/Makefile | 1 + net/dsa/dsa.c | 6 ++ net/dsa/dsa2.c | 6 ++ net/dsa/dsa_priv.h | 4 net/dsa/switch.c | 53 + 6 files changed, 77

[PATCH net-next 2/6] net: dsa: simplify netdevice events handling

2017-02-03 Thread Vivien Didelot
occurred, as the API suggests. Signed-off-by: Vivien Didelot --- net/dsa/slave.c | 44 1 file changed, 16 insertions(+), 28 deletions(-) diff --git a/net/dsa/slave.c b/net/dsa/slave.c index 949644c1dac2..332eb234dc21 100644 --- a/net/dsa/slave.c +++ b/net

Re: [PATCH net-next v7 3/3] net: dsa: mv88e6xxx: Add support for ethernet switch 88E6141

2017-01-30 Thread Vivien Didelot
ly and unlike the 88E6341 it does not have > a TCAM. > > Signed-off-by: Gregory CLEMENT Reviewed-by: Vivien Didelot Thanks, Vivien

Re: [PATCH net-next v7 2/3] net: dsa: mv88e6xxx: Add support for ethernet switch 88E6341

2017-01-30 Thread Vivien Didelot
es of family 88E6390. > > This commit adds an initial support for this switch by describing its > capabilities to the driver and introducing a new family. > > Signed-off-by: Gregory CLEMENT Reviewed-by: Vivien Didelot Thanks, Vivien

[PATCH net-next 0/9] net: dsa: preparatory patches for multi-chip

2017-01-27 Thread Vivien Didelot
, and exposes the bridge device a port belongs to. Vivien Didelot (9): net: dsa: variable number of ports net: dsa: use ds->num_ports when possible net: dsa: add ds and index to dsa_port net: dsa: store a dsa_port in dsa_slave_priv net: dsa: move bridge device in dsa_port net: dsa: p

[PATCH net-next 8/9] net: dsa: qca8k: use dsa_port's bridge pointer

2017-01-27 Thread Vivien Didelot
Now that DSA exposes the bridge device pointer to which a port belongs, use it when programming the port based VLANs and thus remove the cache. Signed-off-by: Vivien Didelot --- drivers/net/dsa/qca8k.c | 12 drivers/net/dsa/qca8k.h | 1 - 2 files changed, 4 insertions(+), 9

[PATCH net-next 4/9] net: dsa: store a dsa_port in dsa_slave_priv

2017-01-27 Thread Vivien Didelot
Store a pointer to the dsa_port structure in the dsa_slave_priv structure, instead of the switch/port index. This will allow to store more information such as the bridge device, needed in DSA drivers for multi-chip configuration. Signed-off-by: Vivien Didelot --- net/dsa/dsa_priv.h| 8

[PATCH net-next 3/9] net: dsa: add ds and index to dsa_port

2017-01-27 Thread Vivien Didelot
Add the physical switch instance and port index a DSA port belongs to to the dsa_port structure. That can be used later to retrieve information about a physical port when configuring a switch fabric, or lighten up struct dsa_slave_priv. Signed-off-by: Vivien Didelot --- include/net/dsa.h | 2

[PATCH net-next 6/9] net: dsa: pass bridge device when a port leaves

2017-01-27 Thread Vivien Didelot
te of the DSA switch fabric is necessary for the drivers to adjust their port based VLANs correctly. Pass the bridge device pointer to the port_bridge_leave operation so that drivers have all information to re-program their chips properly, and do not need to cache it anymore. Signed-off-by: V

[PATCH net-next 5/9] net: dsa: move bridge device in dsa_port

2017-01-27 Thread Vivien Didelot
Move the bridge_dev pointer from dsa_slave_priv to dsa_port so that DSA drivers can access this information and remove the need to cache it. Signed-off-by: Vivien Didelot --- include/net/dsa.h | 1 + net/dsa/dsa_priv.h | 1 - net/dsa/slave.c| 10 +- 3 files changed, 6 insertions

[PATCH net-next 7/9] net: dsa: mv88e6xxx: use dsa_port's bridge pointer

2017-01-27 Thread Vivien Didelot
Now that DSA exposes the bridge device pointer to which a port belongs, use it when programming the port based VLANs and thus remove the cache. Signed-off-by: Vivien Didelot --- drivers/net/dsa/mv88e6xxx/chip.c | 27 +++ drivers/net/dsa/mv88e6xxx/mv88e6xxx.h | 6

[PATCH net-next 1/9] net: dsa: variable number of ports

2017-01-27 Thread Vivien Didelot
ports for the moment. Future patches can update the DSA drivers separately to support dynamic number of ports. Signed-off-by: Vivien Didelot --- drivers/net/dsa/b53/b53_common.c | 7 --- drivers/net/dsa/mv88e6xxx/chip.c | 3 +-- drivers/net/dsa/qca8k.c | 3 +-- include/net/dsa.h

[PATCH net-next 2/9] net: dsa: use ds->num_ports when possible

2017-01-27 Thread Vivien Didelot
The dsa_switch structure contains the number of ports. Use it where the structure is valid instead of the DSA_MAX_PORTS value. Signed-off-by: Vivien Didelot --- net/dsa/dsa.c | 16 net/dsa/dsa2.c| 12 ++-- net/dsa/slave.c | 2 +- net/dsa

[PATCH net-next 9/9] net: dsa: b53: use dsa_port's bridge pointer

2017-01-27 Thread Vivien Didelot
Now that DSA exposes the bridge device pointer to which a port belongs, use it when programming the port based VLANs and thus remove the cache. Signed-off-by: Vivien Didelot --- drivers/net/dsa/b53/b53_common.c | 9 +++-- drivers/net/dsa/b53/b53_priv.h | 1 - 2 files changed, 3 insertions

Re: [PATCH v5 0/2] Add support for the ethernet switch on the ESPRESSObin

2017-01-24 Thread Vivien Didelot
Hi Gregory, Gregory CLEMENT writes: > Hi David, > > On ven., janv. 20 2017, David Miller wrote: > >> From: Gregory CLEMENT >> Date: Thu, 19 Jan 2017 22:49:32 +0100 >> >>> I created a new family for this switch and filled the ops structure >>> by selecting which seems the more appropriate fu

Re: [PATCH v5 2/2] net: dsa: mv88e6xxx: Add support for ethernet switch 88E6341

2017-01-20 Thread Vivien Didelot
Hi Gregory, Gregory CLEMENT writes: > If there a series about to be merged I can rebase my series on it. Else > I propose to keep it and convert the family check to ops when you will > send the series for it. I am reworking the VTU operations, but not these port operations yet. I will take care

Re: [PATCH v5 2/2] net: dsa: mv88e6xxx: Add support for ethernet switch 88E6341

2017-01-19 Thread Vivien Didelot
Hi Andrew, Andrew Lunn writes: >> Maybe I missed it, Andrew, can you confirm that 6341 is a proper Marvell >> family of switch chips? > > My understand is that it is. Marvell have not added it to DSDT. There > is a new SDK called UMSD, also GPLv2 and BSD. They call this family > Topaz, and the 6

Re: [PATCH v5 1/2] net: dsa: mv88e6xxx: Don't forbid MDIO I/Os for PHY addr >= num_of_ports

2017-01-19 Thread Vivien Didelot
Hi Andrew, Andrew Lunn writes: >> Isn't there an hardware table used to map the PHY addresses on such chip? > > The 6390 has something like this. But if we can avoid it, lets keep it > KISS. I definitely agree. I was just curious about this new chip. Thanks, Vivien

Re: [PATCH v5 2/2] net: dsa: mv88e6xxx: Add support for ethernet switch 88E6341

2017-01-19 Thread Vivien Didelot
Gregory CLEMENT writes: > +static bool mv88e6xxx_6341_family(struct mv88e6xxx_chip *chip) > +{ > + return chip->info->family == MV88E6XXX_FAMILY_6341; > +} I don't want to see these erronous family checks anymore, but I cannot blame you for adding it since not all the code is moved to ops ye

Re: [PATCH v5 0/2] Add support for the ethernet switch on the ESPRESSObin

2017-01-19 Thread Vivien Didelot
Hi Gregory, Vivien Didelot writes: > The temperature is accessed via ethtool -e|-E. Oops, that was a silly mistake, no need to explain! ;-) Vivien

Re: [PATCH v5 1/2] net: dsa: mv88e6xxx: Don't forbid MDIO I/Os for PHY addr >= num_of_ports

2017-01-19 Thread Vivien Didelot
callbacks. > > Signed-off-by: Romain Perier > Reviewed-by: Andrew Lunn > Signed-off-by: Gregory CLEMENT The patch is anyway still valid: Reviewed-by: Vivien Didelot Thanks, Vivien

Re: [PATCH v5 0/2] Add support for the ethernet switch on the ESPRESSObin

2017-01-19 Thread Vivien Didelot
Hi Gregory, Gregory CLEMENT writes: > I created a new family for this switch and filled the ops structure by > selecting which seems the more appropriate functions. We don't create families, this information comes from the Marvell DSDT. If you don't know which switch family Marvell put the 6341

[PATCH net-next 2/2] net: dsa: use cpu_switch instead of ds[0]

2017-01-17 Thread Vivien Didelot
Now that the DSA Ethernet switches are true Linux devices, the CPU switch is not necessarily the first one. If its address is higher than the second switch on the same MDIO bus, its index will be 1, not 0. Avoid any confusion by using dst->cpu_switch instead of dst->ds[0]. Signed-off-by:

[PATCH net-next 1/2] net: dsa: store CPU switch structure in the tree

2017-01-17 Thread Vivien Didelot
Store a dsa_switch pointer to the CPU switch in the tree instead of only its index. This avoids the need to initialize it to -1. Signed-off-by: Vivien Didelot --- include/net/dsa.h | 8 net/dsa/dsa.c | 7 +++ net/dsa/dsa2.c| 5 ++--- 3 files changed, 9 insertions(+), 11

Re: [PATCH RFC] net: dsa: remove unnecessary phy.h include

2017-01-17 Thread Vivien Didelot
duces from around 800 files rebuilt to around 40 - even > with ccache, the time difference is noticable. > > Signed-off-by: Russell King This patch applies cleanly on net-next and builds correctly after touching include/linux/phy.h. My boards work fine with it. Tested-by: Vivien Didelot Thanks, Vivien

Re: [PATCH net-next v2 00/10] net: dsa: Support for pdata in dsa2

2017-01-12 Thread Vivien Didelot
ify things. > > Greg, can you Ack/Nack patch 5 since it touched the core LDD? > > Thanks! I've tested this patchset on my mv88e6xxx (DTS) boards to make sure nothing was broken, since it touches the driver. Looks good! Tested-by: Vivien Didelot Thanks, Vivien

[PATCH net-next] net: dsa: mv88e6xxx: add EEPROM support to 6390

2017-01-12 Thread Vivien Didelot
The Marvell 6352 chip has a 8-bit address/16-bit data EEPROM access. The Marvell 6390 chip has a 16-bit address/8-bit data EEPROM access. This patch implements the 8-bit data EEPROM access in the mv88e6xxx driver and adds its support to chips of the 6390 family. Signed-off-by: Vivien Didelot

[PATCH] ARM: dts: vf610-zii-dev: add EEPROM entry to Rev C

2017-01-12 Thread Vivien Didelot
The ZII Dev Rev C board has EEPROMs hanging the 88E6390 Ethernet switch chips. Add an "eeprom-length" property to allow access from ethtool. Signed-off-by: Vivien Didelot --- arch/arm/boot/dts/vf610-zii-dev-rev-c.dts | 2 ++ 1 file changed, 2 insertions(+) diff --git a/arch/arm/boot

[�PATCH net-next] ARM: dts: vf610-zii-dev: add EEPROM entry to Rev B

2017-01-12 Thread Vivien Didelot
The ZII Dev Rev B board has EEPROMs hanging the 88E6352 Ethernet switch chips. Add an "eeprom-length" property to allow access from ethtool. Signed-off-by: Vivien Didelot --- arch/arm/boot/dts/vf610-zii-dev-rev-b.dts | 2 ++ 1 file changed, 2 insertions(+) diff --git a/arch/arm/boot

[PATCH net-next v3] net: dsa: make "label" property optional for dsa2

2017-01-09 Thread Vivien Didelot
device names. If one wants to rename an interface, udev rules can be used as usual. Of course the current behavior is unchanged, and the optional "label" property for user ports has precedence over the enumerated name. Signed-off-by: Vivien Didelot Acked-by: Uwe Kleine-König

[PATCH net-next v2] net: dsa: select NET_SWITCHDEV

2017-01-09 Thread Vivien Didelot
The support for DSA Ethernet switch chips depends on TCP/IP networking, thus explicit that HAVE_NET_DSA depends on INET. DSA uses SWITCHDEV, thus select it instead of depending on it. Signed-off-by: Vivien Didelot Reviewed-by: Andrew Lunn Reviewed-by: Florian Fainelli Tested-by: Randy Dunlap

Re: [PATCH net-next] net: dsa: select NET_SWITCHDEV

2017-01-09 Thread Vivien Didelot
Hi Randy, Randy Dunlap writes: > On 01/08/17 17:18, Florian Fainelli wrote: >> On 01/08/2017 03:17 PM, Vivien Didelot wrote: >>> DSA wraps SWITCHDEV, thus select it instead of depending on it. >>> >>> Signed-off-by: Vivien Didelot >> >>

Re: [PATCH net-next v2] net: dsa: make "label" property optional for dsa2

2017-01-09 Thread Vivien Didelot
Hi Jiri, Jiri Pirko writes: >>Extra question: shouldn't phys_port_{id,name} be switchdev attributes in > > Again, phys_port_id has nothing to do with switches. Should be removed > from dsa because its use there is incorrect. Florian, since 3a543ef just got in, can it be reverted? >>> I guess t

Re: [PATCH net-next v2] net: dsa: make "label" property optional for dsa2

2017-01-09 Thread Vivien Didelot
Hi Jiri, Jiri Pirko writes: >># cat /etc/udev/rules.d/90-net-dsa.rules >>SUBSYSTEM=="net", ACTION=="add", ENV{DEVTYPE}=="dsa", >> PROGRAM="/lib/udev/dsanitizer $attr{phys_switch_id} $attr{phys_port_id}", >> NAME="$result" > > I know this is kind of confusing, but phys_port_id is to be

Re: [PATCH net-next v2] net: dsa: make "label" property optional for dsa2

2017-01-08 Thread Vivien Didelot
Hi Andrew, Andrew Lunn writes: >> Until the printing of netdev_phys_item_id structures is fixed in >> net/core/net-sysfs.c, an external helper can be used like this: > > As Florian pointed out, this cannot be changed. It is now part of the > ABI. We have to live with it printing little endian nu

[PATCH net-next] net: dsa: select NET_SWITCHDEV

2017-01-08 Thread Vivien Didelot
DSA wraps SWITCHDEV, thus select it instead of depending on it. Signed-off-by: Vivien Didelot --- net/dsa/Kconfig | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/net/dsa/Kconfig b/net/dsa/Kconfig index 2ae9bb357523..675acbf1502d 100644 --- a/net/dsa/Kconfig +++ b/net/dsa

[PATCH net-next v2] net: dsa: make "label" property optional for dsa2

2017-01-08 Thread Vivien Didelot
ntf p%d # ip link | awk '/@eth/ { split($2,a,"@"); print a[1]; }' sw0p0 sw0p1 sw0p2 sw1p0 sw1p1 sw1p2 sw2p0 sw2p1 sw2p2 sw2p3 sw2p4 Of course the current behavior is unchanged, and the optional "label" property for us

[PATCH net-next 2/2] arm: dts: vf610-zii-dev-rev-b: remove ports label

2017-01-06 Thread Vivien Didelot
@eth1 eth4@eth1 eth5@eth1 eth6@eth1 eth7@eth1 eth8@eth1 eth9@eth1 eth10@eth1 eth11@eth1 eth12@eth1 Signed-off-by: Vivien Didelot --- arch/arm/boot/dts/vf610-zii-dev-rev-b.dts | 16 1 file changed, 16 deletions(-) diff --git a/arch/ar

[PATCH net-next 1/2] net: dsa: make "label" property optional for dsa2

2017-01-06 Thread Vivien Didelot
device names. If one wants to rename an interface, udev rules can be used as usual. The sysfs phys_port_id and phys_switch_id also provide physical data. Of course the current behavior is unchanged, and the optional "label" property for user ports has precedence over the enumerated name.

[PATCH net-next 0/2] net: dsa: make "label" property optional

2017-01-06 Thread Vivien Didelot
e standard "ethX" network device name. Giving a "label" overwrites this. Patch 2/2 removes the labels for the ZII Rev B board as an example. Vivien Didelot (2): net: dsa: make "label" property optional for dsa2 arm: dts: vf610-zii-dev-rev-b: remove ports label

[PATCH net-next] net: dsa: move HWMON support to its own file

2017-01-06 Thread Vivien Didelot
Isolate the HWMON support in DSA in its own file. Currently only the legacy DSA code is concerned. Signed-off-by: Vivien Didelot --- net/dsa/Makefile | 1 + net/dsa/dsa.c | 131 +-- net/dsa/dsa_priv.h | 9 net/dsa/hwmon.c| 147

[PATCH net-next] net: dsa: remove version string

2017-01-05 Thread Vivien Didelot
The dsa_driver_version string is irrelevant and has not been bumped since its introduction about 9 years ago. Kill it. Signed-off-by: Vivien Didelot --- net/dsa/dsa.c | 5 - net/dsa/dsa_priv.h | 1 - net/dsa/slave.c| 1 - 3 files changed, 7 deletions(-) diff --git a/net/dsa/dsa.c

Re: [PATCH 3/8] ARM: dts: armada-388-clearfog: Utilize new DSA binding

2017-01-04 Thread Vivien Didelot
Hi Andrew, Andrew Lunn writes: >> That makes me think that we should either remove, or use different >> values for the version described in net/dsa/dsa.c: >> >> char dsa_driver_version[] = "0.1"; >> >> Today this is absolutely useless and erroneous. > > I think it has been useless for over

Re: [PATCH 3/8] ARM: dts: armada-388-clearfog: Utilize new DSA binding

2017-01-04 Thread Vivien Didelot
Hi Florian, All, Florian Fainelli writes: >> However is there a way to be sure that the new binding is used? > > The best way is probably to make sure that your switch device appears > parented to the MDIO bus driver under /sys/class/mdio_bus/*mvmdio*. > Alternatively, if you see a message like:

[RFC PATCH] ACPICA: sprintf should use ACPI_SIZE_MAX

2017-01-03 Thread Vivien Didelot
sprintf() should use the architecture independent ACPI_SIZE_MAX value instead of the ACPI_UINT32_MAX 32-bit variant. Change this. Signed-off-by: Vivien Didelot --- drivers/acpi/acpica/utprint.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/acpi/acpica/utprint.c b

Re: [PATCH net-next 0/3] net: dsa: restore HWMON support in dsa2

2017-01-03 Thread Vivien Didelot
Hi Florian, Florian Fainelli writes: The current HWMON support in DSA in embedded in the legacy code. Extract it to its own file and register it in the newer DSA code. >>> >>> I would really prefer not to do this. >>> >>> The temperature sensor is in the embedded PHYs of the switch. Ma

[PATCH net-next v2] net: dsa: remove out label in dsa_switch_setup_one

2017-01-03 Thread Vivien Didelot
The "out" label in dsa_switch_setup_one() is useless, thus remove it. Reviewed-by: Andrew Lunn Signed-off-by: Vivien Didelot --- net/dsa/dsa.c | 40 +--- 1 file changed, 13 insertions(+), 27 deletions(-) diff --git a/net/dsa/dsa.c b/net/dsa/d

<    3   4   5   6   7   8   9   10   11   12   >