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 E8C25A0C43; Wed, 14 Jul 2021 14:22:54 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 6BD6F40E3C; Wed, 14 Jul 2021 14:22:54 +0200 (CEST) Received: from EUR02-HE1-obe.outbound.protection.outlook.com (mail-eopbgr10082.outbound.protection.outlook.com [40.107.1.82]) by mails.dpdk.org (Postfix) with ESMTP id 8BD044069F for ; Wed, 14 Jul 2021 14:22:52 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=I7mPErqZmyRwshKndKBV6KKqfZjFrTW0roF9ugGSP5fxhN+waWh8lFfuHnULq5Hd+ZgKTwZcPCBYaVwijR1C/MmqybiTDVl28cmQZkNoMt9PZDd1o4F3FrkGkwgA3alQCMn2EGNtk89YLAjy54SNAZ2cyhIwsxHJpnvwSyq8tdcb4ux3njfJ1Jv4JcbSX2nh62joNAj5bik9wXtXNmbVrmiaAc0LNXkvtVsX5+2ZyaJeLiQt7rRBJUriS0bTgm7UlMFBnYe6YL3W7fIYOkkczKH/POfjnJHuOyjKmUzw+eta74z1haDqw7ZHApx0XFaKvmwQhNjls39Oz0tr/U8DFQ== 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=Td3Xlx1A9D1ez0iZdflHoVzIQ30QHDLDZaJs/iJMUg8=; b=BNtpfw0mPhkqORThO79WEOjKugTp0BENS1Se909Mwc0LwX+kwngUYTgkH0TLLooF4bNv2jHV0qTu3Pmi51JNAmsaMIdViciwAI+HtE43auALJDgHOzlOx2kWvOXle45H8CprCHCaOd9kEAftvhzAWUnbIa5B5HUk6O6PdK6kXsv+jaPLhX+ohZpHVqI9yvymwkIpYYWgN7WI5XCEeBU6CEv4RP4RetRblJ5uQoYK2dUDKcV0EPe+S6yseJhoflQLr6OIEzAdulbu0LezDZK/sWnYggm+RjzFmunbeLm5N7DQmsXdACmFfNd4o3/kYCWfsFTf21tbKQ7k87HpDmMjdQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=nxp.com; dmarc=pass action=none header.from=nxp.com; dkim=pass header.d=nxp.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nxp.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=Td3Xlx1A9D1ez0iZdflHoVzIQ30QHDLDZaJs/iJMUg8=; b=Qh2KYEioO/NvQlX6/pJK4YC884WV7i1f4PMiyUejdT4+NoNUN/E3WFKpW5VnTRrgIRt6N1mrm8W++KOdiG+ojqVbEPAdwn9n9G72rFx7R/8EKhYP94wMP1pRHA8gjC/VlWI15h9pA2NHrARrERPj8A3lkzT4m/PvxiEHBmS87kA= Received: from DB9PR04MB8429.eurprd04.prod.outlook.com (2603:10a6:10:24e::23) by DB8PR04MB6795.eurprd04.prod.outlook.com (2603:10a6:10:fa::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4331.21; Wed, 14 Jul 2021 12:22:50 +0000 Received: from DB9PR04MB8429.eurprd04.prod.outlook.com ([fe80::b19a:bb85:9b54:24cb]) by DB9PR04MB8429.eurprd04.prod.outlook.com ([fe80::b19a:bb85:9b54:24cb%6]) with mapi id 15.20.4331.021; Wed, 14 Jul 2021 12:22:50 +0000 From: Nipun Gupta To: Chengwen Feng , "thomas@monjalon.net" , "ferruh.yigit@intel.com" , "bruce.richardson@intel.com" , "jerinj@marvell.com" , "jerinjacobk@gmail.com" , "andrew.rybchenko@oktetlabs.ru" CC: "dev@dpdk.org" , "mb@smartsharesystems.com" , Hemant Agrawal , "maxime.coquelin@redhat.com" , "honnappa.nagarahalli@arm.com" , "david.marchand@redhat.com" , "sburla@marvell.com" , "pkapoor@marvell.com" , "konstantin.ananyev@intel.com" , Gagandeep Singh Thread-Topic: [PATCH v3] dmadev: introduce DMA device library Thread-Index: AQHXd+MA5zghZWbV1UWj2Bo4DD2ocatCZO+A Date: Wed, 14 Jul 2021 12:22:50 +0000 Message-ID: References: <1625231891-2963-1-git-send-email-fengchengwen@huawei.com> <1626179263-14645-1-git-send-email-fengchengwen@huawei.com> In-Reply-To: <1626179263-14645-1-git-send-email-fengchengwen@huawei.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: authentication-results: huawei.com; dkim=none (message not signed) header.d=none;huawei.com; dmarc=none action=none header.from=nxp.com; x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: c5fbc72b-4452-4e91-d40c-08d946c218fc x-ms-traffictypediagnostic: DB8PR04MB6795: x-ms-exchange-transport-forked: True x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:10000; x-ms-exchange-senderadcheck: 1 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: rD1Z4VdTJxszKkHHI13rz/ONBiOPplTiUpWVvHoIq7mjzen0RnX1MwU1qUxNR7g8Ks+/jGnG1z7ahBf03qPYuXtrOcKjX7qIPNg5obnaS1tBXanNfuF9kOeZAIX8+ZWYM8g1DPUiXuJSA5Arur18seVA3Tel7In+nwLDHG4SG/7m5pdWWtFDoX8Jl0AS0Y9RjhWTvU7zxqQNW1SSHsUjqPlR7nVIZiuwF4BhO8O2AYa1ZDZn7dnLqgR8mkW6uWgCM416XMV/rmlEhCi3vHmjI/79kFi57jX3Ay6sXon9dU+coUBt6N2YfSziBWVl65Vv1U1J5imLSOdzYPM+qoR1ehSzBQw463deH5sCxwjt80IoSOyrh8KL6OOqvInYvdCg0k+QQ8znYc4SaYUIm3miJrT+L+P7zT4jkrR7uxrgtIksDZvUKMVooo519+PpOCuHc2xlZXyuBgw0sqeP1gsuwyEltkVXliWpBijqumL/PcvbU0A6Zd1uBZelZyZeo8TxM2MZYpmeXjxux/8ANXyiOcgrN93wr0wzwWNAJsGMazmJc7oK9Poui7k7bX7b4+YQ6p45iydcOTSaekpPiD5VHBlx3lSrzpJbUHxRVMqcoFh4+yOl1neLkAyR8ly9c8xBQIY2UFY3+2Tm7fhf4wMOSIr9dl2va0lo3s4ZDFxvuS/2Vn86ea/6wSJ4WaeNCc08NUaJkdTNuu9i7uSzdAVWvg== x-forefront-antispam-report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:DB9PR04MB8429.eurprd04.prod.outlook.com; PTR:; CAT:NONE; SFS:(4636009)(376002)(396003)(346002)(39850400004)(136003)(366004)(5660300002)(478600001)(86362001)(110136005)(122000001)(54906003)(55016002)(8676002)(186003)(7416002)(9686003)(26005)(33656002)(83380400001)(38100700002)(316002)(52536014)(66556008)(55236004)(66946007)(44832011)(76116006)(66476007)(2906002)(66446008)(64756008)(6506007)(4326008)(71200400001)(7696005)(8936002)(38070700004); DIR:OUT; SFP:1101; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?us-ascii?Q?MEM9SLY405NLyY+7fJu5XPUZ+Qj6h/5G3UAnS0jvX5Xct0XTXQ4jBRP2qFQQ?= =?us-ascii?Q?rS+vcFVhuuQb7zHPaRa/VFGAnLe9gMogESRDMQSlYoyBXxw8HOI2ufBwlzw1?= =?us-ascii?Q?lnus9jn2tVmwqzXo0W9GerpaIudU3zGpNIsLZbWsl3QjYQxq5amEvzHUyljW?= =?us-ascii?Q?GCuvN2waBX0nSqddsdo+8+ta9vqdyuqJ740YoCAtCIKUIV3AEr5UhOK+HB2E?= =?us-ascii?Q?fPN0JzIBGfOSfj1TgzH7sZ7JyKRNCl0ibmNpkxvd/en1ZYfx6zx6phpcxZFq?= =?us-ascii?Q?j77Dj5Tq8C3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vUVl3Kz9WCRyWKbVamuI?= =?us-ascii?Q?Z90QxChg05ZADvGYXvEonWk0HNRQZT0+FeQTCFodpFk+QAggzmgOkYNiNceN?= =?us-ascii?Q?5UOqUQAAJApimKZWamBRRJ0VFNdV4O+aExez9B2Zew5BqsCL74spc36+BQ2j?= =?us-ascii?Q?gfQj2qB5AHFHY7LWBEOkPUQz?= Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: DB9PR04MB8429.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: c5fbc72b-4452-4e91-d40c-08d946c218fc X-MS-Exchange-CrossTenant-originalarrivaltime: 14 Jul 2021 12:22:50.5432 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635 X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: q+BaFXBcumBzQQUWnxQeUZwB6ZvY+kLQiNutVmklBBk9Is8lJgOhhemCGRPRMwZA6nKk6himhDR+XIGms0WR4g== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB8PR04MB6795 Subject: Re: [dpdk-dev] [PATCH v3] 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" > +/** > + * A structure used to configure a virtual DMA channel. > + */ > +struct rte_dmadev_vchan_conf { > + uint8_t direction; > + /**< Set of supported transfer directions > + * @see RTE_DMA_MEM_TO_MEM > + * @see RTE_DMA_MEM_TO_DEV > + * @see RTE_DMA_DEV_TO_MEM > + * @see RTE_DMA_DEV_TO_DEV > + */ > + /** Number of descriptor for the virtual DMA channel */ > + uint16_t nb_desc; > + /** 1) Used to describes the port parameter in the device-to-memory > + * transfer scenario. > + * 2) Used to describes the source port parameter in the > + * device-to-device transfer scenario. > + * @see struct rte_dmadev_port_parameters > + */ There should also be a configuration to support no response (per Virtual Ch= annel), And if that is enabled, user will not be required to call 'rte_dmadev_compl= eted' API. This shall also be part of capability. > + struct rte_dmadev_port_parameters src_port; > + /** 1) Used to describes the port parameter in the memory-to-device-to > + * transfer scenario. > + * 2) Used to describes the destination port parameter in the > + * device-to-device transfer scenario. > + * @see struct rte_dmadev_port_parameters > + */ > + struct rte_dmadev_port_parameters dst_port; > +}; > + > +/** > + * @warning > + * @b EXPERIMENTAL: this API may change without prior notice. > + * > + * Enqueue a scatter list copy operation onto the virtual DMA channel. > + * > + * This queues up a scatter list copy operation to be performed by hardw= are, > + * but does not trigger hardware to begin that operation. This would need update with the submit flag. The statement should be true only when the flag is set? Similar comment I see on 'rte_dmadev_copy_sg' and 'rte_dma_fill' APIs > + * > + * @param dev_id > + * The identifier of the device. > + * @param vchan > + * The identifier of virtual DMA channel. > + * @param sg > + * The pointer of scatterlist. > + * @param flags > + * An flags for this operation. > + * @see RTE_DMA_OP_FLAG_* > + * > + * @return > + * - 0..UINT16_MAX: index of enqueued copy scatterlist job. > + * - <0: Error code returned by the driver copy scatterlist function. > + */ > +__rte_experimental > +static inline int > +rte_dmadev_copy_sg(uint16_t dev_id, uint16_t vchan, const struct rte_dma= _sg > *sg, > + uint64_t flags) > +{ > + struct rte_dmadev *dev =3D &rte_dmadevices[dev_id]; > +#ifdef RTE_DMADEV_DEBUG > + if (!rte_dmadev_is_valid_dev(dev_id) || > + vchan >=3D dev->data->dev_conf.max_vchans || > + sg =3D=3D NULL) > + return -EINVAL; > + RTE_FUNC_PTR_OR_ERR_RET(*dev->copy_sg, -ENOTSUP); > +#endif > + return (*dev->copy_sg)(dev, vchan, sg, flags); > +} > +