dpdk: Inquiry about vring cleanup during packets transmission

wangzengyuan wangzengyuan at huawei.com
Sat May 27 09:08:09 CEST 2023


Hi,
         I am writing to inquire about the vring cleanup process during packets transmission.
In the virtio_xmit_pkts function, there is the following code:
         nb_used = virtqueue_nused(vq);

         if (likely(nb_used > vq->vq_nentries - vq->vq_free_thresh))
                   virtio_xmit_cleanup(vq, nb_used);
In other words, cleaning is performed when the number of items used in the vring exceeds (vq->vq_nentries - vq->vq_free_thresh). In the case of an vring size of 4096, at least (4096-32) items need to be cleaned at once, which will take a considerable amount of time.
I'm curious why not clean up fewer items each time to avoid taking up too much CPU time in one transmission. Because during the debugging process, I found that cleaning up thousands of items at once takes up a considerable amount of time.
As I am not familiar with this process, I would appreciate it if you could provide me with some information on what its purpose is.

Best regards,

Zengyuan Wang
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mails.dpdk.org/archives/dev/attachments/20230527/cac299a1/attachment-0001.htm>


More information about the dev mailing list