S2io: two buffer mode
Subsystems (2)
PATCH 8/12 S2io: two buffer mode
Hi,
Attached is the patch for implementing 2-buffer mode on Rx path. More description of this mode of operation follows.
On certain systems when a DMA has to happen on an un-aligned memory location performance will take a significant hit. It's standard practice to offset the Rx buffer address by 2 (as Mac header is 14 bytes) so the IP header starts from an aligned location. Obviously using a single Rx buffer both cannot be achieved. Thus XFrame supports something called 2 buffer Rx mode, where in the Rx'ed frame is split into 2 parts, one is the Ethernet header and the other is the Ethernet payload. So now we can allocate proper aligned memory for both buffers, hence the DMA is not slowed down. Also, the Ethernet payload(starting from L3 header) is on an aligned location so OS need not have to do un-aligned accesses to process IP header. To achieve this, the kernel function eth_type_trans functionality has to be partially implemented in the driver itself.
---
drivers/net/Kconfig +11 -0
@@ -2267,6 +2267,17 @@ If in doubt, say N. +config 2BUFF_MODE + bool "Use 2 Buffer Mode on Rx side." + depends on S2IO + ---help--- + On enabling the 2 buffer mode, the received frame will be + split into 2 parts before being DMA'ed to the hosts memory. + The parts are the ethernet header and ethernet payload. + This is useful on systems where DMA'ing to to unaligned + physical memory loactions comes with a heavy price. + If not sure please say N. + endmenu source "drivers/net/tokenring/Kconfig"
drivers/net/s2io.c +389 -1
601 lines not on this page · raw message
drivers/net/s2io.h +57 -0
95 lines not on this page · raw message