dpdk mbuf?

发布于 2025-02-09 07:56:52 字数 353 浏览 1 评论 0 原文

对于新分配的MBUF,数据缓冲区中数据开始的区域是rte_pktmbuf_headroom bytes,在缓冲区开始后,缓存对齐。

据我所知, ,净空不包含任何数据。因此,我想知道为什么MBUF?还应有一个净空,此外,默认的尺寸为128B。我尝试将净空尺寸设置为更大的东西,例如5120B,并且不会影响性能。因此,我想知道净空存在的目的是什么?

For a newly allocated mbuf, the area at which the data begins in the message buffer is RTE_PKTMBUF_HEADROOM bytes after the beginning of the buffer, which is cache aligned.
enter image description here

As far as I know, the headroom does not contain any data. So I wonder why there should be a headroom in the mbuf?In addition, the default size of HEADROOM is 128B.I've tried setting the HEADROOM size to something bigger, like 5120B, and it doesn't affect performance. So I want to know what is the purpose of the existence of the Headroom, and is there any theoretical limit to the size of the Headroom?

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

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

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

剪不断理还乱 2025-02-16 07:56:52

DPDK MBUF的净空适合于将额外的数据(通常为 metadata )准备到 packet 数据。它的用例特定于PMD。例如,在其中结构virtio_net_hdr 。其他驱动程序可以将其用于卸载结果:校验和有效性状态,数据包分类,哈希值,您将其命名。

至于上限,它取决于MBUF对象的最大大小和最小数据包数据室,这又可能是PMD特定的。在大多数用例中,只能依靠默认大小。

A DPDK mbuf's headroom is suited for prepending extra data (typically, metadata) to the packet data. Its use cases are PMD-specific. For example, virtio PMD stores struct virtio_net_hdr in it. Other drivers may use this for offload results: checksum validity status, packet classification, hash values, you name it.

As for the upper limit, it depends on the mbuf object's maximum size and on the minimum packet data room, which, in turn, might be PMD-specific. For the majority of use cases, it's OK to just rely on default size.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文