DPDK patches and discussions
 help / color / mirror / Atom feed
* dpdk: Inquiry about vring cleanup during packets transmission
@ 2023-05-27  7:08 wangzengyuan
  2023-05-30  9:48 ` Maxime Coquelin
  0 siblings, 1 reply; 2+ messages in thread
From: wangzengyuan @ 2023-05-27  7:08 UTC (permalink / raw)
  To: dev; +Cc: maxime.coquelin, chenbo.xia, zhangxu (BA), luyicai, wangyunjian

[-- Attachment #1: Type: text/plain, Size: 1006 bytes --]

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

[-- Attachment #2: Type: text/html, Size: 4241 bytes --]

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: dpdk: Inquiry about vring cleanup during packets transmission
  2023-05-27  7:08 dpdk: Inquiry about vring cleanup during packets transmission wangzengyuan
@ 2023-05-30  9:48 ` Maxime Coquelin
  0 siblings, 0 replies; 2+ messages in thread
From: Maxime Coquelin @ 2023-05-30  9:48 UTC (permalink / raw)
  To: wangzengyuan, dev; +Cc: chenbo.xia, zhangxu (BA), luyicai, wangyunjian

Hello,

On 5/27/23 09:08, wangzengyuan wrote:
> 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.

Both the Tx and Rx queues free threshold are configurable via ethdev
APIs:

int rte_eth_tx_queue_setup(uint16_t port_id, uint16_t tx_queue_id,
		uint16_t nb_tx_desc, unsigned int socket_id,
		const struct rte_eth_txconf *tx_conf);

int rte_eth_rx_queue_setup(uint16_t port_id, uint16_t rx_queue_id,
		uint16_t nb_rx_desc, unsigned int socket_id,
		const struct rte_eth_rxconf *rx_conf,
		struct rte_mempool *mb_pool);

As you are using large rings, your application may use above APIs to set 
more appropriate values.

Regards,
Maxime

> Best regards,
> 
> Zengyuan Wang
> 


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2023-05-30 15:41 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-05-27  7:08 dpdk: Inquiry about vring cleanup during packets transmission wangzengyuan
2023-05-30  9:48 ` Maxime Coquelin

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).