* macvlan: fix gso_max_size setting
@ 2009-11-23 10:33 Patrick McHardy
2009-11-23 18:10 ` David Miller
0 siblings, 1 reply; 7+ messages in thread
From: Patrick McHardy @ 2009-11-23 10:33 UTC (permalink / raw)
To: David S. Miller; +Cc: Linux Netdev List
[-- Attachment #1: Type: text/plain, Size: 62 bytes --]
Fix macvlan gso_max_size setting. Based on net-next-2.6.git.
[-- Attachment #2: x --]
[-- Type: text/plain, Size: 1184 bytes --]
commit 198a1fd488e7ebec080d1d2da7947cb9e1aacebf
Author: Patrick McHardy <kaber@trash.net>
Date: Mon Nov 23 11:28:22 2009 +0100
macvlan: fix gso_max_size setting
gso_max_size must be set based on the value of the underlying device to
support devices not using the full 64k.
Signed-off-by: Patrick McHardy <kaber@trash.net>
diff --git a/drivers/net/macvlan.c b/drivers/net/macvlan.c
index ae2b5c7..7b0ef0c 100644
--- a/drivers/net/macvlan.c
+++ b/drivers/net/macvlan.c
@@ -376,6 +376,7 @@ static int macvlan_init(struct net_device *dev)
dev->state = (dev->state & ~MACVLAN_STATE_MASK) |
(lowerdev->state & MACVLAN_STATE_MASK);
dev->features = lowerdev->features & MACVLAN_FEATURES;
+ dev->gso_max_size = lowerdev->gso_max_size;
dev->iflink = lowerdev->ifindex;
dev->hard_header_len = lowerdev->hard_header_len;
@@ -652,6 +653,7 @@ static int macvlan_device_event(struct notifier_block *unused,
case NETDEV_FEAT_CHANGE:
list_for_each_entry(vlan, &port->vlans, list) {
vlan->dev->features = dev->features & MACVLAN_FEATURES;
+ vlan->dev->gso_max_size = dev->gso_max_size;
netdev_features_change(vlan->dev);
}
break;
^ permalink raw reply related [flat|nested] 7+ messages in thread
* Re: macvlan: fix gso_max_size setting
2009-11-23 10:33 macvlan: fix gso_max_size setting Patrick McHardy
@ 2009-11-23 18:10 ` David Miller
2009-11-23 22:11 ` Patrick McHardy
0 siblings, 1 reply; 7+ messages in thread
From: David Miller @ 2009-11-23 18:10 UTC (permalink / raw)
To: kaber; +Cc: netdev
From: Patrick McHardy <kaber@trash.net>
Date: Mon, 23 Nov 2009 11:33:06 +0100
> Fix macvlan gso_max_size setting. Based on net-next-2.6.git.
Pretty serious defect, maybe net-2.6 material?
If someone hits this, it's going to trigger something awful.
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: macvlan: fix gso_max_size setting
2009-11-23 18:10 ` David Miller
@ 2009-11-23 22:11 ` Patrick McHardy
2009-11-23 22:22 ` David Miller
0 siblings, 1 reply; 7+ messages in thread
From: Patrick McHardy @ 2009-11-23 22:11 UTC (permalink / raw)
To: David Miller; +Cc: netdev
David Miller wrote:
> From: Patrick McHardy <kaber@trash.net>
> Date: Mon, 23 Nov 2009 11:33:06 +0100
>
>
>> Fix macvlan gso_max_size setting. Based on net-next-2.6.git.
>
> Pretty serious defect, maybe net-2.6 material?
Sure, please take it in net-2.6.
>
> If someone hits this, it's going to trigger something awful.
Don't drivers simply drop the packet? Otherwise I think you
should be able to trigger the same problem using the TC mirred
action.
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: macvlan: fix gso_max_size setting
2009-11-23 22:11 ` Patrick McHardy
@ 2009-11-23 22:22 ` David Miller
2009-11-23 22:33 ` Patrick McHardy
0 siblings, 1 reply; 7+ messages in thread
From: David Miller @ 2009-11-23 22:22 UTC (permalink / raw)
To: kaber; +Cc: netdev
From: Patrick McHardy <kaber@trash.net>
Date: Mon, 23 Nov 2009 23:11:07 +0100
> David Miller wrote:
>> From: Patrick McHardy <kaber@trash.net>
>> Date: Mon, 23 Nov 2009 11:33:06 +0100
>>
>>
>>> Fix macvlan gso_max_size setting. Based on net-next-2.6.git.
>>
>> Pretty serious defect, maybe net-2.6 material?
>
> Sure, please take it in net-2.6.
Done, thanks.
>>
>> If someone hits this, it's going to trigger something awful.
>
> Don't drivers simply drop the packet? Otherwise I think you
> should be able to trigger the same problem using the TC mirred
> action.
I see nothing in the IXGBE driver's transmit code paths which guard
against this.
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: macvlan: fix gso_max_size setting
2009-11-23 22:22 ` David Miller
@ 2009-11-23 22:33 ` Patrick McHardy
2009-11-24 1:08 ` Herbert Xu
0 siblings, 1 reply; 7+ messages in thread
From: Patrick McHardy @ 2009-11-23 22:33 UTC (permalink / raw)
To: David Miller; +Cc: netdev, Herbert Xu
[-- Attachment #1: Type: text/plain, Size: 862 bytes --]
David Miller wrote:
> From: Patrick McHardy <kaber@trash.net>
> Date: Mon, 23 Nov 2009 23:11:07 +0100
>
>
>> David Miller wrote:
>>
>>> From: Patrick McHardy <kaber@trash.net>
>>> Date: Mon, 23 Nov 2009 11:33:06 +0100
>>>
>>>
>>>
>>>> Fix macvlan gso_max_size setting. Based on net-next-2.6.git.
>>>>
>>> Pretty serious defect, maybe net-2.6 material?
>>>
>> Sure, please take it in net-2.6.
>>
>
> Done, thanks.
>
>
>>> If someone hits this, it's going to trigger something awful.
>>>
>> Don't drivers simply drop the packet? Otherwise I think you
>> should be able to trigger the same problem using the TC mirred
>> action.
>>
>
> I see nothing in the IXGBE driver's transmit code paths which guard
> against this.
>
Perhaps we should simply fall back to software in that case.
Compile tested only.
[-- Attachment #2: x --]
[-- Type: text/plain, Size: 685 bytes --]
net: fall back to software segmentation if skb length exceeds dev->gso_max_size
Signed-off-by: Patrick McHardy <kaber@trash.net>
diff --git a/include/linux/netdevice.h b/include/linux/netdevice.h
index ffc3106..edd1e2b 100644
--- a/include/linux/netdevice.h
+++ b/include/linux/netdevice.h
@@ -1943,7 +1943,8 @@ static inline int netif_needs_gso(struct net_device *dev, struct sk_buff *skb)
{
return skb_is_gso(skb) &&
(!skb_gso_ok(skb, dev->features) ||
- unlikely(skb->ip_summed != CHECKSUM_PARTIAL));
+ unlikely(skb->ip_summed != CHECKSUM_PARTIAL) ||
+ unlikely(skb->len > dev->gso_max_size));
}
static inline void netif_set_gso_max_size(struct net_device *dev,
^ permalink raw reply related [flat|nested] 7+ messages in thread
* Re: macvlan: fix gso_max_size setting
2009-11-23 22:33 ` Patrick McHardy
@ 2009-11-24 1:08 ` Herbert Xu
2009-11-24 10:57 ` Patrick McHardy
0 siblings, 1 reply; 7+ messages in thread
From: Herbert Xu @ 2009-11-24 1:08 UTC (permalink / raw)
To: Patrick McHardy; +Cc: David Miller, netdev
On Mon, Nov 23, 2009 at 11:33:05PM +0100, Patrick McHardy wrote:
>
> Perhaps we should simply fall back to software in that case.
> Compile tested only.
Sure.
Since ixgbe appears to be the only driver in our entire tree
that has this limitation, I think it might make more sense to
move this special-case check into it and get it to do software
GSO just like tg3 does for a few other cases that the hardware
can't handle.
Cheers,
--
Visit Openswan at http://www.openswan.org/
Email: Herbert Xu ~{PmV>HI~} <herbert@gondor.apana.org.au>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: macvlan: fix gso_max_size setting
2009-11-24 1:08 ` Herbert Xu
@ 2009-11-24 10:57 ` Patrick McHardy
0 siblings, 0 replies; 7+ messages in thread
From: Patrick McHardy @ 2009-11-24 10:57 UTC (permalink / raw)
To: Herbert Xu; +Cc: David Miller, netdev
Herbert Xu wrote:
> On Mon, Nov 23, 2009 at 11:33:05PM +0100, Patrick McHardy wrote:
>> Perhaps we should simply fall back to software in that case.
>> Compile tested only.
>
> Sure.
>
> Since ixgbe appears to be the only driver in our entire tree
> that has this limitation, I think it might make more sense to
> move this special-case check into it and get it to do software
> GSO just like tg3 does for a few other cases that the hardware
> can't handle.
Sure, that would also be fine. I'll leave that for the Intel
guys however :)
^ permalink raw reply [flat|nested] 7+ messages in thread
end of thread, other threads:[~2009-11-24 10:57 UTC | newest]
Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-11-23 10:33 macvlan: fix gso_max_size setting Patrick McHardy
2009-11-23 18:10 ` David Miller
2009-11-23 22:11 ` Patrick McHardy
2009-11-23 22:22 ` David Miller
2009-11-23 22:33 ` Patrick McHardy
2009-11-24 1:08 ` Herbert Xu
2009-11-24 10:57 ` Patrick McHardy
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).