All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] net offloading: Do not mask out NETIF_F_HW_VLAN_TX for vlan.
@ 2011-01-18  6:46 Jesse Gross
  2011-01-18  6:55 ` Eric Dumazet
  0 siblings, 1 reply; 5+ messages in thread
From: Jesse Gross @ 2011-01-18  6:46 UTC (permalink / raw)
  To: David Miller; +Cc: Eric Dumazet, netdev

In netif_skb_features() we return only the features that are valid for vlans
if we have a vlan packet.  However, we should not mask out NETIF_F_HW_VLAN_TX
since it enables transmission of vlan tags and is obviously valid.

Reported-by: Eric Dumazet <eric.dumazet@gmail.com>
Signed-off-by: Jesse Gross <jesse@nicira.com>
---
 net/core/dev.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/net/core/dev.c b/net/core/dev.c
index 83507c2..4c58d11 100644
--- a/net/core/dev.c
+++ b/net/core/dev.c
@@ -2023,13 +2023,13 @@ int netif_skb_features(struct sk_buff *skb)
 		return harmonize_features(skb, protocol, features);
 	}
 
-	features &= skb->dev->vlan_features;
+	features &= (skb->dev->vlan_features | NETIF_F_HW_VLAN_TX);
 
 	if (protocol != htons(ETH_P_8021Q)) {
 		return harmonize_features(skb, protocol, features);
 	} else {
 		features &= NETIF_F_SG | NETIF_F_HIGHDMA | NETIF_F_FRAGLIST |
-				NETIF_F_GEN_CSUM;
+				NETIF_F_GEN_CSUM | NETIF_F_HW_VLAN_TX;
 		return harmonize_features(skb, protocol, features);
 	}
 }
-- 
1.7.1


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

* Re: [PATCH] net offloading: Do not mask out NETIF_F_HW_VLAN_TX for vlan.
  2011-01-18  6:46 [PATCH] net offloading: Do not mask out NETIF_F_HW_VLAN_TX for vlan Jesse Gross
@ 2011-01-18  6:55 ` Eric Dumazet
  2011-01-18  7:12   ` Jesse Gross
  2011-01-19  0:15   ` David Miller
  0 siblings, 2 replies; 5+ messages in thread
From: Eric Dumazet @ 2011-01-18  6:55 UTC (permalink / raw)
  To: Jesse Gross; +Cc: David Miller, netdev

Le lundi 17 janvier 2011 à 22:46 -0800, Jesse Gross a écrit :
> In netif_skb_features() we return only the features that are valid for vlans
> if we have a vlan packet.  However, we should not mask out NETIF_F_HW_VLAN_TX
> since it enables transmission of vlan tags and is obviously valid.
> 
> Reported-by: Eric Dumazet <eric.dumazet@gmail.com>
> Signed-off-by: Jesse Gross <jesse@nicira.com>

Thanks Jesse

Acked-by: Eric Dumazet <eric.dumazet@gmail.com>

Now back to the "ethtool -K eth0 txvlan off" problem on bnx2

Is it a driver/software problem or hardware/firmware one ?




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

* Re: [PATCH] net offloading: Do not mask out NETIF_F_HW_VLAN_TX for vlan.
  2011-01-18  6:55 ` Eric Dumazet
@ 2011-01-18  7:12   ` Jesse Gross
  2011-01-18 17:21     ` Michael Chan
  2011-01-19  0:15   ` David Miller
  1 sibling, 1 reply; 5+ messages in thread
From: Jesse Gross @ 2011-01-18  7:12 UTC (permalink / raw)
  To: Eric Dumazet; +Cc: David Miller, netdev, Michael Chan

On Tue, Jan 18, 2011 at 1:55 AM, Eric Dumazet <eric.dumazet@gmail.com> wrote:
> Le lundi 17 janvier 2011 à 22:46 -0800, Jesse Gross a écrit :
>> In netif_skb_features() we return only the features that are valid for vlans
>> if we have a vlan packet.  However, we should not mask out NETIF_F_HW_VLAN_TX
>> since it enables transmission of vlan tags and is obviously valid.
>>
>> Reported-by: Eric Dumazet <eric.dumazet@gmail.com>
>> Signed-off-by: Jesse Gross <jesse@nicira.com>
>
> Thanks Jesse
>
> Acked-by: Eric Dumazet <eric.dumazet@gmail.com>
>
> Now back to the "ethtool -K eth0 txvlan off" problem on bnx2
>
> Is it a driver/software problem or hardware/firmware one ?

CC'ing Michael Chan

It looks like bnx2 is storing the offsets of various headers so the
hardware can find them for TSO.  The parsing logic doesn't do anything
for vlan tags, so the hardware gets confused if one is present in the
packet itself.

Quick fix is to simply disallow disabling TX vlan offload or disable
TSO at the same time or some other Ethtool game.  However, if the
hardware supports it then it would be nicer to fix up the TSO setup
logic.  Maybe we can just add the size of the vlan tag to the offset
but I am not certain.  Michael, do you know if this is possible?

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

* Re: [PATCH] net offloading: Do not mask out NETIF_F_HW_VLAN_TX for vlan.
  2011-01-18  7:12   ` Jesse Gross
@ 2011-01-18 17:21     ` Michael Chan
  0 siblings, 0 replies; 5+ messages in thread
From: Michael Chan @ 2011-01-18 17:21 UTC (permalink / raw)
  To: Jesse Gross; +Cc: Eric Dumazet, David Miller, netdev


On Mon, 2011-01-17 at 23:12 -0800, Jesse Gross wrote:
> On Tue, Jan 18, 2011 at 1:55 AM, Eric Dumazet <eric.dumazet@gmail.com> wrote:
> > Le lundi 17 janvier 2011 à 22:46 -0800, Jesse Gross a écrit :
> >> In netif_skb_features() we return only the features that are valid for vlans
> >> if we have a vlan packet.  However, we should not mask out NETIF_F_HW_VLAN_TX
> >> since it enables transmission of vlan tags and is obviously valid.
> >>
> >> Reported-by: Eric Dumazet <eric.dumazet@gmail.com>
> >> Signed-off-by: Jesse Gross <jesse@nicira.com>
> >
> > Thanks Jesse
> >
> > Acked-by: Eric Dumazet <eric.dumazet@gmail.com>
> >
> > Now back to the "ethtool -K eth0 txvlan off" problem on bnx2
> >
> > Is it a driver/software problem or hardware/firmware one ?
> 
> CC'ing Michael Chan
> 
> It looks like bnx2 is storing the offsets of various headers so the
> hardware can find them for TSO.  The parsing logic doesn't do anything
> for vlan tags, so the hardware gets confused if one is present in the
> packet itself.

Yeah, I don't think the hardware/firmware can replicate the vlan tag +
headers properly for TSO if there is a VLAN tag in the packet.  Even
simple tx checksum offload may have problem, but I'll need to check.

> 
> Quick fix is to simply disallow disabling TX vlan offload or disable
> TSO at the same time or some other Ethtool game.  However, if the
> hardware supports it then it would be nicer to fix up the TSO setup
> logic.  Maybe we can just add the size of the vlan tag to the offset
> but I am not certain.  Michael, do you know if this is possible?
> 

I doubt it, as the VLAN tag needs to be replicated for each transmitted
packet.  I'll check with the firmware/hardware guys.

Thanks.



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

* Re: [PATCH] net offloading: Do not mask out NETIF_F_HW_VLAN_TX for vlan.
  2011-01-18  6:55 ` Eric Dumazet
  2011-01-18  7:12   ` Jesse Gross
@ 2011-01-19  0:15   ` David Miller
  1 sibling, 0 replies; 5+ messages in thread
From: David Miller @ 2011-01-19  0:15 UTC (permalink / raw)
  To: eric.dumazet; +Cc: jesse, netdev

From: Eric Dumazet <eric.dumazet@gmail.com>
Date: Tue, 18 Jan 2011 07:55:14 +0100

> Le lundi 17 janvier 2011 à 22:46 -0800, Jesse Gross a écrit :
>> In netif_skb_features() we return only the features that are valid for vlans
>> if we have a vlan packet.  However, we should not mask out NETIF_F_HW_VLAN_TX
>> since it enables transmission of vlan tags and is obviously valid.
>> 
>> Reported-by: Eric Dumazet <eric.dumazet@gmail.com>
>> Signed-off-by: Jesse Gross <jesse@nicira.com>
> 
> Thanks Jesse
> 
> Acked-by: Eric Dumazet <eric.dumazet@gmail.com>

Applied, thanks.

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

end of thread, other threads:[~2011-01-19  0:15 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-01-18  6:46 [PATCH] net offloading: Do not mask out NETIF_F_HW_VLAN_TX for vlan Jesse Gross
2011-01-18  6:55 ` Eric Dumazet
2011-01-18  7:12   ` Jesse Gross
2011-01-18 17:21     ` Michael Chan
2011-01-19  0:15   ` 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.