From: Florian Fainelli <florian.fainelli@broadcom.com>
Hi Greg, Sasha, Jaakub and David,
This patch series contains backports for a change that recently made it
upstream as:
commit f3f9be9c58085d11f4448ec199bf49dc2f9b7fb9
Merge: 18755e270666 f9b3827ee66c
Author: Jakub Kicinski [off-list ref]
Date: Tue Feb 23 12:23:06 2021 -0800
Merge branch 'net-dsa-learning-fixes-for-b53-bcm_sf2'
The way this was fixed in the netdev group's net tree is slightly
different from how it should be backported to stable trees which is why
you will find a patch for each branch in the thread started by this
cover letter.
Let me know if this does not apply for some reason. The changes from 4.9
through 4.19 are nearly identical and then from 5.4 through 5.11 are
about the same.
Thank you very much!
--
2.25.1
Standalone ports should not have learning enabled since all the frames
are always copied to the CPU port. This is particularly important in
case an user-facing port intentionally spoofs the CPU port's MAC
address. With learning enabled we would end up with the switch having
incorrectly learned the address of the CPU port which typically results
in a complete break down of network connectivity until the address
learned ages out and gets re-learned, from the correct port this time.
There was no control of the BR_LEARNING flag until upstream commit
4098ced4680a485c5953f60ac63dff19f3fb3d42 ("Merge branch 'brport-flags'")
which is why we default to enabling learning when the ports gets added
as a bridge member.
Fixes: 967dd82ffc52 ("net: dsa: b53: Add support for Broadcom RoboSwitch")
Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>
---
drivers/net/dsa/b53/b53_common.c | 20 ++++++++++++++++++++
drivers/net/dsa/b53/b53_regs.h | 1 +
drivers/net/dsa/bcm_sf2.c | 5 +++++
drivers/net/dsa/bcm_sf2_regs.h | 2 ++
4 files changed, 28 insertions(+)
@@ -509,6 +522,8 @@ static int b53_enable_port(struct dsa_switch *ds, int port,unsignedintcpu_port=dev->cpu_port;u16pvlan;+b53_port_set_learning(dev,port,false);+/* Clear the Rx and Tx disable bits and set to no spanning tree */b53_write8(dev,B53_CTRL_PAGE,B53_PORT_CTRL(port),0);
@@ -224,6 +224,11 @@ static int bcm_sf2_port_setup(struct dsa_switch *ds, int port,reg&=~P_TXQ_PSM_VDD(port);core_writel(priv,reg,CORE_MEM_PSM_VDD_CTRL);+/* Disable learning */+reg=core_readl(priv,CORE_DIS_LEARN);+reg|=BIT(port);+core_writel(priv,reg,CORE_DIS_LEARN);+/* Clear the Rx and Tx disable bits and set to no spanning tree */core_writel(priv,0,CORE_G_PCTL_PORT(port));
Standalone ports should not have learning enabled since all the frames
are always copied to the CPU port. This is particularly important in
case an user-facing port intentionally spoofs the CPU port's MAC
address. With learning enabled we would end up with the switch having
incorrectly learned the address of the CPU port which typically results
in a complete break down of network connectivity until the address
learned ages out and gets re-learned, from the correct port this time.
There was no control of the BR_LEARNING flag until upstream commit
4098ced4680a485c5953f60ac63dff19f3fb3d42 ("Merge branch 'brport-flags'")
which is why we default to enabling learning when the ports gets added
as a bridge member.
Fixes: 967dd82ffc52 ("net: dsa: b53: Add support for Broadcom RoboSwitch")
Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>
---
drivers/net/dsa/b53/b53_common.c | 20 ++++++++++++++++++++
drivers/net/dsa/b53/b53_regs.h | 1 +
drivers/net/dsa/bcm_sf2.c | 5 +++++
drivers/net/dsa/bcm_sf2_regs.h | 2 ++
4 files changed, 28 insertions(+)
@@ -508,6 +521,8 @@ static int b53_enable_port(struct dsa_switch *ds, int port,unsignedintcpu_port=dev->cpu_port;u16pvlan;+b53_port_set_learning(dev,port,false);+/* Clear the Rx and Tx disable bits and set to no spanning tree */b53_write8(dev,B53_CTRL_PAGE,B53_PORT_CTRL(port),0);
@@ -252,6 +252,11 @@ static int bcm_sf2_port_setup(struct dsa_switch *ds, int port,reg&=~P_TXQ_PSM_VDD(port);core_writel(priv,reg,CORE_MEM_PSM_VDD_CTRL);+/* Disable learning */+reg=core_readl(priv,CORE_DIS_LEARN);+reg|=BIT(port);+core_writel(priv,reg,CORE_DIS_LEARN);+/* Enable Broadcom tags for that port if requested */if(priv->brcm_tag_mask&BIT(port))bcm_sf2_brcm_hdr_setup(priv,port);
Standalone ports should not have learning enabled since all the frames
are always copied to the CPU port. This is particularly important in
case an user-facing port intentionally spoofs the CPU port's MAC
address. With learning enabled we would end up with the switch having
incorrectly learned the address of the CPU port which typically results
in a complete break down of network connectivity until the address
learned ages out and gets re-learned, from the correct port this time.
There was no control of the BR_LEARNING flag until upstream commit
4098ced4680a485c5953f60ac63dff19f3fb3d42 ("Merge branch 'brport-flags'")
which is why we default to enabling learning when the ports gets added
as a bridge member.
Fixes: 967dd82ffc52 ("net: dsa: b53: Add support for Broadcom RoboSwitch")
Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>
---
drivers/net/dsa/b53/b53_common.c | 19 +++++++++++++++++++
drivers/net/dsa/b53/b53_regs.h | 1 +
drivers/net/dsa/bcm_sf2.c | 5 -----
3 files changed, 20 insertions(+), 5 deletions(-)
@@ -507,12 +507,27 @@ void b53_imp_vlan_setup(struct dsa_switch *ds, int cpu_port)}EXPORT_SYMBOL(b53_imp_vlan_setup);+staticvoidb53_port_set_learning(structb53_device*dev,intport,+boollearning)+{+u16reg;++b53_read16(dev,B53_CTRL_PAGE,B53_DIS_LEARNING,®);+if(learning)+reg&=~BIT(port);+else+reg|=BIT(port);+b53_write16(dev,B53_CTRL_PAGE,B53_DIS_LEARNING,reg);+}+intb53_enable_port(structdsa_switch*ds,intport,structphy_device*phy){structb53_device*dev=ds->priv;unsignedintcpu_port=ds->ports[port].cpu_dp->index;u16pvlan;+b53_port_set_learning(dev,port,false);+/* Clear the Rx and Tx disable bits and set to no spanning tree */b53_write8(dev,B53_CTRL_PAGE,B53_PORT_CTRL(port),0);
@@ -173,11 +173,6 @@ static int bcm_sf2_port_setup(struct dsa_switch *ds, int port,reg&=~P_TXQ_PSM_VDD(port);core_writel(priv,reg,CORE_MEM_PSM_VDD_CTRL);-/* Enable learning */-reg=core_readl(priv,CORE_DIS_LEARN);-reg&=~BIT(port);-core_writel(priv,reg,CORE_DIS_LEARN);-/* Enable Broadcom tags for that port if requested */if(priv->brcm_tag_mask&BIT(port))b53_brcm_hdr_setup(ds,port);
Standalone ports should not have learning enabled since all the frames
are always copied to the CPU port. This is particularly important in
case an user-facing port intentionally spoofs the CPU port's MAC
address. With learning enabled we would end up with the switch having
incorrectly learned the address of the CPU port which typically results
in a complete break down of network connectivity until the address
learned ages out and gets re-learned, from the correct port this time.
There was no control of the BR_LEARNING flag until upstream commit
4098ced4680a485c5953f60ac63dff19f3fb3d42 ("Merge branch 'brport-flags'")
which is why we default to enabling learning when the ports gets added
as a bridge member.
Fixes: 967dd82ffc52 ("net: dsa: b53: Add support for Broadcom RoboSwitch")
Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>
---
drivers/net/dsa/b53/b53_common.c | 18 ++++++++++++++++++
drivers/net/dsa/b53/b53_regs.h | 1 +
drivers/net/dsa/bcm_sf2.c | 5 -----
3 files changed, 19 insertions(+), 5 deletions(-)
@@ -172,11 +172,6 @@ static int bcm_sf2_port_setup(struct dsa_switch *ds, int port,reg&=~P_TXQ_PSM_VDD(port);core_writel(priv,reg,CORE_MEM_PSM_VDD_CTRL);-/* Enable learning */-reg=core_readl(priv,CORE_DIS_LEARN);-reg&=~BIT(port);-core_writel(priv,reg,CORE_DIS_LEARN);-/* Enable Broadcom tags for that port if requested */if(priv->brcm_tag_mask&BIT(port))b53_brcm_hdr_setup(ds,port);
Standalone ports should not have learning enabled since all the frames
are always copied to the CPU port. This is particularly important in
case an user-facing port intentionally spoofs the CPU port's MAC
address. With learning enabled we would end up with the switch having
incorrectly learned the address of the CPU port which typically results
in a complete break down of network connectivity until the address
learned ages out and gets re-learned, from the correct port this time.
There was no control of the BR_LEARNING flag until upstream commit
4098ced4680a485c5953f60ac63dff19f3fb3d42 ("Merge branch 'brport-flags'")
which is why we default to enabling learning when the ports gets added
as a bridge member.
Fixes: 967dd82ffc52 ("net: dsa: b53: Add support for Broadcom RoboSwitch")
Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>
---
drivers/net/dsa/b53/b53_common.c | 18 ++++++++++++++++++
drivers/net/dsa/b53/b53_regs.h | 1 +
drivers/net/dsa/bcm_sf2.c | 15 +--------------
3 files changed, 20 insertions(+), 14 deletions(-)
@@ -172,23 +172,10 @@ static int bcm_sf2_port_setup(struct dsa_switch *ds, int port,reg&=~P_TXQ_PSM_VDD(port);core_writel(priv,reg,CORE_MEM_PSM_VDD_CTRL);-/* Enable learning */-reg=core_readl(priv,CORE_DIS_LEARN);-reg&=~BIT(port);-core_writel(priv,reg,CORE_DIS_LEARN);-/* Enable Broadcom tags for that port if requested */-if(priv->brcm_tag_mask&BIT(port)){+if(priv->brcm_tag_mask&BIT(port))b53_brcm_hdr_setup(ds,port);-/* Disable learning on ASP port */-if(port==7){-reg=core_readl(priv,CORE_DIS_LEARN);-reg|=BIT(port);-core_writel(priv,reg,CORE_DIS_LEARN);-}-}-/* Configure Traffic Class to QoS mapping, allow each priority to map*toadifferentqueuenumber*/
Standalone ports should not have learning enabled since all the frames
are always copied to the CPU port. This is particularly important in
case an user-facing port intentionally spoofs the CPU port's MAC
address. With learning enabled we would end up with the switch having
incorrectly learned the address of the CPU port which typically results
in a complete break down of network connectivity until the address
learned ages out and gets re-learned, from the correct port this time.
There was no control of the BR_LEARNING flag until upstream commit
4098ced4680a485c5953f60ac63dff19f3fb3d42 ("Merge branch 'brport-flags'")
which is why we default to enabling learning when the ports gets added
as a bridge member.
Fixes: 967dd82ffc52 ("net: dsa: b53: Add support for Broadcom RoboSwitch")
Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>
---
drivers/net/dsa/b53/b53_common.c | 18 ++++++++++++++++++
drivers/net/dsa/b53/b53_regs.h | 1 +
drivers/net/dsa/bcm_sf2.c | 15 +--------------
3 files changed, 20 insertions(+), 14 deletions(-)
@@ -172,23 +172,10 @@ static int bcm_sf2_port_setup(struct dsa_switch *ds, int port,reg&=~P_TXQ_PSM_VDD(port);core_writel(priv,reg,CORE_MEM_PSM_VDD_CTRL);-/* Enable learning */-reg=core_readl(priv,CORE_DIS_LEARN);-reg&=~BIT(port);-core_writel(priv,reg,CORE_DIS_LEARN);-/* Enable Broadcom tags for that port if requested */-if(priv->brcm_tag_mask&BIT(port)){+if(priv->brcm_tag_mask&BIT(port))b53_brcm_hdr_setup(ds,port);-/* Disable learning on ASP port */-if(port==7){-reg=core_readl(priv,CORE_DIS_LEARN);-reg|=BIT(port);-core_writel(priv,reg,CORE_DIS_LEARN);-}-}-/* Configure Traffic Class to QoS mapping, allow each priority to map*toadifferentqueuenumber*/
Standalone ports should not have learning enabled since all the frames
are always copied to the CPU port. This is particularly important in
case an user-facing port intentionally spoofs the CPU port's MAC
address. With learning enabled we would end up with the switch having
incorrectly learned the address of the CPU port which typically results
in a complete break down of network connectivity until the address
learned ages out and gets re-learned, from the correct port this time.
There was no control of the BR_LEARNING flag until upstream commit
4098ced4680a485c5953f60ac63dff19f3fb3d42 ("Merge branch 'brport-flags'")
which is why we default to enabling learning when the ports gets added
as a bridge member.
Fixes: 967dd82ffc52 ("net: dsa: b53: Add support for Broadcom RoboSwitch")
Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>
---
drivers/net/dsa/b53/b53_common.c | 18 ++++++++++++++++++
drivers/net/dsa/b53/b53_regs.h | 1 +
drivers/net/dsa/bcm_sf2.c | 15 +--------------
3 files changed, 20 insertions(+), 14 deletions(-)
@@ -222,23 +222,10 @@ static int bcm_sf2_port_setup(struct dsa_switch *ds, int port,reg&=~P_TXQ_PSM_VDD(port);core_writel(priv,reg,CORE_MEM_PSM_VDD_CTRL);-/* Enable learning */-reg=core_readl(priv,CORE_DIS_LEARN);-reg&=~BIT(port);-core_writel(priv,reg,CORE_DIS_LEARN);-/* Enable Broadcom tags for that port if requested */-if(priv->brcm_tag_mask&BIT(port)){+if(priv->brcm_tag_mask&BIT(port))b53_brcm_hdr_setup(ds,port);-/* Disable learning on ASP port */-if(port==7){-reg=core_readl(priv,CORE_DIS_LEARN);-reg|=BIT(port);-core_writel(priv,reg,CORE_DIS_LEARN);-}-}-/* Configure Traffic Class to QoS mapping, allow each priority to map*toadifferentqueuenumber*/
Standalone ports should not have learning enabled since all the frames
are always copied to the CPU port. This is particularly important in
case an user-facing port intentionally spoofs the CPU port's MAC
address. With learning enabled we would end up with the switch having
incorrectly learned the address of the CPU port which typically results
in a complete break down of network connectivity until the address
learned ages out and gets re-learned, from the correct port this time.
There was no control of the BR_LEARNING flag until upstream commit
4098ced4680a485c5953f60ac63dff19f3fb3d42 ("Merge branch 'brport-flags'")
which is why we default to enabling learning when the ports gets added
as a bridge member.
Fixes: 967dd82ffc52 ("net: dsa: b53: Add support for Broadcom RoboSwitch")
Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>
---
drivers/net/dsa/b53/b53_common.c | 18 ++++++++++++++++++
drivers/net/dsa/b53/b53_regs.h | 1 +
drivers/net/dsa/bcm_sf2.c | 15 +--------------
3 files changed, 20 insertions(+), 14 deletions(-)
@@ -222,23 +222,10 @@ static int bcm_sf2_port_setup(struct dsa_switch *ds, int port,reg&=~P_TXQ_PSM_VDD(port);core_writel(priv,reg,CORE_MEM_PSM_VDD_CTRL);-/* Enable learning */-reg=core_readl(priv,CORE_DIS_LEARN);-reg&=~BIT(port);-core_writel(priv,reg,CORE_DIS_LEARN);-/* Enable Broadcom tags for that port if requested */-if(priv->brcm_tag_mask&BIT(port)){+if(priv->brcm_tag_mask&BIT(port))b53_brcm_hdr_setup(ds,port);-/* Disable learning on ASP port */-if(port==7){-reg=core_readl(priv,CORE_DIS_LEARN);-reg|=BIT(port);-core_writel(priv,reg,CORE_DIS_LEARN);-}-}-/* Configure Traffic Class to QoS mapping, allow each priority to map*toadifferentqueuenumber*/
On Wed, Feb 24, 2021 at 05:08:53PM -0800, Florian Fainelli wrote:
From: Florian Fainelli <florian.fainelli@broadcom.com>
Hi Greg, Sasha, Jaakub and David,
This patch series contains backports for a change that recently made it
upstream as:
commit f3f9be9c58085d11f4448ec199bf49dc2f9b7fb9
Merge: 18755e270666 f9b3827ee66c
Author: Jakub Kicinski [off-list ref]
Date: Tue Feb 23 12:23:06 2021 -0800
Merge branch 'net-dsa-learning-fixes-for-b53-bcm_sf2'
That is a merge commit, not a "real" commit.
What is the upstream git commit id for this?
The way this was fixed in the netdev group's net tree is slightly
different from how it should be backported to stable trees which is why
you will find a patch for each branch in the thread started by this
cover letter.
Let me know if this does not apply for some reason. The changes from 4.9
through 4.19 are nearly identical and then from 5.4 through 5.11 are
about the same.
Thanks for the backports, but I still need a real git id to match these
up with :)
greg k-h
On Wed, Feb 24, 2021 at 05:09:54PM -0800, Florian Fainelli wrote:
Standalone ports should not have learning enabled since all the frames
are always copied to the CPU port. This is particularly important in
case an user-facing port intentionally spoofs the CPU port's MAC
address. With learning enabled we would end up with the switch having
incorrectly learned the address of the CPU port which typically results
in a complete break down of network connectivity until the address
learned ages out and gets re-learned, from the correct port this time.
There was no control of the BR_LEARNING flag until upstream commit
4098ced4680a485c5953f60ac63dff19f3fb3d42 ("Merge branch 'brport-flags'")
which is why we default to enabling learning when the ports gets added
as a bridge member.
Fixes: 967dd82ffc52 ("net: dsa: b53: Add support for Broadcom RoboSwitch")
Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>
---
drivers/net/dsa/b53/b53_common.c | 18 ++++++++++++++++++
drivers/net/dsa/b53/b53_regs.h | 1 +
drivers/net/dsa/bcm_sf2.c | 15 +--------------
3 files changed, 20 insertions(+), 14 deletions(-)
Note, 5.9.y and 5.8.y are long end-of-life. You can see that at the
front page of www.kernel.org if you ever are curious about it.
thanks,
greg k-h
On Wed, Feb 24, 2021 at 05:08:53PM -0800, Florian Fainelli wrote:
quoted
From: Florian Fainelli <florian.fainelli@broadcom.com>
Hi Greg, Sasha, Jaakub and David,
This patch series contains backports for a change that recently made it
upstream as:
commit f3f9be9c58085d11f4448ec199bf49dc2f9b7fb9
Merge: 18755e270666 f9b3827ee66c
Author: Jakub Kicinski [off-list ref]
Date: Tue Feb 23 12:23:06 2021 -0800
Merge branch 'net-dsa-learning-fixes-for-b53-bcm_sf2'
That is a merge commit, not a "real" commit.
What is the upstream git commit id for this?
The commit upstream is f9b3827ee66cfcf297d0acd6ecf33653a5f297ef ("net:
dsa: b53: Support setting learning on port") it may still only be in
netdev-net/master at this point, though it will likely reach Linus' tree
soon.
quoted
The way this was fixed in the netdev group's net tree is slightly
different from how it should be backported to stable trees which is why
you will find a patch for each branch in the thread started by this
cover letter.
Let me know if this does not apply for some reason. The changes from 4.9
through 4.19 are nearly identical and then from 5.4 through 5.11 are
about the same.
Thanks for the backports, but I still need a real git id to match these
up with :)
You should have it in the Fixes: tag of each patch which all point to
when the bug dates back to when the driver was introduced. Let me know
if you need me to tag the patches differently.
Thank you!
--
Florian
On Thu, Feb 25, 2021 at 08:53:22AM -0800, Florian Fainelli wrote:
On 2/25/2021 12:15 AM, Greg KH wrote:
quoted
On Wed, Feb 24, 2021 at 05:08:53PM -0800, Florian Fainelli wrote:
quoted
From: Florian Fainelli <florian.fainelli@broadcom.com>
Hi Greg, Sasha, Jaakub and David,
This patch series contains backports for a change that recently made it
upstream as:
commit f3f9be9c58085d11f4448ec199bf49dc2f9b7fb9
Merge: 18755e270666 f9b3827ee66c
Author: Jakub Kicinski [off-list ref]
Date: Tue Feb 23 12:23:06 2021 -0800
Merge branch 'net-dsa-learning-fixes-for-b53-bcm_sf2'
That is a merge commit, not a "real" commit.
What is the upstream git commit id for this?
The commit upstream is f9b3827ee66cfcf297d0acd6ecf33653a5f297ef ("net:
dsa: b53: Support setting learning on port") it may still only be in
netdev-net/master at this point, though it will likely reach Linus' tree
soon.
Ah, I can't do anything with them until that hits Linus's tree, you know
this :)
quoted
quoted
The way this was fixed in the netdev group's net tree is slightly
different from how it should be backported to stable trees which is why
you will find a patch for each branch in the thread started by this
cover letter.
Let me know if this does not apply for some reason. The changes from 4.9
through 4.19 are nearly identical and then from 5.4 through 5.11 are
about the same.
Thanks for the backports, but I still need a real git id to match these
up with :)
You should have it in the Fixes: tag of each patch which all point to
when the bug dates back to when the driver was introduced. Let me know
if you need me to tag the patches differently.
The fixes: tag shows what id this patch fixes, not the git id of this
specific patch, like all stable patches show in their changelog text.
That's the id I need. I'll just wait until this hits Linus's tree
before worrying about it.
thanks,
greg k-h
On Thu, Feb 25, 2021 at 08:53:22AM -0800, Florian Fainelli wrote:
quoted
On 2/25/2021 12:15 AM, Greg KH wrote:
quoted
On Wed, Feb 24, 2021 at 05:08:53PM -0800, Florian Fainelli wrote:
quoted
From: Florian Fainelli <florian.fainelli@broadcom.com>
Hi Greg, Sasha, Jaakub and David,
This patch series contains backports for a change that recently made it
upstream as:
commit f3f9be9c58085d11f4448ec199bf49dc2f9b7fb9
Merge: 18755e270666 f9b3827ee66c
Author: Jakub Kicinski [off-list ref]
Date: Tue Feb 23 12:23:06 2021 -0800
Merge branch 'net-dsa-learning-fixes-for-b53-bcm_sf2'
That is a merge commit, not a "real" commit.
What is the upstream git commit id for this?
The commit upstream is f9b3827ee66cfcf297d0acd6ecf33653a5f297ef ("net:
dsa: b53: Support setting learning on port") it may still only be in
netdev-net/master at this point, though it will likely reach Linus' tree
soon.
Ah, I can't do anything with them until that hits Linus's tree, you know
this :)
Yes, that was a tad too quick.
quoted
quoted
quoted
The way this was fixed in the netdev group's net tree is slightly
different from how it should be backported to stable trees which is why
you will find a patch for each branch in the thread started by this
cover letter.
Let me know if this does not apply for some reason. The changes from 4.9
through 4.19 are nearly identical and then from 5.4 through 5.11 are
about the same.
Thanks for the backports, but I still need a real git id to match these
up with :)
You should have it in the Fixes: tag of each patch which all point to
when the bug dates back to when the driver was introduced. Let me know
if you need me to tag the patches differently.
The fixes: tag shows what id this patch fixes, not the git id of this
specific patch, like all stable patches show in their changelog text.
That's the id I need. I'll just wait until this hits Linus's tree
before worrying about it.
Looks like I found an issue that will need fixing in netdev-net/master
as well, so I will resubmit in due time when the commits reach Linus'
tree. Sorry for the noise.
--
Florian