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 86C76A00C4; Tue, 26 Jul 2022 10:49:52 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 34F5440DDD; Tue, 26 Jul 2022 10:49:52 +0200 (CEST) Received: from mga06.intel.com (mga06b.intel.com [134.134.136.31]) by mails.dpdk.org (Postfix) with ESMTP id 6257B40695 for ; Tue, 26 Jul 2022 10:49:50 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1658825390; x=1690361390; h=message-id:date:subject:to:cc:references:from: in-reply-to:content-transfer-encoding:mime-version; bh=lIYgxNjuApg6UiOhq6H0AdX5VqfHNPF3GpUiLJ4NSSs=; b=Hq6pVNPY83cWb01+daojC+YhKvVWZEia3k9YaiJMB6ywESnL/T2VtB7p 8vHJnWqyHsdh863FgEZei2fgRDbRm7S6VijGEXbxHFyHfb8qJ5vQsBM2C XpgmQ+LSTK6t0Xz3a9GM+2M5IlIcevk2I3LNxM5ygWVFN1WOJ3Em2PbhQ twTfdqVRQ0jdk3mu8gRdr0/VKV15xwi6g8nJjMLlDt0KNHgK62LiyN5Hh SrKb/7yNdkpOOirOQiA7Czg3/Lu9T333CNt/atiCwgjwtp78tRz5/DvFo GpwNMpstW1Y+ROqWyneNTHpEy6V/z7Q3wkG2APVSTwulzKmC2YBZepXGU Q==; X-IronPort-AV: E=McAfee;i="6400,9594,10419"; a="349600385" X-IronPort-AV: E=Sophos;i="5.93,193,1654585200"; d="scan'208";a="349600385" Received: from orsmga008.jf.intel.com ([10.7.209.65]) by orsmga104.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 26 Jul 2022 01:49:49 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.93,193,1654585200"; d="scan'208";a="627809681" Received: from fmsmsx606.amr.corp.intel.com ([10.18.126.86]) by orsmga008.jf.intel.com with ESMTP; 26 Jul 2022 01:49:48 -0700 Received: from fmsmsx604.amr.corp.intel.com (10.18.126.84) by fmsmsx606.amr.corp.intel.com (10.18.126.86) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.28; Tue, 26 Jul 2022 01:49:48 -0700 Received: from FMSEDG603.ED.cps.intel.com (10.1.192.133) by fmsmsx604.amr.corp.intel.com (10.18.126.84) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.28 via Frontend Transport; Tue, 26 Jul 2022 01:49:48 -0700 Received: from NAM10-DM6-obe.outbound.protection.outlook.com (104.47.58.107) by edgegateway.intel.com (192.55.55.68) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2375.28; Tue, 26 Jul 2022 01:49:48 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=nnPmklqSUFq2Wo/K+eg47VoV+PKo78NYhhcJUa0krlkM25qw6xv4fGnQbFoDR/G/2Lc8XW87a/FyZxZMaeV+Amj/J0W7ARxw6i48yk96RIv+uf9GVb4DNiEwapzWkkEMCK2giw8LRk2wELDU9ysdT8bveFSbEVzGQGGcpAnjOFXZ/v/oyh4rt0V3mYy4sn0HZFySw6INpvdqHyDQIQ9KJwe5mvND+yt3xygfzr+xJHV7EYWdUpJBbN0VP4fX0loOVfJiEx2gm5u9McD1A1Q0832J7DlOmEwXUOjIf0vjLblLsBNVUtOlAZOtLDPuGSG2YTsXaASL3GBNaZKz4MAFHg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=M6eDOzP1ixkuNsVSii3ft9ad4EyPVphZCgTD8EL1LoY=; b=R+smWAUjFS7UTL4pdttSpFGtQeyKDfDbtddkEbaOzeUpIm4Di2x5NxHRAzIESSvH12ygJpD56uobbj+tYkNURj+XRaXG+xK8DoMhNyfmSRoigxRbHHKwVEcXmzxZOtW/Ushr4Fy7Ok5lc514d2P4cvm7ooyhO+Ag/iz6KIhw3Z2s4snEPKBKpuMC7fgp9iJf2VKhvD1XfU0jJZZyygSnEUx9KfCVR5auHQei7aVbwIGUOP2JuAKwbqY67l7S6QtjKvagkSkOJjGuIxsYIs+kLXu6A4rsc//FIePQFPXfYxyKl7OJQYwyFnw9iugQQPw+GfpscOdqlx9zwOZD6E3ZSw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=intel.com; dmarc=pass action=none header.from=intel.com; dkim=pass header.d=intel.com; arc=none Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=intel.com; Received: from MW4PR11MB5872.namprd11.prod.outlook.com (2603:10b6:303:169::14) by DM6PR11MB3641.namprd11.prod.outlook.com (2603:10b6:5:13b::18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5458.18; Tue, 26 Jul 2022 08:49:46 +0000 Received: from MW4PR11MB5872.namprd11.prod.outlook.com ([fe80::fd61:b244:d8fb:ab1d]) by MW4PR11MB5872.namprd11.prod.outlook.com ([fe80::fd61:b244:d8fb:ab1d%4]) with mapi id 15.20.5458.024; Tue, 26 Jul 2022 08:49:46 +0000 Message-ID: Date: Tue, 26 Jul 2022 09:49:41 +0100 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:91.0) Gecko/20100101 Thunderbird/91.11.0 Subject: Re: [PATCH v2] examples/dma: support DMA dequeue when no packet received Content-Language: en-US To: Chengwen Feng , CC: , References: <20220725122200.47851-1-fengchengwen@huawei.com> From: Kevin Laatz In-Reply-To: <20220725122200.47851-1-fengchengwen@huawei.com> Content-Type: text/plain; charset="UTF-8"; format=flowed Content-Transfer-Encoding: 7bit X-ClientProxiedBy: LO4P123CA0612.GBRP123.PROD.OUTLOOK.COM (2603:10a6:600:314::6) To MW4PR11MB5872.namprd11.prod.outlook.com (2603:10b6:303:169::14) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 8d30a009-7d4d-4f28-dac5-08da6ee3caa4 X-MS-TrafficTypeDiagnostic: DM6PR11MB3641:EE_ X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: mbTsA/Kk8Uel9g+/7Tq10QUO8GqS5c5V6syx+nJB+P5D5iFJfNEG/g7fkWnikStdq77cs1duGXpk7ekcGq6/OfBNRu4irqiJKgV6BMfYJP51Qua9YHMQ5kRQVj6jGoSn45RKWD2hulTKY2pO98NfsbEU8tXELoW/pERfnkluDU1PgyOwODKlW1TjKr+D6eew0eiscOohgcxezbSNartv74+jwhVBcw+Ef3IcvpKbUJfd53txvxkuFnrjdfNEOsH6sssOjcHF58l0hdFrzJyUedTRHMacFfZLWCF3u70n12l7JbfPe2vwfZ+B4h4n7kd6wE4V2nYByhpCAXBWhcAQCmh0MNtUumiW6CQakL9MGYUFjs43U3854TYJicoenE+pjtMjmWuuLHcviXKTp/ZY9OX5pd7RtDqSY0NBprBwypKLw8op9JDKE2VhPLnvMKqZz21kcQ4JAkgV9o6XFvYRBJJxBEE5E4CHZLu2XVPs0zPVLLpYV1rxXLYaG5ZgL6M37j+iY62SoL+DZycIrZ3RO65oHmuN3fuVA1wJ2QNBsvABO45ESqdz8hnOgosk/ZreRzYzOTMYTbc4KnbIRxCMjTOpZkHyKC8inCF02fX5H91HQGBZ8WYROf+KS67BS3o0WvFFQ0p0R7+AZbYay8gyVoarXuZ3X4vddEcrDZMXZmlXFAMoJIFPBL63PauvjXANtLhdlui4VofPIdmcifAyRyuF0wIWzxYXhd3gjYgw91erus9UOURBFfh39t3fXECyJ8dFcPq3c4fGfDfus1u7J6VNDSWZ42JRGnqXVanu+jg2E3k3jdtg8J8/f+iPEfrdRRl/kTEtsYuXi+U6ezMMdQ== X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:MW4PR11MB5872.namprd11.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230016)(39860400002)(366004)(136003)(346002)(396003)(376002)(316002)(186003)(31686004)(6512007)(82960400001)(107886003)(86362001)(31696002)(2616005)(26005)(66476007)(66556008)(66946007)(6486002)(8936002)(8676002)(4326008)(478600001)(53546011)(38100700002)(41300700001)(6666004)(6506007)(2906002)(44832011)(5660300002)(83380400001)(36756003)(45980500001)(43740500002); DIR:OUT; SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?B?MUVURjg2cTEwR25XOVR6Ni96M1ZSMXkveHZIamI0QmlJWnQ1Rjc0MnJ4TTJB?= =?utf-8?B?a05wN0xZMXZzU2FkdjRad1BhREwvdTdzVXRVVXk4Y2N5YnRjUU13MFRXSzRa?= =?utf-8?B?NFAwVThTNU4xUXlQdmR2aFNmNy82MXVuYTFWT0dZbzJHVThibWVrNHBOcmJU?= =?utf-8?B?amUrd3NXT1QyaG9xdnZsK2dBdzUxbVV3OS9ENHdGd3RRTWdSelhlYTVtajVq?= =?utf-8?B?WFJKR2FObE5uMi9IKzRDcDB3MG5MekQ4ekRoeXJPcVkvR2ZIKy9qaGhjWFQv?= =?utf-8?B?YnBhNk1Fa3ZyS2owb05PY2dHNmhld3VXY0dFL3B0TnZuR29PRXQvUDJkbUxS?= =?utf-8?B?d1M2U3dRNTNUcFVRall1eGFnYStteU5MSjlNTytVcWF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f28-dac5-08da6ee3caa4 X-MS-Exchange-CrossTenant-AuthSource: MW4PR11MB5872.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 26 Jul 2022 08:49:46.5904 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 46c98d88-e344-4ed4-8496-4ed7712e255d X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: l4xBT/oti6A0N4MODYjX5Np2RnAYJhaMVrRuVcgRavI7KS/UedSjGsnmCf3kLitq878mb7W4Ctpo/gNMSmDrMg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM6PR11MB3641 X-OriginatorOrg: intel.com 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 On 25/07/2022 13: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 > --- > examples/dma/dmafwd.c | 8 +++++++- > 1 file changed, 7 insertions(+), 1 deletion(-) > Acked-by: Kevin Laatz