All of lore.kernel.org
 help / color / mirror / Atom feed
* [net PATCH 1/1] drivers: net: cpsw: fix dual EMAC stall when connected to same switch
@ 2014-06-18 11:51 Mugunthan V N
  2014-06-18 13:01 ` Yegor Yefremov
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Mugunthan V N @ 2014-06-18 11:51 UTC (permalink / raw)
  To: netdev; +Cc: davem, Mugunthan V N, Yegor Yefremov, Felipe Balbi

In commit 629c9a8fd0bbdfc6d702526b327470166ec39c6b (drivers: net: cpsw: Add
default vlan for dual emac case also), api cpsw_add_default_vlan() also
changes the port vlan which is required to seperate the ports which results
in the following behavior

In Dual EMAC mode, when both the Etnernet connected is connected to same
switch, it creates a loop in the switch and when a broadcast packet is
received it is forwarded to the other port which stalls the whole switch
and needs a reset/power cycle to the switch to recover. So intead of using
the api, add only the default VLAN entry in dual EMAC case.

Cc: Yegor Yefremov <yegorslists@googlemail.com>
Cc: Felipe Balbi <balbi@ti.com>
Signed-off-by: Mugunthan V N <mugunthanvnm@ti.com>
---
 drivers/net/ethernet/ti/cpsw.c | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/drivers/net/ethernet/ti/cpsw.c b/drivers/net/ethernet/ti/cpsw.c
index ff380da..b988d16 100644
--- a/drivers/net/ethernet/ti/cpsw.c
+++ b/drivers/net/ethernet/ti/cpsw.c
@@ -1212,7 +1212,12 @@ static int cpsw_ndo_open(struct net_device *ndev)
 	for_each_slave(priv, cpsw_slave_open, priv);
 
 	/* Add default VLAN */
-	cpsw_add_default_vlan(priv);
+	if (!priv->data.dual_emac)
+		cpsw_add_default_vlan(priv);
+	else
+		cpsw_ale_add_vlan(priv->ale, priv->data.default_vlan,
+				  ALE_ALL_PORTS << priv->host_port,
+				  ALE_ALL_PORTS << priv->host_port, 0, 0);
 
 	if (!cpsw_common_res_usage_state(priv)) {
 		/* setup tx dma to fixed prio and zero offset */
-- 
1.9.2.459.g68773ac

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

* Re: [net PATCH 1/1] drivers: net: cpsw: fix dual EMAC stall when connected to same switch
  2014-06-18 11:51 [net PATCH 1/1] drivers: net: cpsw: fix dual EMAC stall when connected to same switch Mugunthan V N
@ 2014-06-18 13:01 ` Yegor Yefremov
  2014-06-18 14:52 ` Felipe Balbi
  2014-06-22  0:18 ` David Miller
  2 siblings, 0 replies; 4+ messages in thread
From: Yegor Yefremov @ 2014-06-18 13:01 UTC (permalink / raw)
  To: Mugunthan V N
  Cc: netdev, David Miller, Felipe Balbi, Sebastian Andrzej Siewior

On Wed, Jun 18, 2014 at 1:51 PM, Mugunthan V N <mugunthanvnm@ti.com> wrote:
> In commit 629c9a8fd0bbdfc6d702526b327470166ec39c6b (drivers: net: cpsw: Add
> default vlan for dual emac case also), api cpsw_add_default_vlan() also
> changes the port vlan which is required to seperate the ports which results
> in the following behavior
>
> In Dual EMAC mode, when both the Etnernet connected is connected to same
> switch, it creates a loop in the switch and when a broadcast packet is
> received it is forwarded to the other port which stalls the whole switch
> and needs a reset/power cycle to the switch to recover. So intead of using
> the api, add only the default VLAN entry in dual EMAC case.
>
> Cc: Yegor Yefremov <yegorslists@googlemail.com>
> Cc: Felipe Balbi <balbi@ti.com>
> Signed-off-by: Mugunthan V N <mugunthanvnm@ti.com>
> ---

Thanks a lot. I have two interfaces connected to the same switch with
different subnets and everything is working.

Tested-by: Yegor Yefremov <yegorslists@googlemail.com>

Regards,
Yegor

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

* Re: [net PATCH 1/1] drivers: net: cpsw: fix dual EMAC stall when connected to same switch
  2014-06-18 11:51 [net PATCH 1/1] drivers: net: cpsw: fix dual EMAC stall when connected to same switch Mugunthan V N
  2014-06-18 13:01 ` Yegor Yefremov
@ 2014-06-18 14:52 ` Felipe Balbi
  2014-06-22  0:18 ` David Miller
  2 siblings, 0 replies; 4+ messages in thread
From: Felipe Balbi @ 2014-06-18 14:52 UTC (permalink / raw)
  To: Mugunthan V N; +Cc: netdev, davem, Yegor Yefremov, Felipe Balbi

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

On Wed, Jun 18, 2014 at 05:21:48PM +0530, Mugunthan V N wrote:
> In commit 629c9a8fd0bbdfc6d702526b327470166ec39c6b (drivers: net: cpsw: Add
> default vlan for dual emac case also), api cpsw_add_default_vlan() also
> changes the port vlan which is required to seperate the ports which results
> in the following behavior
> 
> In Dual EMAC mode, when both the Etnernet connected is connected to same
> switch, it creates a loop in the switch and when a broadcast packet is
> received it is forwarded to the other port which stalls the whole switch
> and needs a reset/power cycle to the switch to recover. So intead of using
> the api, add only the default VLAN entry in dual EMAC case.
> 
> Cc: Yegor Yefremov <yegorslists@googlemail.com>
> Cc: Felipe Balbi <balbi@ti.com>

Tested yesterday on top of next-20140617

Tested-by: Felipe Balbi <balbi@ti.com>

> Signed-off-by: Mugunthan V N <mugunthanvnm@ti.com>
> ---
>  drivers/net/ethernet/ti/cpsw.c | 7 ++++++-
>  1 file changed, 6 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/net/ethernet/ti/cpsw.c b/drivers/net/ethernet/ti/cpsw.c
> index ff380da..b988d16 100644
> --- a/drivers/net/ethernet/ti/cpsw.c
> +++ b/drivers/net/ethernet/ti/cpsw.c
> @@ -1212,7 +1212,12 @@ static int cpsw_ndo_open(struct net_device *ndev)
>  	for_each_slave(priv, cpsw_slave_open, priv);
>  
>  	/* Add default VLAN */
> -	cpsw_add_default_vlan(priv);
> +	if (!priv->data.dual_emac)
> +		cpsw_add_default_vlan(priv);
> +	else
> +		cpsw_ale_add_vlan(priv->ale, priv->data.default_vlan,
> +				  ALE_ALL_PORTS << priv->host_port,
> +				  ALE_ALL_PORTS << priv->host_port, 0, 0);
>  
>  	if (!cpsw_common_res_usage_state(priv)) {
>  		/* setup tx dma to fixed prio and zero offset */
> -- 
> 1.9.2.459.g68773ac
> 

-- 
balbi

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

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

* Re: [net PATCH 1/1] drivers: net: cpsw: fix dual EMAC stall when connected to same switch
  2014-06-18 11:51 [net PATCH 1/1] drivers: net: cpsw: fix dual EMAC stall when connected to same switch Mugunthan V N
  2014-06-18 13:01 ` Yegor Yefremov
  2014-06-18 14:52 ` Felipe Balbi
@ 2014-06-22  0:18 ` David Miller
  2 siblings, 0 replies; 4+ messages in thread
From: David Miller @ 2014-06-22  0:18 UTC (permalink / raw)
  To: mugunthanvnm; +Cc: netdev, yegorslists, balbi

From: Mugunthan V N <mugunthanvnm@ti.com>
Date: Wed, 18 Jun 2014 17:21:48 +0530

> In commit 629c9a8fd0bbdfc6d702526b327470166ec39c6b (drivers: net: cpsw: Add
> default vlan for dual emac case also), api cpsw_add_default_vlan() also
> changes the port vlan which is required to seperate the ports which results
> in the following behavior
> 
> In Dual EMAC mode, when both the Etnernet connected is connected to same
> switch, it creates a loop in the switch and when a broadcast packet is
> received it is forwarded to the other port which stalls the whole switch
> and needs a reset/power cycle to the switch to recover. So intead of using
> the api, add only the default VLAN entry in dual EMAC case.
> 
> Cc: Yegor Yefremov <yegorslists@googlemail.com>
> Cc: Felipe Balbi <balbi@ti.com>
> Signed-off-by: Mugunthan V N <mugunthanvnm@ti.com>

Applied and queued up for -stable, thanks.

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

end of thread, other threads:[~2014-06-22  0:18 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-06-18 11:51 [net PATCH 1/1] drivers: net: cpsw: fix dual EMAC stall when connected to same switch Mugunthan V N
2014-06-18 13:01 ` Yegor Yefremov
2014-06-18 14:52 ` Felipe Balbi
2014-06-22  0:18 ` David Miller

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.