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 DBDE6A0544; Tue, 7 Jun 2022 12:49:41 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id C8C61415D7; Tue, 7 Jun 2022 12:49:41 +0200 (CEST) Received: from wout5-smtp.messagingengine.com (wout5-smtp.messagingengine.com [64.147.123.21]) by mails.dpdk.org (Postfix) with ESMTP id A11984021D for ; Tue, 7 Jun 2022 12:49:40 +0200 (CEST) Received: from compute1.internal (compute1.nyi.internal [10.202.2.41]) by mailout.west.internal (Postfix) with ESMTP id 3E39F32007D7; Tue, 7 Jun 2022 06:49:39 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute1.internal (MEProxy); Tue, 07 Jun 2022 06:49:39 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=monjalon.net; h= cc:cc:content-transfer-encoding:content-type:date:date:from:from :in-reply-to:in-reply-to:message-id:mime-version:references :reply-to:sender:subject:subject:to:to; s=fm2; t=1654598978; x= 1654685378; bh=6mdj5ZlktXu+1ZpKPVh9js2284lqJnczxp519hnWWjM=; b=W G2zIU3ZtTy7SEnEzIw5D2ckmERrNNZLA4M0BqMzQ/mOEtqFxETW32Xa4LK+ciAWA eQbSZuXlLJ9m5r2X/hb9+L7eygUoTV2WqHLltSLfRXX+9Q4rlVV9KnUMGd9jlx7A 2djrpgeJns2Knb9qbHGWJEe2js17Y/rGGRaBM9SG+yPzTo3n0XCm/QKhyE9g2bIE Hq1PdRrA19/ocxWF2FTzpf/WYUQsJeYeehTpfTkZ82MHR8o4NYedS2ExViZeTggQ dSYO9E/7RRnbDVjNFfFdBfescgVUHTv1egKUEvIEwe+XNiQo6ojcI05V9bpO5LsI uIfOd32LtsPtRpoLwFVCg== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-transfer-encoding :content-type:date:date:feedback-id:feedback-id:from:from :in-reply-to:in-reply-to:message-id:mime-version:references :reply-to:sender:subject:subject:to:to:x-me-proxy:x-me-proxy :x-me-sender:x-me-sender:x-sasl-enc; s=fm2; t=1654598978; x= 1654685378; bh=6mdj5ZlktXu+1ZpKPVh9js2284lqJnczxp519hnWWjM=; b=R zK+XLfGMrEwY58dLi8nt3M4A76fwtensf5g0W9geVjPvJ3JmG0tZ2cJAjU07sbfO l8m9SldajvGwnCVphtrOHfHbg6AcZyO/nxeUAcFNYBLDGGbjmDXFNcKBhTA2uF+R I9LktVVZKgh3sl36pVSqc70Lppn8hr64fZdoIWTdeM59VRpcU3ey35V1A7G6NWXD 1ns29Cf1nnmOg4rVcIDJpzsU7/DmQf/ad/WfeJlx7+/SeoioBHyEhQYewdkVA2I+ rAGqW9eKPMKFJb/X5NysUm/nvUUr1RuoAjwZdyj5f0Xssk61S7MdjbUF8+mYRq4D jpvpeMLrQafJ+q/pjeKRQ== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvfedruddthedgfeduucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhephffvvefufffkjghfggfgtgesthfuredttddtvdenucfhrhhomhepvfhhohhm rghsucfoohhnjhgrlhhonhcuoehthhhomhgrshesmhhonhhjrghlohhnrdhnvghtqeenuc ggtffrrghtthgvrhhnpedtjeeiieefhedtfffgvdelteeufeefheeujefgueetfedttdei kefgkeduhedtgfenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepmhgrihhlfh hrohhmpehthhhomhgrshesmhhonhhjrghlohhnrdhnvght X-ME-Proxy: Feedback-ID: i47234305:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Tue, 7 Jun 2022 06:49:37 -0400 (EDT) From: Thomas Monjalon To: "fengchengwen@huawei.com" Cc: "Tummala, Sivaprasad" , dev@dpdk.org, "Tummala, Sivaprasad" , "Varghese, Vipin" Subject: Re: [PATCH] dma/skeleton: support multiple instances Date: Tue, 07 Jun 2022 12:49:34 +0200 Message-ID: <7331019.QJadu78ljV@thomas> In-Reply-To: References: <20220328142314.46322-1-Sivaprasad.Tummala@amd.com> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" 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 Chengwen, as the maintainer of this driver, what do you think? 28/03/2022 16:40, Varghese, Vipin: > [AMD Official Use Only] > > Verified on ` AMD EPYC 7713 64-Core Processor` platform with argument ` --vdev=dma_skeleton0,lcore=4 --vdev=dma_skeleton1,lcore=5`. > > Tested-by: Vipin Varghese > > -----Original Message----- > From: Sivaprasad Tummala > 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 = 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 = rte_ctrl_thread_create(&hw->thread, "dma_skeleton", NULL, > + snprintf(name, sizeof(name), "dma_skel_%d", dev->data->dev_id); > + ret = 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 = rte_zmalloc_socket("dma_skeleton_desc", > + snprintf(pool_name, RTE_RING_NAMESIZE, "dma_skel_desc_pool_%d", > + dev_id); > + desc = rte_zmalloc_socket(pool_name, > nb_desc * sizeof(struct skeldma_desc), > RTE_CACHE_LINE_SIZE, hw->socket_id); > if (desc == NULL) { > @@ -177,13 +183,21 @@ vchan_setup(struct skeldma_hw *hw, uint16_t nb_desc) > return -ENOMEM; > } > > - empty = rte_ring_create("dma_skeleton_desc_empty", nb_desc, > + snprintf(ring_name, RTE_RING_NAMESIZE, "dma_skel_desc_empty_%d", > + dev_id); > + empty = rte_ring_create(ring_name, nb_desc, > hw->socket_id, RING_F_SP_ENQ | RING_F_SC_DEQ); > - pending = rte_ring_create("dma_skeleton_desc_pending", nb_desc, > + snprintf(ring_name, RTE_RING_NAMESIZE, "dma_skel_desc_pend_%d", > + dev_id); > + pending = rte_ring_create(ring_name, nb_desc, > hw->socket_id, RING_F_SP_ENQ | RING_F_SC_DEQ); > - running = rte_ring_create("dma_skeleton_desc_running", nb_desc, > + snprintf(ring_name, RTE_RING_NAMESIZE, "dma_skel_desc_run_%d", > + dev_id); > + running = rte_ring_create(ring_name, nb_desc, > hw->socket_id, RING_F_SP_ENQ | RING_F_SC_DEQ); > - completed = rte_ring_create("dma_skeleton_desc_completed", nb_desc, > + snprintf(ring_name, RTE_RING_NAMESIZE, "dma_skel_desc_comp_%d", > + dev_id); > + completed = rte_ring_create(ring_name, nb_desc, > hw->socket_id, RING_F_SP_ENQ | RING_F_SC_DEQ); > if (empty == NULL || pending == NULL || running == NULL || > completed == NULL) { > @@ -254,7 +268,7 @@ skeldma_vchan_setup(struct rte_dma_dev *dev, uint16_t vchan, > } > > 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 = skeldma_create(name, vdev, lcore_id); > -- > 2.17.1 >