[PATCH net-next v2 4/5] net: dsa: mv88e6xxx: exclude all ports in new VLAN

2017-06-07 Thread Vivien Didelot
Now that the DSA core adds the CPU and DSA ports itself to the new VLAN entry, there is no need to include them as members of this VLAN when initializing a new VTU entry. As of now, initialize a new VTU entry with all ports excluded. Reviewed-by: Florian Fainelli Signed-off-by: Vivien Didelot

[PATCH net-next v2 0/5] net: dsa: add cross-chip VLAN support

2017-06-07 Thread Vivien Didelot
a VLAN - add Reviewed-by tags Vivien Didelot (5): net: dsa: mv88e6xxx: define membership on VLAN add net: dsa: check VLAN capability of every switch net: dsa: add CPU and DSA ports as VLAN members net: dsa: mv88e6xxx: exclude all ports in new VLAN net: dsa: mv88e6xxx: do not skip ports

[PATCH net-next v2 0/5] net: dsa: add cross-chip VLAN support

2017-06-07 Thread Vivien Didelot
a VLAN - add Reviewed-by tags Vivien Didelot (5): net: dsa: mv88e6xxx: define membership on VLAN add net: dsa: check VLAN capability of every switch net: dsa: add CPU and DSA ports as VLAN members net: dsa: mv88e6xxx: exclude all ports in new VLAN net: dsa: mv88e6xxx: do not skip ports

[PATCH net-next v2 1/5] net: dsa: mv88e6xxx: define membership on VLAN add

2017-06-07 Thread Vivien Didelot
<f.faine...@gmail.com> Signed-off-by: Vivien Didelot <vivien.dide...@savoirfairelinux.com> --- drivers/net/dsa/mv88e6xxx/chip.c | 16 +++- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/drivers/net/dsa/mv88e6xxx/chip.c b/drivers/net/dsa/mv88e6xxx/chip.c index

[PATCH net-next v2 3/5] net: dsa: add CPU and DSA ports as VLAN members

2017-06-07 Thread Vivien Didelot
<f.faine...@gmail.com> Signed-off-by: Vivien Didelot <vivien.dide...@savoirfairelinux.com> --- net/dsa/switch.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/net/dsa/switch.c b/net/dsa/switch.c index f235ae1e9777..f1029a8d0e20 100644 --- a/net/dsa/switch.c +++ b/net/dsa/switch

[PATCH net-next v2 3/5] net: dsa: add CPU and DSA ports as VLAN members

2017-06-07 Thread Vivien Didelot
Signed-off-by: Vivien Didelot --- net/dsa/switch.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/net/dsa/switch.c b/net/dsa/switch.c index f235ae1e9777..f1029a8d0e20 100644 --- a/net/dsa/switch.c +++ b/net/dsa/switch.c @@ -166,6 +166,9 @@ static int dsa_switch_vlan_add(struct dsa_switch

[PATCH net-next v2 1/5] net: dsa: mv88e6xxx: define membership on VLAN add

2017-06-07 Thread Vivien Didelot
Signed-off-by: Vivien Didelot --- drivers/net/dsa/mv88e6xxx/chip.c | 16 +++- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/drivers/net/dsa/mv88e6xxx/chip.c b/drivers/net/dsa/mv88e6xxx/chip.c index 44c87027623b..962b4e873bf9 100644 --- a/drivers/net/dsa/mv88e6xxx/chip.c

[PATCH net-next v2 2/5] net: dsa: check VLAN capability of every switch

2017-06-07 Thread Vivien Didelot
-by: Florian Fainelli <f.faine...@gmail.com> Signed-off-by: Vivien Didelot <vivien.dide...@savoirfairelinux.com> --- net/dsa/switch.c | 27 +-- 1 file changed, 17 insertions(+), 10 deletions(-) diff --git a/net/dsa/switch.c b/net/dsa/switch.c index d8e5c311ee7c..f235ae1

[PATCH net-next v2 5/5] net: dsa: mv88e6xxx: do not skip ports on VLAN del

2017-06-07 Thread Vivien Didelot
of the VID in order to correctly pass frames in the data path. Now that the DSA core explicitly manages DSA and CPU ports, do not skip them when checking remaining VLAN members. Signed-off-by: Vivien Didelot <vivien.dide...@savoirfairelinux.com> --- drivers/net/dsa/mv88e6xxx/chip.c | 4 -

[PATCH net-next v2 2/5] net: dsa: check VLAN capability of every switch

2017-06-07 Thread Vivien Didelot
-by: Florian Fainelli Signed-off-by: Vivien Didelot --- net/dsa/switch.c | 27 +-- 1 file changed, 17 insertions(+), 10 deletions(-) diff --git a/net/dsa/switch.c b/net/dsa/switch.c index d8e5c311ee7c..f235ae1e9777 100644 --- a/net/dsa/switch.c +++ b/net/dsa/switch.c @@ -159,19

[PATCH net-next v2 5/5] net: dsa: mv88e6xxx: do not skip ports on VLAN del

2017-06-07 Thread Vivien Didelot
of the VID in order to correctly pass frames in the data path. Now that the DSA core explicitly manages DSA and CPU ports, do not skip them when checking remaining VLAN members. Signed-off-by: Vivien Didelot --- drivers/net/dsa/mv88e6xxx/chip.c | 4 1 file changed, 4 deletions(-) diff

Re: [PATCH net-next 2/5] net: dsa: check VLAN capability of every switch

2017-06-07 Thread Vivien Didelot
Hi Florian, Florian Fainelli <f.faine...@gmail.com> writes: > On 06/06/2017 01:56 PM, Vivien Didelot wrote: >> Now that the VLAN object is propagated to every switch chip of the >> switch fabric, we can easily ensure that they all support the required >> VLAN operation

Re: [PATCH net-next 2/5] net: dsa: check VLAN capability of every switch

2017-06-07 Thread Vivien Didelot
Hi Florian, Florian Fainelli writes: > On 06/06/2017 01:56 PM, Vivien Didelot wrote: >> Now that the VLAN object is propagated to every switch chip of the >> switch fabric, we can easily ensure that they all support the required >> VLAN operations before modifying an ent

Re: [PATCH net-next 5/5] net: dsa: mv88e6xxx: do not purge a VTU entry

2017-06-07 Thread Vivien Didelot
Hi Florian, Florian Fainelli <f.faine...@gmail.com> writes: > On 06/06/2017 01:56 PM, Vivien Didelot wrote: >> The mv88e6xxx driver currently tries to be smart and remove by itself a >> VLAN entry from the VTU when the driven switch sees no user ports as &

Re: [PATCH net-next 5/5] net: dsa: mv88e6xxx: do not purge a VTU entry

2017-06-07 Thread Vivien Didelot
Hi Florian, Florian Fainelli writes: > On 06/06/2017 01:56 PM, Vivien Didelot wrote: >> The mv88e6xxx driver currently tries to be smart and remove by itself a >> VLAN entry from the VTU when the driven switch sees no user ports as >> members of the VLAN. >> >

[PATCH net-next 0/5] net: dsa: add cross-chip VLAN support

2017-06-06 Thread Vivien Didelot
yet since it requires some caching. (*) the output is shown from this out-of-tree debugfs patch: https://github.com/vivien/linux/commit/7b61a684b9d6b6a499135a587c7f62a1fddceb8b.patch Vivien Didelot (5): net: dsa: mv88e6xxx: define membership on VLAN add net: dsa: check VLAN capability of every

[PATCH net-next 0/5] net: dsa: add cross-chip VLAN support

2017-06-06 Thread Vivien Didelot
yet since it requires some caching. (*) the output is shown from this out-of-tree debugfs patch: https://github.com/vivien/linux/commit/7b61a684b9d6b6a499135a587c7f62a1fddceb8b.patch Vivien Didelot (5): net: dsa: mv88e6xxx: define membership on VLAN add net: dsa: check VLAN capability of every

[PATCH net-next 1/5] net: dsa: mv88e6xxx: define membership on VLAN add

2017-06-06 Thread Vivien Didelot
Define the target port membership of the VLAN entry in mv88e6xxx_port_vlan_add where ds is scoped. Allow the DSA core to call later the port_vlan_add operation for CPU or DSA ports, by using the Unmodified membership for these ports, as in the current behavior. Signed-off-by: Vivien Didelot

[PATCH net-next 1/5] net: dsa: mv88e6xxx: define membership on VLAN add

2017-06-06 Thread Vivien Didelot
Define the target port membership of the VLAN entry in mv88e6xxx_port_vlan_add where ds is scoped. Allow the DSA core to call later the port_vlan_add operation for CPU or DSA ports, by using the Unmodified membership for these ports, as in the current behavior. Signed-off-by: Vivien Didelot

[PATCH net-next 3/5] net: dsa: add CPU and DSA ports as VLAN members

2017-06-06 Thread Vivien Didelot
for caring about the abstracted switch logic and topology. Make the DSA core program the CPU and DSA ports as part of the VLAN. This makes all chips of the data path to be aware of VIDs spanning the the whole fabric and thus, seamlessly add support for cross-chip VLAN. Signed-off-by: Vivien Didelot

[PATCH net-next 3/5] net: dsa: add CPU and DSA ports as VLAN members

2017-06-06 Thread Vivien Didelot
for caring about the abstracted switch logic and topology. Make the DSA core program the CPU and DSA ports as part of the VLAN. This makes all chips of the data path to be aware of VIDs spanning the the whole fabric and thus, seamlessly add support for cross-chip VLAN. Signed-off-by: Vivien Didelot

[PATCH net-next 4/5] net: dsa: mv88e6xxx: exclude all ports in new VLAN

2017-06-06 Thread Vivien Didelot
Now that the DSA core adds the CPU and DSA ports itself to the new VLAN entry, there is no need to include them as members of this VLAN when initializing a new VTU entry. As of now, initialize a new VTU entry with all ports excluded. Signed-off-by: Vivien Didelot <vivien.d

[PATCH net-next 4/5] net: dsa: mv88e6xxx: exclude all ports in new VLAN

2017-06-06 Thread Vivien Didelot
Now that the DSA core adds the CPU and DSA ports itself to the new VLAN entry, there is no need to include them as members of this VLAN when initializing a new VTU entry. As of now, initialize a new VTU entry with all ports excluded. Signed-off-by: Vivien Didelot --- drivers/net/dsa/mv88e6xxx

[PATCH net-next 5/5] net: dsa: mv88e6xxx: do not purge a VTU entry

2017-06-06 Thread Vivien Didelot
of the VID in order to correctly pass frames in the data path. Remove the code purging a VTU entry when updating a port membership. Signed-off-by: Vivien Didelot <vivien.dide...@savoirfairelinux.com> --- drivers/net/dsa/mv88e6xxx/chip.c | 15 +-- 1 file changed, 1 insertion(

[PATCH net-next 5/5] net: dsa: mv88e6xxx: do not purge a VTU entry

2017-06-06 Thread Vivien Didelot
of the VID in order to correctly pass frames in the data path. Remove the code purging a VTU entry when updating a port membership. Signed-off-by: Vivien Didelot --- drivers/net/dsa/mv88e6xxx/chip.c | 15 +-- 1 file changed, 1 insertion(+), 14 deletions(-) diff --git a/drivers/net

[PATCH net-next 2/5] net: dsa: check VLAN capability of every switch

2017-06-06 Thread Vivien Didelot
-by: Vivien Didelot <vivien.dide...@savoirfairelinux.com> --- net/dsa/switch.c | 27 +-- 1 file changed, 17 insertions(+), 10 deletions(-) diff --git a/net/dsa/switch.c b/net/dsa/switch.c index d8e5c311ee7c..f235ae1e9777 100644 --- a/net/dsa/switch.c +++ b/net/dsa/sw

[PATCH net-next 2/5] net: dsa: check VLAN capability of every switch

2017-06-06 Thread Vivien Didelot
-by: Vivien Didelot --- net/dsa/switch.c | 27 +-- 1 file changed, 17 insertions(+), 10 deletions(-) diff --git a/net/dsa/switch.c b/net/dsa/switch.c index d8e5c311ee7c..f235ae1e9777 100644 --- a/net/dsa/switch.c +++ b/net/dsa/switch.c @@ -159,19 +159,27 @@ static int

[PATCH net-next] net: dsa: mv88e6xxx: fix 6085 frame mode masking

2017-06-05 Thread Vivien Didelot
The register bits used for the frame mode were masked with DSA (0x1) instead of the mask value (0x3) in the 6085 implementation of port_set_frame_mode. Fix this. Fixes: 56995cbc3540 ("net: dsa: mv88e6xxx: Refactor CPU and DSA port setup") Signed-off-by: Vivien Didelot &l

[PATCH net-next] net: dsa: mv88e6xxx: fix 6085 frame mode masking

2017-06-05 Thread Vivien Didelot
The register bits used for the frame mode were masked with DSA (0x1) instead of the mask value (0x3) in the 6085 implementation of port_set_frame_mode. Fix this. Fixes: 56995cbc3540 ("net: dsa: mv88e6xxx: Refactor CPU and DSA port setup") Signed-off-by: Vivien Didelot --- drive

Re: [PATCH net] net: dsa: Fix stale cpu_switch reference after unbind then bind

2017-06-03 Thread Vivien Didelot
cpu_switch in > dsa_cpu_parse(). > > Fixes: 9520ed8fb841 ("net: dsa: use cpu_switch instead of ds[0]") > Signed-off-by: Florian Fainelli <f.faine...@gmail.com> Reviewed-by: Vivien Didelot <vivien.dide...@savoirfairelinux.com> Thanks! Vivien

Re: [PATCH net] net: dsa: Fix stale cpu_switch reference after unbind then bind

2017-06-03 Thread Vivien Didelot
_cpu_parse(). > > Fixes: 9520ed8fb841 ("net: dsa: use cpu_switch instead of ds[0]") > Signed-off-by: Florian Fainelli Reviewed-by: Vivien Didelot Thanks! Vivien

[PATCH net-next 5/5] net: dsa: mv88e6xxx: move the Global 2 macros

2017-06-02 Thread Vivien Didelot
Move the GLOBAL2_* macros where they belong, in the related global2.h header. Signed-off-by: Vivien Didelot <vivien.dide...@savoirfairelinux.com> --- drivers/net/dsa/mv88e6xxx/chip.h| 101 --- drivers/net/dsa/mv88e6xxx/global2.c | 2 - drivers/n

[PATCH net-next 5/5] net: dsa: mv88e6xxx: move the Global 2 macros

2017-06-02 Thread Vivien Didelot
Move the GLOBAL2_* macros where they belong, in the related global2.h header. Signed-off-by: Vivien Didelot --- drivers/net/dsa/mv88e6xxx/chip.h| 101 --- drivers/net/dsa/mv88e6xxx/global2.c | 2 - drivers/net/dsa/mv88e6xxx/global2.h | 103

[PATCH net-next 3/5] net: dsa: mv88e6xxx: move the Port macros

2017-06-02 Thread Vivien Didelot
Move the PORT_* macros where they belong, in the related port.h header. Signed-off-by: Vivien Didelot <vivien.dide...@savoirfairelinux.com> --- drivers/net/dsa/mv88e6xxx/chip.h | 160 --- drivers/net/dsa/mv88e6xxx/port.h

[PATCH net-next 0/5] net: dsa: mv88e6xxx: move registers macros

2017-06-02 Thread Vivien Didelot
an implicit namespace and easily identify model subtleties in registers layout, as correctly done in the newly added serdes.h header. Vivien Didelot (5): net: dsa: mv88e6xxx: rename chip header net: dsa: mv88e6xxx: move PHY macros net: dsa: mv88e6xxx: move the Port macros net: dsa: mv88e6xxx

[PATCH net-next 3/5] net: dsa: mv88e6xxx: move the Port macros

2017-06-02 Thread Vivien Didelot
Move the PORT_* macros where they belong, in the related port.h header. Signed-off-by: Vivien Didelot --- drivers/net/dsa/mv88e6xxx/chip.h | 160 --- drivers/net/dsa/mv88e6xxx/port.h | 160 +++ 2 files changed, 160

[PATCH net-next 0/5] net: dsa: mv88e6xxx: move registers macros

2017-06-02 Thread Vivien Didelot
an implicit namespace and easily identify model subtleties in registers layout, as correctly done in the newly added serdes.h header. Vivien Didelot (5): net: dsa: mv88e6xxx: rename chip header net: dsa: mv88e6xxx: move PHY macros net: dsa: mv88e6xxx: move the Port macros net: dsa: mv88e6xxx

[PATCH net-next 4/5] net: dsa: mv88e6xxx: move the Global 1 macros

2017-06-02 Thread Vivien Didelot
Move the GLOBAL_* macros where they belong, in the related global1.h header. Include it in global2.c which uses GLOBAL_STATUS_IRQ_DEVICE. Signed-off-by: Vivien Didelot <vivien.dide...@savoirfairelinux.com> --- drivers/net/dsa/mv88e6xxx/chip.h

[PATCH net-next 4/5] net: dsa: mv88e6xxx: move the Global 1 macros

2017-06-02 Thread Vivien Didelot
Move the GLOBAL_* macros where they belong, in the related global1.h header. Include it in global2.c which uses GLOBAL_STATUS_IRQ_DEVICE. Signed-off-by: Vivien Didelot --- drivers/net/dsa/mv88e6xxx/chip.h| 141 drivers/net/dsa/mv88e6xxx/global1.h | 141

[PATCH net-next 1/5] net: dsa: mv88e6xxx: rename chip header

2017-06-02 Thread Vivien Didelot
The mv88e6xxx.h is meant to contains the chip structures and data. Rename it to chip.h, as for other source/header pairs of the driver. At the same time, ensure that relative header inclusions are separated by a newline and sorted alphabetically. Signed-off-by: Vivien Didelot <vivien.d

[PATCH net-next 2/5] net: dsa: mv88e6xxx: move PHY macros

2017-06-02 Thread Vivien Didelot
Move the PHY_* macros where they belong, in the related phy.h header. Signed-off-by: Vivien Didelot <vivien.dide...@savoirfairelinux.com> --- drivers/net/dsa/mv88e6xxx/chip.h | 4 drivers/net/dsa/mv88e6xxx/phy.h | 3 +++ 2 files changed, 3 insertions(+), 4 deletions(-) diff

[PATCH net-next 1/5] net: dsa: mv88e6xxx: rename chip header

2017-06-02 Thread Vivien Didelot
The mv88e6xxx.h is meant to contains the chip structures and data. Rename it to chip.h, as for other source/header pairs of the driver. At the same time, ensure that relative header inclusions are separated by a newline and sorted alphabetically. Signed-off-by: Vivien Didelot --- drivers/net

[PATCH net-next 2/5] net: dsa: mv88e6xxx: move PHY macros

2017-06-02 Thread Vivien Didelot
Move the PHY_* macros where they belong, in the related phy.h header. Signed-off-by: Vivien Didelot --- drivers/net/dsa/mv88e6xxx/chip.h | 4 drivers/net/dsa/mv88e6xxx/phy.h | 3 +++ 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/drivers/net/dsa/mv88e6xxx/chip.h b/drivers

Re: [PATCH net] net: dsa: Move dsa_switch_{suspend,resume} out of legacy.c

2017-06-02 Thread Vivien Didelot
f-by: Florian Fainelli <f.faine...@gmail.com> Reviewed-by: Vivien Didelot <vivien.dide...@savoirfairelinux.com>

Re: [PATCH net] net: dsa: Move dsa_switch_{suspend,resume} out of legacy.c

2017-06-02 Thread Vivien Didelot
Florian Fainelli writes: > dsa_switch_suspend() and dsa_switch_resume() are functions that belong in > net/dsa/dsa.c and are not part of the legacy platform support code. > > Fixes: a6a71f19fe5e ("net: dsa: isolate legacy code") > Signed-off-by: Florian Fainelli Reviewed-by: Vivien Didelot

[PATCH net-next v3 5/5] net: dsa: factor skb freeing on xmit

2017-06-01 Thread Vivien Didelot
NULL could be written "!nskb" #208: FILE: net/dsa/tag_trailer.c:35: + if (nskb == NULL) Signed-off-by: Vivien Didelot <vivien.dide...@savoirfairelinux.com> --- net/dsa/slave.c | 8 ++-- net/dsa/tag_brcm.c| 6 +- net/dsa/tag_dsa.c | 8 ++-- net/dsa/tag_e

[PATCH net-next v3 5/5] net: dsa: factor skb freeing on xmit

2017-06-01 Thread Vivien Didelot
NULL could be written "!nskb" #208: FILE: net/dsa/tag_trailer.c:35: + if (nskb == NULL) Signed-off-by: Vivien Didelot --- net/dsa/slave.c | 8 ++-- net/dsa/tag_brcm.c| 6 +- net/dsa/tag_dsa.c | 8 ++-- net/dsa/tag_edsa.c| 8 ++-- net/dsa/tag_ksz.c

[PATCH net-next v3 1/5] net: dsa: comment hot path requirements

2017-06-01 Thread Vivien Didelot
The DSA layer uses inline helpers and copy of the tagging functions for faster access in hot path. Add comments to detail that. Reviewed-by: Florian Fainelli <f.faine...@gmail.com> Signed-off-by: Vivien Didelot <vivien.dide...@savoirfairelinux.com> --- include/net/dsa.h | 3

[PATCH net-next v3 0/5] net: dsa: tagger simplification

2017-06-01 Thread Vivien Didelot
in v2: - do not remove tagger function copies - document hot path requirements - make netdev_uses_dsa simpler - add reviewers' tags Vivien Didelot (5): net: dsa: comment hot path requirements net: dsa: do not cast dst net: dsa: remove dsa_uses_tagged_protocol net: dsa: remove

[PATCH net-next v3 3/5] net: dsa: remove dsa_uses_tagged_protocol

2017-06-01 Thread Vivien Didelot
Since dev->dsa_ptr is a pointer to a dsa_switch_tree, there is no need to have another inline helper just to check rcv. Remove dsa_uses_tagged_protocol and check dsa_ptr && dsa_ptr->rcv together at the same time. Reviewed-by: Florian Fainelli <f.faine...@gmail.com> Signed-of

[PATCH net-next v3 4/5] net: dsa: remove out_drop label in taggers rcv

2017-06-01 Thread Vivien Didelot
Many rcv functions from net/dsa/tag_*.c have a useless out_drop goto label which simply returns NULL. Kill it in favor of the obvious. Reviewed-by: Florian Fainelli <f.faine...@gmail.com> Signed-off-by: Vivien Didelot <vivien.dide...@savoirfairelinux.com> --- net/dsa/tag_br

[PATCH net-next v3 4/5] net: dsa: remove out_drop label in taggers rcv

2017-06-01 Thread Vivien Didelot
Many rcv functions from net/dsa/tag_*.c have a useless out_drop goto label which simply returns NULL. Kill it in favor of the obvious. Reviewed-by: Florian Fainelli Signed-off-by: Vivien Didelot --- net/dsa/tag_brcm.c| 11 --- net/dsa/tag_dsa.c | 13 + net/dsa

[PATCH net-next v3 1/5] net: dsa: comment hot path requirements

2017-06-01 Thread Vivien Didelot
The DSA layer uses inline helpers and copy of the tagging functions for faster access in hot path. Add comments to detail that. Reviewed-by: Florian Fainelli Signed-off-by: Vivien Didelot --- include/net/dsa.h | 3 +++ net/dsa/dsa_priv.h | 1 + 2 files changed, 4 insertions(+) diff --git

[PATCH net-next v3 0/5] net: dsa: tagger simplification

2017-06-01 Thread Vivien Didelot
in v2: - do not remove tagger function copies - document hot path requirements - make netdev_uses_dsa simpler - add reviewers' tags Vivien Didelot (5): net: dsa: comment hot path requirements net: dsa: do not cast dst net: dsa: remove dsa_uses_tagged_protocol net: dsa: remove

[PATCH net-next v3 3/5] net: dsa: remove dsa_uses_tagged_protocol

2017-06-01 Thread Vivien Didelot
Since dev->dsa_ptr is a pointer to a dsa_switch_tree, there is no need to have another inline helper just to check rcv. Remove dsa_uses_tagged_protocol and check dsa_ptr && dsa_ptr->rcv together at the same time. Reviewed-by: Florian Fainelli Signed-off-by: Vivien Didelot --

[PATCH net-next v3 2/5] net: dsa: do not cast dst

2017-06-01 Thread Vivien Didelot
dsa_ptr is not a void pointer anymore since Nov 2011, as of cf50dcc24f82 ("dsa: Change dsa_uses_{dsa, trailer}_tags() into inline functions"), but an explicit dsa_switch_tree pointer, thus remove the (void *) cast. Reviewed-by: Florian Fainelli <f.faine...@gmail.com> Signed-off-by

[PATCH net-next v3 2/5] net: dsa: do not cast dst

2017-06-01 Thread Vivien Didelot
dsa_ptr is not a void pointer anymore since Nov 2011, as of cf50dcc24f82 ("dsa: Change dsa_uses_{dsa, trailer}_tags() into inline functions"), but an explicit dsa_switch_tree pointer, thus remove the (void *) cast. Reviewed-by: Florian Fainelli Signed-off-by: Vivien Didelot --- net/

Re: [PATCH net-next v2 6/6] net: dsa: factor skb freeing on xmit

2017-05-31 Thread Vivien Didelot
Hi Florian, Florian Fainelli <f.faine...@gmail.com> writes: > On 05/30/2017 11:33 AM, Vivien Didelot wrote: >> The taggers are currently responsible to free the original SKB if they >> made a copy of it, or in case of error. >> >> This patch simplifies

Re: [PATCH net-next v2 6/6] net: dsa: factor skb freeing on xmit

2017-05-31 Thread Vivien Didelot
Hi Florian, Florian Fainelli writes: > On 05/30/2017 11:33 AM, Vivien Didelot wrote: >> The taggers are currently responsible to free the original SKB if they >> made a copy of it, or in case of error. >> >> This patch simplifies this by freeing the original SKB in t

Re: [PATCH net-next v2 4/6] net: dsa: remove unused arguments of tagger rcv

2017-05-30 Thread Vivien Didelot
Florian Fainelli writes: >> Is orig_dev really needed in the tagging implementation, or only in the >> layer above? (dsa_slave_xmit and dsa_switch_rcv.) > > It's needed: > > https://github.com/ffainelli/linux/commits/switch-tag >

Re: [PATCH net-next v2 4/6] net: dsa: remove unused arguments of tagger rcv

2017-05-30 Thread Vivien Didelot
Florian Fainelli writes: >> Is orig_dev really needed in the tagging implementation, or only in the >> layer above? (dsa_slave_xmit and dsa_switch_rcv.) > > It's needed: > > https://github.com/ffainelli/linux/commits/switch-tag >

Re: [PATCH net-next v2 4/6] net: dsa: remove unused arguments of tagger rcv

2017-05-30 Thread Vivien Didelot
Hi Florian, Florian Fainelli writes: > I actually have a patch pending that adds support for HW > insertion/extraction of switch tags (broadcom HW supports that) which > require the orig_dev to be there so we know what features are supported > by the master network device.

Re: [PATCH net-next v2 4/6] net: dsa: remove unused arguments of tagger rcv

2017-05-30 Thread Vivien Didelot
Hi Florian, Florian Fainelli writes: > I actually have a patch pending that adds support for HW > insertion/extraction of switch tags (broadcom HW supports that) which > require the orig_dev to be there so we know what features are supported > by the master network device. Is orig_dev really

Re: [PATCH V2 2/3] net-next: dsa: add multi cpu port support

2017-05-30 Thread Vivien Didelot
Hi John, Vivien Didelot <vivien.dide...@savoirfairelinux.com> writes: >> +int port_cpu = ds->ports[port].upstream; > > ds->ports[port] is p->dp. I misread this part, p is not yet allocated in that chunk, please ignore this one comment ;-) Thanks, Vivien

Re: [PATCH V2 2/3] net-next: dsa: add multi cpu port support

2017-05-30 Thread Vivien Didelot
Hi John, Vivien Didelot writes: >> +int port_cpu = ds->ports[port].upstream; > > ds->ports[port] is p->dp. I misread this part, p is not yet allocated in that chunk, please ignore this one comment ;-) Thanks, Vivien

Re: [PATCH V2 2/3] net-next: dsa: add multi cpu port support

2017-05-30 Thread Vivien Didelot
Hi John, John Crispin writes: > +static inline bool dsa_is_upstream_port(struct dsa_switch *ds, int p) > +{ > + return dsa_is_cpu_port(ds, p) || dsa_is_dsa_port(ds, p); > +} This looks confusing to me. What DSA calls an "upstream" port for the moment is the port which

Re: [PATCH V2 2/3] net-next: dsa: add multi cpu port support

2017-05-30 Thread Vivien Didelot
Hi John, John Crispin writes: > +static inline bool dsa_is_upstream_port(struct dsa_switch *ds, int p) > +{ > + return dsa_is_cpu_port(ds, p) || dsa_is_dsa_port(ds, p); > +} This looks confusing to me. What DSA calls an "upstream" port for the moment is the port which goes to the CPU

[PATCH net-next v2 6/6] net: dsa: factor skb freeing on xmit

2017-05-30 Thread Vivien Didelot
the original SKB if it returned a copy of it. At the same time, fix the checkpatch NULL comparison check: CHECK: Comparison to NULL could be written "!nskb" #208: FILE: net/dsa/tag_trailer.c:35: + if (nskb == NULL) Signed-off-by: Vivien Didelot <vivien.dide...@savoirf

[PATCH net-next v2 6/6] net: dsa: factor skb freeing on xmit

2017-05-30 Thread Vivien Didelot
the original SKB if it returned a copy of it. At the same time, fix the checkpatch NULL comparison check: CHECK: Comparison to NULL could be written "!nskb" #208: FILE: net/dsa/tag_trailer.c:35: + if (nskb == NULL) Signed-off-by: Vivien Didelot --- net/dsa/slave.c

[PATCH net-next v2 4/6] net: dsa: remove unused arguments of tagger rcv

2017-05-30 Thread Vivien Didelot
The struct dsa_device_ops defines the rcv function with 2 unused arguments struct packet_type *pt, and struct net_device *orig_dev. This patch removes them from the definition and implementations. Reviewed-by: Andrew Lunn <and...@lunn.ch> Signed-off-by: Vivien Didelot <vi

[PATCH net-next v2 2/6] net: dsa: do not cast dst

2017-05-30 Thread Vivien Didelot
dsa_ptr is not a void pointer anymore since Nov 2011, as of cf50dcc24f82 ("dsa: Change dsa_uses_{dsa, trailer}_tags() into inline functions"), but an explicit dsa_switch_tree pointer, thus remove the (void *) cast. Signed-off-by: Vivien Didelot <vivien.dide...@savoirfairelinux.com&

[PATCH net-next v2 4/6] net: dsa: remove unused arguments of tagger rcv

2017-05-30 Thread Vivien Didelot
The struct dsa_device_ops defines the rcv function with 2 unused arguments struct packet_type *pt, and struct net_device *orig_dev. This patch removes them from the definition and implementations. Reviewed-by: Andrew Lunn Signed-off-by: Vivien Didelot --- include/net/dsa.h | 4 +--- net

[PATCH net-next v2 2/6] net: dsa: do not cast dst

2017-05-30 Thread Vivien Didelot
dsa_ptr is not a void pointer anymore since Nov 2011, as of cf50dcc24f82 ("dsa: Change dsa_uses_{dsa, trailer}_tags() into inline functions"), but an explicit dsa_switch_tree pointer, thus remove the (void *) cast. Signed-off-by: Vivien Didelot --- net/dsa/dsa2.c | 2 +- net/dsa/le

[PATCH net-next v2 1/6] net: dsa: comment hot path requirements

2017-05-30 Thread Vivien Didelot
The DSA layer uses inline helpers and copies of the tagging functions for faster access in hot path. Add comments to detail that. Signed-off-by: Vivien Didelot <vivien.dide...@savoirfairelinux.com> --- include/net/dsa.h | 3 +++ net/dsa/dsa_priv.h | 1 + 2 files changed, 4 insertions(+)

[PATCH net-next v2 1/6] net: dsa: comment hot path requirements

2017-05-30 Thread Vivien Didelot
The DSA layer uses inline helpers and copies of the tagging functions for faster access in hot path. Add comments to detail that. Signed-off-by: Vivien Didelot --- include/net/dsa.h | 3 +++ net/dsa/dsa_priv.h | 1 + 2 files changed, 4 insertions(+) diff --git a/include/net/dsa.h b/include

[PATCH net-next v2 0/6] net: dsa: tagger simplification

2017-05-30 Thread Vivien Didelot
simpler - add reviewers' tags Vivien Didelot (6): net: dsa: comment hot path requirements net: dsa: do not cast dst net: dsa: remove dsa_uses_tagged_protocol net: dsa: remove unused arguments of tagger rcv net: dsa: remove out_drop label in taggers rcv net: dsa: factor skb freeing

[PATCH net-next v2 0/6] net: dsa: tagger simplification

2017-05-30 Thread Vivien Didelot
simpler - add reviewers' tags Vivien Didelot (6): net: dsa: comment hot path requirements net: dsa: do not cast dst net: dsa: remove dsa_uses_tagged_protocol net: dsa: remove unused arguments of tagger rcv net: dsa: remove out_drop label in taggers rcv net: dsa: factor skb freeing

[PATCH net-next v2 5/6] net: dsa: remove out_drop label in taggers rcv

2017-05-30 Thread Vivien Didelot
Many rcv functions from net/dsa/tag_*.c have a useless out_drop goto label which simply returns NULL. Kill it in favor of the obvious. Signed-off-by: Vivien Didelot <vivien.dide...@savoirfairelinux.com> --- net/dsa/tag_brcm.c| 11 --- net/dsa/tag_dsa.c | 13 + n

[PATCH net-next v2 5/6] net: dsa: remove out_drop label in taggers rcv

2017-05-30 Thread Vivien Didelot
Many rcv functions from net/dsa/tag_*.c have a useless out_drop goto label which simply returns NULL. Kill it in favor of the obvious. Signed-off-by: Vivien Didelot --- net/dsa/tag_brcm.c| 11 --- net/dsa/tag_dsa.c | 13 + net/dsa/tag_edsa.c| 13

[PATCH net-next v2 3/6] net: dsa: remove dsa_uses_tagged_protocol

2017-05-30 Thread Vivien Didelot
Since dev->dsa_ptr is a pointer to a dsa_switch_tree, there is no need to have another inline helper just to check rcv. Remove dsa_uses_tagged_protocol and check dsa_ptr && dsa_ptr->rcv together at the same time. Signed-off-by: Vivien Didelot <vivien.dide...@savoirfairelinux.

[PATCH net-next v2 3/6] net: dsa: remove dsa_uses_tagged_protocol

2017-05-30 Thread Vivien Didelot
Since dev->dsa_ptr is a pointer to a dsa_switch_tree, there is no need to have another inline helper just to check rcv. Remove dsa_uses_tagged_protocol and check dsa_ptr && dsa_ptr->rcv together at the same time. Signed-off-by: Vivien Didelot --- include/net/dsa.h | 8 +---

Re: [PATCH net-next 1/7] net: dsa: hide dsa_uses_tagged_protocol code

2017-05-30 Thread Vivien Didelot
Hi Andrew, Andrew Lunn <and...@lunn.ch> writes: > On Tue, May 30, 2017 at 11:56:30AM -0400, Vivien Didelot wrote: >> Hi Andrew, David, >> >> David Miller <da...@davemloft.net> writes: >> >> >>> +bool dsa_uses_tagged_protocol(struct dsa_sw

Re: [PATCH net-next 1/7] net: dsa: hide dsa_uses_tagged_protocol code

2017-05-30 Thread Vivien Didelot
Hi Andrew, Andrew Lunn writes: > On Tue, May 30, 2017 at 11:56:30AM -0400, Vivien Didelot wrote: >> Hi Andrew, David, >> >> David Miller writes: >> >> >>> +bool dsa_uses_tagged_protocol(struct dsa_switch_tree *dst) &

Re: [PATCH net-next 1/7] net: dsa: hide dsa_uses_tagged_protocol code

2017-05-30 Thread Vivien Didelot
Hi Andrew, David, David Miller writes: >>> +bool dsa_uses_tagged_protocol(struct dsa_switch_tree *dst) >>> +{ >>> + return !!dst->rcv; >>> +} >>> + >> >> You need to be careful here. This is in the hot path. Every frame >> received uses this code. And think about a

Re: [PATCH net-next 1/7] net: dsa: hide dsa_uses_tagged_protocol code

2017-05-30 Thread Vivien Didelot
Hi Andrew, David, David Miller writes: >>> +bool dsa_uses_tagged_protocol(struct dsa_switch_tree *dst) >>> +{ >>> + return !!dst->rcv; >>> +} >>> + >> >> You need to be careful here. This is in the hot path. Every frame >> received uses this code. And think about a distro kernel, which might

Re: [PATCH net-next 6/7] net: dsa: remove useless copy of tagger xmit

2017-05-30 Thread Vivien Didelot
Hi Andrew, Andrew Lunn writes: >> /* Transmit function may have to reallocate the original SKB */ >> -nskb = p->xmit(skb, dev); >> +nskb = p->dp->ds->dst->tag_ops->xmit(skb, dev); > > This is also the hot path for DSA transmit. Do we really want to do 4 > extra

Re: [PATCH net-next 6/7] net: dsa: remove useless copy of tagger xmit

2017-05-30 Thread Vivien Didelot
Hi Andrew, Andrew Lunn writes: >> /* Transmit function may have to reallocate the original SKB */ >> -nskb = p->xmit(skb, dev); >> +nskb = p->dp->ds->dst->tag_ops->xmit(skb, dev); > > This is also the hot path for DSA transmit. Do we really want to do 4 > extra pointer dereferences

Re: [PATCH net-next 4/7] net: dsa: free orig skb on rcv if reallocated

2017-05-30 Thread Vivien Didelot
Hi Andrew, Andrew Lunn <and...@lunn.ch> writes: > On Tue, May 30, 2017 at 10:21:28AM -0400, Vivien Didelot wrote: >> If the receive function of a tagger reallocated the SKB, the original >> SKB is currently not freed. Fix this and free it on both copy or error. > > I d

Re: [PATCH net-next 4/7] net: dsa: free orig skb on rcv if reallocated

2017-05-30 Thread Vivien Didelot
Hi Andrew, Andrew Lunn writes: > On Tue, May 30, 2017 at 10:21:28AM -0400, Vivien Didelot wrote: >> If the receive function of a tagger reallocated the SKB, the original >> SKB is currently not freed. Fix this and free it on both copy or error. > > I don't see any of

[PATCH net-next 7/7] net: dsa: factor skb freeing on xmit

2017-05-30 Thread Vivien Didelot
comparison check: CHECK: Comparison to NULL could be written "!nskb" #208: FILE: net/dsa/tag_trailer.c:35: + if (nskb == NULL) Signed-off-by: Vivien Didelot <vivien.dide...@savoirfairelinux.com> --- net/dsa/slave.c | 2 ++ net/dsa/tag_brcm.c| 6 +- net/dsa/t

[PATCH net-next 7/7] net: dsa: factor skb freeing on xmit

2017-05-30 Thread Vivien Didelot
comparison check: CHECK: Comparison to NULL could be written "!nskb" #208: FILE: net/dsa/tag_trailer.c:35: + if (nskb == NULL) Signed-off-by: Vivien Didelot --- net/dsa/slave.c | 2 ++ net/dsa/tag_brcm.c| 6 +- net/dsa/tag_dsa.c | 8 ++-- net/dsa/tag_eds

[PATCH net-next 1/7] net: dsa: hide dsa_uses_tagged_protocol code

2017-05-30 Thread Vivien Didelot
/dsa/dsa.c:32: + return dst->rcv != NULL; Signed-off-by: Vivien Didelot <vivien.dide...@savoirfairelinux.com> --- include/net/dsa.h | 5 + net/dsa/dsa.c | 5 + 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/include/net/dsa.h b/include/net/dsa.h index c0e567c0c82

[PATCH net-next 2/7] net: dsa: remove useless rcv copy in DSA tree

2017-05-30 Thread Vivien Didelot
The dsa_switch_tree holds a copy of the rcv member of the dsa_device_ops structure. dst->rcv is always assigned to dst->tag_ops->rcv. Remove this useless copy. Signed-off-by: Vivien Didelot <vivien.dide...@savoirfairelinux.com> --- include/net/dsa.h | 4 net/dsa/dsa.c |

[PATCH net-next 1/7] net: dsa: hide dsa_uses_tagged_protocol code

2017-05-30 Thread Vivien Didelot
/dsa/dsa.c:32: + return dst->rcv != NULL; Signed-off-by: Vivien Didelot --- include/net/dsa.h | 5 + net/dsa/dsa.c | 5 + 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/include/net/dsa.h b/include/net/dsa.h index c0e567c0c824..cb5d668b265d 100644 --- a/include/net/dsa

[PATCH net-next 2/7] net: dsa: remove useless rcv copy in DSA tree

2017-05-30 Thread Vivien Didelot
The dsa_switch_tree holds a copy of the rcv member of the dsa_device_ops structure. dst->rcv is always assigned to dst->tag_ops->rcv. Remove this useless copy. Signed-off-by: Vivien Didelot --- include/net/dsa.h | 4 net/dsa/dsa.c | 4 ++-- net/dsa/dsa2.c| 2 -- net/dsa

[PATCH net-next 3/7] net: dsa: remove unused arguments of tagger rcv

2017-05-30 Thread Vivien Didelot
The struct dsa_device_ops defines the rcv function with 2 unused arguments struct packet_type *pt, and struct net_device *orig_dev. This patch removes them from the definition and implementations. Signed-off-by: Vivien Didelot <vivien.dide...@savoirfairelinux.com> --- net/dsa/dsa.c

[PATCH net-next 0/7] net: dsa: tagger simplification

2017-05-30 Thread Vivien Didelot
and only the rcv caller (partially) handles the SKB freeing. The rcv function also contains unused arguments. This patchset removes the copy of rcv and xmit functions, the unused arguments of the rcv signature and the useless labels, and handles freeing of the SKB in the xmit caller. Vivien

[PATCH net-next 3/7] net: dsa: remove unused arguments of tagger rcv

2017-05-30 Thread Vivien Didelot
The struct dsa_device_ops defines the rcv function with 2 unused arguments struct packet_type *pt, and struct net_device *orig_dev. This patch removes them from the definition and implementations. Signed-off-by: Vivien Didelot --- net/dsa/dsa.c | 2 +- net/dsa/dsa_priv.h| 4

[PATCH net-next 0/7] net: dsa: tagger simplification

2017-05-30 Thread Vivien Didelot
and only the rcv caller (partially) handles the SKB freeing. The rcv function also contains unused arguments. This patchset removes the copy of rcv and xmit functions, the unused arguments of the rcv signature and the useless labels, and handles freeing of the SKB in the xmit caller. Vivien

[PATCH net-next 4/7] net: dsa: free orig skb on rcv if reallocated

2017-05-30 Thread Vivien Didelot
If the receive function of a tagger reallocated the SKB, the original SKB is currently not freed. Fix this and free it on both copy or error. Signed-off-by: Vivien Didelot <vivien.dide...@savoirfairelinux.com> --- net/dsa/dsa.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-)

<    5   6   7   8   9   10   11   12   13   14   >