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

2017-03-13 Thread Vivien Didelot
Hi Florian,

Florian Fainelli  writes:

> Just some general note on the way the driver seems to be going there
> seems to be a multiplication of new ops being introduced, and most of
> them seem to default to the mv88e6xxx (generic) ones. Should you do
> something like:
>
> if (!ops->foo)
>   ops->foo = mv88e6xxx_foo
>
> Such that you reduce the possibility for a specific switch model to lack
> such an operation?

You are correct, ideally generic library functions (the one starting
with the mv88e6xxx_ prefix) should not be assigned to ops.

The ops are const though. I'll come up with something maintainable.

Thanks!

Vivien


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

2017-03-13 Thread Vivien Didelot
Hi Florian,

Florian Fainelli  writes:

> Just some general note on the way the driver seems to be going there
> seems to be a multiplication of new ops being introduced, and most of
> them seem to default to the mv88e6xxx (generic) ones. Should you do
> something like:
>
> if (!ops->foo)
>   ops->foo = mv88e6xxx_foo
>
> Such that you reduce the possibility for a specific switch model to lack
> such an operation?

You are correct, ideally generic library functions (the one starting
with the mv88e6xxx_ prefix) should not be assigned to ops.

The ops are const though. I'll come up with something maintainable.

Thanks!

Vivien


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

2017-03-13 Thread David Miller
From: Vivien Didelot 
Date: Sat, 11 Mar 2017 16:12:46 -0500

> The purpose of this patch series is to rework the code related to the
> Address Translation Unit (ATU), and bring support for it to the 88E6390
> family of switch chips.
> 
> All Global (1) ATU related code have been reworked and moved to its own
> file. Some port related bits used for ATU configuration (such as the
> Learn2All and MessagePort feature) have also been taken care of.
> 
> The ports' mode and egress flooding mode have been refactored to fix the
> egress of frames with unknown unicast or multicast destination address,
> and write all these bits regardless the port mode (Normal, DSA, etc.)
> 
> Finally remove the eth_addr_greater which was only used by mv88e6xxx.
> 
> Changes in v2:
>   - add Reviewed-by tags
>   - split mv88e6xxx_g1_atu_set_age_time and mv88e6xxx_atu_setup addition
>   - remove DSA_TAG_PROTO_TRAILER check
>   - split Message Port and Learn2All addition
>   - remove unused MV88E6XXX_FLAG_G1_ATU_FID flag
>   - add dsa_is_normal_port helper

Series applied.


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

2017-03-13 Thread David Miller
From: Vivien Didelot 
Date: Sat, 11 Mar 2017 16:12:46 -0500

> The purpose of this patch series is to rework the code related to the
> Address Translation Unit (ATU), and bring support for it to the 88E6390
> family of switch chips.
> 
> All Global (1) ATU related code have been reworked and moved to its own
> file. Some port related bits used for ATU configuration (such as the
> Learn2All and MessagePort feature) have also been taken care of.
> 
> The ports' mode and egress flooding mode have been refactored to fix the
> egress of frames with unknown unicast or multicast destination address,
> and write all these bits regardless the port mode (Normal, DSA, etc.)
> 
> Finally remove the eth_addr_greater which was only used by mv88e6xxx.
> 
> Changes in v2:
>   - add Reviewed-by tags
>   - split mv88e6xxx_g1_atu_set_age_time and mv88e6xxx_atu_setup addition
>   - remove DSA_TAG_PROTO_TRAILER check
>   - split Message Port and Learn2All addition
>   - remove unused MV88E6XXX_FLAG_G1_ATU_FID flag
>   - add dsa_is_normal_port helper

Series applied.


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

2017-03-11 Thread Florian Fainelli
Le 03/11/17 à 13:12, Vivien Didelot a écrit :
> The purpose of this patch series is to rework the code related to the
> Address Translation Unit (ATU), and bring support for it to the 88E6390
> family of switch chips.
> 
> All Global (1) ATU related code have been reworked and moved to its own
> file. Some port related bits used for ATU configuration (such as the
> Learn2All and MessagePort feature) have also been taken care of.
> 
> The ports' mode and egress flooding mode have been refactored to fix the
> egress of frames with unknown unicast or multicast destination address,
> and write all these bits regardless the port mode (Normal, DSA, etc.)
> 
> Finally remove the eth_addr_greater which was only used by mv88e6xxx.

Just some general note on the way the driver seems to be going there
seems to be a multiplication of new ops being introduced, and most of
them seem to default to the mv88e6xxx (generic) ones. Should you do
something like:

if (!ops->foo)
ops->foo = mv88e6xxx_foo

Such that you reduce the possibility for a specific switch model to lack
such an operation?

> 
> Changes in v2:
>   - add Reviewed-by tags
>   - split mv88e6xxx_g1_atu_set_age_time and mv88e6xxx_atu_setup addition
>   - remove DSA_TAG_PROTO_TRAILER check
>   - split Message Port and Learn2All addition
>   - remove unused 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: dsa: mv88e6xxx: rework ATU Load/Purge
>   net: dsa: mv88e6xxx: rework ATU GetNext
>   net: dsa: mv88e6xxx: rework ATU Flush
>   net: dsa: mv88e6xxx: rework ATU Remove
>   net: dsa: mv88e6xxx: rename new FID helper
>   net: dsa: mv88e6xxx: rename the port vector member
>   net: dsa: add dsa_is_normal_port helper
>   net: dsa: mv88e6xxx: rework port mode setup
>   net: dsa: mv88e6xxx: fix port egress flooding mode
>   net: dsa: mv88e6xxx: add port ATU learn limit op
>   net: dsa: mv88e6xxx: add port priority override op
>   etherdevice: remove unused eth_addr_greater
> 
>  drivers/net/dsa/mv88e6xxx/Makefile  |   1 +
>  drivers/net/dsa/mv88e6xxx/chip.c| 667 
> +++-
>  drivers/net/dsa/mv88e6xxx/global1.h |  11 +
>  drivers/net/dsa/mv88e6xxx/global1_atu.c | 300 ++
>  drivers/net/dsa/mv88e6xxx/mv88e6xxx.h   |  44 ++-
>  drivers/net/dsa/mv88e6xxx/port.c|  78 +++-
>  drivers/net/dsa/mv88e6xxx/port.h|  16 +-
>  include/linux/etherdevice.h |  15 -
>  include/net/dsa.h   |   5 +
>  9 files changed, 638 insertions(+), 499 deletions(-)
>  create mode 100644 drivers/net/dsa/mv88e6xxx/global1_atu.c
> 


-- 
Florian


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

2017-03-11 Thread Florian Fainelli
Le 03/11/17 à 13:12, Vivien Didelot a écrit :
> The purpose of this patch series is to rework the code related to the
> Address Translation Unit (ATU), and bring support for it to the 88E6390
> family of switch chips.
> 
> All Global (1) ATU related code have been reworked and moved to its own
> file. Some port related bits used for ATU configuration (such as the
> Learn2All and MessagePort feature) have also been taken care of.
> 
> The ports' mode and egress flooding mode have been refactored to fix the
> egress of frames with unknown unicast or multicast destination address,
> and write all these bits regardless the port mode (Normal, DSA, etc.)
> 
> Finally remove the eth_addr_greater which was only used by mv88e6xxx.

Just some general note on the way the driver seems to be going there
seems to be a multiplication of new ops being introduced, and most of
them seem to default to the mv88e6xxx (generic) ones. Should you do
something like:

if (!ops->foo)
ops->foo = mv88e6xxx_foo

Such that you reduce the possibility for a specific switch model to lack
such an operation?

> 
> Changes in v2:
>   - add Reviewed-by tags
>   - split mv88e6xxx_g1_atu_set_age_time and mv88e6xxx_atu_setup addition
>   - remove DSA_TAG_PROTO_TRAILER check
>   - split Message Port and Learn2All addition
>   - remove unused 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: dsa: mv88e6xxx: rework ATU Load/Purge
>   net: dsa: mv88e6xxx: rework ATU GetNext
>   net: dsa: mv88e6xxx: rework ATU Flush
>   net: dsa: mv88e6xxx: rework ATU Remove
>   net: dsa: mv88e6xxx: rename new FID helper
>   net: dsa: mv88e6xxx: rename the port vector member
>   net: dsa: add dsa_is_normal_port helper
>   net: dsa: mv88e6xxx: rework port mode setup
>   net: dsa: mv88e6xxx: fix port egress flooding mode
>   net: dsa: mv88e6xxx: add port ATU learn limit op
>   net: dsa: mv88e6xxx: add port priority override op
>   etherdevice: remove unused eth_addr_greater
> 
>  drivers/net/dsa/mv88e6xxx/Makefile  |   1 +
>  drivers/net/dsa/mv88e6xxx/chip.c| 667 
> +++-
>  drivers/net/dsa/mv88e6xxx/global1.h |  11 +
>  drivers/net/dsa/mv88e6xxx/global1_atu.c | 300 ++
>  drivers/net/dsa/mv88e6xxx/mv88e6xxx.h   |  44 ++-
>  drivers/net/dsa/mv88e6xxx/port.c|  78 +++-
>  drivers/net/dsa/mv88e6xxx/port.h|  16 +-
>  include/linux/etherdevice.h |  15 -
>  include/net/dsa.h   |   5 +
>  9 files changed, 638 insertions(+), 499 deletions(-)
>  create mode 100644 drivers/net/dsa/mv88e6xxx/global1_atu.c
> 


-- 
Florian


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

2017-03-11 Thread Vivien Didelot
The purpose of this patch series is to rework the code related to the
Address Translation Unit (ATU), and bring support for it to the 88E6390
family of switch chips.

All Global (1) ATU related code have been reworked and moved to its own
file. Some port related bits used for ATU configuration (such as the
Learn2All and MessagePort feature) have also been taken care of.

The ports' mode and egress flooding mode have been refactored to fix the
egress of frames with unknown unicast or multicast destination address,
and write all these bits regardless the port mode (Normal, DSA, etc.)

Finally remove the eth_addr_greater which was only used by mv88e6xxx.

Changes in v2:
  - add Reviewed-by tags
  - split mv88e6xxx_g1_atu_set_age_time and mv88e6xxx_atu_setup addition
  - remove DSA_TAG_PROTO_TRAILER check
  - split Message Port and Learn2All addition
  - remove unused 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: dsa: mv88e6xxx: rework ATU Load/Purge
  net: dsa: mv88e6xxx: rework ATU GetNext
  net: dsa: mv88e6xxx: rework ATU Flush
  net: dsa: mv88e6xxx: rework ATU Remove
  net: dsa: mv88e6xxx: rename new FID helper
  net: dsa: mv88e6xxx: rename the port vector member
  net: dsa: add dsa_is_normal_port helper
  net: dsa: mv88e6xxx: rework port mode setup
  net: dsa: mv88e6xxx: fix port egress flooding mode
  net: dsa: mv88e6xxx: add port ATU learn limit op
  net: dsa: mv88e6xxx: add port priority override op
  etherdevice: remove unused eth_addr_greater

 drivers/net/dsa/mv88e6xxx/Makefile  |   1 +
 drivers/net/dsa/mv88e6xxx/chip.c| 667 +++-
 drivers/net/dsa/mv88e6xxx/global1.h |  11 +
 drivers/net/dsa/mv88e6xxx/global1_atu.c | 300 ++
 drivers/net/dsa/mv88e6xxx/mv88e6xxx.h   |  44 ++-
 drivers/net/dsa/mv88e6xxx/port.c|  78 +++-
 drivers/net/dsa/mv88e6xxx/port.h|  16 +-
 include/linux/etherdevice.h |  15 -
 include/net/dsa.h   |   5 +
 9 files changed, 638 insertions(+), 499 deletions(-)
 create mode 100644 drivers/net/dsa/mv88e6xxx/global1_atu.c

-- 
2.12.0



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

2017-03-11 Thread Vivien Didelot
The purpose of this patch series is to rework the code related to the
Address Translation Unit (ATU), and bring support for it to the 88E6390
family of switch chips.

All Global (1) ATU related code have been reworked and moved to its own
file. Some port related bits used for ATU configuration (such as the
Learn2All and MessagePort feature) have also been taken care of.

The ports' mode and egress flooding mode have been refactored to fix the
egress of frames with unknown unicast or multicast destination address,
and write all these bits regardless the port mode (Normal, DSA, etc.)

Finally remove the eth_addr_greater which was only used by mv88e6xxx.

Changes in v2:
  - add Reviewed-by tags
  - split mv88e6xxx_g1_atu_set_age_time and mv88e6xxx_atu_setup addition
  - remove DSA_TAG_PROTO_TRAILER check
  - split Message Port and Learn2All addition
  - remove unused 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: dsa: mv88e6xxx: rework ATU Load/Purge
  net: dsa: mv88e6xxx: rework ATU GetNext
  net: dsa: mv88e6xxx: rework ATU Flush
  net: dsa: mv88e6xxx: rework ATU Remove
  net: dsa: mv88e6xxx: rename new FID helper
  net: dsa: mv88e6xxx: rename the port vector member
  net: dsa: add dsa_is_normal_port helper
  net: dsa: mv88e6xxx: rework port mode setup
  net: dsa: mv88e6xxx: fix port egress flooding mode
  net: dsa: mv88e6xxx: add port ATU learn limit op
  net: dsa: mv88e6xxx: add port priority override op
  etherdevice: remove unused eth_addr_greater

 drivers/net/dsa/mv88e6xxx/Makefile  |   1 +
 drivers/net/dsa/mv88e6xxx/chip.c| 667 +++-
 drivers/net/dsa/mv88e6xxx/global1.h |  11 +
 drivers/net/dsa/mv88e6xxx/global1_atu.c | 300 ++
 drivers/net/dsa/mv88e6xxx/mv88e6xxx.h   |  44 ++-
 drivers/net/dsa/mv88e6xxx/port.c|  78 +++-
 drivers/net/dsa/mv88e6xxx/port.h|  16 +-
 include/linux/etherdevice.h |  15 -
 include/net/dsa.h   |   5 +
 9 files changed, 638 insertions(+), 499 deletions(-)
 create mode 100644 drivers/net/dsa/mv88e6xxx/global1_atu.c

-- 
2.12.0