英文:
DPDK buffers received from the RX ring and freeded on the TX path
问题
RX 缓冲区不会被显式释放,因为它们在 TX 环上被重用。依赖于 TX 队列是否由 NIC 处理以释放 RX 环中的条目是否是良好的实践?
英文:
Consider a DPDK program where each EAL thread:
- receives a packet on its own RX queue
- modifies the buffer in place
- puts it back on the TX ring to echo it back to the sender
The RX buffers are not explicitely freeed as they are re-used on the TX ring. Is it good practice to depend on the TX queue to be processed by the NIC to free up entries in the RX ring?
答案1
得分: 2
成功放入Tx队列的缓冲区将由PMD释放。这是唯一的选项,所以是的,这是一个好的做法。
但请注意,将一批数据包放入Tx队列可能会失败,因为由于某种原因队列可能已满。因此,如果在rte_eth_tx_burst()
之后还有未入队的数据包,那些必须手动释放或者必须重新尝试传输。
英文:
The buffers successfully put in the Tx queue will be freed by the PMD. That’s the only option, so yes it’s a good practice.
Please note though, that placing a burst of packets in the Tx queue might fail, as the queue might be full for some reason. So if there are any packets left unqueued after rte_eth_tx_burst()
, those must be freed manually or the transmission must be retried.
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论