简体   繁体   English

KMDF DMA 传输在几次重新启动后变慢

[英]KMDF DMA transfer slows down after a few restarts

Story: I am developing a KMDF driver for a custom PCI-E board, which has a PLX9056 chip connecting to the PCI-E.故事:我正在为定制的 PCI-E 板开发 KMDF 驱动程序,该板具有连接到 PCI-E 的 PLX9056 芯片。

The driver and it's test software works perfectly after booting the computer, but after restarting the software and driver a several times, the transfer speed slows down from 160Mb/s to around 110 MB/s step by step.启动电脑后驱动及其测试软件运行正常,但多次重启软件和驱动后,传输速度从160Mb/s逐步降低到110MB/s左右。

(I have to disable and re-enable the driver everytime I want to restart the software, firmware bug, not my job atm.) (每次我想重新启动软件,固件错误,而不是我的工作自动取款机时,我都必须禁用并重新启用驱动程序。)

My main question is, is there any memory or anything connected to the DMA that can get fragmented and therefore make the transfers slower?我的主要问题是,是否有任何内存或任何连接到 DMA 的东西会碎片化从而使传输变慢?

The driver uses Scatter/Gather DMA, hardware supported, only 32bit.驱动使用 Scatter/Gather DMA,支持硬件,仅 32 位。 This only occurs when transferring data to the device.这仅在将数据传输设备时发生。

The issue seems to be the way the driver handles the data/buffers.问题似乎是驱动程序处理数据/缓冲区的方式。 The PLX provided DMA testing software always gets the 160MB/s rate every time, even when our driver already broke and manages only 110MB/s. PLX 提供的 DMA 测试软件每次总是获得 160MB/s 的速率,即使我们的驱动程序已经损坏并且仅管理 110MB/s。 Therefore, the problem must be in our driver.因此,问题一定出在我们的驱动程序上。

Reinstalling the driver does not solve the problem, only a reboot does.重新安装驱动程序并不能解决问题,只有重新启动才能解决问题。

Worth to mention, the software allocates a rather huge buffer (1GB), from which it sends the data to the device through the driver.值得一提的是,该软件分配了一个相当大的缓冲区(1GB),从中通过驱动程序将数据发送到设备。

Solved the issue.解决了这个问题。

The fragmentation of the memory caused the driver to not be able to allocate large continous blocks of memory after the OS has been running for a while.内存碎片导致驱动程序无法在操作系统运行一段时间后分配大的连续内存块。

Fixed by using Large-Page Support which allowed me to allocated huge continous memory pages.通过使用允许我分配巨大的连续内存页面的大页面支持来修复。 https://docs.microsoft.com/en-us/windows/win32/memory/large-page-support https://docs.microsoft.com/en-us/windows/win32/memory/large-page-support

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM