Re: [PATCH 0/4] net-next: dsa: fix flow dissection

2017-08-09 Thread Vivien Didelot
mit title prefix represents the most impacted subsystem, here "net: dsa: xxx" would map the net/dsa/ or drivers/net/dsa directories. Other than that, the whole patchset LGTM: Reviewed-by: Vivien Didelot Thanks, Vivien

Re: [PATCH] net: dsa: make dsa_switch_ops const

2017-08-09 Thread Vivien Didelot
Bhumika Goyal <bhumi...@gmail.com> writes: > Make these structures const as they are only stored in the ops field of > a dsa_switch structure, which is const. > Done using Coccinelle. > > Signed-off-by: Bhumika Goyal <bhumi...@gmail.com> Reviewed-by:

Re: [PATCH] net: dsa: make dsa_switch_ops const

2017-08-09 Thread Vivien Didelot
Bhumika Goyal writes: > Make these structures const as they are only stored in the ops field of > a dsa_switch structure, which is const. > Done using Coccinelle. > > Signed-off-by: Bhumika Goyal Reviewed-by: Vivien Didelot

Re: [PATCH net-next] net: dsa: lan9303: Only allocate 3 ports

2017-08-07 Thread Vivien Didelot
of other net/dsa/tag_xxx.c files.) > > Signed-off-by: Egil Hjelmeland <pri...@egil-hjelmeland.no> Reviewed-by: Vivien Didelot <vivien.dide...@savoirfairelinux.com>

Re: [PATCH net-next] net: dsa: lan9303: Only allocate 3 ports

2017-08-07 Thread Vivien Didelot
iles.) > > Signed-off-by: Egil Hjelmeland Reviewed-by: Vivien Didelot

[PATCH net-next v3 0/3] net: dsa: remove useless arguments

2017-08-07 Thread Vivien Didelot
r per-cpu 64-bit statistics") - added Florian's tags Changes in v2: - ds->dev is already assigned by dsa_switch_alloc Vivien Didelot (3): net: dsa: remove useless argument in legacy setup net: dsa: remove useless args of dsa_cpu_dsa_setup net: dsa: remove useless args of dsa

[PATCH net-next v3 0/3] net: dsa: remove useless arguments

2017-08-07 Thread Vivien Didelot
r per-cpu 64-bit statistics") - added Florian's tags Changes in v2: - ds->dev is already assigned by dsa_switch_alloc Vivien Didelot (3): net: dsa: remove useless argument in legacy setup net: dsa: remove useless args of dsa_cpu_dsa_setup net: dsa: remove useless args of dsa

[PATCH net-next v3 1/3] net: dsa: remove useless argument in legacy setup

2017-08-07 Thread Vivien Didelot
dsa_switch_alloc() already assigns ds-dev, which can be used in dsa_switch_setup_one and dsa_cpu_dsa_setups instead of requiring an additional struct device argument. Signed-off-by: Vivien Didelot <vivien.dide...@savoirfairelinux.com> Reviewed-by: Florian Fainelli <f.faine...@gmail.com&

[PATCH net-next v3 1/3] net: dsa: remove useless argument in legacy setup

2017-08-07 Thread Vivien Didelot
dsa_switch_alloc() already assigns ds-dev, which can be used in dsa_switch_setup_one and dsa_cpu_dsa_setups instead of requiring an additional struct device argument. Signed-off-by: Vivien Didelot Reviewed-by: Florian Fainelli --- net/dsa/legacy.c | 16 1 file changed, 8

[PATCH net-next v3 2/3] net: dsa: remove useless args of dsa_cpu_dsa_setup

2017-08-07 Thread Vivien Didelot
dsa_cpu_dsa_setup currently takes 4 arguments but they are all available from the dsa_port argument. Remove all others. Signed-off-by: Vivien Didelot <vivien.dide...@savoirfairelinux.com> Reviewed-by: Florian Fainelli <f.faine...@gmail.com> --- net/dsa/dsa.c | 10 +- ne

[PATCH net-next v3 2/3] net: dsa: remove useless args of dsa_cpu_dsa_setup

2017-08-07 Thread Vivien Didelot
dsa_cpu_dsa_setup currently takes 4 arguments but they are all available from the dsa_port argument. Remove all others. Signed-off-by: Vivien Didelot Reviewed-by: Florian Fainelli --- net/dsa/dsa.c | 10 +- net/dsa/dsa2.c | 4 ++-- net/dsa/dsa_priv.h | 3 +-- net/dsa

[PATCH net-next v3 3/3] net: dsa: remove useless args of dsa_slave_create

2017-08-07 Thread Vivien Didelot
dsa_slave_create currently takes 4 arguments while it only needs the related dsa_port and its name. Remove all other arguments. Signed-off-by: Vivien Didelot <vivien.dide...@savoirfairelinux.com> Reviewed-by: Florian Fainelli <f.faine...@gmail.com> --- net/dsa/dsa2.c | 2

[PATCH net-next v3 3/3] net: dsa: remove useless args of dsa_slave_create

2017-08-07 Thread Vivien Didelot
dsa_slave_create currently takes 4 arguments while it only needs the related dsa_port and its name. Remove all other arguments. Signed-off-by: Vivien Didelot Reviewed-by: Florian Fainelli --- net/dsa/dsa2.c | 2 +- net/dsa/dsa_priv.h | 3 +-- net/dsa/legacy.c | 2 +- net/dsa/slave.c

[PATCH net-next v2 3/3] net: dsa: remove useless args of dsa_slave_create

2017-08-05 Thread Vivien Didelot
dsa_slave_create currently takes 4 arguments while it only needs the related dsa_port and its name. Remove all other arguments. Signed-off-by: Vivien Didelot <vivien.dide...@savoirfairelinux.com> --- net/dsa/dsa2.c | 2 +- net/dsa/dsa_priv.h | 3 +-- net/dsa/legacy.c | 2 +- n

[PATCH net-next v2 3/3] net: dsa: remove useless args of dsa_slave_create

2017-08-05 Thread Vivien Didelot
dsa_slave_create currently takes 4 arguments while it only needs the related dsa_port and its name. Remove all other arguments. Signed-off-by: Vivien Didelot --- net/dsa/dsa2.c | 2 +- net/dsa/dsa_priv.h | 3 +-- net/dsa/legacy.c | 2 +- net/dsa/slave.c| 14 +++--- 4 files

[PATCH net-next v2 0/3] net: dsa: remove useless arguments

2017-08-05 Thread Vivien Didelot
Several DSA core setup functions take many arguments, mostly because of the legacy code. This patch series removes the useless args of these functions, where either the dsa_switch or dsa_port argument is enough. Changes in v2: - ds->dev is already assigned by dsa_switch_alloc Vivien Didelot

[PATCH net-next v2 0/3] net: dsa: remove useless arguments

2017-08-05 Thread Vivien Didelot
Several DSA core setup functions take many arguments, mostly because of the legacy code. This patch series removes the useless args of these functions, where either the dsa_switch or dsa_port argument is enough. Changes in v2: - ds->dev is already assigned by dsa_switch_alloc Vivien Didelot

[PATCH net-next v2 1/3] net: dsa: remove useless argument in legacy setup

2017-08-05 Thread Vivien Didelot
dsa_switch_alloc() already assigns ds-dev, which can be used in dsa_switch_setup_one and dsa_cpu_dsa_setups instead of requiring an additional struct device argument. Signed-off-by: Vivien Didelot <vivien.dide...@savoirfairelinux.com> --- net/dsa/legacy.c | 16 1 file chan

[PATCH net-next v2 1/3] net: dsa: remove useless argument in legacy setup

2017-08-05 Thread Vivien Didelot
dsa_switch_alloc() already assigns ds-dev, which can be used in dsa_switch_setup_one and dsa_cpu_dsa_setups instead of requiring an additional struct device argument. Signed-off-by: Vivien Didelot --- net/dsa/legacy.c | 16 1 file changed, 8 insertions(+), 8 deletions(-) diff

[PATCH net-next v2 2/3] net: dsa: remove useless args of dsa_cpu_dsa_setup

2017-08-05 Thread Vivien Didelot
dsa_cpu_dsa_setup currently takes 4 arguments but they are all available from the dsa_port argument. Remove all others. Signed-off-by: Vivien Didelot <vivien.dide...@savoirfairelinux.com> --- net/dsa/dsa.c | 10 +- net/dsa/dsa2.c | 4 ++-- net/dsa/dsa_priv.h | 3 +-- n

[PATCH net-next v2 2/3] net: dsa: remove useless args of dsa_cpu_dsa_setup

2017-08-05 Thread Vivien Didelot
dsa_cpu_dsa_setup currently takes 4 arguments but they are all available from the dsa_port argument. Remove all others. Signed-off-by: Vivien Didelot --- net/dsa/dsa.c | 10 +- net/dsa/dsa2.c | 4 ++-- net/dsa/dsa_priv.h | 3 +-- net/dsa/legacy.c | 4 +--- 4 files changed

Re: [PATCH net-next 1/3] net: dsa: assign switch device in legacy code

2017-08-05 Thread Vivien Didelot
Hi Andrew, Andrew Lunn writes: >> @@ -251,8 +251,9 @@ dsa_switch_setup(struct dsa_switch_tree *dst, struct >> net_device *master, >> ds->cd = cd; >> ds->ops = ops; >> ds->priv = priv; >> +ds->dev = parent; > > Is this even needed? dsa_switch_alloc() does

Re: [PATCH net-next 1/3] net: dsa: assign switch device in legacy code

2017-08-05 Thread Vivien Didelot
Hi Andrew, Andrew Lunn writes: >> @@ -251,8 +251,9 @@ dsa_switch_setup(struct dsa_switch_tree *dst, struct >> net_device *master, >> ds->cd = cd; >> ds->ops = ops; >> ds->priv = priv; >> +ds->dev = parent; > > Is this even needed? dsa_switch_alloc() does ds->dev = dev. You

[PATCH net-next 0/3] net: dsa: remove unnecessary arguments

2017-08-04 Thread Vivien Didelot
Several DSA core functions take many arguments, mostly because the legacy code does not assign ds->dev. This patch series assigns ds->dev in legacy and removes the unnecessary arguments of these functions, where either the dsa_switch or dsa_port argument is enough. Vivien Didelot (3): ne

[PATCH net-next 0/3] net: dsa: remove unnecessary arguments

2017-08-04 Thread Vivien Didelot
Several DSA core functions take many arguments, mostly because the legacy code does not assign ds->dev. This patch series assigns ds->dev in legacy and removes the unnecessary arguments of these functions, where either the dsa_switch or dsa_port argument is enough. Vivien Didelot (3): ne

[PATCH net-next 2/3] net: dsa: remove useless args of dsa_cpu_dsa_setup

2017-08-04 Thread Vivien Didelot
dsa_cpu_dsa_setup currently takes 4 arguments but they are all available from the dsa_port argument. Remove all others. Signed-off-by: Vivien Didelot <vivien.dide...@savoirfairelinux.com> --- net/dsa/dsa.c | 10 +- net/dsa/dsa2.c | 4 ++-- net/dsa/dsa_priv.h | 3 +-- n

[PATCH net-next 2/3] net: dsa: remove useless args of dsa_cpu_dsa_setup

2017-08-04 Thread Vivien Didelot
dsa_cpu_dsa_setup currently takes 4 arguments but they are all available from the dsa_port argument. Remove all others. Signed-off-by: Vivien Didelot --- net/dsa/dsa.c | 10 +- net/dsa/dsa2.c | 4 ++-- net/dsa/dsa_priv.h | 3 +-- net/dsa/legacy.c | 4 +--- 4 files changed

[PATCH net-next 1/3] net: dsa: assign switch device in legacy code

2017-08-04 Thread Vivien Didelot
-by: Vivien Didelot <vivien.dide...@savoirfairelinux.com> --- net/dsa/legacy.c | 17 + 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/net/dsa/legacy.c b/net/dsa/legacy.c index 1d7a3282f2a7..c565787e1c78 100644 --- a/net/dsa/legacy.c +++ b/net/dsa/legacy.c @@ -78,7

[PATCH net-next 1/3] net: dsa: assign switch device in legacy code

2017-08-04 Thread Vivien Didelot
-by: Vivien Didelot --- net/dsa/legacy.c | 17 + 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/net/dsa/legacy.c b/net/dsa/legacy.c index 1d7a3282f2a7..c565787e1c78 100644 --- a/net/dsa/legacy.c +++ b/net/dsa/legacy.c @@ -78,7 +78,7 @@ dsa_switch_probe(struct device *parent

[PATCH net-next 3/3] net: dsa: remove useless args of dsa_slave_create

2017-08-04 Thread Vivien Didelot
dsa_slave_create currently takes 4 arguments while it only needs the related dsa_port and its name. Remove all other arguments. Signed-off-by: Vivien Didelot <vivien.dide...@savoirfairelinux.com> --- net/dsa/dsa2.c | 2 +- net/dsa/dsa_priv.h | 3 +-- net/dsa/legacy.c | 2 +- n

[PATCH net-next 3/3] net: dsa: remove useless args of dsa_slave_create

2017-08-04 Thread Vivien Didelot
dsa_slave_create currently takes 4 arguments while it only needs the related dsa_port and its name. Remove all other arguments. Signed-off-by: Vivien Didelot --- net/dsa/dsa2.c | 2 +- net/dsa/dsa_priv.h | 3 +-- net/dsa/legacy.c | 2 +- net/dsa/slave.c| 14 +++--- 4 files

[PATCH net-next] net: dsa: bcm_sf2: dst in not an array

2017-08-02 Thread Vivien Didelot
It's been a while now since ds->dst is not an array anymore, but a simple pointer to a dsa_switch_tree. Fortunately, SF2 does not support multi-chip and thus ds->index is always 0. This patch substitutes 'ds->dst[ds->index].' with 'ds->dst->'. Signed-off-by: Vivien Di

[PATCH net-next] net: dsa: bcm_sf2: dst in not an array

2017-08-02 Thread Vivien Didelot
It's been a while now since ds->dst is not an array anymore, but a simple pointer to a dsa_switch_tree. Fortunately, SF2 does not support multi-chip and thus ds->index is always 0. This patch substitutes 'ds->dst[ds->index].' with 'ds->dst->'. Signed-off-by: Vivien Didelot --

[PATCH net-next v2 06/11] net: dsa: bcm_sf2: remove unneeded supported flags

2017-08-01 Thread Vivien Didelot
The SF2 driver is masking the supported bitfield of its private copy of the ports' ethtool_eee structures. It is used nowhere, thus remove it. Signed-off-by: Vivien Didelot <vivien.dide...@savoirfairelinux.com> --- drivers/net/dsa/bcm_sf2.c | 4 1 file changed, 4 deletions(-) diff

[PATCH net-next v2 06/11] net: dsa: bcm_sf2: remove unneeded supported flags

2017-08-01 Thread Vivien Didelot
The SF2 driver is masking the supported bitfield of its private copy of the ports' ethtool_eee structures. It is used nowhere, thus remove it. Signed-off-by: Vivien Didelot --- drivers/net/dsa/bcm_sf2.c | 4 1 file changed, 4 deletions(-) diff --git a/drivers/net/dsa/bcm_sf2.c b/drivers

[PATCH net-next v2 02/11] net: dsa: qca8k: fix EEE init

2017-08-01 Thread Vivien Didelot
ne, which is "Returns 0 if EEE was not enabled, or 1 otherwise". This results in returning -EOPNOTSUPP on success and caching EEE enabled on failure. This patch fixes the returned value of qca8k_eee_init. Signed-off-by: Vivien Didelot <vivien.dide...@savoirfairelinux.com> --- drivers/ne

[PATCH net-next v2 02/11] net: dsa: qca8k: fix EEE init

2017-08-01 Thread Vivien Didelot
ne, which is "Returns 0 if EEE was not enabled, or 1 otherwise". This results in returning -EOPNOTSUPP on success and caching EEE enabled on failure. This patch fixes the returned value of qca8k_eee_init. Signed-off-by: Vivien Didelot --- drivers/net/dsa/qca8k.c | 4 ++-- 1 file changed,

[PATCH net-next v2 04/11] net: dsa: qca8k: do not cache unneeded EEE fields

2017-08-01 Thread Vivien Didelot
rivate ethtool_eee members and only rely on phy_ethtool_get_eee to assign the eee_active member. Signed-off-by: Vivien Didelot <vivien.dide...@savoirfairelinux.com> --- drivers/net/dsa/qca8k.c | 11 +-- 1 file changed, 1 insertion(+), 10 deletions(-) diff --git a/drivers/net/d

[PATCH net-next v2 11/11] net: dsa: rename switch EEE ops

2017-08-01 Thread Vivien Didelot
To avoid confusion with the PHY EEE settings, rename the .set_eee and .get_eee ops to respectively .set_mac_eee and .get_mac_eee. Signed-off-by: Vivien Didelot <vivien.dide...@savoirfairelinux.com> --- drivers/net/dsa/bcm_sf2.c| 12 ++-- drivers/net/dsa/mv88e6xxx/chip.

[PATCH net-next v2 04/11] net: dsa: qca8k: do not cache unneeded EEE fields

2017-08-01 Thread Vivien Didelot
rivate ethtool_eee members and only rely on phy_ethtool_get_eee to assign the eee_active member. Signed-off-by: Vivien Didelot --- drivers/net/dsa/qca8k.c | 11 +-- 1 file changed, 1 insertion(+), 10 deletions(-) diff --git a/drivers/net/dsa/qca8k.c b/drivers/net/dsa/qca8k.c index 9d6b5d

[PATCH net-next v2 11/11] net: dsa: rename switch EEE ops

2017-08-01 Thread Vivien Didelot
To avoid confusion with the PHY EEE settings, rename the .set_eee and .get_eee ops to respectively .set_mac_eee and .get_mac_eee. Signed-off-by: Vivien Didelot --- drivers/net/dsa/bcm_sf2.c| 12 ++-- drivers/net/dsa/mv88e6xxx/chip.c | 12 ++-- drivers/net/dsa/qca8k.c

[PATCH net-next v2 10/11] net: dsa: mv88e6xxx: remove EEE support

2017-08-01 Thread Vivien Didelot
The PHY's EEE settings are already accessed by the DSA layer through the Marvell PHY driver and there is nothing to be done for switch's MACs. Remove all EEE support from the mv88e6xxx driver and simply return 0 from the EEE ops. Signed-off-by: Vivien Didelot <vivien.dide...@savoirfairelinux.

[PATCH net-next v2 10/11] net: dsa: mv88e6xxx: remove EEE support

2017-08-01 Thread Vivien Didelot
The PHY's EEE settings are already accessed by the DSA layer through the Marvell PHY driver and there is nothing to be done for switch's MACs. Remove all EEE support from the mv88e6xxx driver and simply return 0 from the EEE ops. Signed-off-by: Vivien Didelot --- drivers/net/dsa/mv88e6xxx

[PATCH net-next v2 09/11] net: dsa: remove PHY device argument from .set_eee

2017-08-01 Thread Vivien Didelot
. Signed-off-by: Vivien Didelot <vivien.dide...@savoirfairelinux.com> --- drivers/net/dsa/bcm_sf2.c| 1 - drivers/net/dsa/mv88e6xxx/chip.c | 2 +- drivers/net/dsa/qca8k.c | 14 +++--- include/net/dsa.h| 1 - net/dsa/slave.c | 2 +- 5

[PATCH net-next v2 09/11] net: dsa: remove PHY device argument from .set_eee

2017-08-01 Thread Vivien Didelot
. Signed-off-by: Vivien Didelot --- drivers/net/dsa/bcm_sf2.c| 1 - drivers/net/dsa/mv88e6xxx/chip.c | 2 +- drivers/net/dsa/qca8k.c | 14 +++--- include/net/dsa.h| 1 - net/dsa/slave.c | 2 +- 5 files changed, 5 insertions(+), 15 deletions

[PATCH net-next v2 08/11] net: dsa: call phy_init_eee in DSA layer

2017-08-01 Thread Vivien Didelot
All DSA drivers are calling phy_init_eee if eee_enabled is true. Move up this statement in the DSA layer to simplify the DSA drivers. qca8k does not require to cache the ethtool_eee structures from now on. Signed-off-by: Vivien Didelot <vivien.dide...@savoirfairelinux.com> --- drivers/n

[PATCH net-next v2 08/11] net: dsa: call phy_init_eee in DSA layer

2017-08-01 Thread Vivien Didelot
All DSA drivers are calling phy_init_eee if eee_enabled is true. Move up this statement in the DSA layer to simplify the DSA drivers. qca8k does not require to cache the ethtool_eee structures from now on. Signed-off-by: Vivien Didelot --- drivers/net/dsa/bcm_sf2.c| 9

[PATCH net-next v2 00/11] net: dsa: rework EEE support

2017-08-01 Thread Vivien Didelot
and DSA EEE ops mandatory for slave EEE operations. - simply return 0 in drivers which don't need to do anything to configure the port' MAC. Subsequent PHY calls will be enough. Vivien Didelot (11): net: dsa: PHY device is mandatory for EEE net: dsa: qca8k: fix EEE init net: dsa: qca8k

[PATCH net-next v2 00/11] net: dsa: rework EEE support

2017-08-01 Thread Vivien Didelot
and DSA EEE ops mandatory for slave EEE operations. - simply return 0 in drivers which don't need to do anything to configure the port' MAC. Subsequent PHY calls will be enough. Vivien Didelot (11): net: dsa: PHY device is mandatory for EEE net: dsa: qca8k: fix EEE init net: dsa: qca8k

[PATCH net-next v2 03/11] net: dsa: qca8k: enable EEE once

2017-08-01 Thread Vivien Didelot
If EEE is queried enabled, qca8k_set_eee calls qca8k_eee_enable_set twice (because it is already called in qca8k_eee_init). Fix that. Signed-off-by: Vivien Didelot <vivien.dide...@savoirfairelinux.com> --- drivers/net/dsa/qca8k.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-)

[PATCH net-next v2 03/11] net: dsa: qca8k: enable EEE once

2017-08-01 Thread Vivien Didelot
If EEE is queried enabled, qca8k_set_eee calls qca8k_eee_enable_set twice (because it is already called in qca8k_eee_init). Fix that. Signed-off-by: Vivien Didelot --- drivers/net/dsa/qca8k.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/drivers/net/dsa/qca8k.c b

[PATCH net-next v2 05/11] net: dsa: qca8k: empty qca8k_get_eee

2017-08-01 Thread Vivien Didelot
phy_ethtool_get_eee is already called by the DSA layer, thus remove the duplicated call in the qca8k driver. Signed-off-by: Vivien Didelot <vivien.dide...@savoirfairelinux.com> --- drivers/net/dsa/qca8k.c | 12 ++-- 1 file changed, 2 insertions(+), 10 deletions(-) diff --git a/d

[PATCH net-next v2 05/11] net: dsa: qca8k: empty qca8k_get_eee

2017-08-01 Thread Vivien Didelot
phy_ethtool_get_eee is already called by the DSA layer, thus remove the duplicated call in the qca8k driver. Signed-off-by: Vivien Didelot --- drivers/net/dsa/qca8k.c | 12 ++-- 1 file changed, 2 insertions(+), 10 deletions(-) diff --git a/drivers/net/dsa/qca8k.c b/drivers/net/dsa

[PATCH net-next v2 01/11] net: dsa: PHY device is mandatory for EEE

2017-08-01 Thread Vivien Didelot
The port's PHY and MAC are both implied in EEE. The current code does not call the PHY operations if the related device is NULL. Change that by returning -ENODEV if there's no PHY device attached to the interface. Signed-off-by: Vivien Didelot <vivien.dide...@savoirfairelinux.com> --- n

[PATCH net-next v2 01/11] net: dsa: PHY device is mandatory for EEE

2017-08-01 Thread Vivien Didelot
The port's PHY and MAC are both implied in EEE. The current code does not call the PHY operations if the related device is NULL. Change that by returning -ENODEV if there's no PHY device attached to the interface. Signed-off-by: Vivien Didelot --- net/dsa/slave.c | 18 ++ 1 file

[PATCH net-next v2 07/11] net: dsa: mv88e6xxx: call phy_init_eee

2017-08-01 Thread Vivien Didelot
It is safer to init the EEE before the DSA layer call phy_ethtool_set_eee, as sf2 and qca8k are doing. Signed-off-by: Vivien Didelot <vivien.dide...@savoirfairelinux.com> --- drivers/net/dsa/mv88e6xxx/chip.c | 6 ++ 1 file changed, 6 insertions(+) diff --git a/drivers/net/dsa/mv8

[PATCH net-next v2 07/11] net: dsa: mv88e6xxx: call phy_init_eee

2017-08-01 Thread Vivien Didelot
It is safer to init the EEE before the DSA layer call phy_ethtool_set_eee, as sf2 and qca8k are doing. Signed-off-by: Vivien Didelot --- drivers/net/dsa/mv88e6xxx/chip.c | 6 ++ 1 file changed, 6 insertions(+) diff --git a/drivers/net/dsa/mv88e6xxx/chip.c b/drivers/net/dsa/mv88e6xxx/chip.c

Re: [PATCH net-next 10/11] net: dsa: mv88e6xxx: remove EEE support

2017-08-01 Thread Vivien Didelot
Vivien Didelot <vivien.dide...@savoirfairelinux.com> writes: > Second option is: we keep it KISS and let the driver define its noop, > but as I explain, it is confusing, especially for the get operation. In fact we should be good because the DSA layer will call ds->ops->{g,s

Re: [PATCH net-next 10/11] net: dsa: mv88e6xxx: remove EEE support

2017-08-01 Thread Vivien Didelot
Vivien Didelot writes: > Second option is: we keep it KISS and let the driver define its noop, > but as I explain, it is confusing, especially for the get operation. In fact we should be good because the DSA layer will call ds->ops->{g,s}et_mac_eee before phy_ethtool_{g,s}et_eee, s

Re: [PATCH net-next 10/11] net: dsa: mv88e6xxx: remove EEE support

2017-08-01 Thread Vivien Didelot
Hi Andrew, Andrew Lunn writes: >> >> The PHY's EEE settings are already accessed by the DSA layer through the >> >> Marvell PHY driver and there is nothing to be done for switch's MACs. >> > >> > I'm confused, or missing something. Does not patch #1 mean that if the >> > DSA

Re: [PATCH net-next 10/11] net: dsa: mv88e6xxx: remove EEE support

2017-08-01 Thread Vivien Didelot
Hi Andrew, Andrew Lunn writes: >> >> The PHY's EEE settings are already accessed by the DSA layer through the >> >> Marvell PHY driver and there is nothing to be done for switch's MACs. >> > >> > I'm confused, or missing something. Does not patch #1 mean that if the >> > DSA driver does not

Re: [PATCH net-next 10/11] net: dsa: mv88e6xxx: remove EEE support

2017-08-01 Thread Vivien Didelot
Hi Andrew, Andrew Lunn <and...@lunn.ch> writes: > On Mon, Jul 31, 2017 at 06:17:18PM -0400, Vivien Didelot wrote: >> The PHY's EEE settings are already accessed by the DSA layer through the >> Marvell PHY driver and there is nothing to be done for switch's MACs. > &g

Re: [PATCH net-next 10/11] net: dsa: mv88e6xxx: remove EEE support

2017-08-01 Thread Vivien Didelot
Hi Andrew, Andrew Lunn writes: > On Mon, Jul 31, 2017 at 06:17:18PM -0400, Vivien Didelot wrote: >> The PHY's EEE settings are already accessed by the DSA layer through the >> Marvell PHY driver and there is nothing to be done for switch's MACs. > > I'm confused, or mi

[PATCH net-next 01/11] net: dsa: make EEE ops optional

2017-07-31 Thread Vivien Didelot
the EEE ops optional and call them only when provided. Calling it first allows a switch driver to stop the whole operation at runtime if a given switch does not support the EEE setting. If both the MAC operation and PHY are not present, -ENODEV is returned. Signed-off-by: Vivien Didelot <vivien.d

[PATCH net-next 01/11] net: dsa: make EEE ops optional

2017-07-31 Thread Vivien Didelot
the EEE ops optional and call them only when provided. Calling it first allows a switch driver to stop the whole operation at runtime if a given switch does not support the EEE setting. If both the MAC operation and PHY are not present, -ENODEV is returned. Signed-off-by: Vivien Didelot --- net

[PATCH net-next 11/11] net: dsa: rename switch EEE ops

2017-07-31 Thread Vivien Didelot
To avoid confusion with the PHY EEE settings, rename the .set_eee and .get_eee ops to respectively .set_mac_eee and .get_mac_eee. Signed-off-by: Vivien Didelot <vivien.dide...@savoirfairelinux.com> --- drivers/net/dsa/bcm_sf2.c | 12 ++-- drivers/net/dsa/qca8k.c | 4 ++-- inclu

[PATCH net-next 11/11] net: dsa: rename switch EEE ops

2017-07-31 Thread Vivien Didelot
To avoid confusion with the PHY EEE settings, rename the .set_eee and .get_eee ops to respectively .set_mac_eee and .get_mac_eee. Signed-off-by: Vivien Didelot --- drivers/net/dsa/bcm_sf2.c | 12 ++-- drivers/net/dsa/qca8k.c | 4 ++-- include/net/dsa.h | 10 +- net

[PATCH net-next 00/11] net: dsa: rework EEE support

2017-07-31 Thread Vivien Didelot
are integrated in the Ethernet switch device. This patchset fixes the EEE support in qca8k driver, makes the DSA layer call phy_init_eee for all drivers, and remove the EEE support from the mv88e6xxx driver since the Marvell PHY driver should be enough for it. Vivien Didelot (11): net: dsa

[PATCH net-next 00/11] net: dsa: rework EEE support

2017-07-31 Thread Vivien Didelot
are integrated in the Ethernet switch device. This patchset fixes the EEE support in qca8k driver, makes the DSA layer call phy_init_eee for all drivers, and remove the EEE support from the mv88e6xxx driver since the Marvell PHY driver should be enough for it. Vivien Didelot (11): net: dsa

[PATCH net-next 07/11] net: dsa: mv88e6xxx: call phy_init_eee

2017-07-31 Thread Vivien Didelot
It is safer to init the EEE before the DSA layer call phy_ethtool_set_eee, as sf2 and qca8k are doing. Signed-off-by: Vivien Didelot <vivien.dide...@savoirfairelinux.com> --- drivers/net/dsa/mv88e6xxx/chip.c | 6 ++ 1 file changed, 6 insertions(+) diff --git a/drivers/net/dsa/mv8

[PATCH net-next 03/11] net: dsa: qca8k: enable EEE once

2017-07-31 Thread Vivien Didelot
If EEE is queried enabled, qca8k_set_eee calls qca8k_eee_enable_set twice (because it is already called in qca8k_eee_init). Fix that. Signed-off-by: Vivien Didelot <vivien.dide...@savoirfairelinux.com> --- drivers/net/dsa/qca8k.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-)

[PATCH net-next 09/11] net: dsa: remove PHY device argument from .set_eee

2017-07-31 Thread Vivien Didelot
. Signed-off-by: Vivien Didelot <vivien.dide...@savoirfairelinux.com> --- drivers/net/dsa/bcm_sf2.c| 1 - drivers/net/dsa/mv88e6xxx/chip.c | 2 +- drivers/net/dsa/qca8k.c | 14 +++--- include/net/dsa.h| 1 - net/dsa/slave.c | 2 +- 5

[PATCH net-next 07/11] net: dsa: mv88e6xxx: call phy_init_eee

2017-07-31 Thread Vivien Didelot
It is safer to init the EEE before the DSA layer call phy_ethtool_set_eee, as sf2 and qca8k are doing. Signed-off-by: Vivien Didelot --- drivers/net/dsa/mv88e6xxx/chip.c | 6 ++ 1 file changed, 6 insertions(+) diff --git a/drivers/net/dsa/mv88e6xxx/chip.c b/drivers/net/dsa/mv88e6xxx/chip.c

[PATCH net-next 03/11] net: dsa: qca8k: enable EEE once

2017-07-31 Thread Vivien Didelot
If EEE is queried enabled, qca8k_set_eee calls qca8k_eee_enable_set twice (because it is already called in qca8k_eee_init). Fix that. Signed-off-by: Vivien Didelot --- drivers/net/dsa/qca8k.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/drivers/net/dsa/qca8k.c b

[PATCH net-next 09/11] net: dsa: remove PHY device argument from .set_eee

2017-07-31 Thread Vivien Didelot
. Signed-off-by: Vivien Didelot --- drivers/net/dsa/bcm_sf2.c| 1 - drivers/net/dsa/mv88e6xxx/chip.c | 2 +- drivers/net/dsa/qca8k.c | 14 +++--- include/net/dsa.h| 1 - net/dsa/slave.c | 2 +- 5 files changed, 5 insertions(+), 15 deletions

[PATCH net-next 08/11] net: dsa: call phy_init_eee in DSA layer

2017-07-31 Thread Vivien Didelot
All DSA drivers are calling phy_init_eee if eee_enabled is true. Move up this statement in the DSA layer to simplify the DSA drivers. qca8k does not require to cache the ethtool_eee structures from now on. Signed-off-by: Vivien Didelot <vivien.dide...@savoirfairelinux.com> --- drivers/n

[PATCH net-next 08/11] net: dsa: call phy_init_eee in DSA layer

2017-07-31 Thread Vivien Didelot
All DSA drivers are calling phy_init_eee if eee_enabled is true. Move up this statement in the DSA layer to simplify the DSA drivers. qca8k does not require to cache the ethtool_eee structures from now on. Signed-off-by: Vivien Didelot --- drivers/net/dsa/bcm_sf2.c| 9

[PATCH net-next 04/11] net: dsa: qca8k: do not cache unneeded EEE fields

2017-07-31 Thread Vivien Didelot
rivate ethtool_eee members and only rely on phy_ethtool_get_eee to assign the eee_active member. Signed-off-by: Vivien Didelot <vivien.dide...@savoirfairelinux.com> --- drivers/net/dsa/qca8k.c | 11 +-- 1 file changed, 1 insertion(+), 10 deletions(-) diff --git a/drivers/net/d

[PATCH net-next 04/11] net: dsa: qca8k: do not cache unneeded EEE fields

2017-07-31 Thread Vivien Didelot
rivate ethtool_eee members and only rely on phy_ethtool_get_eee to assign the eee_active member. Signed-off-by: Vivien Didelot --- drivers/net/dsa/qca8k.c | 11 +-- 1 file changed, 1 insertion(+), 10 deletions(-) diff --git a/drivers/net/dsa/qca8k.c b/drivers/net/dsa/qca8k.c index 9d6b5d

[PATCH net-next 10/11] net: dsa: mv88e6xxx: remove EEE support

2017-07-31 Thread Vivien Didelot
The PHY's EEE settings are already accessed by the DSA layer through the Marvell PHY driver and there is nothing to be done for switch's MACs. Remove all EEE support from the mv88e6xxx driver. Signed-off-by: Vivien Didelot <vivien.dide...@savoirfairelinux.com> --- drivers/net/dsa/mv8

[PATCH net-next 10/11] net: dsa: mv88e6xxx: remove EEE support

2017-07-31 Thread Vivien Didelot
The PHY's EEE settings are already accessed by the DSA layer through the Marvell PHY driver and there is nothing to be done for switch's MACs. Remove all EEE support from the mv88e6xxx driver. Signed-off-by: Vivien Didelot --- drivers/net/dsa/mv88e6xxx/chip.c | 82

[PATCH net-next 02/11] net: dsa: qca8k: fix EEE init

2017-07-31 Thread Vivien Didelot
ne, which is "Returns 0 if EEE was not enabled, or 1 otherwise". This results in returning -EOPNOTSUPP on success and caching EEE enabled on failure. This patch fixes the returned value of qca8k_eee_init. Signed-off-by: Vivien Didelot <vivien.dide...@savoirfairelinux.com> --- drivers/ne

[PATCH net-next 02/11] net: dsa: qca8k: fix EEE init

2017-07-31 Thread Vivien Didelot
ne, which is "Returns 0 if EEE was not enabled, or 1 otherwise". This results in returning -EOPNOTSUPP on success and caching EEE enabled on failure. This patch fixes the returned value of qca8k_eee_init. Signed-off-by: Vivien Didelot --- drivers/net/dsa/qca8k.c | 4 ++-- 1 file changed,

[PATCH net-next 06/11] net: dsa: bcm_sf2: remove unneeded supported flags

2017-07-31 Thread Vivien Didelot
The SF2 driver is masking the supported bitfield of its private copy of the ports' ethtool_eee structures. It is used nowhere, thus remove it. Signed-off-by: Vivien Didelot <vivien.dide...@savoirfairelinux.com> --- drivers/net/dsa/bcm_sf2.c | 4 1 file changed, 4 deletions(-) diff

[PATCH net-next 05/11] net: dsa: qca8k: remove qca8k_get_eee

2017-07-31 Thread Vivien Didelot
phy_ethtool_get_eee is already called by the DSA layer, thus remove the duplicated call in the qca8k driver. qca8k_get_eee becomes unnecessary. Signed-off-by: Vivien Didelot <vivien.dide...@savoirfairelinux.com> --- drivers/net/dsa/qca8k.c | 17 - 1 file changed, 17 del

[PATCH net-next 06/11] net: dsa: bcm_sf2: remove unneeded supported flags

2017-07-31 Thread Vivien Didelot
The SF2 driver is masking the supported bitfield of its private copy of the ports' ethtool_eee structures. It is used nowhere, thus remove it. Signed-off-by: Vivien Didelot --- drivers/net/dsa/bcm_sf2.c | 4 1 file changed, 4 deletions(-) diff --git a/drivers/net/dsa/bcm_sf2.c b/drivers

[PATCH net-next 05/11] net: dsa: qca8k: remove qca8k_get_eee

2017-07-31 Thread Vivien Didelot
phy_ethtool_get_eee is already called by the DSA layer, thus remove the duplicated call in the qca8k driver. qca8k_get_eee becomes unnecessary. Signed-off-by: Vivien Didelot --- drivers/net/dsa/qca8k.c | 17 - 1 file changed, 17 deletions(-) diff --git a/drivers/net/dsa/qca8k.c

Re: [PATCH net-next 2/2] net: dsa: lan9303: Simplify lan9303_xxx_packet_processing() usage

2017-07-31 Thread Vivien Didelot
Hi Egil, Egil Hjelmeland writes: >> It is indeed out of scope. You may want to add a first commit "net: dsa: >> lan9303: introduce LAN9303_NUM_PORTS" for instance. > > In a later series I assume? Or is allowed to add patches to a series > under review? If it makes

Re: [PATCH net-next 2/2] net: dsa: lan9303: Simplify lan9303_xxx_packet_processing() usage

2017-07-31 Thread Vivien Didelot
Hi Egil, Egil Hjelmeland writes: >> It is indeed out of scope. You may want to add a first commit "net: dsa: >> lan9303: introduce LAN9303_NUM_PORTS" for instance. > > In a later series I assume? Or is allowed to add patches to a series > under review? If it makes sense to include this first

Re: [PATCH net-next 2/2] net: dsa: lan9303: Simplify lan9303_xxx_packet_processing() usage

2017-07-31 Thread Vivien Didelot
Hi Egil, Egil Hjelmeland writes: > Would doing > > - chip->ds = dsa_switch_alloc(chip->dev, DSA_MAX_PORTS); > + chip->ds = dsa_switch_alloc(chip->dev, LAN9303_NUM_PORTS); > > at the same time be good, or breaking the scope of the patch? It is indeed out of

Re: [PATCH net-next 2/2] net: dsa: lan9303: Simplify lan9303_xxx_packet_processing() usage

2017-07-31 Thread Vivien Didelot
Hi Egil, Egil Hjelmeland writes: > Would doing > > - chip->ds = dsa_switch_alloc(chip->dev, DSA_MAX_PORTS); > + chip->ds = dsa_switch_alloc(chip->dev, LAN9303_NUM_PORTS); > > at the same time be good, or breaking the scope of the patch? It is indeed out of scope. You may want to add a

Re: [PATCH net-next 2/2] net: dsa: lan9303: Simplify lan9303_xxx_packet_processing() usage

2017-07-31 Thread Vivien Didelot
Hi Egil, Egil Hjelmeland writes: >>> + for (p = 0; p <= 2; p++) { >> >> Exclusive limits are often prefer, i.e. 'p < 3'. >> > OK, that can be nice when I later introduce LAN9303_NUM_PORTS = 3. This is indeed another reason what exclusive limits are prefered ;-)

Re: [PATCH net-next 2/2] net: dsa: lan9303: Simplify lan9303_xxx_packet_processing() usage

2017-07-31 Thread Vivien Didelot
Hi Egil, Egil Hjelmeland writes: >>> + for (p = 0; p <= 2; p++) { >> >> Exclusive limits are often prefer, i.e. 'p < 3'. >> > OK, that can be nice when I later introduce LAN9303_NUM_PORTS = 3. This is indeed another reason what exclusive limits are prefered ;-) >>> + int ret;

Re: [PATCH net-next 2/2] net: dsa: lan9303: Simplify lan9303_xxx_packet_processing() usage

2017-07-31 Thread Vivien Didelot
Hi Egil, A few nitpicks below for lan9303_disable_processing. Egil Hjelmeland writes: > static int lan9303_disable_processing(struct lan9303 *chip) > { > - int ret; > + int p; > > - ret = lan9303_disable_packet_processing(chip, 0); > - if (ret) >

Re: [PATCH net-next 2/2] net: dsa: lan9303: Simplify lan9303_xxx_packet_processing() usage

2017-07-31 Thread Vivien Didelot
Hi Egil, A few nitpicks below for lan9303_disable_processing. Egil Hjelmeland writes: > static int lan9303_disable_processing(struct lan9303 *chip) > { > - int ret; > + int p; > > - ret = lan9303_disable_packet_processing(chip, 0); > - if (ret) > - return ret; >

Re: [PATCH net-next 4/4] net: dsa: lan9303: MDIO access phy registers directly

2017-07-28 Thread Vivien Didelot
PORT_SYMBOL(lan9303_indirect_phy_ops); >> >> Isn't EXPORT_SYMBOL_GPL prefered over EXPORT_SYMBOL? > > I have no opinion. I just used the same variant as the other EXPORTS > in the file. If there is no concern from others about this, LGTM too: Reviewed-by: Vivien Didelot <vivien.dide...@savoirfairelinux.com> Thanks, Vivien

Re: [PATCH net-next 4/4] net: dsa: lan9303: MDIO access phy registers directly

2017-07-28 Thread Vivien Didelot
>> >> Isn't EXPORT_SYMBOL_GPL prefered over EXPORT_SYMBOL? > > I have no opinion. I just used the same variant as the other EXPORTS > in the file. If there is no concern from others about this, LGTM too: Reviewed-by: Vivien Didelot Thanks, Vivien

Re: [PATCH net-next 4/4] net: dsa: lan9303: MDIO access phy registers directly

2017-07-28 Thread Vivien Didelot
Hi Egil, Egil Hjelmeland writes: > +const struct lan9303_phy_ops lan9303_indirect_phy_ops = { > + .phy_read = lan9303_indirect_phy_read, > + .phy_write = lan9303_indirect_phy_write, > +}; > +EXPORT_SYMBOL(lan9303_indirect_phy_ops); Isn't EXPORT_SYMBOL_GPL

Re: [PATCH net-next 4/4] net: dsa: lan9303: MDIO access phy registers directly

2017-07-28 Thread Vivien Didelot
Hi Egil, Egil Hjelmeland writes: > +const struct lan9303_phy_ops lan9303_indirect_phy_ops = { > + .phy_read = lan9303_indirect_phy_read, > + .phy_write = lan9303_indirect_phy_write, > +}; > +EXPORT_SYMBOL(lan9303_indirect_phy_ops); Isn't EXPORT_SYMBOL_GPL prefered over EXPORT_SYMBOL?

Re: [PATCH net-next 3/4] net: dsa: lan9303: Renamed indirect phy access functions

2017-07-28 Thread Vivien Didelot
ect_phy_wait_for_completion() > > lan9303_port_phy_reg_read() to > lan9303_indirect_phy_read() > > lan9303_port_phy_reg_write() to > lan9303_indirect_phy_write() > > Also changed "val" parameter of lan9303_indirect_phy_write() to u16, > for clarity. > > Signed-of

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