1

Here is something I googled:

sendfile() is like write(), only directly from descriptor to a socket. That eliminates copying the data from the buffer cache to a buffer in user space.

Current NICs can do scatter-gather I/O, i.e. they can take the packet header from a kernel buffer, but the packet contents from the buffer cache(csum partial copy from user).

The result is called Zero Copy TCP and it is the ultimate goal.

My question is:

What is the purpose of csum_partial_copy_from_user() and when it is called? I followed the process of sendfile until dev_queue_xmit(), but I didn't find where it is called. Thanks

SKD
  • 464
  • 1
  • 4
  • 16
sliter
  • 1,063
  • 1
  • 17
  • 34
  • Do the comments [above their declarations](http://lxr.free-electrons.com/source/include/asm-generic/checksum.h#L4) answer your first question? The second can be answered with a simple cross-reference: http://lxr.free-electrons.com/ident?i=csum_partial_copy_from_user – Michael Foukarakis Feb 01 '16 at 07:51

0 Answers0