From: Patrick McHardy <kaber@trash.net>
To: David Miller <davem@davemloft.net>
Cc: netdev@vger.kernel.org, Herbert Xu <herbert@gondor.apana.org.au>
Subject: Re: macvlan: fix gso_max_size setting
Date: Mon, 23 Nov 2009 23:33:05 +0100 [thread overview]
Message-ID: <4B0B0DA1.7010403@trash.net> (raw)
In-Reply-To: <20091123.142207.14190542.davem@davemloft.net>
[-- 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,
next prev parent reply other threads:[~2009-11-23 22:33 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
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 [this message]
2009-11-24 1:08 ` Herbert Xu
2009-11-24 10:57 ` Patrick McHardy
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=4B0B0DA1.7010403@trash.net \
--to=kaber@trash.net \
--cc=davem@davemloft.net \
--cc=herbert@gondor.apana.org.au \
--cc=netdev@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).