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 AF7DD45683; Mon, 22 Jul 2024 18:41:59 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 8AC6640EAB; Mon, 22 Jul 2024 18:40:16 +0200 (CEST) Received: from DUZPR83CU001.outbound.protection.outlook.com (mail-northeuropeazon11013030.outbound.protection.outlook.com [52.101.67.30]) by mails.dpdk.org (Postfix) with ESMTP id 18D6F40E43 for ; Mon, 22 Jul 2024 18:40:14 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=ByoNqZV/w8bY/5rKH0cITIuW4V0g3PD4d/Dv4KsT72EebiEoeGksH1Adc4FXmDyaRLHGxOO08qbus35azBBpFEGJz7im6L1mkl66qq81kOTW3gpk1eeu5py4tCKr7kO9bZVOemjZt9gnKXxYNqsFpQtUmqMlJ3xrRFBdvG0E2QMmLCZFaUXKxSr7naYXe0dB1yXk7BhJLfQSV8lFGYn9GOMgL4KtIa+YlHHoDcYLWjqxRvAOjUamQsERUP0ZMoztQpF8wWWnXfVJlA4MFQB10oSi+kfDAlhfAWxXjMWZp1ogyPX+ix6ngWhePehK7BVAxAXeaK0N/Ow+oZrN5uFbQA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; 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=LyPst23F4dEFabeUjgji3XsXEmmbpjjOKbMsaEAw1ng=; b=APZlLACh2P/GgdE9Q3PqvFjR8MHoNODvxcoTdJMZTyfUVBdtKJfhV4hhdWpTYvxj4apFDeNAT8Hblag/xVVYxmlzt9pSmDWpa48XegIxcczghOuVaoWIwoh1ccMsK5o8VRMyjrFpp1kwG4dFX45QdrSCnf6HPv10bS9pj5H14tDqZ+dWLItO+KSP9etmSoVLPP5f8I6nNNSjwAdMihNW4SpVXksSoNc0EPc3UK4W2jGBJAqPqBT8u26Vu6u67Pgg5Lvob41hnJhk5rJ5hLkOapN7tkv+PpFhSDsgxWLT50WMDUal/y6yVY+v3YmOTHwiB6MAuCNv5c1nb3mDhdJNrw== 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=LyPst23F4dEFabeUjgji3XsXEmmbpjjOKbMsaEAw1ng=; b=Wf05zbWXr1qL+4D1P6Rau1IzXYbm7pBXypueZL4gQaD/khFa5dEQ9+1KihLOgDoOb3xPekwoDkYsPDuyjKMx+z9fhNcv2ReDR6gbmlCrsZeTOxTEK05sbC8nWAZBjpk+cHKBdlPVHeF5xMZsKsH3E781kxRbvgoJZYcJhAT0xwQ= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=nxp.com; Received: from AS8SPR01MB0024.eurprd04.prod.outlook.com (2603:10a6:20b:3d0::24) by PA1PR04MB10652.eurprd04.prod.outlook.com (2603:10a6:102:491::5) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7784.16; Mon, 22 Jul 2024 16:40:13 +0000 Received: from AS8SPR01MB0024.eurprd04.prod.outlook.com ([fe80::c634:479e:8f8a:a325]) by AS8SPR01MB0024.eurprd04.prod.outlook.com ([fe80::c634:479e:8f8a:a325%7]) with mapi id 15.20.7784.017; Mon, 22 Jul 2024 16:40:12 +0000 From: Gagandeep Singh To: dev@dpdk.org, Sachin Saxena Cc: Vanshika Shukla Subject: [v3 15/30] dma/dpaa: add burst capacity API Date: Mon, 22 Jul 2024 22:09:15 +0530 Message-Id: <20240722163930.2171568-16-g.singh@nxp.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20240722163930.2171568-1-g.singh@nxp.com> References: <20240722115843.1830105-1-g.singh@nxp.com> <20240722163930.2171568-1-g.singh@nxp.com> Content-Transfer-Encoding: 8bit Content-Type: text/plain X-ClientProxiedBy: SG3P274CA0014.SGPP274.PROD.OUTLOOK.COM (2603:1096:4:be::26) To AS8SPR01MB0024.eurprd04.prod.outlook.com (2603:10a6:20b:3d0::24) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: AS8SPR01MB0024:EE_|PA1PR04MB10652:EE_ X-MS-Office365-Filtering-Correlation-Id: 2a2bb43c-3e85-4115-6d0f-08dcaa6cf53a X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; ARA:13230040|366016|52116014|376014|1800799024|38350700014; X-Microsoft-Antispam-Message-Info: =?us-ascii?Q?n5s5eMxAgcwFkclhP2KxpNlchj1uFSWfMUAs5qBVgUAIWuqj66njW6hvHL1s?= =?us-ascii?Q?AOiZmlC6gUJwzQKd+LoTfCya9CiAXTl+BjVntfZ9nlxZdpz5YtfqUJYi5Gzz?= =?us-ascii?Q?GbylVwLB3URtan61S6lL6DUNBma/XrOKkyKDXZX30hM+6NKkPVsBS8pj/5n0?= =?us-ascii?Q?kfsFRn4fwUOCghLHaI3aTg8/5MCdKmk30uOk1mUnoCczCnGRB0k86y1jaoS6?= =?us-ascii?Q?Fe1LkD5sKHMyVhfnd/ZVAy2pDu6wqZWYooKu2sNqluWQzaSU0ypEZ35btLjY?= =?us-ascii?Q?yfTxx02Y8H7FhUT6vmm+oZOjNuVVvhVgGwGhQTlRyzUsMJs3og4Xy5bo5/Hv?= =?us-ascii?Q?FUVqZMGIQJKBTUKNsZGt5ouBAY3y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ascii?Q?qHiBvMsuZrt88Eg8sti1ai7v468nFJMxRNRfq9bSJO5G8hPhZjUTGmw00Mke?= =?us-ascii?Q?55NOKRyD4SUXuew+SPkKmeyuKD5m9CtVYEIigTwsbQW2rhMIzDds9StZHufV?= =?us-ascii?Q?U8fk1f2tNtscwXMtyg88WhkcE89pxn1iM44hDPzIVhZ1zRq+Yw=3D=3D?= X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:AS8SPR01MB0024.eurprd04.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230040)(366016)(52116014)(376014)(1800799024)(38350700014); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?us-ascii?Q?WdmoVrV2xZe8BxwT+ALFy233DB5Cyi1R6RdExrnaUHDK/FWvMx568lm8Y9OG?= =?us-ascii?Q?9aeZbw/8s8bFc7eUigQHxP5JgO/pRkg9c00zdF3Ayl88kxR6tYPxWGGgzu9g?= =?us-ascii?Q?NnvxhAZ5K/LWYQkp552WCq4qOoem738wudToYLeX9KH9cFCg/uO83IytyV4B?= =?us-ascii?Q?28OlMIRz9k9a2BzQnD1ep6GR1aVH3gybNIYa+kg3nw84kR1xAevkGWtcNlmi?= =?us-ascii?Q?CF7FNodFaN/pdpk5lARBBnne3MIqsXT8KZAOBU32t/TvcuDVzdDESgEBp9B2?= =?us-ascii?Q?+xGA0a63Cj1NoroUB5ej9yzMZOZdXeAVaKtVctVtXzy7yC85GtIfWmfuI9Dn?= =?us-ascii?Q?kI4QxbJuM+CiPW0s0bTDcpAWOS/iwvagEWAeXqIT5QqqxyfeekzcPaVRDShE?= =?us-ascii?Q?xa/k2ZuCO7fgd6Wn+FAfBLADU0eWZf1te+Xht82Nq5wwKbFQ3JLJiSVgbm15?= =?us-ascii?Q?T/4M1JJi2TUY64sI9Bnpts1SeHmHP0XJtgrJV8rUWoYvw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QbBV6qb8WMvP7z9XJIMbdZnyn5NBugjjuzOmfuVKrHx?= =?us-ascii?Q?vrYbptbVOATxFdrEj9SYkHkOtgTraGT+MWzm7phelzC7D+r7RJKovH7O3Z7q?= =?us-ascii?Q?ZmjX3UWToXjt1U3Uwzg3kKXHw+8DchEObCWo/n/cQP4ZIGqSKseKEZR0XBlJ?= =?us-ascii?Q?SrVuE2Gx6fZwLnYiyH7da/weiSEzDTdYrm90MIX3?= X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 2a2bb43c-3e85-4115-6d0f-08dcaa6cf53a X-MS-Exchange-CrossTenant-AuthSource: AS8SPR01MB0024.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 22 Jul 2024 16:40:12.8894 (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: uhmRwpU90dtr7KO9Kg2f5JS3CfwspDox5WE+KPp3suTYsiiuRsqM4oxM/O02QVvV X-MS-Exchange-Transport-CrossTenantHeadersStamped: PA1PR04MB10652 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 From: Vanshika Shukla This patch improves the dpaa qdma driver and adds dpaa_qdma_burst_capacity API which returns the remaining space in the descriptor ring. Signed-off-by: Vanshika Shukla --- drivers/dma/dpaa/dpaa_qdma.c | 34 +++++++++++++++++++++++++--------- drivers/dma/dpaa/dpaa_qdma.h | 3 +-- 2 files changed, 26 insertions(+), 11 deletions(-) diff --git a/drivers/dma/dpaa/dpaa_qdma.c b/drivers/dma/dpaa/dpaa_qdma.c index 0a91cf040a..bb6b54e583 100644 --- a/drivers/dma/dpaa/dpaa_qdma.c +++ b/drivers/dma/dpaa/dpaa_qdma.c @@ -423,7 +423,6 @@ fsl_qdma_halt(struct fsl_qdma_engine *fsl_qdma) static int fsl_qdma_queue_transfer_complete(struct fsl_qdma_engine *fsl_qdma, void *block, int id, const uint16_t nb_cpls, - uint16_t *last_idx, enum rte_dma_status_code *status) { struct fsl_qdma_queue *fsl_queue = fsl_qdma->queue; @@ -457,7 +456,6 @@ fsl_qdma_queue_transfer_complete(struct fsl_qdma_engine *fsl_qdma, if (fsl_status->virt_head == fsl_status->cq + fsl_status->n_cq) fsl_status->virt_head = fsl_status->cq; qdma_writel_be(reg, block + FSL_QDMA_BSQMR); - *last_idx = fsl_comp->index; if (status != NULL) status[count] = RTE_DMA_STATUS_SUCCESSFUL; @@ -607,7 +605,6 @@ fsl_qdma_enqueue_desc(struct fsl_qdma_chan *fsl_chan, qdma_desc_addr_set64(ccdf, fsl_comp->bus_addr + 16); qdma_ccdf_set_format(ccdf, qdma_ccdf_get_offset(fsl_comp->virt_addr)); qdma_ccdf_set_ser(ccdf, qdma_ccdf_get_status(fsl_comp->virt_addr)); - fsl_comp->index = fsl_queue->virt_head - fsl_queue->cq; fsl_queue->virt_head++; if (fsl_queue->virt_head == fsl_queue->cq + fsl_queue->n_cq) @@ -623,7 +620,7 @@ fsl_qdma_enqueue_desc(struct fsl_qdma_chan *fsl_chan, } else { fsl_queue->pending++; } - return fsl_comp->index; + return 0; } static int @@ -771,8 +768,10 @@ dpaa_qdma_enqueue(void *dev_private, uint16_t vchan, struct fsl_qdma_engine *fsl_qdma = (struct fsl_qdma_engine *)dev_private; struct fsl_qdma_chan *fsl_chan = &fsl_qdma->chans[fsl_qdma->vchan_map[vchan]]; - int ret; + struct fsl_qdma_queue *fsl_queue = fsl_chan->queue; + int ret, idx; + idx = (uint16_t)(fsl_queue->stats.submitted + fsl_queue->pending); void *fsl_comp = NULL; fsl_comp = fsl_qdma_prep_memcpy(fsl_chan, @@ -783,8 +782,10 @@ dpaa_qdma_enqueue(void *dev_private, uint16_t vchan, return -1; } ret = fsl_qdma_enqueue_desc(fsl_chan, fsl_comp, flags); + if (ret < 0) + return ret; - return ret; + return idx; } static uint16_t @@ -826,8 +827,10 @@ dpaa_qdma_dequeue_status(void *dev_private, uint16_t vchan, FSL_QDMA_BLOCK_BASE_OFFSET(fsl_qdma, id); intr = fsl_qdma_queue_transfer_complete(fsl_qdma, block, id, nb_cpls, - last_idx, st); + st); fsl_queue->stats.completed += intr; + if (last_idx != NULL) + *last_idx = (uint16_t)(fsl_queue->stats.completed - 1); return intr; } @@ -873,9 +876,10 @@ dpaa_qdma_dequeue(void *dev_private, FSL_QDMA_BLOCK_BASE_OFFSET(fsl_qdma, id); intr = fsl_qdma_queue_transfer_complete(fsl_qdma, block, id, nb_cpls, - last_idx, NULL); + NULL); fsl_queue->stats.completed += intr; - + if (last_idx != NULL) + *last_idx = (uint16_t)(fsl_queue->stats.completed - 1); return intr; } @@ -912,6 +916,17 @@ dpaa_qdma_stats_reset(struct rte_dma_dev *dmadev, uint16_t vchan) return 0; } +static uint16_t +dpaa_qdma_burst_capacity(const void *dev_private, uint16_t vchan) +{ + const struct fsl_qdma_engine *fsl_qdma = dev_private; + struct fsl_qdma_chan *fsl_chan = + &fsl_qdma->chans[fsl_qdma->vchan_map[vchan]]; + struct fsl_qdma_queue *fsl_queue = fsl_chan->queue; + + return fsl_queue->n_cq - fsl_queue->pending; +} + static struct rte_dma_dev_ops dpaa_qdma_ops = { .dev_info_get = dpaa_info_get, .dev_configure = dpaa_qdma_configure, @@ -1035,6 +1050,7 @@ dpaa_qdma_probe(__rte_unused struct rte_dpaa_driver *dpaa_drv, dmadev->fp_obj->submit = dpaa_qdma_submit; dmadev->fp_obj->completed = dpaa_qdma_dequeue; dmadev->fp_obj->completed_status = dpaa_qdma_dequeue_status; + dmadev->fp_obj->burst_capacity = dpaa_qdma_burst_capacity; /* Invoke PMD device initialization function */ ret = dpaa_qdma_init(dmadev); diff --git a/drivers/dma/dpaa/dpaa_qdma.h b/drivers/dma/dpaa/dpaa_qdma.h index 7e9e76e21a..2092fb39f5 100644 --- a/drivers/dma/dpaa/dpaa_qdma.h +++ b/drivers/dma/dpaa/dpaa_qdma.h @@ -1,5 +1,5 @@ /* SPDX-License-Identifier: BSD-3-Clause - * Copyright 2021 NXP + * Copyright 2021-2024 NXP */ #ifndef _DPAA_QDMA_H_ @@ -176,7 +176,6 @@ struct fsl_qdma_comp { dma_addr_t bus_addr; dma_addr_t desc_bus_addr; void *virt_addr; - int index; void *desc_virt_addr; struct fsl_qdma_chan *qchan; dma_call_back call_back_func; -- 2.25.1