DPDK缓冲区从RX环接收并在TX路径上释放。

huangapple go评论57阅读模式
英文:

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.

huangapple
  • 本文由 发表于 2020年1月4日 00:16:12
  • 转载请务必保留本文链接:https://go.coder-hub.com/59581822.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定