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: Fri, 4 Aug 2006 10:20:08 +0400 [thread overview]
Message-ID: <20060804062008.GC413@2ka.mipt.ru> (raw)
In-Reply-To: <41b516cb0608031332v9cc383bq37a13254f25f45a9@mail.gmail.com>
On Thu, Aug 03, 2006 at 01:32:10PM -0700, Chris Leech (chris.leech@gmail.com) wrote:
> >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.
>
> The maximum supported MTU size differs between e1000 devices due to
> differences in FIFO size. For performance reasons the driver won't
> enable a MTU that doesn't allow for at least two frames in the Tx FIFO
> at once - you really want e1000 to be able to DMA the next frame into
> Tx FIFO while the current one is going out on the wire. This doesn't
> change the fact that with LPE set, anything that can fit into the Rx
> FIFO and has a valid CRC will be DMAed into buffers regardless of
> length.
But still it must be less than MAX_JUMBO_FRAME_SIZE, which is 16128
bytes, at least it is maxiumum allowed mtu in e1000_change_mtu().
> >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.
>
> You're changing the size of the buffer without telling the hardware.
> In the interrupt context e1000 knows the size of what was DMAed into
> the skb, but that's after the fact. So e1000 could detect that memory
> was corrupted, but not prevent it if you don't give it power of 2
> buffers. Actually, the power of 2 thing doesn't hold true for all
> e1000 devices. Some have 1k granularity, but not Arnd's 82540.
I can not change it - code checks if requested mtu and additional size
is less than allocated aligned buffer it tricks allocator.
Or do you mean that even after 9k mtu was setup it is possible that card
can receive packets up to 16k?
> You can't know the size of a received packet before it's DMAed into
> host memory, no high performance network controller works that way.
> - Chris
--
Evgeniy Polyakov
next prev parent reply other threads:[~2006-08-04 6:20 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
2006-08-03 20:32 ` Chris Leech
2006-08-04 6:20 ` Evgeniy Polyakov [this message]
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=20060804062008.GC413@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).