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 693B7A0C43; Wed, 16 Jun 2021 04:18:00 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 2510740140; Wed, 16 Jun 2021 04:18:00 +0200 (CEST) Received: from mga17.intel.com (mga17.intel.com [192.55.52.151]) by mails.dpdk.org (Postfix) with ESMTP id 74DC34003C for ; Wed, 16 Jun 2021 04:17:57 +0200 (CEST) IronPort-SDR: S6LqvDZy+CAr41ZpB/X4MBjwJ0hJbiaJVZvgg/uj+z1CkfQSAujtIJkAATx3W+1D5ZOmts2tm4 WMvdadX8ohNA== X-IronPort-AV: E=McAfee;i="6200,9189,10016"; a="186477662" X-IronPort-AV: E=Sophos;i="5.83,276,1616482800"; d="scan'208";a="186477662" Received: from orsmga007.jf.intel.com ([10.7.209.58]) by fmsmga107.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 15 Jun 2021 19:17:56 -0700 IronPort-SDR: ALDKrAmewN5+Tt2TRWDUJfqn2qrSf6XjrhgNC6QfCO7KQZ6m2T/1FUHsAlpko/I8kBjuXXwwyv 4vMK27p8ZOQg== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.83,276,1616482800"; d="scan'208";a="442736339" Received: from orsmsx603.amr.corp.intel.com ([10.22.229.16]) by orsmga007.jf.intel.com with ESMTP; 15 Jun 2021 19:17:56 -0700 Received: from orsmsx609.amr.corp.intel.com (10.22.229.22) 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.4; Tue, 15 Jun 2021 19:17:55 -0700 Received: from orsmsx611.amr.corp.intel.com (10.22.229.24) by ORSMSX609.amr.corp.intel.com (10.22.229.22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2242.4; Tue, 15 Jun 2021 19:17:55 -0700 Received: from ORSEDG601.ED.cps.intel.com (10.7.248.6) by orsmsx611.amr.corp.intel.com (10.22.229.24) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2242.4 via Frontend Transport; Tue, 15 Jun 2021 19:17:55 -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.4; Tue, 15 Jun 2021 19:17:55 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=UpmM1IpBVXFK8yD7JQUKG6Udsjjgauh84kpuDx7XeGZBo9dVnzuv+pqFUPX9Sg4GNHLorV/1pGKo0LhHvwRM9k60ulPa9j6rl3uTZBeObxIXb2bNHLImvs7XBmVN/1AGcddeDLfrwKyTxyFqc/H+tje4fdKxiR6s4erSOUNvXG/c0Y39PMzztZH669Nxw6pHhRWd1TxN1+vgOQplvKA0V8cI0OsGeZFLUfIx0IJ7jpwsx5gR4ensE2uVkLKjc4eONQLhgrDrRss0BjesZeTBrxe3e9fGU7UwwU+EFUrTPFcUWoSJTKCraH2WSDso80c1R3POiAiVgtHpUrQJSPEB0g== 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=3NMMZSdFaJ3DbHvMJRkiecAQc/PP0Yr6An33C2pBUa8=; b=j350imhFuntn5DXb+NmoKON7MckE+OmCfsw3/2eEeHkQt/GSm8kYWH9NAyGv7AJzLIH6l5L2OraCpHE+jwSJ3UsOG3jct90ASxRD8mhsnjIaiCPsatNStM1qDcLa0Ew8Xboc5pCRuv6MHNrvXCqoAJnKlKtsjAGgblI8ToZvyG/YeQlwNE12dh51F4oMtrimz7PIrQgOUoYp4/1TxaHn/WnHIsEXha9llXGD+pPBWKNPT4CHzNMOWr/uq9IDdAKkj+BAxWowk/oOax/Sl7XxvlNxmw2ArAz92C4m791//zqkKikMRqNvzUWZK9U8yowA1aqKaiwGH1fSEf1dcG6TTg== 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=3NMMZSdFaJ3DbHvMJRkiecAQc/PP0Yr6An33C2pBUa8=; b=fU6wtFvsIWKVZfxQ5e/01fmQssJbNB2a4g6DBnogGgwZbkJfm/XElIiEDEeBnDcceB8H59rgWKxT2RUrETFDZA4wLK1wNctwDg1qlOxIZxlUgrzHqlVwj9Z5wFuJvvz7xdCtq4HmH/tGvazs2urUPNRdyr9RxCYUT2dvud2yiWY= Received: from BN8PR11MB3795.namprd11.prod.outlook.com (2603:10b6:408:82::31) by BN6PR11MB1444.namprd11.prod.outlook.com (2603:10b6:405:a::19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4219.24; Wed, 16 Jun 2021 02:17:52 +0000 Received: from BN8PR11MB3795.namprd11.prod.outlook.com ([fe80::8807:6661:e425:102]) by BN8PR11MB3795.namprd11.prod.outlook.com ([fe80::8807:6661:e425:102%7]) with mapi id 15.20.4219.025; Wed, 16 Jun 2021 02:17:52 +0000 From: "Wang, Haiyue" To: Chengwen Feng , "thomas@monjalon.net" , "Yigit, Ferruh" CC: "dev@dpdk.org" , "nipun.gupta@nxp.com" , "hemant.agrawal@nxp.com" , "maxime.coquelin@redhat.com" , "honnappa.nagarahalli@arm.com" , "jerinj@marvell.com" , "david.marchand@redhat.com" , "Richardson, Bruce" , "jerinjacobk@gmail.com" , "Xia, Chenbo" Thread-Topic: [dpdk-dev] [RFC PATCH] dmadev: introduce DMA device library Thread-Index: AQHXYeoG0smDTq5tREKq6aLKQC/efqsV5cNw Date: Wed, 16 Jun 2021 02:17:51 +0000 Message-ID: References: <1623763327-30987-1-git-send-email-fengchengwen@huawei.com> In-Reply-To: <1623763327-30987-1-git-send-email-fengchengwen@huawei.com> Accept-Language: zh-CN, en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: dlp-product: dlpe-windows dlp-reaction: no-action dlp-version: 11.6.0.76 authentication-results: huawei.com; dkim=none (message not signed) header.d=none;huawei.com; dmarc=none action=none header.from=intel.com; x-originating-ip: [192.55.46.52] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: 14fb9245-5db7-499d-73f8-08d9306cf1c9 x-ms-traffictypediagnostic: BN6PR11MB1444: 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:3276; x-ms-exchange-senderadcheck: 1 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: +qYKIvy4PIRMEDdjRdhVZRpEl3VkvvL4nw/xpPCxYiSRqxYtxieuyF1wPjacvcBnT+b5F2/Ywsqy752c4jFVCeaeeRX5ptYI1Z7rBslSwpBrEZbv5DVEXdoeYohnLPZQDvViV1ael5vANeOqKyiSVI35pA9ZorUNr2YtMVeJ2NNEwMMFJJn9dX2sBr91ZiBamG4KybANrQjcjRfwAgxDw8GJxWlqAdOORAbaNmVPCRItX+GWT1mtSemf9R4IjGzvgeA/SsMam20NDhb5N5YEs6UIOZdQFOqKWS+At8AFpbXss/RCE+UQCVzub3WdqAR7x1xHZMFplw8cVPmlLTwObzM472lmdweDEpHSgHHwui5SBF7a6ZH4ZYtVN3erbKCUtW0jQCiZAfcgIhwTxTrXB2VgWikQ2s8CUy3g/t76WM+vsYdVc0aJyHE+niv/R7Bjtbj4EzCoiar0sXjVXeoOFIg73lQS6cUWOCv+KYl145o2zgNNNqNs0JiWPu6SLYO+Dqc2a2px/B1NyYbLZftBmNingldVKVQy6my/vyrMTLIUZO+Yz3bwSRP6dgVUmN45/ivuSqwCmaHclQu+shG+YQthoNaD1GRd2w2d3VxcLNev5wHs/Go3awgGsGuN7XjXSqOt6+HJCU1ZEPIzBBfe+w== x-forefront-antispam-report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:BN8PR11MB3795.namprd11.prod.outlook.com; PTR:; CAT:NONE; SFS:(39860400002)(396003)(346002)(136003)(376002)(366004)(5660300002)(52536014)(8676002)(26005)(7696005)(186003)(55016002)(53546011)(6636002)(107886003)(6506007)(54906003)(478600001)(110136005)(122000001)(316002)(76116006)(66556008)(2906002)(66476007)(38100700002)(9686003)(83380400001)(33656002)(4326008)(8936002)(86362001)(66946007)(71200400001)(7416002)(64756008)(66446008)(21314003); DIR:OUT; SFP:1102; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?us-ascii?Q?meNPD053iI4lAIwTYXXu+APepQps+Zt5IjinwAtOgpfCFktt/j4Bl8zQ/FsC?= =?us-ascii?Q?HZTsyxrl1N2iQKKEb6lYwptFJjV2P0qpXMKLjrhJ1UGu1Vzh/yCIGAPOEH8S?= =?us-ascii?Q?taZOSyrYk3TOYbs3LCJm4D5FkFfX7LVcEJBRF7bma2zTmxCJ+l7hkQcs6F2U?= =?us-ascii?Q?g+3OjH2o/NJyF2sIFpzVUcP4cSwfIaEvdrsSOv+IkozSv+VLoJHlbM12EHc+?= =?us-ascii?Q?EJXLSfvPmsmOhJDtzqr5TExSj/so7ux4sJPaySSQtX2NHt+4gOeTbuUXXr+F?= =?us-ascii?Q?Fde26VnjM4VZeX0JlK0D1bLBLMkbWzFvG0niw1W+/gTtoUUAU01u+9AaetBE?= =?us-ascii?Q?KjUudb4zcv4cNaUiDDiLui09kNeK322pSXrOA2QChbb+mKxqkKau5JljUWXi?= =?us-ascii?Q?QkzmpbyhT37ZNlZvcS11NsaBTf1/wboSxlaH9ts4E/Sz5O/NVLl5VW9idMPW?= =?us-ascii?Q?znZjvHdXhatdZcaWINqKmYXKKtxpKip8/JPa1ABJXMyOMPQuWo3XEbUi/YO5?= =?us-ascii?Q?+u4tS+s7h8HCcVooBl1JYuYw7FQRLcWotEW2QOXnntWiTnbbLQriviG7QKhZ?= =?us-ascii?Q?LZa0L9CsR0mN63FFArI/KEimuQ4WFnReGrgkmagvLXu2MYg6veyazs+neq3X?= =?us-ascii?Q?Sasp5UxNiA48ys57D3Hl1fjglqge52ADY7nt4mgZOJccuu2JT42zaU1INdMl?= =?us-ascii?Q?BiveEEWyN6tH9UlYekz8WotgnVVuwquV5/WOPl88efrlxavn1eO0bhJlMSAK?= =?us-ascii?Q?b8Dc4PuQVBwiQgRxzOt4EwjeeufbKEhveCluFzL4snIDVElPMWTpA6nV1Jzs?= =?us-ascii?Q?KEjDd81t60apJQ2ucbN78PQe6PPKW5z/89LMAUoSH1I+CJZpoff0VSUKkCnH?= =?us-ascii?Q?D66A8vXSD6uBkIDxPa4wf0uppausQ0HOvPMxCs71CkVc+Cw0hivQIaOrz302?= =?us-ascii?Q?EnMaQKg3dUDuwgSvbxUrStzlmdGlQQujpEquj6wPTzahP33GTUXCEO2Xp7Bh?= =?us-ascii?Q?PUgEBOmsWQMva3PHqa8kAgUdCuMOyjpygXtAnEFebiVye7+5pNmMF2zokaRA?= =?us-ascii?Q?GJktBjdfb6ymcrCHV5um4zK0hGS6QU/xLRsedsYSS00nBag2kEHWPGUWd6KG?= =?us-ascii?Q?983IpOzvDkicV7bwGEXBGJr7qidXn4KzJYrtXu/7zZ0uU4BsSdm9m6xPccrE?= =?us-ascii?Q?l0RCBqPQQ+8fRs0b+oc4won+lK8Uin4a8rphmVddJHf0v95lA5hCAZtT2lAc?= =?us-ascii?Q?HOM275fwfzaPYYECjjf3X3Qz7P2x99bHym3XKUq7qeRDa806qULQXAaik289?= =?us-ascii?Q?m/M=3D?= Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: BN8PR11MB3795.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 14fb9245-5db7-499d-73f8-08d9306cf1c9 X-MS-Exchange-CrossTenant-originalarrivaltime: 16 Jun 2021 02:17:51.9829 (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: slF+MIHMjjKi5ZhPKS5KUPHzGEQHJp9guQ8CeVoewlMnC1YtDAZbIIH30GoPxNtabTTCFuxxBB9tmVeL5mDQpg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: BN6PR11MB1444 X-OriginatorOrg: intel.com Subject: Re: [dpdk-dev] [RFC PATCH] dmadev: introduce DMA device library 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" > -----Original Message----- > From: dev On Behalf Of Chengwen Feng > Sent: Tuesday, June 15, 2021 21:22 > To: thomas@monjalon.net; Yigit, Ferruh > Cc: dev@dpdk.org; nipun.gupta@nxp.com; hemant.agrawal@nxp.com; maxime.coq= uelin@redhat.com; > honnappa.nagarahalli@arm.com; jerinj@marvell.com; david.marchand@redhat.c= om; Richardson, Bruce > ; jerinjacobk@gmail.com > Subject: [dpdk-dev] [RFC PATCH] dmadev: introduce DMA device library >=20 > This patch introduces 'dmadevice' which is a generic type of DMA > device. >=20 > The APIs of dmadev library exposes some generic operations which can > enable configuration and I/O with the DMA devices. >=20 > Signed-off-by: Chengwen Feng > --- > lib/dmadev/rte_dmadev.h | 531 ++++++++++++++++++++++++++++++++++++++= ++++++ > lib/dmadev/rte_dmadev_pmd.h | 384 ++++++++++++++++++++++++++++++++ > 2 files changed, 915 insertions(+) > create mode 100644 lib/dmadev/rte_dmadev.h > create mode 100644 lib/dmadev/rte_dmadev_pmd.h >=20 > diff --git a/lib/dmadev/rte_dmadev.h b/lib/dmadev/rte_dmadev.h > new file mode 100644 > index 0000000..ca7c8a8 > --- /dev/null > +++ b/lib/dmadev/rte_dmadev.h > @@ -0,0 +1,531 @@ > +/* SPDX-License-Identifier: BSD-3-Clause > + * Copyright 2021 HiSilicon Limited. > + */ > + > +#ifndef _RTE_DMADEV_H_ > +#define _RTE_DMADEV_H_ > + > +/** > + * @file rte_dmadev.h > + * > + * DMA (Direct Memory Access) device APIs. > + * > + * Defines RTE DMA Device APIs for DMA operations and its provisioning. > + */ > + > +#ifdef __cplusplus > +extern "C" { > +#endif > + > +#include > +#include > +#include > +#include > + > +/** > + * @warning > + * @b EXPERIMENTAL: this API may change without prior notice. > + * > + * Get the total number of DMA devices that have been successfully > + * initialised. > + * > + * @return > + * The total number of usable DMA devices. > + */ > +__rte_experimental > +uint16_t > +rte_dmadev_count(void); > + > +/** > + * @warning > + * @b EXPERIMENTAL: this API may change without prior notice. > + * > + * Get the device identifier for the named DMA device. > + * > + * @param name > + * DMA device name to select the DMA device identifier. > + * > + * @return > + * Returns DMA device identifier on success. > + * - <0: Failure to find named DMA device. > + */ > +__rte_experimental > +int > +rte_dmadev_get_dev_id(const char *name); > + Like 'struct rte_pci_device', 'struct rte_vdev_device', and new introduced 'struct rte_auxiliary_device', have the "rte_xxx_device" name style, How about 'struct rte_dma_device' name ? The API can be rte_dma_dev_get_dev_id ... Just a suggestion. ;-) > +rte_dmadev_pmd_release(struct rte_dmadev *dev); > + > +#ifdef __cplusplus > +} > +#endif > + > +#endif /* _RTE_DMADEV_PMD_H_ */ > -- > 2.8.1