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 2207D4564F; Fri, 19 Jul 2024 12:03:34 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id C60B442F21; Fri, 19 Jul 2024 12:02:24 +0200 (CEST) Received: from AS8PR04CU009.outbound.protection.outlook.com (mail-westeuropeazon11011009.outbound.protection.outlook.com [52.101.70.9]) by mails.dpdk.org (Postfix) with ESMTP id F002B42EF1 for ; Fri, 19 Jul 2024 12:02:07 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=fjLP3fGd1V9uFXhNlq6TwrG6dCjO62zW6T7A/bSGhNH0NAwYdtXzzKPAyD5YLAXRU+Etsp0WAj8I9Nxh/4P2xXu7ka1O6OTzOaIOQAlXEczSlA4IWP8D5OClrT92IluuZ0NDeBeX5LujlssjIqz1jdt50QaKIR35nSLLD/ddrgNrZc1z9yloQ1PMTaWvfMHHYOmniVnR45GGyDL5vCEbjeYOPoYLwJ3EyGEPuMJxeP9bsbq1yWFcDWzJS89FvcA7xOwCVpe2FZMH34n7mmsgD55OiYztbfO6XBQ3TSqDFwz4Zhtu6k20b95MkE/uGZv0Y2LnxBzBof1RksBgHLRgKA== 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=fTqh+w9VK/QNzqdYjjsbL6ZIfHINeWlKlv75dYKYb1TjE90Twjni06R7jSbfdW2JDpb1dTKFYscn+sLiHB0sZjPXYO4alTJqc4CW1UguvDkxL3RC3h0QOwJWA/Rp8WgSdb/0+SB4X/k3KP3U+9woIu6RgnKKuORKmwHPJ1DU9HW+imHo0neAGjHVRp2XOai/Plutvss0QQFj39clUv/t00Dd8VkBGLJPjHnAlDWFeVsZweHFx6EQ2jU0Ur4FKg+bPDhLqmP28bAYJzZPaz0EDkWaA865bUtJTegm2Un1tSTf18M9Z/vbJqWR/Zy3V7Hli67x43wO7pCNbJ1Tvrx5Lw== 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=Pt9i78TxLKFIIyJu78l/F6JCx/rj4jy//URqOMD+J0If6BXPOCPKTTI2K4rXioTwksF4zBA9LW0RKv3PbxIVO0/hmJEoLMs+HEo0Y19idfAi7CWIBvV19K+UQKWWtO/X3TZPHdfBydTTfsCMHbvC2doK837pRLAQ1om7h16MlaM= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=nxp.com; Received: from PAXPR04MB8205.eurprd04.prod.outlook.com (2603:10a6:102:1c2::20) by DB9PR04MB8345.eurprd04.prod.outlook.com (2603:10a6:10:246::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7784.19; Fri, 19 Jul 2024 10:02:06 +0000 Received: from PAXPR04MB8205.eurprd04.prod.outlook.com ([fe80::7633:884d:5973:174f]) by PAXPR04MB8205.eurprd04.prod.outlook.com ([fe80::7633:884d:5973:174f%6]) with mapi id 15.20.7784.016; Fri, 19 Jul 2024 10:02:06 +0000 From: Gagandeep Singh To: dev@dpdk.org, Sachin Saxena Cc: Vanshika Shukla Subject: [PATCH 15/30] dma/dpaa: add burst capacity API Date: Fri, 19 Jul 2024 15:31:11 +0530 Message-Id: <20240719100126.1150373-15-g.singh@nxp.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20240719100126.1150373-1-g.singh@nxp.com> References: <20240719100126.1150373-1-g.singh@nxp.com> Content-Transfer-Encoding: 8bit Content-Type: text/plain X-ClientProxiedBy: SG2PR01CA0184.apcprd01.prod.exchangelabs.com (2603:1096:4:189::9) To PAXPR04MB8205.eurprd04.prod.outlook.com (2603:10a6:102:1c2::20) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: PAXPR04MB8205:EE_|DB9PR04MB8345:EE_ X-MS-Office365-Filtering-Correlation-Id: 961b8d6c-1637-4d51-ea0e-08dca7d9d8a8 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; ARA:13230040|52116014|366016|1800799024|376014|38350700014; X-Microsoft-Antispam-Message-Info: =?us-ascii?Q?f5dDVsLaHNr4FTxKaDfMgVcPF/puYRbClOswFjNOWG4YJrT6knOMSHkwR/G+?= =?us-ascii?Q?VSySrXnsZvqICh//zZFDtxQA1IwAnkKOxIcTto0z2TZhX2OidYVGIh5z9TK/?= =?us-ascii?Q?XbcWtQcyhE/82gbbQQvn7aUEYNIeX3cklGlEZgdjEbgbxIZ3573MtotuFRkY?= =?us-ascii?Q?L5i9s9SZXY/LgP/NVbM7iiL61BArZf6oSgTOfQx6Jl1Uiwsw1iAxo4W48uTR?= =?us-ascii?Q?7p90Sn8GWllrfIw/PpcqzqeLHwDroogA1DnussFzK7C5uuYtfpKuDBilKxQE?= =?us-ascii?Q?8QXtEndc3g6ukTXXLrq32Mzn+lKxm04OMMrtBLsLqeJR9WTTxaYN11OCuu3O?= =?us-ascii?Q?9bqbiaAbt6toru3g3XKBbVKZMWa+2zUzwr7qHVl9zKL8WhUgKnYC+5KD7ooL?= =?us-ascii?Q?OlPXCCK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us-ascii?Q?H43DOBCoEdt2oppg2eDz45JnACAemoJkgiHOID6LVog3CR1l6zvNzkbCd3mk?= =?us-ascii?Q?c3OyAKWhwKxdsdCMG18nySfQBrvBqyRkTv4n+AaN4A5Jlu6fDg=3D=3D?= X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:PAXPR04MB8205.eurprd04.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230040)(52116014)(366016)(1800799024)(376014)(38350700014); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?us-ascii?Q?CF2afKRSgRNDm89HQPfitKtmfjnVLT7JN+b+7hfU35LLbZmUDSFnpgIAcj6Q?= =?us-ascii?Q?KEm3c0jrBSISj12x/+prw8ZQXAN04ZaHbrbwSRkj50nubDCHCby1Au977q4g?= =?us-ascii?Q?F+dH5R0eGYtHQp54zko526Ls/g+orJpT0VWKhLvGnSyK/iRLYXt9seOdU7FU?= =?us-ascii?Q?RPiGZL828n7n1tHUbjp+42TbNye5GXd/7mGfo8S6Z/QUDJc9JmQmNsIPdO4X?= =?us-ascii?Q?FWr9OJMqquBHstHlBVz0xb1WiJCF5P97zRTxmdrXOe168pOi7lUhhFZWUg48?= =?us-ascii?Q?PPF8ePyoQR7QhEM9JHKSmHGeJzGM+2rr3ifH7nHndMXljJAuWMbMu+FqR2MP?= =?us-ascii?Q?gDD/Y9k0zew7tLirJfwdeBsz5FoGzIOdKc9kiHOolORrpoWexznr0xv6pUsp?= =?us-ascii?Q?4MEMCYKl1C9+stUVlU0RnTYXaqrDkeZsDs3UMVVCOyGNetmwlN0d4cK2UOOU?= =?us-ascii?Q?dct/T6ejUpcoCudMsPrFyYdwiPuh3diFXcZkcGfYQD3aZMHQSJIc7z0w0bwy?= =?us-ascii?Q?gy8INuXtqZlNa51HFSf3mQ1OvFbRl88Ow6yEnJZwdlF2uL6g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rg8QYb8W/f/O7d84C23zLgb/Hl/Kz3XDLUMj4Ac3j?= =?us-ascii?Q?S45M7UgeNlYo3xg06CX0PhPC+bvJQqc2FtNqIQVpLXSvRyzw8r9uOXznKqmq?= =?us-ascii?Q?tlk/TiT8/wJS5jNWgH71rKykVqAmN3feHa66GZeD?= X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 961b8d6c-1637-4d51-ea0e-08dca7d9d8a8 X-MS-Exchange-CrossTenant-AuthSource: PAXPR04MB8205.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 19 Jul 2024 10:02:06.6065 (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: uTLokpGtSZfcTjpyK4xkfuXzayTiDLhu7yY0/+4ZV9zCWY8fiOochczvPJH4UGFF X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB9PR04MB8345 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