linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v3 net] mv88e6060: disable hardware level MAC learning
@ 2018-11-30 23:58 Anderson Luiz Alves
  2018-12-01 15:39 ` Andrew Lunn
                   ` (2 more replies)
  0 siblings, 3 replies; 5+ messages in thread
From: Anderson Luiz Alves @ 2018-11-30 23:58 UTC (permalink / raw)
  To: andrew, vivien.didelot, f.fainelli, davem, netdev, linux-kernel
  Cc: Anderson Luiz Alves

Disable hardware level MAC learning because it breaks station roaming.
When enabled it drops all frames that arrive from a MAC address
that is on a different port at learning table.

Signed-off-by: Anderson Luiz Alves <alacn1@gmail.com>
---

Notes:
    v2: Updated code comments.
    v3: Sent with correct whitespaces.

 drivers/net/dsa/mv88e6060.c | 10 +++-------
 1 file changed, 3 insertions(+), 7 deletions(-)

diff --git a/drivers/net/dsa/mv88e6060.c b/drivers/net/dsa/mv88e6060.c
index 65f10fec2..0b3e51f24 100644
--- a/drivers/net/dsa/mv88e6060.c
+++ b/drivers/net/dsa/mv88e6060.c
@@ -116,8 +116,7 @@ static int mv88e6060_switch_reset(struct dsa_switch *ds)
 	/* Reset the switch. */
 	REG_WRITE(REG_GLOBAL, GLOBAL_ATU_CONTROL,
 		  GLOBAL_ATU_CONTROL_SWRESET |
-		  GLOBAL_ATU_CONTROL_ATUSIZE_1024 |
-		  GLOBAL_ATU_CONTROL_ATE_AGE_5MIN);
+		  GLOBAL_ATU_CONTROL_LEARNDIS);
 
 	/* Wait up to one second for reset to complete. */
 	timeout = jiffies + 1 * HZ;
@@ -142,13 +141,10 @@ static int mv88e6060_setup_global(struct dsa_switch *ds)
 	 */
 	REG_WRITE(REG_GLOBAL, GLOBAL_CONTROL, GLOBAL_CONTROL_MAX_FRAME_1536);
 
-	/* Enable automatic address learning, set the address
-	 * database size to 1024 entries, and set the default aging
-	 * time to 5 minutes.
+	/* Disable automatic address learning.
 	 */
 	REG_WRITE(REG_GLOBAL, GLOBAL_ATU_CONTROL,
-		  GLOBAL_ATU_CONTROL_ATUSIZE_1024 |
-		  GLOBAL_ATU_CONTROL_ATE_AGE_5MIN);
+		  GLOBAL_ATU_CONTROL_LEARNDIS);
 
 	return 0;
 }
-- 
2.17.1


^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [PATCH v3 net] mv88e6060: disable hardware level MAC learning
  2018-11-30 23:58 [PATCH v3 net] mv88e6060: disable hardware level MAC learning Anderson Luiz Alves
@ 2018-12-01 15:39 ` Andrew Lunn
  2018-12-04  0:04 ` David Miller
  2018-12-28  8:22 ` Pavel Machek
  2 siblings, 0 replies; 5+ messages in thread
From: Andrew Lunn @ 2018-12-01 15:39 UTC (permalink / raw)
  To: Anderson Luiz Alves
  Cc: vivien.didelot, f.fainelli, davem, netdev, linux-kernel

On Fri, Nov 30, 2018 at 09:58:36PM -0200, Anderson Luiz Alves wrote:
> Disable hardware level MAC learning because it breaks station roaming.
> When enabled it drops all frames that arrive from a MAC address
> that is on a different port at learning table.
> 
> Signed-off-by: Anderson Luiz Alves <alacn1@gmail.com>

Reviewed-by: Andrew Lunn <andrew@lunn.ch>

Hi Anderson

One more process thing. You should add any Reviewed-by, Acked-by tags
you get when posting a new version. However, there is no need for a v4
for just this.

    Andrew

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH v3 net] mv88e6060: disable hardware level MAC learning
  2018-11-30 23:58 [PATCH v3 net] mv88e6060: disable hardware level MAC learning Anderson Luiz Alves
  2018-12-01 15:39 ` Andrew Lunn
@ 2018-12-04  0:04 ` David Miller
  2018-12-28  8:22 ` Pavel Machek
  2 siblings, 0 replies; 5+ messages in thread
From: David Miller @ 2018-12-04  0:04 UTC (permalink / raw)
  To: alacn1; +Cc: andrew, vivien.didelot, f.fainelli, netdev, linux-kernel

From: Anderson Luiz Alves <alacn1@gmail.com>
Date: Fri, 30 Nov 2018 21:58:36 -0200

> Disable hardware level MAC learning because it breaks station roaming.
> When enabled it drops all frames that arrive from a MAC address
> that is on a different port at learning table.
> 
> Signed-off-by: Anderson Luiz Alves <alacn1@gmail.com>
> ---
> 
> Notes:
>     v2: Updated code comments.
>     v3: Sent with correct whitespaces.

Applied, thanks.

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH v3 net] mv88e6060: disable hardware level MAC learning
  2018-11-30 23:58 [PATCH v3 net] mv88e6060: disable hardware level MAC learning Anderson Luiz Alves
  2018-12-01 15:39 ` Andrew Lunn
  2018-12-04  0:04 ` David Miller
@ 2018-12-28  8:22 ` Pavel Machek
  2018-12-28  9:06   ` Andrew Lunn
  2 siblings, 1 reply; 5+ messages in thread
From: Pavel Machek @ 2018-12-28  8:22 UTC (permalink / raw)
  To: Anderson Luiz Alves
  Cc: andrew, vivien.didelot, f.fainelli, davem, netdev, linux-kernel

[-- Attachment #1: Type: text/plain, Size: 2064 bytes --]

On Fri 2018-11-30 21:58:36, Anderson Luiz Alves wrote:
> Disable hardware level MAC learning because it breaks station roaming.
> When enabled it drops all frames that arrive from a MAC address
> that is on a different port at learning table.
> 
> Signed-off-by: Anderson Luiz Alves <alacn1@gmail.com>

Will not this effectively disable the hardware switching leading to
serious performance implications?

AFAICT the e6060 driver does not support ATU access from the kernel,
so we'll fall back to "all software" bridging....

								Pavel
> ---
> 
> Notes:
>     v2: Updated code comments.
>     v3: Sent with correct whitespaces.
> 
>  drivers/net/dsa/mv88e6060.c | 10 +++-------
>  1 file changed, 3 insertions(+), 7 deletions(-)
> 
> diff --git a/drivers/net/dsa/mv88e6060.c b/drivers/net/dsa/mv88e6060.c
> index 65f10fec2..0b3e51f24 100644
> --- a/drivers/net/dsa/mv88e6060.c
> +++ b/drivers/net/dsa/mv88e6060.c
> @@ -116,8 +116,7 @@ static int mv88e6060_switch_reset(struct dsa_switch *ds)
>  	/* Reset the switch. */
>  	REG_WRITE(REG_GLOBAL, GLOBAL_ATU_CONTROL,
>  		  GLOBAL_ATU_CONTROL_SWRESET |
> -		  GLOBAL_ATU_CONTROL_ATUSIZE_1024 |
> -		  GLOBAL_ATU_CONTROL_ATE_AGE_5MIN);
> +		  GLOBAL_ATU_CONTROL_LEARNDIS);
>  
>  	/* Wait up to one second for reset to complete. */
>  	timeout = jiffies + 1 * HZ;
> @@ -142,13 +141,10 @@ static int mv88e6060_setup_global(struct dsa_switch *ds)
>  	 */
>  	REG_WRITE(REG_GLOBAL, GLOBAL_CONTROL, GLOBAL_CONTROL_MAX_FRAME_1536);
>  
> -	/* Enable automatic address learning, set the address
> -	 * database size to 1024 entries, and set the default aging
> -	 * time to 5 minutes.
> +	/* Disable automatic address learning.
>  	 */
>  	REG_WRITE(REG_GLOBAL, GLOBAL_ATU_CONTROL,
> -		  GLOBAL_ATU_CONTROL_ATUSIZE_1024 |
> -		  GLOBAL_ATU_CONTROL_ATE_AGE_5MIN);
> +		  GLOBAL_ATU_CONTROL_LEARNDIS);
>  
>  	return 0;
>  }

-- 
(english) http://www.livejournal.com/~pavelmachek
(cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 181 bytes --]

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH v3 net] mv88e6060: disable hardware level MAC learning
  2018-12-28  8:22 ` Pavel Machek
@ 2018-12-28  9:06   ` Andrew Lunn
  0 siblings, 0 replies; 5+ messages in thread
From: Andrew Lunn @ 2018-12-28  9:06 UTC (permalink / raw)
  To: Pavel Machek
  Cc: Anderson Luiz Alves, vivien.didelot, f.fainelli, davem, netdev,
	linux-kernel

On Fri, Dec 28, 2018 at 09:22:55AM +0100, Pavel Machek wrote:
> On Fri 2018-11-30 21:58:36, Anderson Luiz Alves wrote:
> > Disable hardware level MAC learning because it breaks station roaming.
> > When enabled it drops all frames that arrive from a MAC address
> > that is on a different port at learning table.
> > 
> > Signed-off-by: Anderson Luiz Alves <alacn1@gmail.com>
> 
> Will not this effectively disable the hardware switching leading to
> serious performance implications?

Hi Pavel

This switch is not doing hardware switching to start with. See
mv88e6060_setup_port():

        /* Port based VLAN map: give each port its own address
         * database, allow the CPU port to talk to each of the 'real'
         * ports, and allow each of the 'real' ports to only talk to
         * the CPU port.
         */
        REG_WRITE(addr, PORT_VLAN_MAP,
                  ((p & 0xf) << PORT_VLAN_MAP_DBNUM_SHIFT) |
                   (dsa_is_cpu_port(ds, p) ? dsa_user_ports(ds) :
                    BIT(dsa_to_port(ds, p)->cpu_dp->index)));

        /* Port Association Vector: when learning source addresses
         * of packets, add the address to the address database using
         * a port bitmap that has only the bit for this port set and
         * the other bits clear.
         */
        REG_WRITE(addr, PORT_ASSOC_VECTOR, BIT(p));


This is a very old driver, added way before offload support was added.

     Andrew

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2018-12-28  9:06 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-11-30 23:58 [PATCH v3 net] mv88e6060: disable hardware level MAC learning Anderson Luiz Alves
2018-12-01 15:39 ` Andrew Lunn
2018-12-04  0:04 ` David Miller
2018-12-28  8:22 ` Pavel Machek
2018-12-28  9:06   ` Andrew Lunn

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).