Re: How many copies to get from NIC RX to user read()?

From: Matti Aarnio (matti.aarnio@zmailer.org)
Date: Wed Jul 10 2002 - 03:29:16 EST


On Tue, Jul 09, 2002 at 04:29:35PM -0600, Hurwitz Justin W. wrote:
> Please Cc: me in your responses.
>
> The story so far:
>
> I've been continuing to muck around with the stack, trying both to improve
> overall performance, and specifically to improve rx relative to tx
> performance, primarily in gig-and-beyond (e.g., Quadrics) environments.
...
> The direct question:
>
> How many times is data copied between the time that it is received at the
> NIC and when the user's call to read() returns the data?
 
> The reason for the question:
>
> I could've sworn I heard the stack was single-copy on both the TX and RX
> sides. But, it doesn't look to me like it is. Rather, it looks like there
> is one copy in tcp_rcv_estabilshed() (via tcp_copy_to_iovec()), and a
> second copy in tcp_recvmsg() (which is called when the user calls read()).
> Both of these copies are, I believe, done by skb_copy_datagram_iovec().

  I suspect that in many cases there is third copy right in the network
  card driver to realign data so that TCP frame begins at a 32-bit boundary.
  Perhaps that is only for RISC CPU systems (e.g. Alpha, primarily.)

  Can the GigE cards do ethernet-frame reception pre-alignment so that
  after the 14 byte ethernet header, the TCP frame begins at 32-bit
  boundary ?

...
> Cheers,
> --Gus

/Matti Aarnio
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/



This archive was generated by hypermail 2b29 : Mon Jul 15 2002 - 22:00:17 EST