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
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
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
<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
<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
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
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
-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
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 -
-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
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
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
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
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
&
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.
>>
>
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
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
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
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
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
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
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
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
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(
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
-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
-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
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
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
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
_cpu_parse().
>
> Fixes: 9520ed8fb841 ("net: dsa: use cpu_switch instead of ds[0]")
> Signed-off-by: Florian Fainelli
Reviewed-by: Vivien Didelot
Thanks!
Vivien
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
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
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
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
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
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
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
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
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
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
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
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
f-by: Florian Fainelli <f.faine...@gmail.com>
Reviewed-by: Vivien Didelot <vivien.dide...@savoirfairelinux.com>
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
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
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
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
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
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
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
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
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
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
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
--
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
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/
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
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
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
>
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
>
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.
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
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
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
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
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
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
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
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
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&
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
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
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(+)
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
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
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
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
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
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.
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 +---
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
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)
&
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
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
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
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
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
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
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
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
/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
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 |
/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
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
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
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
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
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
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(-)
901 - 1000 of 3273 matches
Mail list logo