[PATCH] Re: [E1000-devel] e1000 jumbo problems
From: <hidden>
Date: 2004-07-01 19:51:14
This patch is not for applying, just for discussion. comments below... Chris Leech wrote:
quoted
quoted
Another related issue, is that the driver uses 4KiB buffers for MTUs in the 1500 -> 2000 range which seems a bit silly. Any particular reason for that?It is wasteful, but does anyone actually use an MTU in the range of 1501 - 2030? It seems silly to me to go with a non-standard frame size, but not go up to something that might give you a performance benefit (9k).quoted
I changed the driver to use 2KiB buffers for frames in the 1518 -> 2048 range (BSEX=0, LPE=1). This breaks however as packets are not dropped that are larger than the max specified? Instead they're scribbled into memory causing a lockup after a while.That sounds right, if you actually got the RCTL register set correctly. In e1000_setup_rctl the adapter->rx_buffer_len is used to set that register, and it's currently written to only set LPE if the buffer size is bigger than 2k (thus, why 4k buffers are used even when the MTU is in the 1501 - 2030 range). To use 2k buffers for slightly large frames, you'd want some new flag in the adapter for LPE (or check netdev->mtu I guess) and do something like: rctl |= E1000_RCTL_SZ_2048 | E1000_RCTL_LPE e1000 devices don't have a programmable MTU for receive filtering, they drop anything larger than 1518 unless LPE (long packet enable) is set. If LPE is set they accept anything that fits in the FIFO and has a valid FCS.
More accurately e1000s accept anything (even greater than a FIFO). When a large packet is written into multiple FIFOs, only the last rx descriptor has the EOP (end of packet) flag set. The driver doesn't handle this at all currently and will drop the initial buffers (because they don't have the EOP set) which is fine, but it will accept the last buffer (part of the packet). I've attached a patch that fixes this. Also the patch drops packets that fit within a buffer but are larger than MTU. So in summary the patch will stop packets > MTU being accepted by the driver. Note also this patch changes to using 2KiB buffers (from 4KiB) for MTUs between 1500 and 2030, and also it enables large frame reception (LFE) always, but ingore these as they're just for debugging. The patch makes my system completely stable now for MTUs <= 2500, However I can still get the system to freeze repeatedly by sending packets larger than this. cheers, Pádraig.
Attachments
- e1000-smallMTU.diff [application/x-texinfo] 5497 bytes · preview