From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 2FE3742BE6; Tue, 30 May 2023 17:41:11 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 02B2B410EE; Tue, 30 May 2023 17:41:11 +0200 (CEST) Received: from szxga03-in.huawei.com (szxga03-in.huawei.com [45.249.212.189]) by mails.dpdk.org (Postfix) with ESMTP id 5A84540A7A for ; Sat, 27 May 2023 09:08:12 +0200 (CEST) Received: from canpemm100007.china.huawei.com (unknown [172.30.72.55]) by szxga03-in.huawei.com (SkyGuard) with ESMTP id 4QStBQ64TmzLmV9; Sat, 27 May 2023 15:06:38 +0800 (CST) Received: from kwepemm600005.china.huawei.com (7.193.23.191) by canpemm100007.china.huawei.com (7.192.105.181) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.23; Sat, 27 May 2023 15:08:09 +0800 Received: from kwepemm600005.china.huawei.com ([7.193.23.191]) by kwepemm600005.china.huawei.com ([7.193.23.191]) with mapi id 15.01.2507.023; Sat, 27 May 2023 15:08:09 +0800 From: wangzengyuan To: "dev@dpdk.org" CC: "maxime.coquelin@redhat.com" , "chenbo.xia@intel.com" , "zhangxu (BA)" , luyicai , wangyunjian Subject: dpdk: Inquiry about vring cleanup during packets transmission Thread-Topic: dpdk: Inquiry about vring cleanup during packets transmission Thread-Index: AdmQaaqLvoIP3nrlQxi0gNeQ3A23hg== Date: Sat, 27 May 2023 07:08:09 +0000 Message-ID: Accept-Language: zh-CN, en-US Content-Language: zh-CN X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [10.174.242.232] Content-Type: multipart/alternative; boundary="_000_cbb8e8c33fcd4661a844a9993d29f9fahuaweicom_" MIME-Version: 1.0 X-CFilter-Loop: Reflected X-Mailman-Approved-At: Tue, 30 May 2023 17:41:09 +0200 X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org --_000_cbb8e8c33fcd4661a844a9993d29f9fahuaweicom_ Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Hi, I am writing to inquire about the vring cleanup process during pac= kets transmission. In the virtio_xmit_pkts function, there is the following code: nb_used =3D 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 vri= ng 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 m= uch CPU time in one transmission. Because during the debugging process, I f= ound that cleaning up thousands of items at once takes up a considerable am= ount 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 --_000_cbb8e8c33fcd4661a844a9993d29f9fahuaweicom_ Content-Type: text/html; charset="us-ascii" Content-Transfer-Encoding: quoted-printable

Hi,=

     &= nbsp;   I am writing to inquire about the vring cleanup process d= uring packets transmission.

In= the virtio_xmit_pkts function, there is the following code:

&n= bsp;        nb_used =3D virtqueue_nused(= vq);

 

&n= bsp;        if (likely(nb_used > vq-&= gt;vq_nentries - vq->vq_free_thresh))

&n= bsp;            = ;      virtio_xmit_cleanup(vq, nb_used);

In= other words, cleaning is performed when the number of items used in the vr= ing 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 muc= h CPU time in one transmission. Because during the debugging process, I fou= nd 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 pr= ovide me with some information on what its purpose is.

 

Best regards,=

 

Zengyuan Wang=

--_000_cbb8e8c33fcd4661a844a9993d29f9fahuaweicom_--