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 BD737A00C2; Mon, 28 Mar 2022 16:40:27 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 70F76427F9; Mon, 28 Mar 2022 16:40:27 +0200 (CEST) Received: from NAM10-DM6-obe.outbound.protection.outlook.com (mail-dm6nam10on2059.outbound.protection.outlook.com [40.107.93.59]) by mails.dpdk.org (Postfix) with ESMTP id 73F1141104 for ; Mon, 28 Mar 2022 16:40:25 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=RD5FJhjLQshkQi6noAa/575rogbGnOyps9CTz5yqUZEnVx1U3y0pB7oDKsF3diuPUb+Osng6XN2M8LApjBmuWfLYWULhoqimW50dlmVPygT4EnOMUhR9iDitzv4PiRgk+R+ogNzbQk0g7JS9lFm2bgX31XPU3VIdMTUQUDxAgp/Mkfs9lASmXzmWb86quZ9pGSLqMcpJM3vSQNA30IHiAcflwruvvpeahRHQQJpFGUJVfUgHTHy4ZYXcYAx1JOHqmbRk0lSSdT/LGEKhSLx5D14GeqHt22lyqPCrqATvyRc/K3jKB1jmUqODpBcxoE6tsYlT6fO0piN1RsDtbsEqnw== 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=+F3ivh27SUgwZBZoopTy0JrgCFoXEL+IXEMdi4VSKgg=; b=RYdLz7GYoRLXHzJtgiQ+siFUERkwK+ENsM9AOXLflK8apNuMAkudxlOEea3TSdLwjVqE3PPa8Ufi5cP/JC15YielT7IVfpTltdCxl11+ApdygkXY1AtwDI9+q91ApnkxxMZQvXAGOGpPh0VjmoBCrGyzi/1Zt2BXHxYyBtiIDaadRbY+OZvbEkHWqG98hqlQwGkzJZetvlG8GtDs4I6QZQci7fECndOsMagJEUkN0rx4PiBVeIWmyF6F764KO2T7+V3b97Kmg7cOqndkFJkvqPuQvXwg3PdbuOIquNLRnV0WoH4e6RpcAKZ3Zs2ba+sAm66xM2RHdHaFLfhgVEMYAw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=amd.com; dmarc=pass action=none header.from=amd.com; dkim=pass header.d=amd.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amd.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=+F3ivh27SUgwZBZoopTy0JrgCFoXEL+IXEMdi4VSKgg=; b=jWv/GZYNY7CgEwZXaPtMlKChqouL99AA9ZmQlewqpHFgZyGbaAR/h37Bach8OG1awbr6wBskdV/6RD69ZQ4BBLaEQfEdKirsDmslgqq7t5RR5QGxOazcF/tT40Ofxf13SFm9/QPcio+BmOg2atWUZ+tfftDyVUCczGEjWJQbVCU= Received: from MN2PR12MB3085.namprd12.prod.outlook.com (2603:10b6:208:c5::29) by CH2PR12MB3830.namprd12.prod.outlook.com (2603:10b6:610:2f::30) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5102.17; Mon, 28 Mar 2022 14:40:23 +0000 Received: from MN2PR12MB3085.namprd12.prod.outlook.com ([fe80::4920:844e:76e8:1fd3]) by MN2PR12MB3085.namprd12.prod.outlook.com ([fe80::4920:844e:76e8:1fd3%3]) with mapi id 15.20.5102.023; Mon, 28 Mar 2022 14:40:23 +0000 From: "Varghese, Vipin" To: "Tummala, Sivaprasad" , "fengchengwen@huawei.com" CC: "dev@dpdk.org" , "Tummala, Sivaprasad" Subject: RE: [PATCH] dma/skeleton: support multiple instances Thread-Topic: [PATCH] dma/skeleton: support multiple instances Thread-Index: AQHYQq/goa+6VN4dpU2xkkEiV5fRwqzU3Zmw Date: Mon, 28 Mar 2022 14:40:22 +0000 Message-ID: References: <20220328142314.46322-1-Sivaprasad.Tummala@amd.com> In-Reply-To: <20220328142314.46322-1-Sivaprasad.Tummala@amd.com> Accept-Language: en-IN, en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: msip_labels: MSIP_Label_88914ebd-7e6c-4e12-a031-a9906be2db14_Enabled=true; MSIP_Label_88914ebd-7e6c-4e12-a031-a9906be2db14_SetDate=2022-03-28T14:40:20Z; MSIP_Label_88914ebd-7e6c-4e12-a031-a9906be2db14_Method=Standard; MSIP_Label_88914ebd-7e6c-4e12-a031-a9906be2db14_Name=AMD Official Use Only-AIP 2.0; MSIP_Label_88914ebd-7e6c-4e12-a031-a9906be2db14_SiteId=3dd8961f-e488-4e60-8e11-a82d994e183d; MSIP_Label_88914ebd-7e6c-4e12-a031-a9906be2db14_ActionId=d39c0112-d2e3-4f8f-b6ef-13f69fd513a6; MSIP_Label_88914ebd-7e6c-4e12-a031-a9906be2db14_ContentBits=1 msip_label_88914ebd-7e6c-4e12-a031-a9906be2db14_enabled: true msip_label_88914ebd-7e6c-4e12-a031-a9906be2db14_setdate: 2022-03-28T14:40:20Z msip_label_88914ebd-7e6c-4e12-a031-a9906be2db14_method: Standard msip_label_88914ebd-7e6c-4e12-a031-a9906be2db14_name: AMD Official Use Only-AIP 2.0 msip_label_88914ebd-7e6c-4e12-a031-a9906be2db14_siteid: 3dd8961f-e488-4e60-8e11-a82d994e183d msip_label_88914ebd-7e6c-4e12-a031-a9906be2db14_actionid: 64eafde5-3395-4bcc-b375-ed2403361bc8 msip_label_88914ebd-7e6c-4e12-a031-a9906be2db14_contentbits: 0 authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=amd.com; x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: 093fb62e-2eb7-45a2-2bf5-08da10c8e3f8 x-ms-traffictypediagnostic: CH2PR12MB3830:EE_ x-microsoft-antispam-prvs: x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: 6/lKgInqp7tTJA1kDeonBYRs8IWzh5CuWZkEFpE4QocQQz0seiQrURXFX/GwI2DFGjkEkitlVEr3OUtGqK3+DWb3fNDRnJ9ddoD+qiIzZwQuX0U9p8mgz+xP1PfVMhr5gj2EKCDh6i9vqLLeLMCIIsHoh1vGN3oL1Q1rs7buzkErShrQtNnhtPr1agm6M0aVemgG10iJSAgoPHZMnQB3acbS5EhEbqSJk7YqaFBbNeCRlHXFtJZrvRRT/AxeRT2l0ApcxY5+s1nTImcPE/fPhLO/r/JL4Emz9SQeZIfROJo7UuR0Zmf0gL6IHziOwb1+NOWf17cfnU3+EHDNRvpqRJqwayJK1QO/EbygKfQJ1uRD6hFcgF3quahnh/nCJiTNLQ/x2dTVErveHFOS6mgHEib8bR6k1vgIm0v6rfXg+/Zc20B8wU5YvOB2xfJ1ZjVi1p+0mY8BgRkOtEQV/6gmpJuVZVqE+D8GJAlZdxQBGS1lYM08cVYhkiDVEW57IE0L8972NlGbyQaucmY6ZEWhwGpw1e9R6fMClYKwE37l1/4D22233naOXNQAXFbySpHNCZHVmCpu7vXhuLITW1ijvgzoj574n8xDAkR0HbALaoNd3vdWV5V8HrcQVGLPVcMo5KihLrnZXWTYzmCcqdBjDzj+IuWZNR0JHyiCBsZoR9vt2Bd/gb5hVXyZYfTdDifMiW5Fmbiafltt6wXlTr5JOg== x-forefront-antispam-report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:MN2PR12MB3085.namprd12.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230001)(4636009)(366004)(52536014)(5660300002)(2906002)(83380400001)(33656002)(38100700002)(6506007)(38070700005)(9686003)(8936002)(7696005)(53546011)(66446008)(186003)(26005)(55016003)(122000001)(316002)(4326008)(8676002)(64756008)(66476007)(110136005)(76116006)(54906003)(66946007)(66556008)(508600001)(71200400001)(86362001); DIR:OUT; SFP:1101; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?us-ascii?Q?3c/F3EyRe21eQD2hB/QS1onUX19pf9DFErbpUCUQYpHXnb7Dprui+/6aELh3?= =?us-ascii?Q?xRA14XiwLel1/VzmTAJI6cVuAgTa2aFv669Sf4d1gG1iBRuM9LdjhoOKQCxA?= =?us-ascii?Q?GfrcIeDzSYHTTxXlqJe2h9RmpXl0WBUUKxt6n9iLIbexxg0FHAe6a9AbPcAw?= =?us-ascii?Q?PybnbsPxxkwlSIEGWzicznUhCp+WoonNS4NQFOO56+N+/xyWaZO5/esiRzfs?= =?us-ascii?Q?ahhGKNOaUnr8C1NkQHs2YY2ssnF6XE7Xxbtd/HN54SW9UsreXdYayFMhk85x?= =?us-ascii?Q?AXu7vkNHUk81+rgQeu91caUu4LC0IKNwBXlVcXBxquwzHmeVqKNN4fAog8ds?= =?us-ascii?Q?O92XXtH5Kbj3i8bHzlibBDNzVFEmplmX8Vrz9KW/N9fHTQ8pQx6A6Nmx7q4p?= =?us-ascii?Q?ctyyIz+Q2aVQQNH/6mZxnq8y7Y/JHzvcOZ6jZY+4/2HRbq+eP7FDJdQ2550+?= =?us-ascii?Q?vI2NvMyItoyVVBoXnQcRadkKpKjbayam5jVrnExjn12YM5mKpKjOH5I8Vw1v?= =?us-ascii?Q?XxQraWEvZDO7lncZFETSi0VxvXz3mu7mycKme6ukS/bRco/+Sg+VJlYKobQT?= =?us-ascii?Q?Ignnfk9vKPcq4YH/hWdiMIfB9GXjtlj9ivFML9zyxEMvcy7zyCe3aXLoTdgk?= =?us-ascii?Q?uNWoiT0n5vbsCTwdSUzbBN/YxRwkLwMjWanc1cc+S8S3MkZLPB0QpfcpYuzR?= =?us-ascii?Q?x0Pg1HvWlLiWnVzd8zJbXz/5ua+e3h2LgxfUuxstWF6US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W/a6AprV/iu2OoWDrKN39Mx8pcGJ35RjeYQCha8PE+b0NrQd+Ft8?= =?us-ascii?Q?a+YBIK9oWUNBdwB7zhcvlJtylaDIHQYhXGzFg0q7ypSvB3Ck?= Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: MN2PR12MB3085.namprd12.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 093fb62e-2eb7-45a2-2bf5-08da10c8e3f8 X-MS-Exchange-CrossTenant-originalarrivaltime: 28 Mar 2022 14:40:22.9761 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 3dd8961f-e488-4e60-8e11-a82d994e183d X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: rcgwYu0+QIs1lhZkyYYxZM7aPEuisO8Pmt3c7M68iw+6apvD0tzH9u5sFDNTQJCzeJBS+uAxxmkhblYV8bxnUw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: CH2PR12MB3830 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 [AMD Official Use Only] Verified on ` AMD EPYC 7713 64-Core Processor` platform with argument ` --v= dev=3Ddma_skeleton0,lcore=3D4 --vdev=3Ddma_skeleton1,lcore=3D5`.=20 Tested-by: Vipin Varghese -----Original Message----- From: Sivaprasad Tummala =20 Sent: Monday, March 28, 2022 7:53 PM To: fengchengwen@huawei.com Cc: dev@dpdk.org; Tummala, Sivaprasad Subject: [PATCH] dma/skeleton: support multiple instances [CAUTION: External Email] dpdk app can support multiple hardware dma instances. with dma skeleton, only a single instance can be configured. This patch supports multiple driver instances per device. Signed-off-by: Sivaprasad Tummala --- drivers/dma/skeleton/skeleton_dmadev.c | 37 +++++++++++++++----------- 1 file changed, 22 insertions(+), 15 deletions(-) diff --git a/drivers/dma/skeleton/skeleton_dmadev.c b/drivers/dma/skeleton/= skeleton_dmadev.c index 81cbdd286e..6b1c01d89c 100644 --- a/drivers/dma/skeleton/skeleton_dmadev.c +++ b/drivers/dma/skeleton/skeleton_dmadev.c @@ -100,6 +100,7 @@ static int skeldma_start(struct rte_dma_dev *dev) { struct skeldma_hw *hw =3D dev->data->dev_private; + char name[RTE_MAX_THREAD_NAME_LEN]; rte_cpuset_t cpuset; int ret; @@ -125,7 +126,8 @@ skeldma_start(struct rte_dma_dev *dev) rte_mb(); - ret =3D rte_ctrl_thread_create(&hw->thread, "dma_skeleton", NULL, + snprintf(name, sizeof(name), "dma_skel_%d", dev->data->dev_id); + ret =3D rte_ctrl_thread_create(&hw->thread, name, NULL, cpucopy_thread, dev); if (ret) { SKELDMA_LOG(ERR, "Start cpucopy thread fail!"); @@ -160,7 += 162,7 @@ skeldma_stop(struct rte_dma_dev *dev) } static int -vchan_setup(struct skeldma_hw *hw, uint16_t nb_desc) +vchan_setup(struct skeldma_hw *hw, int16_t dev_id, uint16_t nb_desc) { struct skeldma_desc *desc; struct rte_ring *empty; @@ -168,8 +170,12 @@ vchan_setup(struct skeldma_hw *hw, uint16_t nb_desc) struct rte_ring *running; struct rte_ring *completed; uint16_t i; + char pool_name[RTE_RING_NAMESIZE]; + char ring_name[RTE_RING_NAMESIZE]; - desc =3D rte_zmalloc_socket("dma_skeleton_desc", + snprintf(pool_name, RTE_RING_NAMESIZE, "dma_skel_desc_pool_%d", + dev_id); + desc =3D rte_zmalloc_socket(pool_name, nb_desc * sizeof(struct skeldma_desc), RTE_CACHE_LINE_SIZE, hw->socket_id); if (desc =3D=3D NULL) { @@ -177,13 +183,21 @@ vchan_setup(struct skeldma_hw *hw, uint16_t nb_desc) return -ENOMEM; } - empty =3D rte_ring_create("dma_skeleton_desc_empty", nb_desc, + snprintf(ring_name, RTE_RING_NAMESIZE, "dma_skel_desc_empty_%d", + dev_id); + empty =3D rte_ring_create(ring_name, nb_desc, hw->socket_id, RING_F_SP_ENQ | RING_F_SC_DE= Q); - pending =3D rte_ring_create("dma_skeleton_desc_pending", nb_desc, + snprintf(ring_name, RTE_RING_NAMESIZE, "dma_skel_desc_pend_%d", + dev_id); + pending =3D rte_ring_create(ring_name, nb_desc, hw->socket_id, RING_F_SP_ENQ | RING_F_SC_= DEQ); - running =3D rte_ring_create("dma_skeleton_desc_running", nb_desc, + snprintf(ring_name, RTE_RING_NAMESIZE, "dma_skel_desc_run_%d", + dev_id); + running =3D rte_ring_create(ring_name, nb_desc, hw->socket_id, RING_F_SP_ENQ | RING_F_SC_= DEQ); - completed =3D rte_ring_create("dma_skeleton_desc_completed", nb_des= c, + snprintf(ring_name, RTE_RING_NAMESIZE, "dma_skel_desc_comp_%d", + dev_id); + completed =3D rte_ring_create(ring_name, nb_desc, hw->socket_id, RING_F_SP_ENQ | RING_F_SC_= DEQ); if (empty =3D=3D NULL || pending =3D=3D NULL || running =3D=3D NULL= || completed =3D=3D NULL) { @@ -254,7 +268,7 @@ skeldma_vchan_setup(struct rte_dma_dev *dev, uint16_t v= chan, } vchan_release(hw); - return vchan_setup(hw, conf->nb_desc); + return vchan_setup(hw, dev->data->dev_id, conf->nb_desc); } static int @@ -548,13 +562,6 @@ skeldma_probe(struct rte_vdev_device *vdev) return -EINVAL; } - /* More than one instance is not supported */ - if (skeldma_count > 0) { - SKELDMA_LOG(ERR, "Multiple instance not supported for %s", - name); - return -EINVAL; - } - skeldma_parse_vdev_args(vdev, &lcore_id); ret =3D skeldma_create(name, vdev, lcore_id); -- 2.17.1