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.
Signed-off-by: Raghavendra Koushik <raghavendra.koushik@xxxxxxxx>
Description: Binary data