linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] tg3: fix VLAN tagging regression
@ 2011-09-20 20:48 Kasper Pedersen
  2011-09-20 21:09 ` Matt Carlson
  2011-09-20 22:41 ` [PATCH v2] " Kasper Pedersen
  0 siblings, 2 replies; 8+ messages in thread
From: Kasper Pedersen @ 2011-09-20 20:48 UTC (permalink / raw)
  To: Matt Carlson, Michael Chan; +Cc: netdev, linux-kernel

commit 92cd3a17ce9c719abb4c28dee3438e0c641f8de4
    tg3: Simplify tx bd assignments

broke VLAN tagging on outbound packets.
It ifdef'ed BCM_KERNEL_SUPPORTS_8021Q, but this
is not set anywhere. So vlan never gets set, and
all packets are sent with vlan=0.

Change to use the CONFIG_VLAN_xxx defines instead.
Tested on BCM5721 rev 11.

Signed-off-by: Kasper Pedersen <kernel@kasperkp.dk>
---
 drivers/net/tg3.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/drivers/net/tg3.c b/drivers/net/tg3.c
index dc3fbf6..a00d21b 100644
--- a/drivers/net/tg3.c
+++ b/drivers/net/tg3.c
@@ -6234,7 +6234,7 @@ static netdev_tx_t tg3_start_xmit(struct sk_buff *skb, struct net_device *dev)
 		}
 	}
 
-#ifdef BCM_KERNEL_SUPPORTS_8021Q
+#if defined(CONFIG_VLAN_8021Q) || defined(CONFIG_VLAN_8021Q_MODULE)
 	if (vlan_tx_tag_present(skb)) {
 		base_flags |= TXD_FLAG_VLAN;
 		vlan = vlan_tx_tag_get(skb);


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

* Re: [PATCH] tg3: fix VLAN tagging regression
  2011-09-20 20:48 [PATCH] tg3: fix VLAN tagging regression Kasper Pedersen
@ 2011-09-20 21:09 ` Matt Carlson
  2011-09-20 21:27   ` Jesse Gross
  2011-09-20 22:41 ` [PATCH v2] " Kasper Pedersen
  1 sibling, 1 reply; 8+ messages in thread
From: Matt Carlson @ 2011-09-20 21:09 UTC (permalink / raw)
  To: Kasper Pedersen
  Cc: Matthew Carlson, Michael Chan, netdev@vger.kernel.org,
	linux-kernel@vger.kernel.org

On Tue, Sep 20, 2011 at 01:48:56PM -0700, Kasper Pedersen wrote:
> commit 92cd3a17ce9c719abb4c28dee3438e0c641f8de4
>     tg3: Simplify tx bd assignments
> 
> broke VLAN tagging on outbound packets.
> It ifdef'ed BCM_KERNEL_SUPPORTS_8021Q, but this
> is not set anywhere. So vlan never gets set, and
> all packets are sent with vlan=0.
> 
> Change to use the CONFIG_VLAN_xxx defines instead.
> Tested on BCM5721 rev 11.
> 
> Signed-off-by: Kasper Pedersen <kernel@kasperkp.dk>

Yes.  This is correct.

Acked-by: Matt Carlson <mcarlson@broadcom.com>

> ---
>  drivers/net/tg3.c |    2 +-
>  1 files changed, 1 insertions(+), 1 deletions(-)
> 
> diff --git a/drivers/net/tg3.c b/drivers/net/tg3.c
> index dc3fbf6..a00d21b 100644
> --- a/drivers/net/tg3.c
> +++ b/drivers/net/tg3.c
> @@ -6234,7 +6234,7 @@ static netdev_tx_t tg3_start_xmit(struct sk_buff *skb, struct net_device *dev)
>  		}
>  	}
>  
> -#ifdef BCM_KERNEL_SUPPORTS_8021Q
> +#if defined(CONFIG_VLAN_8021Q) || defined(CONFIG_VLAN_8021Q_MODULE)
>  	if (vlan_tx_tag_present(skb)) {
>  		base_flags |= TXD_FLAG_VLAN;
>  		vlan = vlan_tx_tag_get(skb);
> 
> 


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

* Re: [PATCH] tg3: fix VLAN tagging regression
  2011-09-20 21:09 ` Matt Carlson
@ 2011-09-20 21:27   ` Jesse Gross
  2011-09-20 21:57     ` Kasper Pedersen
  0 siblings, 1 reply; 8+ messages in thread
From: Jesse Gross @ 2011-09-20 21:27 UTC (permalink / raw)
  To: Matt Carlson
  Cc: Kasper Pedersen, Michael Chan, netdev@vger.kernel.org,
	linux-kernel@vger.kernel.org

On Tue, Sep 20, 2011 at 2:09 PM, Matt Carlson <mcarlson@broadcom.com> wrote:
> On Tue, Sep 20, 2011 at 01:48:56PM -0700, Kasper Pedersen wrote:
>> commit 92cd3a17ce9c719abb4c28dee3438e0c641f8de4
>>     tg3: Simplify tx bd assignments
>>
>> broke VLAN tagging on outbound packets.
>> It ifdef'ed BCM_KERNEL_SUPPORTS_8021Q, but this
>> is not set anywhere. So vlan never gets set, and
>> all packets are sent with vlan=0.
>>
>> Change to use the CONFIG_VLAN_xxx defines instead.
>> Tested on BCM5721 rev 11.
>>
>> Signed-off-by: Kasper Pedersen <kernel@kasperkp.dk>
>
> Yes.  This is correct.
>
> Acked-by: Matt Carlson <mcarlson@broadcom.com>

Actually, please don't do this.  Those config #define's refer to the
802.1q module that creates vlan devices only.  The rest of the network
stack has code for dealing with vlan packets that is not protected by
config guards, so there's no reason that drivers should be.  The
correct thing to do here is just drop the test altogether and
unconditionally include the code.

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

* Re: [PATCH] tg3: fix VLAN tagging regression
  2011-09-20 21:27   ` Jesse Gross
@ 2011-09-20 21:57     ` Kasper Pedersen
  2011-09-20 22:08       ` Eric Dumazet
  0 siblings, 1 reply; 8+ messages in thread
From: Kasper Pedersen @ 2011-09-20 21:57 UTC (permalink / raw)
  To: Jesse Gross
  Cc: Matt Carlson, Michael Chan, netdev@vger.kernel.org,
	linux-kernel@vger.kernel.org

On 09/20/2011 11:27 PM, Jesse Gross wrote:

> On Tue, Sep 20, 2011 at 2:09 PM, Matt Carlson <mcarlson@broadcom.com> wrote:
>> On Tue, Sep 20, 2011 at 01:48:56PM -0700, Kasper Pedersen wrote:
>>> commit 92cd3a17ce9c719abb4c28dee3438e0c641f8de4
>>>     tg3: Simplify tx bd assignments
>>>
>>> broke VLAN tagging on outbound packets.
>>> It ifdef'ed BCM_KERNEL_SUPPORTS_8021Q, but this
>>> is not set anywhere. So vlan never gets set, and
>>> all packets are sent with vlan=0.
>>>
>>> Change to use the CONFIG_VLAN_xxx defines instead.
>>> Tested on BCM5721 rev 11.
>>>
>>> Signed-off-by: Kasper Pedersen <kernel@kasperkp.dk>
>>
>> Yes.  This is correct.
>>
>> Acked-by: Matt Carlson <mcarlson@broadcom.com>
> 
> Actually, please don't do this.  Those config #define's refer to the
> 802.1q module that creates vlan devices only.  The rest of the network
> stack has code for dealing with vlan packets that is not protected by
> config guards, so there's no reason that drivers should be.  The
> correct thing to do here is just drop the test altogether and
> unconditionally include the code.
> 


currently testing, and will post a just-remove-ifdef in a few hours,
assuming it behaves as expected on a no-802.1q-module config.


tg3 has one more place where this is done, and it looks as if the code
in that location doesn't quite mesh with the comment.

/Kasper Pedersen

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

* Re: [PATCH] tg3: fix VLAN tagging regression
  2011-09-20 21:57     ` Kasper Pedersen
@ 2011-09-20 22:08       ` Eric Dumazet
  2011-09-20 22:11         ` Eric Dumazet
  0 siblings, 1 reply; 8+ messages in thread
From: Eric Dumazet @ 2011-09-20 22:08 UTC (permalink / raw)
  To: Kasper Pedersen
  Cc: Jesse Gross, Matt Carlson, Michael Chan, netdev@vger.kernel.org,
	linux-kernel@vger.kernel.org

Le mardi 20 septembre 2011 à 23:57 +0200, Kasper Pedersen a écrit :
> On 09/20/2011 11:27 PM, Jesse Gross wrote:
> 
> > On Tue, Sep 20, 2011 at 2:09 PM, Matt Carlson <mcarlson@broadcom.com> wrote:
> >> On Tue, Sep 20, 2011 at 01:48:56PM -0700, Kasper Pedersen wrote:
> >>> commit 92cd3a17ce9c719abb4c28dee3438e0c641f8de4
> >>>     tg3: Simplify tx bd assignments
> >>>
> >>> broke VLAN tagging on outbound packets.
> >>> It ifdef'ed BCM_KERNEL_SUPPORTS_8021Q, but this
> >>> is not set anywhere. So vlan never gets set, and
> >>> all packets are sent with vlan=0.
> >>>
> >>> Change to use the CONFIG_VLAN_xxx defines instead.
> >>> Tested on BCM5721 rev 11.
> >>>
> >>> Signed-off-by: Kasper Pedersen <kernel@kasperkp.dk>
> >>
> >> Yes.  This is correct.
> >>
> >> Acked-by: Matt Carlson <mcarlson@broadcom.com>
> > 
> > Actually, please don't do this.  Those config #define's refer to the
> > 802.1q module that creates vlan devices only.  The rest of the network
> > stack has code for dealing with vlan packets that is not protected by
> > config guards, so there's no reason that drivers should be.  The
> > correct thing to do here is just drop the test altogether and
> > unconditionally include the code.
> > 
> 
> 
> currently testing, and will post a just-remove-ifdef in a few hours,
> assuming it behaves as expected on a no-802.1q-module config.
> 
> 
> tg3 has one more place where this is done, and it looks as if the code
> in that location doesn't quite mesh with the comment.

Thanks for finding this bug, this hit me last day on a BCM5755M but I
had no time to investigate.



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

* Re: [PATCH] tg3: fix VLAN tagging regression
  2011-09-20 22:08       ` Eric Dumazet
@ 2011-09-20 22:11         ` Eric Dumazet
  0 siblings, 0 replies; 8+ messages in thread
From: Eric Dumazet @ 2011-09-20 22:11 UTC (permalink / raw)
  To: Kasper Pedersen
  Cc: Jesse Gross, Matt Carlson, Michael Chan, netdev@vger.kernel.org,
	linux-kernel@vger.kernel.org

Le mercredi 21 septembre 2011 à 00:08 +0200, Eric Dumazet a écrit :

> Thanks for finding this bug, this hit me last day on a BCM5755M but I
> had no time to investigate.
> 

I meant a BCM5715S, but its probably a generic bug anyway ;)





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

* [PATCH v2] tg3: fix VLAN tagging regression
  2011-09-20 20:48 [PATCH] tg3: fix VLAN tagging regression Kasper Pedersen
  2011-09-20 21:09 ` Matt Carlson
@ 2011-09-20 22:41 ` Kasper Pedersen
  2011-09-21  6:15   ` David Miller
  1 sibling, 1 reply; 8+ messages in thread
From: Kasper Pedersen @ 2011-09-20 22:41 UTC (permalink / raw)
  To: Matt Carlson, Michael Chan; +Cc: netdev, linux-kernel

commit 92cd3a17ce9c719abb4c28dee3438e0c641f8de4
    tg3: Simplify tx bd assignments

broke VLAN tagging on outbound packets.
It ifdef'ed BCM_KERNEL_SUPPORTS_8021Q, but this
is not set anywhere. So vlan never gets set, and
all packets are sent with vlan=0.

v2: We can just remove the test. vlan_tx_tag_present
is valid regardless of whether the 802.1q module
is built.

Tested on BCM5721 rev 11.

Signed-off-by: Kasper Pedersen <kernel@kasperkp.dk>
---
 drivers/net/tg3.c |    2 --
 1 files changed, 0 insertions(+), 2 deletions(-)

diff --git a/drivers/net/tg3.c b/drivers/net/tg3.c
index dc3fbf6..4a1374d 100644
--- a/drivers/net/tg3.c
+++ b/drivers/net/tg3.c
@@ -6234,12 +6234,10 @@ static netdev_tx_t tg3_start_xmit(struct sk_buff *skb, struct net_device *dev)
 		}
 	}
 
-#ifdef BCM_KERNEL_SUPPORTS_8021Q
 	if (vlan_tx_tag_present(skb)) {
 		base_flags |= TXD_FLAG_VLAN;
 		vlan = vlan_tx_tag_get(skb);
 	}
-#endif
 
 	if (tg3_flag(tp, USE_JUMBO_BDFLAG) &&
 	    !mss && skb->len > VLAN_ETH_FRAME_LEN)


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

* Re: [PATCH v2] tg3: fix VLAN tagging regression
  2011-09-20 22:41 ` [PATCH v2] " Kasper Pedersen
@ 2011-09-21  6:15   ` David Miller
  0 siblings, 0 replies; 8+ messages in thread
From: David Miller @ 2011-09-21  6:15 UTC (permalink / raw)
  To: kernel; +Cc: mcarlson, mchan, netdev, linux-kernel

From: Kasper Pedersen <kernel@kasperkp.dk>
Date: Wed, 21 Sep 2011 00:41:17 +0200

> commit 92cd3a17ce9c719abb4c28dee3438e0c641f8de4
>     tg3: Simplify tx bd assignments
> 
> broke VLAN tagging on outbound packets.
> It ifdef'ed BCM_KERNEL_SUPPORTS_8021Q, but this
> is not set anywhere. So vlan never gets set, and
> all packets are sent with vlan=0.
> 
> v2: We can just remove the test. vlan_tx_tag_present
> is valid regardless of whether the 802.1q module
> is built.
> 
> Tested on BCM5721 rev 11.
> 
> Signed-off-by: Kasper Pedersen <kernel@kasperkp.dk>

Applied.

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

end of thread, other threads:[~2011-09-21  6:17 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-09-20 20:48 [PATCH] tg3: fix VLAN tagging regression Kasper Pedersen
2011-09-20 21:09 ` Matt Carlson
2011-09-20 21:27   ` Jesse Gross
2011-09-20 21:57     ` Kasper Pedersen
2011-09-20 22:08       ` Eric Dumazet
2011-09-20 22:11         ` Eric Dumazet
2011-09-20 22:41 ` [PATCH v2] " Kasper Pedersen
2011-09-21  6:15   ` David Miller

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).