netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Evgeniy Polyakov <johnpol@2ka.mipt.ru>
To: Chris Leech <chris.leech@gmail.com>
Cc: Krzysztof Oledzki <olel@ans.pl>, Arnd Hannemann <arnd@arndnet.de>,
	linux-kernel@vger.kernel.org, netdev@vger.kernel.org
Subject: Re: problems with e1000 and jumboframes
Date: Thu, 3 Aug 2006 20:10:47 +0400	[thread overview]
Message-ID: <20060803161046.GA703@2ka.mipt.ru> (raw)
In-Reply-To: <41b516cb0608030857h1d55820rfd4ccd0cc56dd71d@mail.gmail.com>

On Thu, Aug 03, 2006 at 08:57:36AM -0700, Chris Leech (chris.leech@gmail.com) wrote:
> On 8/3/06, Evgeniy Polyakov <johnpol@2ka.mipt.ru> wrote:
> 
> >> Strange, why this skb_shared_info cannon be added before first alignment?
> >> And what about smaller frames like 1500, does this driver behave similar
> >> (first align then add)?
> >
> >It can be.
> >Could attached  (completely untested) patch help?
> 
> Note that e1000 uses power of two buffers because that's what the
> hardware supports.  Also, there's no program able MTU - only a single
> bit for "long packet enable" that disables frame length checks when
> using jumbo frames.  That means that if you tell the e1000 it has a
> 16k buffer, and a 16k frame shows up on the wire, it's going to write
> to the entire 16k regardless of your 9k MTU setting.  If a 32k frame
> shows up, two full 16k buffers get written to (OK, assuming the frame
> can fit into the receive FIFO)

Maximum e1000 frame is 16128 bytes, which is enough before being rounded
to 16k to have a space for shared info.
My patch just tricks refilling logic to request to allocate slightly less
than was setup when mtu was changed.

> That's why I've always been against trying to optimize the allocation
> sizes in the driver, even with your small change the skb_shinfo area
> can get corrupted.  It may be unlikely, because the frame still has to
> be valid, but some switches aren't real picky about what sized frame
> they'll forward on if you enable jumbo support either.  So any box on
> the LAN could send you larger than MTU frames in an attempt to corrupt
> memory.

It is trivial patch and it can be incorrect (especially for small sized
packets), but it is a hint, that 9k jumbo frame should not require 32k
allocation.

> I believe that if you tell a hardware device it has a buffer of a
> certain size, you need to be prepared for that entire buffer to get
> written to.  Unfortunately that means wasteful allocations for e1000
> if a single buffer per frame is going to be used.

Hardware is not affected, second patch just checks if there is enough
space (e1000 stores real mtu). I can not believe that such modern NIC
like e1000 can not know in receive interrupt size of the received
packet, if it is true, than in generel you are right and some more 
clever mechanisms shoud be used (at least turn hack off for small
packets and only enable it for less than 16 jumbo frames wheere place 
always is), if size of the received packet is known, then it is enough
to compare aligned size and size of the packet to make a decision for
allocation.

> - Chris

-- 
	Evgeniy Polyakov

  reply	other threads:[~2006-08-03 16:11 UTC|newest]

Thread overview: 38+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-08-03 13:48 problems with e1000 and jumboframes Arnd Hannemann
2006-08-03 13:59 ` Evgeniy Polyakov
2006-08-03 14:37   ` Arnd Hannemann
2006-08-03 15:03     ` Evgeniy Polyakov
2006-08-03 15:08       ` Krzysztof Oledzki
2006-08-03 15:16         ` Evgeniy Polyakov
2006-08-03 15:37           ` Arnd Hannemann
2006-08-03 15:43             ` Evgeniy Polyakov
2006-08-03 15:41           ` Evgeniy Polyakov
2006-08-03 18:09             ` Arnd Hannemann
2006-08-03 18:29               ` Evgeniy Polyakov
2006-08-03 21:40                 ` Arnd Hannemann
2006-08-03 15:57           ` Chris Leech
2006-08-03 16:10             ` Evgeniy Polyakov [this message]
2006-08-03 20:32               ` Chris Leech
2006-08-04  6:20                 ` Evgeniy Polyakov
2006-08-04 15:16                   ` Chris Leech
2006-08-03 16:24             ` Arnd Hannemann
2006-08-03 20:34               ` Chris Leech
2006-08-04  5:59                 ` Herbert Xu
2006-08-04  6:15                   ` Evgeniy Polyakov
2006-08-04 15:34                     ` Chris Leech
2006-08-04 19:42                       ` Evgeniy Polyakov
2006-08-04 21:02                         ` Jesse Brandeburg
2006-08-05  9:58                           ` Evgeniy Polyakov
2006-08-05 10:09                             ` Herbert Xu
2006-08-05 10:24                               ` Evgeniy Polyakov
2006-08-05 10:33                                 ` Herbert Xu
2006-08-05 10:41                                   ` Evgeniy Polyakov
2006-08-03 15:23         ` Evgeniy Polyakov
2006-08-04  5:52   ` Herbert Xu
2006-08-04  5:55     ` David Miller
2006-08-04  5:58       ` Evgeniy Polyakov
2006-08-03 14:24 ` Benjamin LaHaise
2006-08-03 14:49   ` Krzysztof Oledzki
2006-08-03 14:52     ` Benjamin LaHaise
2006-08-03 15:04       ` Krzysztof Oledzki
2006-08-03 15:32   ` Arnd Hannemann

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=20060803161046.GA703@2ka.mipt.ru \
    --to=johnpol@2ka.mipt.ru \
    --cc=arnd@arndnet.de \
    --cc=chris.leech@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=olel@ans.pl \
    /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).