xen-devel.lists.xenproject.org archive mirror
 help / color / mirror / Atom feed
From: Malcolm Crossley <malcolm.crossley@citrix.com>
To: xen-devel@lists.xen.org
Subject: Re: [PATCH 2/6] xen-netfront: reduce gso_max_size to account for ethernet header
Date: Mon, 25 Mar 2013 19:09:37 +0000	[thread overview]
Message-ID: <5150A0F1.7020001@citrix.com> (raw)
In-Reply-To: <20130325.143923.762657816602656826.davem@davemloft.net>

On 25/03/13 18:39, David Miller wrote:
> From: Wei Liu <wei.liu2@citrix.com>
> Date: Mon, 25 Mar 2013 18:32:06 +0000
>
>> On Mon, Mar 25, 2013 at 04:18:09PM +0000, David Miller wrote:
>>> From: Wei Liu <wei.liu2@citrix.com>
>>> Date: Mon, 25 Mar 2013 11:08:18 +0000
>>>
>>>> The maximum packet including ethernet header that can be handled by netfront /
>>>> netback wire format is 65535. Reduce gso_max_size accordingly.
>>>>
>>>> Drop skb and print warning when skb->len > 65535. This can 1) save the effort
>>>> to send malformed packet to netback, 2) help spotting misconfiguration of
>>>> netfront in the future.
>>>>
>>>> Signed-off-by: Wei Liu <wei.liu2@citrix.com>
>>> This is effectively the default already, you don't need to change this
>>> value explicitly.
>>>
>>> ->gso_max_size is set by default to 65536 and then TCP performs this
>>> calculation:
>>>
>>>                  xmit_size_goal = ((sk->sk_gso_max_size - 1) -
>>>                                    inet_csk(sk)->icsk_af_ops->net_header_len -
>>>                                    inet_csk(sk)->icsk_ext_hdr_len -
>>>                                    tp->tcp_header_len);
>> OK. But I see similar fix for a physical nic (commit b7e5887e0e414b), am
>> I missing something here?
>>
>> And the symptom is that if I don't reserve headroom I see skb->len =
>> 65538. Can you shed some light on this?

I think the problem is that the netback wire protocol includes the 
ethernet header.

The xmit_size_goal is taking into account the IP header, IP options and 
TCP header but not the ethernet header itself.

The Emulex driver seems to have similar problem with maximum size of 
packet with ethernet header,
http://patchwork.ozlabs.org/patch/164818/

I think we should subtract VLAN_ETH_HLEN so that we can trunk VLAN 
through netback safely

  parent reply	other threads:[~2013-03-25 19:09 UTC|newest]

Thread overview: 54+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <1364209702-12437-1-git-send-email-wei.liu2@citrix.com>
2013-03-25 11:08 ` [PATCH 1/6] xen-netfront: remove unused variable `extra' Wei Liu
2013-03-25 11:08 ` [PATCH 2/6] xen-netfront: reduce gso_max_size to account for ethernet header Wei Liu
2013-03-25 11:08 ` [PATCH 3/6] xen-netfront: frags -> slots in xennet_get_responses Wei Liu
2013-03-25 11:08 ` [PATCH 4/6] xen-netback: remove skb in xen_netbk_alloc_page Wei Liu
2013-03-25 11:08 ` [PATCH 5/6] xen-netback: coalesce slots before copying Wei Liu
2013-03-25 11:08 ` [PATCH 6/6] xen-netback: don't disconnect frontend when seeing oversize frame Wei Liu
     [not found] ` <1364209702-12437-3-git-send-email-wei.liu2@citrix.com>
2013-03-25 13:54   ` [PATCH 2/6] xen-netfront: reduce gso_max_size to account for ethernet header Malcolm Crossley
2013-03-25 14:23   ` David Vrabel
     [not found]   ` <51505DF9.4080406@citrix.com>
2013-03-25 14:39     ` Jan Beulich
2013-03-25 15:50   ` Sergei Shtylyov
2013-03-25 16:18   ` David Miller
2013-03-25 16:56   ` Konrad Rzeszutek Wilk
     [not found]   ` <20130325.121809.2023305728304341952.davem@davemloft.net>
2013-03-25 16:54     ` Eric Dumazet
     [not found]     ` <1364230472.29473.21.camel@edumazet-glaptop>
2013-03-25 16:59       ` David Miller
     [not found]       ` <20130325.125949.1046297562456662826.davem@davemloft.net>
2013-03-25 17:24         ` Eric Dumazet
2013-03-25 20:49         ` Ben Hutchings
2013-03-25 18:32     ` Wei Liu
     [not found]     ` <20130325183206.GA7004@zion.uk.xensource.com>
2013-03-25 18:39       ` David Miller
     [not found]       ` <20130325.143923.762657816602656826.davem@davemloft.net>
2013-03-25 19:09         ` Malcolm Crossley [this message]
     [not found] ` <1364209702-12437-4-git-send-email-wei.liu2@citrix.com>
2013-03-25 14:25   ` [PATCH 3/6] xen-netfront: frags -> slots in xennet_get_responses David Vrabel
2013-03-25 16:20   ` David Miller
     [not found] ` <1364209702-12437-2-git-send-email-wei.liu2@citrix.com>
2013-03-25 14:21   ` [PATCH 1/6] xen-netfront: remove unused variable `extra' David Vrabel
2013-03-25 16:20   ` David Miller
     [not found] ` <1364209702-12437-5-git-send-email-wei.liu2@citrix.com>
2013-03-25 16:20   ` [PATCH 4/6] xen-netback: remove skb in xen_netbk_alloc_page David Miller
     [not found] ` <1364209702-12437-6-git-send-email-wei.liu2@citrix.com>
2013-03-25 15:13   ` [PATCH 5/6] xen-netback: coalesce slots before copying David Vrabel
     [not found]   ` <5150699C.6080209@citrix.com>
2013-03-25 15:47     ` Wei Liu
     [not found]     ` <CAOsiSVUNO0FQkfJWjv9bcoMgKNnHu4XYciz61hG3YNFzZNxK3w@mail.gmail.com>
2013-03-25 16:34       ` David Vrabel
     [not found]       ` <51507C9B.3080109@citrix.com>
2013-03-25 16:58         ` Wei Liu
2013-03-25 17:06           ` Wei Liu
2013-03-25 18:29           ` David Vrabel
     [not found]           ` <51509789.8090608@citrix.com>
2013-03-25 19:09             ` Wei Liu
     [not found]             ` <20130325190911.GC7004@zion.uk.xensource.com>
2013-03-26  9:16               ` Paul Durrant
2013-03-26 10:52               ` James Harper
     [not found]               ` <291EDFCB1E9E224A99088639C4762022013F7D8E0DC6@LONPMAILBOX01.citrite.net>
2013-03-26  9:51                 ` Wei Liu
2013-03-26 11:00                 ` James Harper
     [not found]                 ` <6035A0D088A63A46850C3988ED045A4B3880B4F4@BITCOM1.int.sbss.com.au>
2013-03-26 11:24                   ` Paul Durrant
2013-03-26 11:27                   ` David Laight
     [not found]                   ` <291EDFCB1E9E224A99088639C4762022013F7D8E0E06@LONPMAILBOX01.citrite.net>
2013-03-26 11:29                     ` James Harper
     [not found]                     ` <6035A0D088A63A46850C3988ED045A4B3880B6AE@BITCOM1.int.sbss.com.au>
2013-03-26 11:38                       ` Paul Durrant
     [not found]               ` <6035A0D088A63A46850C3988ED045A4B3880B43D@BITCOM1.int.sbss.com.au>
2013-03-26 11:06                 ` David Vrabel
     [not found]                 ` <5151812F.3080905@citrix.com>
2013-03-26 11:15                   ` James Harper
2013-03-26 11:13               ` David Vrabel
     [not found]               ` <515182E2.50103@citrix.com>
2013-03-26 11:29                 ` Wei Liu
2013-03-25 16:20   ` David Miller
2013-03-25 16:57   ` Konrad Rzeszutek Wilk
2013-03-26 18:02   ` David Vrabel
     [not found]   ` <20130325165746.GB25740@phenom.dumpdata.com>
2013-04-09 15:10     ` Ian Campbell
     [not found] ` <1364209702-12437-7-git-send-email-wei.liu2@citrix.com>
2013-03-25 11:47   ` [PATCH 6/6] xen-netback: don't disconnect frontend when seeing oversize frame David Vrabel
     [not found]   ` <51503945.6040204@citrix.com>
2013-03-25 12:00     ` Wei Liu
2013-03-25 12:53   ` Jan Beulich
     [not found]   ` <515056F502000078000C8184@nat28.tlf.novell.com>
2013-03-25 13:52     ` Wei Liu
2013-03-25 16:21   ` David Miller
2013-03-25 16:58   ` Konrad Rzeszutek Wilk
     [not found]   ` <20130325165834.GC25740@phenom.dumpdata.com>
2013-03-27 10:03     ` William Dauchy

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=5150A0F1.7020001@citrix.com \
    --to=malcolm.crossley@citrix.com \
    --cc=xen-devel@lists.xen.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).