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 C798F45681; Mon, 22 Jul 2024 14:00:51 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id BED5B402EA; Mon, 22 Jul 2024 13:59:37 +0200 (CEST) Received: from DU2PR03CU002.outbound.protection.outlook.com (mail-northeuropeazon11012009.outbound.protection.outlook.com [52.101.66.9]) by mails.dpdk.org (Postfix) with ESMTP id EEFA3402D9 for ; Mon, 22 Jul 2024 13:59:32 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=XSB5nCTJ2Yi94/yCuZLa0tbWl7thxhsj043ACIACrCB4hB/drh7KBwuItKZSatR1MWm1QmgKEASX9uMJyzyTXLPs7JziS9pu8zLk1Ryb8MPf2LGEmgd+fx0U/+XO7dUIgm5cpZ5KQE84qlw4z58wxfVKe/ETLc8PDQ/Qn2y7T3tXH6cO3PqDHBV0K3jqoOWXURIV7/UvxfklCXMVIGZwmj4nDZHZh3giYa4JKCjgva2N9Gr5mglYoEiFIWSNXywyX5juNsObk7rkLaWelbHYhtvC6VKNPEXdBAeupZS3McnHXHN2FTbMJlxat845IDPpGb//AUsKqTJfbd/Z0mpK/w== 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=AfUQzgpk9CI+arl2svDvKlMSBcxFFyZXX7lQdk3Ye8kqHRdhFSRgpzJb1aYs8Xv5SXEwOSn1ai4zlP3uwlhRxNaFLBev5M/Lq/u3i1/7SzvXGp4QAHzEx9ij2q+W75eGrjbW3XSdjKHpnFtsAtCzS78b8lEMEuVBkV/w13yiuYHx+enpqSbvg3TeLJgh/vsAKJ+34GA5JmuBsPMk2rKG3lUKGrVuAoGPZVOjIPAaW2A4BYdts08DUK7cAijEwKalQe0WmZHL9pU4BdyJj4af1zBgjOZe1kWlyCvehqStea+PK+DHo/ti+o7ayRpRumK4S3dg68+ILjboTDegOO4ibw== 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=FvqaCAHK1rhnObItFcOyAL84Wzayj4aPMBJoSOx0zhyzG1hVQPyFMwWSLFS89gG9iZxhBFL7c0dCiOtytTjvn/KDQW71qn9IYLx0fSaZSapTx8EhQ9UjO3+VK/kaJynFPCyQlUpN2DwPLuME8HhC8/xo+iRaTcbQBBjNvosbMlg= 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 AM8PR04MB7970.eurprd04.prod.outlook.com (2603:10a6:20b:24f::9) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7762.29; Mon, 22 Jul 2024 11:59:31 +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 11:59:29 +0000 From: Gagandeep Singh To: dev@dpdk.org, Sachin Saxena Cc: Vanshika Shukla Subject: [v2 15/30] dma/dpaa: add burst capacity API Date: Mon, 22 Jul 2024 17:28:28 +0530 Message-Id: <20240722115843.1830105-16-g.singh@nxp.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20240722115843.1830105-1-g.singh@nxp.com> References: <20240719100126.1150373-1-g.singh@nxp.com> <20240722115843.1830105-1-g.singh@nxp.com> Content-Transfer-Encoding: 8bit Content-Type: text/plain X-ClientProxiedBy: SI2PR02CA0025.apcprd02.prod.outlook.com (2603:1096:4:195::21) To AS8SPR01MB0024.eurprd04.prod.outlook.com (2603:10a6:20b:3d0::24) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: AS8SPR01MB0024:EE_|AM8PR04MB7970:EE_ X-MS-Office365-Filtering-Correlation-Id: 15139ad8-9a49-4410-e6ac-08dcaa45bdba X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; ARA:13230040|1800799024|366016|52116014|376014|38350700014; X-Microsoft-Antispam-Message-Info: =?us-ascii?Q?znqDUEkUDlSYmvYZgwaOVyshiEwESSgWFH+yluaeDOexUuPY38/tMS7sOyZJ?= =?us-ascii?Q?d7Zaz8HE/IIJlhdbZ99vNW6wfHZEQaV4tEqsBV7zKYhcCWvxBrdU93oiQZvX?= =?us-ascii?Q?SA6O49ezvttZr2qxUOTOWIs/ew9Wy07OoTpF4hTD85a6cKIPL/TMnmSt8hFJ?= =?us-ascii?Q?cnMSSSmhUTKp3w1XjZWKIWsQ4OxUc3ot61iJaWji5yuAjRyEYFk02WLPgdu0?= =?us-ascii?Q?ZGl3mtVxuQzSkyAtz/umBMPGxSxsdGKeSHvKe5pOznbSpWejIbmbz5ezz6eK?= =?us-ascii?Q?vqIKFG1rqIb10eRJYefm3iWQwea0auWIM+dKwp6PbCL55lu39RqG4BiFCH0Q?= =?us-ascii?Q?fzWuQMzxOvA1Ru6mSbSv+dm8v+/SFHWWBWHUVEvy/ePW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2/fOxRbOBdcfWESMAiBZkICr8AWgCrpM4bDwR6cl7RVj38Wy/?= =?us-ascii?Q?xd62lP6FlrKcQ2ZEwQirTaed4lt4RlMuQ08GjAvZ8WzZH1N3qTt8qF+/DMox?= =?us-ascii?Q?/iQLq3erfXg2sdXXVsETgNJQx5Pvm/fOcuOxdo6/o+kl6+nlpg=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)(1800799024)(366016)(52116014)(376014)(38350700014); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?us-ascii?Q?1EhiuY7sjLT408PSfyyjmilEXGHMjsKqqkoDc3wUqaEq7PqgWxqc+852PYCW?= =?us-ascii?Q?nk1DoEDdxduSsUNMXB91ZhM+RkZwnTqVJm2VQqJH/nq5HYu1LPGnObg6D8Sl?= =?us-ascii?Q?UTfvlSU6SSO4HO5bojlVBIYe92ItX68Dw40Zxv3HsmAUM7OLEkgs5mTqiHp6?= =?us-ascii?Q?5WQd8ylH0ruReCV0j/02sDbrj3Auz+KvRSxMsLnmiSJ7eq6uHD1GE4YRIt/E?= =?us-ascii?Q?4lBK9m0agcVhl2ZtOokLMCnCPj/1Rn7pCy/bZV82qA5USEelU6jFXBzPa6K7?= =?us-ascii?Q?gAoEZiM1oG7FLVDaS5W4srd0/609ySuBlR4FSKoOopAQ57yVJqx1cM7rxZII?= =?us-ascii?Q?WlQ/aCrrJ+gbqxs/36woGWL8i3IwMgZqioVJDyRjoW6KC+gL1DcvR2JeHF20?= =?us-ascii?Q?oxt9QmCfshKI39vXp7Uugtb8UEKJQYwsgpkMLmkpeIWxqM3i3Sx4UKsv8ekP?= =?us-ascii?Q?WQGCmTijG91FC9zuIRd8jJ15K4k20tATmA1UCOKlHP5StfeHDi4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2ZR6EsqvsBDjn2EvUCwo7ULIAjlEQHANeBUIvyMASTukLu?= =?us-ascii?Q?z5TkPqIZ27MJ7QqE+AWFR6O1r3IfNTcV85cpVH+ZJnW5UOp2QWLXYayOwgUA?= =?us-ascii?Q?nowafZAtpCsM4N7CIJQFX6aEgaJpTn/PMGxae/zR/3BcRblMXlizQxtjPS05?= =?us-ascii?Q?/R07IPNZH4vF7b6yqUHuGHFTtoFDjicUJ5fmkP5Y?= X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 15139ad8-9a49-4410-e6ac-08dcaa45bdba X-MS-Exchange-CrossTenant-AuthSource: AS8SPR01MB0024.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 22 Jul 2024 11:59:29.4023 (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: qBYMFr/Mbl6gPoE7jUMuFFhpxGXcPbEDy9miDI5twFaPfI9S7JfKTWIxFBfUfqie X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM8PR04MB7970 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