在发送文件期间调用 csum_partial_copy_from_user() 时

发布于 2024-12-08 20:15:50 字数 381 浏览 6 评论 0原文

这是我在谷歌上搜索的内容:

sendfile() 类似于 write(),只是直接从描述符到套接字。这就消除了将数据从缓冲区高速缓存复制到用户空间中的缓冲区的情况。

当前的 NIC 可以进行分散-收集 I/O,即它们可以从内核缓冲区获取数据包标头,但从缓冲区高速缓存获取数据包内容(来自用户的 csum 部分副本)。

结果称为零复制 TCP,它是最终目标。

我的问题是:

csum_partial_copy_from_user() 的目的是什么以及何时调用它?我跟踪了sendfile的流程直到dev_queue_xmit(),但是没有找到它在哪里被调用。谢谢

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

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文