[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/chip.c

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

2017-03-11 Thread Vivien Didelot
as an 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 <vivien.dide...@savoirfairelinux.com> --- drivers/net/dsa/mv88e6xxx/chip.c | 120 +++--- drivers/n

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

2017-03-11 Thread Vivien Didelot
as an 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 files

[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 <vivien.d

[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 <vivien.dide...@savoirfairelinux.com> Reviewed-by: Andrew Lunn <and...@lunn.ch>

[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

[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 <vivien.dide...@savoirfairelinux.com> --- drivers/net/dsa/mv88e6xxx/chip.c| 140 +++- drivers/net/dsa/mv88e6xxx/global1.h | 2 + d

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

2017-03-11 Thread Vivien Didelot
mv88e6xxx_6320_family helper. Signed-off-by: Vivien Didelot <vivien.dide...@savoirfairelinux.com> Reviewed-by: Andrew Lunn <and...@lunn.ch> --- drivers/net/dsa/mv88e6xxx/chip.c | 39 +++ drivers/net/dsa/mv88e6xxx/mv88e6xxx.h | 1 + drivers/net/dsa/mv88e6xxx/port

[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
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 | 1

[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 &l

[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 <vivien.dide...@savoirfairelinux.com> --- include/net/dsa.h | 5 + 1 file changed, 5 insertions(+) diff --git a/include/net/d

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

2017-03-11 Thread Vivien Didelot
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 net

[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
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 net

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

2017-03-11 Thread Vivien Didelot
them. Signed-off-by: Vivien Didelot <vivien.dide...@savoirfairelinux.com> --- drivers/net/dsa/mv88e6xxx/chip.c| 140 drivers/net/dsa/mv88e6xxx/global1.h | 2 + drivers/net/dsa/mv88e6xxx/global1_atu.c | 66 +++ 3 files chang

[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 <vivien.dide...@savoirfairelinux.com> Reviewed-by: Andrew Lunn <and...@lunn.ch> --- drivers/net/dsa/mv88e6xxx/mv88e6xxx.h | 5 +

[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 <vivien.d

[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 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 provided.

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

2017-03-11 Thread Vivien Didelot
Signed-off-by: Vivien Didelot <vivien.dide...@savoirfairelinux.com> --- 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 change

[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 <vivien.d

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

2017-03-11 Thread Vivien Didelot
Signed-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(-)

[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 Reviewed

[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 provided.

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

2017-03-11 Thread Vivien Didelot
Hi Andrew, Andrew Lunn <and...@lunn.ch> 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 >>

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 <vivien.dide...@savoirfairelinux.com> Reviewed-by: Andrew Lunn <and...@lunn.ch> --- drivers/net/dsa/mv88e6xxx/mv88e6xxx.h | 5 +

[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 <vivien.dide...@savoirfairelinux.com&

[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 <vivien.d

[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 <vivien.dide...@savoirfairelinux.com> --- drivers/net/dsa/mv88e6xxx/chip.c

[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 <vivien.dide...@savoirfairelinux.com> --- drivers/net/dsa/mv88e6xxx/chip.c | 4 ++--

[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 <vivien.dide...@savoirfairelinux.com> --- include/linux/etherdevice.h | 15 --- 1 file changed, 15 deletions(-)

[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 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 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
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: rework ATU

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

2017-03-09 Thread Vivien Didelot
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: rework ATU

[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 provided.

[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 provided.

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

2017-03-09 Thread Vivien Didelot
mv88e6xxx_6320_family helper. Signed-off-by: Vivien Didelot <vivien.dide...@savoirfairelinux.com> --- 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/

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

2017-03-09 Thread Vivien Didelot
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 changed, 35

[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 <vivien.d

[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 --- drivers/net

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

2017-03-09 Thread Vivien Didelot
as an 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 <vivien.dide...@savoirfairelinux.com> --- drivers/net/dsa/mv88e6xxx/chip.c | 118 +-- 1 file chang

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

2017-03-09 Thread Vivien Didelot
as an 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 --git

[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 <vivien.dide...@savoirfairelinux.com> --- drivers/net/dsa/mv88e6xxx/chip.c| 22 +--- drivers/net/dsa/mv88e6xxx/glo

[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 <vivien.dide...@savoirfairelinux.com> --- drivers/net/dsa/mv88e6xxx/Makefile | 1 + drivers/net/dsa/mv88e6xxx/

[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

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

[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 <vivien.dide...@savoirfairelinux.com> --- drivers/net/dsa/mv88e6xxx/Makefile | 1 + drivers/n

[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 <vivien.dide...@savoirfairelinux.com> --- drivers/n

[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 <vivien.dide...@savoirfairelinux.

[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 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 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 <vivien.dide...@savoirfairelinux.com> --- drivers/net/dsa/mv88e6xxx/mv88e6xxx.h | 5 + drivers/net/dsa/mv88e6xxx/port.c | 2 +- 2

[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 <vivien.d

[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 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 <vivien.d

[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 <vivien.dide...@savoirfairelinux.com> --- drivers/net/dsa/mv88e6xxx/Makefile | 1 + drivers/n

[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 <vivien.dide...@savoirfairelinux.com> --- drivers/net/dsa/mv88e6xxx/mv88e6xxx.h | 5 + drivers/net/dsa/mv88e6xxx/port.c | 2 +- 2

[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 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 <vivien.dide...@savoirfairelinux.com> --- drivers/n

[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 <vivien.dide...@savoirfairelinux.

[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,

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: [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 != _slave_netdev_ops) >> +return NOTIFY_DONE; > > Why not keep the dsa_slave_dev_check() here?

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 != _slave_netdev_ops) >> +return NOTIFY_DONE; > > Why not keep the dsa_slave_dev_check() here? I dropped it because

[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 <vivien.dide...@savoirfairelinux.com> --- net/dsa

[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 <vivien.dide...@savoirfairelinux.com> --- inclu

[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 <vivie

<    9   10   11   12   13   14   15   16   17   18   >