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 2B392A0C40; Thu, 5 Aug 2021 14:57:04 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id DCDD140143; Thu, 5 Aug 2021 14:57:03 +0200 (CEST) Received: from mga18.intel.com (mga18.intel.com [134.134.136.126]) by mails.dpdk.org (Postfix) with ESMTP id DE2C340040 for ; Thu, 5 Aug 2021 14:57:01 +0200 (CEST) X-IronPort-AV: E=McAfee;i="6200,9189,10066"; a="201332965" X-IronPort-AV: E=Sophos;i="5.84,296,1620716400"; d="scan'208";a="201332965" Received: from orsmga002.jf.intel.com ([10.7.209.21]) by orsmga106.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 05 Aug 2021 05:57:00 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.84,296,1620716400"; d="scan'208";a="437778832" Received: from orsmsx603.amr.corp.intel.com ([10.22.229.16]) by orsmga002.jf.intel.com with ESMTP; 05 Aug 2021 05:57:00 -0700 Received: from orsmsx612.amr.corp.intel.com (10.22.229.25) by ORSMSX603.amr.corp.intel.com (10.22.229.16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2242.10; Thu, 5 Aug 2021 05:56:59 -0700 Received: from orsmsx607.amr.corp.intel.com (10.22.229.20) by ORSMSX612.amr.corp.intel.com (10.22.229.25) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2242.10; Thu, 5 Aug 2021 05:56:59 -0700 Received: from ORSEDG601.ED.cps.intel.com (10.7.248.6) by orsmsx607.amr.corp.intel.com (10.22.229.20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2242.10 via Frontend Transport; Thu, 5 Aug 2021 05:56:59 -0700 Received: from NAM12-BN8-obe.outbound.protection.outlook.com (104.47.55.176) by edgegateway.intel.com (134.134.137.102) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2242.10; Thu, 5 Aug 2021 05:56:58 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=MyUU5vcIYMHhSHxOo9k+cCJSOGFTE4I/dZDGRFCzoAmAD1wxBiw3x3NCnccEx36ZIXNsmsmmcEuL84PEa2BVoEl1Y3Vm4kA+XMBU5mY1/RnsxYwN045x7khFnOs6S0V9vxmjvHEm6+2f11a2zjXmWoq0xT5SUwAJZYlV5rvFTJAWO1D5U+Krqfguk4VRttY7wxUIIHGrlZLLSfZYEGp0Wk48XwZIhw9CM34BqT6OvFlAl2cPxjSAvaQOoq+xS1DqGxP/qc6MrGY1+iHgTi4aG8uT33MlYL+c9vGhFCxlz9h0SRK/fD5r/ERi1uuxMUWx4ysfaYv3WJ1Qbt1jMV3fiQ== 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-SenderADCheck; bh=gpVI+/eTMBe9cLDHITwMGrGnL2c3OgOuhzOugMvLiaY=; b=c0VClVwXWujGMRZZnYSJGOx8xhQs7bf24QzpVV1UeGNWTu/qDpJ429JrpG/BkkPJtw23qENlbeFEaE3D2xATqiHFT6mWLkJdqpT7gfJTijjZHhucaqQJHDxplPvfZncYigXz9EsIa4XXP8R7zgbQM4L2QtuXs8+TlvEj01qBlIH/PAwRLHLdcnsrIdqvNlM9wfc/7fofGOsx8uDyj0CyyZBDuXe1nsjXcHP+FJ6vc7mdORcNwTdHx+ofbFSsP0XbV95PPk88JJByh1KvekReIyqHkU46QT2QUL56wqsNk4TmDcdLJPDsKJZoUPRfGVSrL7oHb0qTTEj/KVTtjq2c5A== 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 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=intel.onmicrosoft.com; s=selector2-intel-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=gpVI+/eTMBe9cLDHITwMGrGnL2c3OgOuhzOugMvLiaY=; b=T0EYWuQI/Ge6FlS5F4NuOyLhIHlsIUZTQwwbK3wvCXdH0a2CqAZ2Z9n6zr+HkwIR0TjypH+xED4WEo4wVCqHk3Hys1cQQpnRxGnEFMRYtp/4QoWrxmf59MGiyWgOUf3p5BtN2fN1r2J7dUR9G8885ALsJNk1Lc0Bw68wbPfp5P4= Received: from PH0PR11MB5207.namprd11.prod.outlook.com (2603:10b6:510:32::15) by PH0PR11MB4806.namprd11.prod.outlook.com (2603:10b6:510:31::21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4394.15; Thu, 5 Aug 2021 12:56:56 +0000 Received: from PH0PR11MB5207.namprd11.prod.outlook.com ([fe80::c42e:f6ab:d4d6:dc8a]) by PH0PR11MB5207.namprd11.prod.outlook.com ([fe80::c42e:f6ab:d4d6:dc8a%5]) with mapi id 15.20.4373.026; Thu, 5 Aug 2021 12:56:56 +0000 From: "Walsh, Conor" To: Chengwen Feng , "thomas@monjalon.net" , "Yigit, Ferruh" , "Richardson, Bruce" , "jerinj@marvell.com" , "jerinjacobk@gmail.com" , "andrew.rybchenko@oktetlabs.ru" CC: "dev@dpdk.org" , "mb@smartsharesystems.com" , "nipun.gupta@nxp.com" , "hemant.agrawal@nxp.com" , "maxime.coquelin@redhat.com" , "honnappa.nagarahalli@arm.com" , "david.marchand@redhat.com" , "sburla@marvell.com" , "pkapoor@marvell.com" , "Ananyev, Konstantin" Thread-Topic: [dpdk-dev] [PATCH v13 4/6] dmadev: introduce DMA device library implementation Thread-Index: AQHXiFudTsNwb6SaIkKLZ7NiX+/tc6tk3dQw Date: Thu, 5 Aug 2021 12:56:55 +0000 Message-ID: References: <1625231891-2963-1-git-send-email-fengchengwen@huawei.com> <1627990189-36531-1-git-send-email-fengchengwen@huawei.com> <1627990189-36531-5-git-send-email-fengchengwen@huawei.com> In-Reply-To: <1627990189-36531-5-git-send-email-fengchengwen@huawei.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: dlp-reaction: no-action dlp-version: 11.5.1.3 dlp-product: dlpe-windows authentication-results: huawei.com; dkim=none (message not signed) header.d=none;huawei.com; dmarc=none action=none header.from=intel.com; x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: f16b6dc1-87be-41ff-bbba-08d95810813d x-ms-traffictypediagnostic: PH0PR11MB4806: x-ld-processed: 46c98d88-e344-4ed4-8496-4ed7712e255d,ExtAddr x-ms-exchange-transport-forked: True x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:6108; x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: Qn+rY6LU2YWbTfh3ZEK2p7rUVuOcBtFB3FmihbSIB+5ZtGSRGx0tdoyhH9yXCreI9xmwFu+cJgootPFFjDFtPEf4dWjxFGurx5S4u7DRdodDmdbWfTVofwPcyZPZKYOv1S0NG07n8Wzqy/YRhY21vZ7GrMOkEDN2QyZRmsjAaGw7ueaZMNWQYvhzyQW68oC2Y5G0fOVIrJkP/sIJ9udve35LM6bWMRc6yg9x65t41deM9rx4+pF4WKFx5s6FQQuEy2BjrOS+9ETxRVcusmec3sWhboQGUNnBwVt1aQHN6LYOGqg1ZxR8R1ijEPstxRySdO7oWv2mP13IH3gR/usR8Mth14LWmgRADajexskiunFnIWcWOSFFu9rUMRWB/zgexMgJbUgf7jK8UOQjg3qJ6rNtOB305qcjJfzJhB+DbzfXeSaOFkx6ZiWbvRE+KorzTdSXvZdADEvGzcXBn65Zd1QL/0qSZgvKVrqEWMASF36ZSfvf2hRnaJaRIhueLKE/i6Mt7OEUHPVYJdw2YmgWwZHkvh3DfqNil43pbxgGSscV6TmGBGbzMiA9k0Wf/L088clnUmU5C20N/kG427isTmmzUb0hpNTtPpskJmHkIHjKLewXwcmMXP23AnpE1Y58UOOPqB8zwa7PORzFtiOurLQGBXe510qJLM2KOF4yDEtD1J8VwiwlUfURLGmKy96Fxd5h5nzqLVG2h79pKcVFbA== x-forefront-antispam-report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:PH0PR11MB5207.namprd11.prod.outlook.com; PTR:; CAT:NONE; SFS:(4636009)(366004)(186003)(66556008)(5660300002)(30864003)(6506007)(26005)(83380400001)(4326008)(64756008)(33656002)(52536014)(66446008)(7416002)(66476007)(66946007)(7696005)(76116006)(8936002)(38100700002)(71200400001)(122000001)(2906002)(8676002)(55016002)(9686003)(107886003)(38070700005)(66574015)(508600001)(54906003)(316002)(110136005)(86362001)(579004)(559001); DIR:OUT; SFP:1102; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?utf-8?B?RnQvdS84Qk9Hdlo5Z3hXclU1b3REVklsdzF0ajJGeFhIWjExL1RMYTg0dmlu?= =?utf-8?B?RFgyd2x3UUU2ME1ZS0JDT3NBS1FNTFVBK3NpVVRYSGFqaHpieXBXdWdNbDFN?= =?utf-8?B?ZTBwdUszWk85YkdjQ0JpZmt3L0lzdXVZSEt1a3JibWsrQlZFbXJjSFFkb002?= =?utf-8?B?WTJxZ2h3MkRnTytQbzcyODk0Zy9UY2lLbUJnR1dTamRNTENtVDZtZW1mYlBD?= =?utf-8?B?VG9ZZ0tsUEZRcFlEeHI1UnBPczZsbVVCdEkwOTRVN0E0NGxnSGJrZTM0UFVu?= =?utf-8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r?= =?utf-8?B?eFdaVUk2bllxajJ2SU1zVVg3Ump0S1VKMkNTQ0pCYURQNzdYZ0xNekVEZmIw?= =?utf-8?B?N29ybG9OL1ovZTkzMUYwcW4vNGlnM3NNeG83QStIL2VTaTJ6OVRqZ0IweHVR?= =?utf-8?B?SjlNYldtRGRqM3crSGJGdExxRHJtSXBoZWdUZ1UxZUhlei9ZMGg2V2hSbGhK?= =?utf-8?B?ZTNPZndiTmwrMkRqcnZaM2txc05VSmRwZ1RsL0JYK2xUUk01K1YxNnRUMlhq?= =?utf-8?B?eFNvN1R0UHQyb2UyNk9yRnpBUTlOeVhId2ozYVlUOW1WZEVzWEo5c2ZZcnFr?= =?utf-8?B?M0ZUUHdlL3hFT1l1WnlocU1yU1U3TTY4b3BDRDRHU3QxUnpqenBIS1NHNkZB?= =?utf-8?B?ZExKb0V0OVgvenVxUHEvYjhqRkNNc0wyb1hLNWV2cTcrL0U4SExxVE1UQ1lL?= =?utf-8?B?RkJUK29xa0FEWENpcGxHdWdEQlIvLzBBa1pnZjFsNi9vR3Q3QS9aWkNhWGJl?= =?utf-8?B?Nk5Hei9YdjE2WGJaWUwzZW8yVzFYWHRSZWwrU1BUVnVRbEVzL29acytBQ0RQ?= =?utf-8?Q?2dMCPYB7nqSdJwDzcr0b0SEaU6Ms1HWkgUFGa3o?= Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: base64 MIME-Version: 1.0 X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: PH0PR11MB5207.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: f16b6dc1-87be-41ff-bbba-08d95810813d X-MS-Exchange-CrossTenant-originalarrivaltime: 05 Aug 2021 12:56:55.9269 (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: q7CLH23woAQxN/dfCHoH1zRQruYDoh7LDp5kZV1+cViLKk4uhGY0jvpHsjUjPdW8MfBMcE3CfP/ae6Jjp/GPHw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: PH0PR11MB4806 X-OriginatorOrg: intel.com Subject: Re: [dpdk-dev] [PATCH v13 4/6] dmadev: introduce DMA device library implementation 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 Sender: "dev" PiBUaGlzIHBhdGNoIGludHJvZHVjZSBETUEgZGV2aWNlIGxpYnJhcnkgaW1wbGVtZW50YXRpb24g d2hpY2ggaW5jbHVkZXMNCj4gY29uZmlndXJhdGlvbiBhbmQgSS9PIHdpdGggdGhlIERNQSBkZXZp Y2VzLg0KPiANCj4gU2lnbmVkLW9mZi1ieTogQ2hlbmd3ZW4gRmVuZyA8ZmVuZ2NoZW5nd2VuQGh1 YXdlaS5jb20+DQo+IEFja2VkLWJ5OiBCcnVjZSBSaWNoYXJkc29uIDxicnVjZS5yaWNoYXJkc29u QGludGVsLmNvbT4NCj4gQWNrZWQtYnk6IE1vcnRlbiBCcsO4cnVwIDxtYkBzbWFydHNoYXJlc3lz dGVtcy5jb20+DQo+IC0tLQ0KPiAgY29uZmlnL3J0ZV9jb25maWcuaCAgICAgICAgICB8ICAgMyAr DQo+ICBsaWIvZG1hZGV2L21lc29uLmJ1aWxkICAgICAgIHwgICAxICsNCj4gIGxpYi9kbWFkZXYv cnRlX2RtYWRldi5jICAgICAgfCA1NjMNCj4gKysrKysrKysrKysrKysrKysrKysrKysrKysrKysr KysrKysrKysrKysrKw0KPiAgbGliL2RtYWRldi9ydGVfZG1hZGV2LmggICAgICB8IDExOCArKysr KysrKy0NCj4gIGxpYi9kbWFkZXYvcnRlX2RtYWRldl9jb3JlLmggfCAgIDIgKw0KPiAgbGliL2Rt YWRldi92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