* rx_copybreak value for non-i386 architectures
@ 2001-02-28 2:32 Jun Sun
2001-02-28 2:44 ` David S. Miller
2001-02-28 9:42 ` Alan Cox
0 siblings, 2 replies; 3+ messages in thread
From: Jun Sun @ 2001-02-28 2:32 UTC (permalink / raw)
To: linux-kernel
I notice that many net drivers set rx_copybreak to 1518 (the max packet size)
for non-i386 architectures. Once I thought I understood it and it seems
related to cache line alignment. However, I am not sure exactly about the
reason now. Can someone enlighten me a little bit?
Basically I try to understand whether for MIPS architectures we need to set
this value as well.
Please CC your reply to my email address.
TIA.
Jun
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: rx_copybreak value for non-i386 architectures
2001-02-28 2:32 rx_copybreak value for non-i386 architectures Jun Sun
@ 2001-02-28 2:44 ` David S. Miller
2001-02-28 9:42 ` Alan Cox
1 sibling, 0 replies; 3+ messages in thread
From: David S. Miller @ 2001-02-28 2:44 UTC (permalink / raw)
To: Jun Sun; +Cc: linux-kernel
Jun Sun writes:
> I notice that many net drivers set rx_copybreak to 1518 (the max packet size)
> for non-i386 architectures. Once I thought I understood it and it seems
> related to cache line alignment. However, I am not sure exactly about the
> reason now. Can someone enlighten me a little bit?
Most non-x86 architectures take a large hit for unaligned accesses.
If the ethernet chip cannot land the beginning of the packet at an
arbitrary byte offset (a modulo 2 offset for ethernet is needed for an
aligned IP header) then the rx_copybreak is set to the ethernet MTU
so that all packets get copied into new buffers where they can have
their header aligned.
Later,
David S. Miller
davem@redhat.com
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: rx_copybreak value for non-i386 architectures
2001-02-28 2:32 rx_copybreak value for non-i386 architectures Jun Sun
2001-02-28 2:44 ` David S. Miller
@ 2001-02-28 9:42 ` Alan Cox
1 sibling, 0 replies; 3+ messages in thread
From: Alan Cox @ 2001-02-28 9:42 UTC (permalink / raw)
To: Jun Sun; +Cc: linux-kernel
> for non-i386 architectures. Once I thought I understood it and it seems
> related to cache line alignment. However, I am not sure exactly about the
> reason now. Can someone enlighten me a little bit?
A lot of pci net cards can only start packets on a 4 byte boundary. A lot
of CPU's need 4 byte aligned read/writes for performance. The ethernet header
is howerver 14 bytes long.
For CPU's with poor unaligned performance it turns out better to copy or
copy/checksum the data so the IP/TCP headers are aligned. If the card can
hit 16bit boundaries then you will see card drivers doing
alloc_skb(blah)
skb_reserve(skb, 2);
to align the header of he buffer so that the IP data is aligned
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2001-02-28 9:39 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2001-02-28 2:32 rx_copybreak value for non-i386 architectures Jun Sun
2001-02-28 2:44 ` David S. Miller
2001-02-28 9:42 ` Alan Cox
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).