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 40D37A0032; Tue, 13 Sep 2022 03:44:23 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id D92D240151; Tue, 13 Sep 2022 03:44:22 +0200 (CEST) Received: from szxga01-in.huawei.com (szxga01-in.huawei.com [45.249.212.187]) by mails.dpdk.org (Postfix) with ESMTP id 545B84003F for ; Tue, 13 Sep 2022 03:44:21 +0200 (CEST) Received: from dggpeml500024.china.huawei.com (unknown [172.30.72.53]) by szxga01-in.huawei.com (SkyGuard) with ESMTP id 4MRR470KP9zlVr2; Tue, 13 Sep 2022 09:40:23 +0800 (CST) Received: from [10.67.100.224] (10.67.100.224) by dggpeml500024.china.huawei.com (7.185.36.10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.31; Tue, 13 Sep 2022 09:44:19 +0800 Subject: Re: [PATCH v2] examples/dma: support DMA dequeue when no packet received From: fengchengwen To: CC: , , References: <20220725122200.47851-1-fengchengwen@huawei.com> Message-ID: Date: Tue, 13 Sep 2022 09:44:18 +0800 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:68.0) Gecko/20100101 Thunderbird/68.11.0 MIME-Version: 1.0 In-Reply-To: <20220725122200.47851-1-fengchengwen@huawei.com> Content-Type: text/plain; charset="utf-8" Content-Language: en-US Content-Transfer-Encoding: 7bit X-Originating-IP: [10.67.100.224] X-ClientProxiedBy: dggems706-chm.china.huawei.com (10.3.19.183) To dggpeml500024.china.huawei.com (7.185.36.10) X-CFilter-Loop: Reflected 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 Kindly ping. On 2022/7/25 20:22, Chengwen Feng wrote: > Currently the example using DMA in asynchronous mode, which are: > nb_rx = rte_eth_rx_burst(); > if (nb_rx == 0) > continue; > ... > dma_enqueue(); // enqueue the received packets copy request > nb_cpl = dma_dequeue(); // get copy completed packets > ... > > There are no waiting inside dma_dequeue(), and this is why it's called > asynchronus. If there are no packet received, it won't call > dma_dequeue(), but some packets may still in the DMA queue which > enqueued in last cycle. As a result, when the traffic is stopped, the > sent packets and received packets are unbalanced from the perspective > of the traffic generator. > > The patch supports DMA dequeue when no packet received, it helps to > judge the test result by comparing the sent packets with the received > packets on traffic generator sides. > > Signed-off-by: Chengwen Feng > --- ...