[转] dpdk memory相关

dpdk内存篇1-基本   https://www.sdnlab.com/23475.html

     https://software.intel.com/en-us/articles/memory-in-dpdk-part-1-general-concepts

dpdk内存篇2-深入IOVA  https://www.sdnlab.com/23551.html 

                                          https://software.intel.com/en-us/articles/memory-in-dpdk-part-2-deep-dive-into-iova

dpdk内存3-dpdk 17.11及更早版本  https://software.intel.com/en-us/articles/memory-in-dpdk-part-3-1711-and-earlier-releases

dpdk内存4 -dpdk18.11之后 https://software.intel.com/en-us/articles/memory-in-dpdk-part-4-1811-and-beyond

 

general concepts

huge pages:

memory 以page为单位进行管理,page:virtually and physically continuous blocks of memory.

程序运行时,通过page address来访问memory。这个地址需要从应用所用的虚拟地址转换为hardware认识的物理地址。

转换过程通过page tables;最近使用的page address被放在cache中(TLB:translation lookaside buffer). 每个page占用TLB中的一个entry。

若你要访问的页不在TLB中,那么就是TLB miss。OS会从global page table中去找miss的这个页放到TLB中。这个过程比较expensive。

为了减少TLB miss,DPDK采用huge page:2MB或1GB的virtually and physically continuous memory area。

这样1个page可以覆盖更大的memory area,即每个TLB entry对应的memory area更大。这样会减少TLB miss。

 

pinning memory to NUMA node

 

hardware,physical address and DMA

 

IOMMU and IOVA

iova:

input-output virtual address

memory allocation and management

 

memory pools

 

deep dive into IOVA

iova

 

 

pci driver in DPDK

uio_pci_generic

kernel中的uio driver。比igb_uio的功能少:所支持的interrupt type只有legacy interrupt;不能创建virtual functions。

igb_uio

是dpdk最开始时候就设计的。

利用kernel的UIO framework,提供了对所有中断类型的支持(legacy,message signal interrupt[MSI],MSI-X), 以及创建virtual functions。

并把硬件设备的registers和interrupt handles 暴露到/dev/uio 文件系统下。这样DPDK EAL把它映射到user space,供给DPDK PMD使用。

igb_uio不支持IOMMU,只能用passthrough的方式,它在IOVA和physical address间的映射是1:1的。只能用IOVA as PA。

vfio-pci

是kernel中VFIO infrastructure 的一部分。

VFIO infrastructure使得设备registers 和设备interrupts 可以被user space应用程序使用,而且可以使用IOMMU建立IOVA mappings 来

从user space执行IO。

vfio-pci允许使用IOVA as PA(需要root权限)和IOVA as VA。

4.5之后的kernel引入enable_unsafe_noiommu_mode,使得vfio可以在没有IOMMU的情况使用。

 

dpdk17.11 and before

 

dpdk18.11 and beyond

 

原文链接: https://www.cnblogs.com/yi-mu-xi/p/12146341.html

欢迎关注

微信关注下方公众号,第一时间获取干货硬货;公众号内回复【pdf】免费获取数百本计算机经典书籍;

也有高质量的技术群,里面有嵌入式、搜广推等BAT大佬

    [转] dpdk memory相关

原创文章受到原创版权保护。转载请注明出处:https://www.ccppcoding.com/archives/403591

非原创文章文中已经注明原地址,如有侵权,联系删除

关注公众号【高性能架构探索】,第一时间获取最新文章

转载文章受原作者版权保护。转载请注明原作者出处!

(0)
上一篇 2023年4月23日 上午9:16
下一篇 2023年4月23日 上午9:16

相关推荐