gianfar: fix bug caused by 87c288c6e9aa31720b72e2bc2d665e24e1653c3e
Subsystems (2)
PATCH 1/1 gianfar: fix bug caused by 87c288c6e9aa31720b72e2bc2d665e24e1653c3e
commit 87c288c6e9aa31720b72e2bc2d665e24e1653c3e "gianfar: do vlan cleanup" has two issues:
# permutation of rx and tx flags # enabling vlan tag insertion by default (this leads to unusable connections on some configurations)
If VLAN insertion is requested (via ethtool) it will be set at an other point ...
---
drivers/net/gianfar.c | 6 +----- 1 files changed, 1 insertions(+), 5 deletions(-)
drivers/net/gianfar.c +1 -5
@@ -388,12 +388,8 @@ static void gfar_init_mac(struct net_device *ndev)if (priv->hwts_rx_en) rctrl |=RCTRL_PRSDEP_INIT |RCTRL_TS_ENABLE ; -/* keep vlan related bits if it's enabled */ -if (ndev->features &NETIF_F_HW_VLAN_TX ) - rctrl |=RCTRL_VLEX |RCTRL_PRSDEP_INIT ; -if (ndev->features &NETIF_F_HW_VLAN_RX ) - tctrl |=TCTRL_VLINS ; + rctrl |=RCTRL_VLEX |RCTRL_PRSDEP_INIT ;/* Init rctrl based on our settings */ gfar_write (®s->rctrl, rctrl);
Quoted 3 lines · Tue, Jul 26, 2011 at 12:03:13PM CEST, [email protected] wrote:
commit
87c288c6e9aa31720b72e2bc2d665e24e1653c3e"gianfar: do vlan cleanup" has two issues:# permutation of rx and tx flags # enabling vlan tag insertion by default (this leads to unusable connections on some configurations)
How so? What's causing that?
Quoted 19 lines
If VLAN insertion is requested (via ethtool) it will be set at an other point ...
Signed-off-by Sebastian Poehn <[email protected]>---
drivers/net/gianfar.c| 6 +-----1 files changed, 1 insertions(+), 5 deletions(-)drivers/net/gianfar.c +0
-0@@ -388,12 +388,8 @@ static void gfar_init_mac(struct net_device *ndev)if (priv->hwts_rx_en) rctrl |=RCTRL_PRSDEP_INIT |RCTRL_TS_ENABLE ;
drivers/net/gianfar.c static void gfar_init_mac(struct net_device *ndev) · line 395
Quoted 10 lines
drivers/net/gianfar.c +1
-5-/* keep vlan related bits if it's enabled */ -if (ndev->features &NETIF_F_HW_VLAN_TX ) - rctrl |=RCTRL_VLEX |RCTRL_PRSDEP_INIT ; -if (ndev->features &NETIF_F_HW_VLAN_RX ) - tctrl |=TCTRL_VLINS ; + rctrl |=RCTRL_VLEX |RCTRL_PRSDEP_INIT ;/* Init rctrl based on our settings */ gfar_write (®s->rctrl, rctrl);
If you really need that to be done, you should remove NETIF_F_HW_VLAN_TX from features (not hw_features) (never add it).
Am Dienstag, den 26.07.2011, 12:46 +0200 schrieb Jiri Pirko:
Quoted 6 lines
Quoted 3 lines · Tue, Jul 26, 2011 at 12:03:13PM CEST, [email protected] wrote:
commit
87c288c6e9aa31720b72e2bc2d665e24e1653c3e"gianfar: do vlan cleanup" has two issues:# permutation of rx and tx flags # enabling vlan tag insertion by default (this leads to unusable connections on some configurations)How so? What's causing that?
If you enable the VLINS bit of txctrl and do not alter the vlan tag configuration of the NIC, every packet will get a all zero vlan tag (0x8100 0000). If you run a network without vlan awareness all packets will be ignored.
In my configuration gianfar system <-> 3c59x system the 3com system discards all packets received with the vlan tag.
Quoted 26 lines
Quoted 26 lines
If VLAN insertion is requested (via ethtool) it will be set at an other point ...
Signed-off-by Sebastian Poehn <[email protected]>---
drivers/net/gianfar.c| 6 +-----1 files changed, 1 insertions(+), 5 deletions(-)drivers/net/gianfar.c +1
-5@@ -388,12 +388,8 @@ static void gfar_init_mac(struct net_device *ndev)if (priv->hwts_rx_en) rctrl |=RCTRL_PRSDEP_INIT |RCTRL_TS_ENABLE ; -/* keep vlan related bits if it's enabled */ -if (ndev->features &NETIF_F_HW_VLAN_TX ) - rctrl |=RCTRL_VLEX |RCTRL_PRSDEP_INIT ; -if (ndev->features &NETIF_F_HW_VLAN_RX ) - tctrl |=TCTRL_VLINS ; + rctrl |=RCTRL_VLEX |RCTRL_PRSDEP_INIT ;
Quoted 8 lines
drivers/net/gianfar.c static void gfar_init_mac(struct net_device *ndev) · line 395
Quoted 4 lines
drivers/net/gianfar.c +0
-0/* Init rctrl based on our settings */ gfar_write (®s->rctrl, rctrl);If you really need that to be done, you should remove
NETIF_F_HW_VLAN_TXfrom features (nothw_features) (never add it).
The only thing I did is to let the vlan insertion disabled by default. If someone wants it, it may be enabled via ethtool.
Quoted 11 lines · Tue, Jul 26, 2011 at 01:13:41PM CEST, [email protected] wrote:
Am Dienstag, den 26.07.2011, 12:46 +0200 schrieb Jiri Pirko:
Quoted 6 lines
Quoted 3 lines · Tue, Jul 26, 2011 at 12:03:13PM CEST, [email protected] wrote:
commit
87c288c6e9aa31720b72e2bc2d665e24e1653c3e"gianfar: do vlan cleanup" has two issues:# permutation of rx and tx flags # enabling vlan tag insertion by default (this leads to unusable connections on some configurations)How so? What's causing that?
If you enable the VLINS bit of txctrl and do not alter the vlan tag configuration of the NIC, every packet will get a all zero vlan tag (
0x81000000). If you run a network without vlan awareness all packets will be ignored.
Interesting hw... I would guess that if gfar_tx_vlan() is not called, no tag would be put there...
Quoted 41 lines
In my configuration gianfar system <-> 3c59x system the 3com system discards all packets received with the vlan tag.
Quoted 26 lines
Quoted 26 lines
If VLAN insertion is requested (via ethtool) it will be set at an other point ...
Signed-off-by Sebastian Poehn <[email protected]>---
drivers/net/gianfar.c| 6 +-----1 files changed, 1 insertions(+), 5 deletions(-)drivers/net/gianfar.c +1
-5@@ -388,12 +388,8 @@ static void gfar_init_mac(struct net_device *ndev)if (priv->hwts_rx_en) rctrl |=RCTRL_PRSDEP_INIT |RCTRL_TS_ENABLE ; -/* keep vlan related bits if it's enabled */ -if (ndev->features &NETIF_F_HW_VLAN_TX ) - rctrl |=RCTRL_VLEX |RCTRL_PRSDEP_INIT ; -if (ndev->features &NETIF_F_HW_VLAN_RX ) - tctrl |=TCTRL_VLINS ; + rctrl |=RCTRL_VLEX |RCTRL_PRSDEP_INIT ;Quoted 8 lines
drivers/net/gianfar.c static void gfar_init_mac(struct net_device *ndev) · line 395
Quoted 4 lines
drivers/net/gianfar.c +0
-0/* Init rctrl based on our settings */ gfar_write (®s->rctrl, rctrl);If you really need that to be done, you should remove
NETIF_F_HW_VLAN_TXfrom features (nothw_features) (never add it).The only thing I did is to let the vlan insertion disabled by default. If someone wants it, it may be enabled via ethtool.
Am Dienstag, den 26.07.2011, 14:04 +0200 schrieb Jiri Pirko:
Quoted 8 lines
Quoted 7 lines · Tue, Jul 26, 2011 at 01:13:41PM CEST, [email protected] wrote:
Am Dienstag, den 26.07.2011, 12:46 +0200 schrieb Jiri Pirko:
Quoted 6 lines
Quoted 3 lines · Tue, Jul 26, 2011 at 12:03:13PM CEST, [email protected] wrote:
commit
87c288c6e9aa31720b72e2bc2d665e24e1653c3e"gianfar: do vlan cleanup" has two issues:# permutation of rx and tx flags # enabling vlan tag insertion by default (this leads to unusable connections on some configurations)How so? What's causing that?
Quoted 8 lines
Quoted 4 lines
If you enable the VLINS bit of txctrl and do not alter the vlan tag configuration of the NIC, every packet will get a all zero vlan tag (
0x81000000). If you run a network without vlan awareness all packets will be ignored.Interesting hw... I would guess that if
gfar_tx_vlan()is not called, no tag would be put there...
The Freescale documentation says in detail:
if(FCB has valid VLAN field)
send packet with this one
else
send packet with default vlan tag
default vlan tag = dfvlan register = 0x8100 0000 by default
Quoted 42 lines
Quoted 42 lines
In my configuration gianfar system <-> 3c59x system the 3com system discards all packets received with the vlan tag.
Quoted 26 lines
Quoted 26 lines
If VLAN insertion is requested (via ethtool) it will be set at an other point ...
Signed-off-by Sebastian Poehn <[email protected]>---
drivers/net/gianfar.c| 6 +-----1 files changed, 1 insertions(+), 5 deletions(-)drivers/net/gianfar.c +1
-5@@ -388,12 +388,8 @@ static void gfar_init_mac(struct net_device *ndev)if (priv->hwts_rx_en) rctrl |=RCTRL_PRSDEP_INIT |RCTRL_TS_ENABLE ; -/* keep vlan related bits if it's enabled */ -if (ndev->features &NETIF_F_HW_VLAN_TX ) - rctrl |=RCTRL_VLEX |RCTRL_PRSDEP_INIT ; -if (ndev->features &NETIF_F_HW_VLAN_RX ) - tctrl |=TCTRL_VLINS ; + rctrl |=RCTRL_VLEX |RCTRL_PRSDEP_INIT ;Quoted 8 lines
drivers/net/gianfar.c static void gfar_init_mac(struct net_device *ndev) · line 395
Quoted 4 lines
drivers/net/gianfar.c +0
-0/* Init rctrl based on our settings */ gfar_write (®s->rctrl, rctrl);If you really need that to be done, you should remove
NETIF_F_HW_VLAN_TXfrom features (nothw_features) (never add it).The only thing I did is to let the vlan insertion disabled by default. If someone wants it, it may be enabled via ethtool.
From: "Sebastian Pöhn" <[email protected]>
Date: Tue, 26 Jul 2011 12:03:13 +0200
Quoted 7 lines
commit
87c288c6e9aa31720b72e2bc2d665e24e1653c3e"gianfar: do vlan cleanup" has two issues:# permutation of rx and tx flags # enabling vlan tag insertion by default (this leads to unusable connections on some configurations)If VLAN insertion is requested (via ethtool) it will be set at an other point ...
Signed-off-by Sebastian Poehn <[email protected]>
Applied.