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 61DC545683; Mon, 22 Jul 2024 18:44:01 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id E957741109; Mon, 22 Jul 2024 18:41:09 +0200 (CEST) Received: from AS8PR04CU009.outbound.protection.outlook.com (mail-westeuropeazon11011064.outbound.protection.outlook.com [52.101.70.64]) by mails.dpdk.org (Postfix) with ESMTP id 7C87F40EE5 for ; Mon, 22 Jul 2024 18:40:37 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=U+cnvIb+BTO/Nqbi1HSO0mRVM/fo8FwRfc6MCoSA358VYCd9/wFLqYpJ/dbNVMDmdwEcLynFdHBK4rbW+PHkPdUwnhAwru10jc87dKMPQRbZpb3OpUdXaaCNkt1Lk3Xu6dcekK5fYqupMLIo+6PQoZezw4QKaO8RFGxR+FmAhur4adh4kX6t4Z46nLBrn7Bt1hNUxdoh5Ovh9axCoKGVHq4OwFWxmhHH2MGXT3329VancDfifO3QqDvgMlQsABeUrNClcQP2E8CHq+eezsAos3WCKyPFkh50f91fZbC6YE9pAd3x9Y4sdSXxa7m30/X8AifdAsM6aYo84HYhQn5jhg== 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=BD5wk57fTeKwbD7LdLzHgXRL7CmAFrk5p6/PJ1Jjb1M=; b=owfrZUsSYAn3nddXL0PcV0q+mfQsdeHtCeJNPxd32+LjjuBZaIXrKk2/Xk4AwcveE2ApwXA9a4IIf+mtxnUZyjQXQCBQ5yeLdlzLTZhNtWsmWSYikBCooJmVyVlCoBx7PlwqUujPUViIqTYiPk9p/CcOjv8ChnruomSdXPG686JtgTqmdoYJQEwpbBKQ7PC2XN+Vz9U33Z3CRokmdrMkogboX1xnzz/rX/71kCnwDZvtpC3zCtupl93+pxglDQci3Wvo/RjMmECKKvqdnFsCp2IxBhgpe3kjnpyneKxwQrldxKADqUXvIpvyynh8x/SrtrP2Z8sT41SiRBzA2tV4qQ== 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=BD5wk57fTeKwbD7LdLzHgXRL7CmAFrk5p6/PJ1Jjb1M=; b=E6hII4AFaooB9visJteaH2qU/kYzemRoHv9T+ey8wbRE5G8AM9j+LORjlz8Ct1iz0tiVeEtU+b7qjWKJYk4awKTWH+uI30eahGfDQ9Uh7m312j54tfVI1rbtwfW19CO9kOZN9cxVT4yCxJn5/Yi/AFC39KQSZ0zQXvx9Rmq9kAw= 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 VI1PR04MB6798.eurprd04.prod.outlook.com (2603:10a6:803:131::19) 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:36 +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:36 +0000 From: Gagandeep Singh To: dev@dpdk.org, Sachin Saxena Cc: Jun Yang Subject: [v3 28/30] dma/dpaa: support multiple SG copies Date: Mon, 22 Jul 2024 22:09:28 +0530 Message-Id: <20240722163930.2171568-29-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_|VI1PR04MB6798:EE_ X-MS-Office365-Filtering-Correlation-Id: b9c336df-ec73-442c-06fe-08dcaa6d0309 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; ARA:13230040|376014|52116014|1800799024|366016|38350700014; X-Microsoft-Antispam-Message-Info: =?us-ascii?Q?uuXhL+ObOjALRtf0rrm7065te8E2LYTR3CuzZcLWqBtlCdidfbAsDxMyj+6b?= =?us-ascii?Q?DAb3R83OlcvxGnJtePTyRUct85ZKXP9WEvbKJRGeEWBD9MDdo8WZkbqsGr09?= =?us-ascii?Q?0N7OAO1I0PLJsezkSQ2KlBv5WypwEIoQvz9E3CC5abH9AVgfTHCqrE3VpzYO?= =?us-ascii?Q?vI9HO54zZ9/0EOTbuekTdV0andVDhwpLu/l9yHIuCQkzX97KY5yWiO+VGpaJ?= =?us-ascii?Q?0kDmSa/xToX1DRV+ubjs8UEeUZqs+uEfXnWAzM8aPoiBaGj46EdsXLQxYByL?= =?us-ascii?Q?cJ381Ta65lsBDnF74RZnJncuipSDzBPTmDx6TQNIVry7Vc5Emgmd7XEqmH79?= =?us-ascii?Q?Tz/SbIj2rK+ILpFgSZzQhpYuPAScd8h841NTjMcqA/9gdAx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qyXOChvu5J8M43Pv2oSTyrbfeaI0fcCnwOMNH6C4Ugd60?= =?us-ascii?Q?+h2sBZyIxbCFqs27QSnPZXa/siadhFdrLrYaqNl2lxPjVI7Lt5Pe4S7VYNWF?= =?us-ascii?Q?oGeDQrsNm0wF0zb0zQzc9FhBfHAAwzM42R+sp1sUhE7JQ07ysw=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)(376014)(52116014)(1800799024)(366016)(38350700014); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?us-ascii?Q?Pk6GS7h/NovWMj5sLBvxRkp5IhMVbZiHOkGgB5sfSmIc6LfPxMM7uA4uy+Fi?= =?us-ascii?Q?W/I30+4GIfUUO9fLm+S31EDxfM5Dhb5lZ1OIbE0Ut+AI+d7HW6GyL93z6+Np?= =?us-ascii?Q?0RMAClO9GPsbaeuSv6HeohZAcGokiVmzB8OhmZM4zltSG80lJJalxM7VIS3f?= =?us-ascii?Q?qHeFtREEbbv/0YDqAXJJHFu7mQzvQ9l+sFEekBHVQhNa/qViQJEV+MzPZqWT?= =?us-ascii?Q?qcjsLYcSmq5CBHB1u1xeAPBFjyC3KLHRGbr8AMVL2PfjGDzRDvAIyH6m9/u7?= =?us-ascii?Q?L9kDjXWV7JjT/F8v8UYkaccqX9Ul2U95OY12AyfO9bY+foE8B99RkF4+UxNz?= =?us-ascii?Q?pEt9zKJJsxUN88+y18Ug5cNK64moXsHynhnqv9N9/OxyXuxaeu+ggDncF8ry?= =?us-ascii?Q?p4GkNkQyskH4RIzud0tT63Id1ibHjajhNpgSkMrKk5d5MJYNhqnY9LwPjZwY?= =?us-ascii?Q?CUkxiHuGko3gG1CfpPcvYGCzOcnmKnnqHZ7BXu8zfPwX1N/jW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sVBND+BRSGLujXopBKvxfPpQsELcq/?= =?us-ascii?Q?EfsM0LjfpC0RwjGRQBypY7FC3FRBnxKlQ074nmndCpZ9y551n7NPI5ElYWgI?= =?us-ascii?Q?crOs0XEQFZBwg6rJFuYOL2Rqz/iL10PBhvEqoU+rRO+9YNsF1EM++5d+H+NC?= =?us-ascii?Q?v0UOjpagN9m5Bx1IglKn5wcEwNwuwTftTWOtOubP?= X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: b9c336df-ec73-442c-06fe-08dcaa6d0309 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:36.1630 (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: Vywnj9SF53BX4ldH38Itoa1UpEVGTAyKqSVGJzpkynqfJCuJZB5qFghATGkFS1IF X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR04MB6798 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: Jun Yang Split burst copies to multiple SG copies if burst number exceeds max number of SG entries. Signed-off-by: Jun Yang --- drivers/dma/dpaa/dpaa_qdma.c | 180 +++++++++++++++++++---------------- drivers/dma/dpaa/dpaa_qdma.h | 2 +- 2 files changed, 98 insertions(+), 84 deletions(-) diff --git a/drivers/dma/dpaa/dpaa_qdma.c b/drivers/dma/dpaa/dpaa_qdma.c index 8f5b6c6ea5..383142fc75 100644 --- a/drivers/dma/dpaa/dpaa_qdma.c +++ b/drivers/dma/dpaa/dpaa_qdma.c @@ -584,17 +584,15 @@ dpaa_qdma_block_dequeue(struct fsl_qdma_engine *fsl_qdma, static int fsl_qdma_enqueue_desc_to_ring(struct fsl_qdma_queue *fsl_queue, - int is_burst) + uint16_t num) { struct fsl_qdma_engine *fsl_qdma = fsl_queue->engine; - uint16_t i, num = fsl_queue->pending_num, idx, start, dq; + uint16_t i, idx, start, dq; int ret, dq_cnt; if (fsl_qdma->is_silent) return 0; - num = is_burst ? fsl_queue->pending_num : 1; - fsl_queue->desc_in_hw[fsl_queue->ci] = num; eq_again: ret = rte_ring_enqueue(fsl_queue->complete_burst, @@ -634,6 +632,69 @@ fsl_qdma_enqueue_desc_to_ring(struct fsl_qdma_queue *fsl_queue, return 0; } +static int +fsl_qdma_enqueue_overflow(struct fsl_qdma_queue *fsl_queue) +{ + int overflow = 0; + uint32_t reg; + uint16_t blk_drain, check_num, drain_num; + uint8_t *block = fsl_queue->block_vir; + const struct rte_dma_stats *st = &fsl_queue->stats; + struct fsl_qdma_engine *fsl_qdma = fsl_queue->engine; + + check_num = 0; +overflow_check: + if (fsl_qdma->is_silent || unlikely(s_hw_err_check)) { + reg = qdma_readl_be(block + + FSL_QDMA_BCQSR(fsl_queue->queue_id)); + overflow = (reg & FSL_QDMA_BCQSR_QF_XOFF_BE) ? + 1 : 0; + } else { + overflow = (fsl_qdma_queue_bd_in_hw(fsl_queue) >= + QDMA_QUEUE_CR_WM) ? 1 : 0; + } + + if (likely(!overflow)) { + return 0; + } else if (fsl_qdma->is_silent) { + check_num++; + if (check_num >= 10000) { + DPAA_QDMA_WARN("Waiting for HW complete in silent mode"); + check_num = 0; + } + goto overflow_check; + } + + DPAA_QDMA_DP_DEBUG("TC%d/Q%d submitted(%"PRIu64")-completed(%"PRIu64") >= %d", + fsl_queue->block_id, fsl_queue->queue_id, + st->submitted, st->completed, QDMA_QUEUE_CR_WM); + drain_num = 0; + +drain_again: + blk_drain = dpaa_qdma_block_dequeue(fsl_qdma, + fsl_queue->block_id); + if (!blk_drain) { + drain_num++; + if (drain_num >= 10000) { + DPAA_QDMA_WARN("TC%d failed drain, Q%d's %"PRIu64" bd in HW.", + fsl_queue->block_id, fsl_queue->queue_id, + st->submitted - st->completed); + drain_num = 0; + } + goto drain_again; + } + check_num++; + if (check_num >= 1000) { + DPAA_QDMA_WARN("TC%d failed check, Q%d's %"PRIu64" bd in HW.", + fsl_queue->block_id, fsl_queue->queue_id, + st->submitted - st->completed); + check_num = 0; + } + goto overflow_check; + + return 0; +} + static int fsl_qdma_enqueue_desc_single(struct fsl_qdma_queue *fsl_queue, dma_addr_t dst, dma_addr_t src, size_t len) @@ -646,6 +707,10 @@ fsl_qdma_enqueue_desc_single(struct fsl_qdma_queue *fsl_queue, struct fsl_qdma_sdf *sdf; #endif + ret = fsl_qdma_enqueue_overflow(fsl_queue); + if (unlikely(ret)) + return ret; + ft = fsl_queue->ft[fsl_queue->ci]; #ifdef RTE_DMA_DPAA_ERRATA_ERR050757 @@ -677,7 +742,7 @@ fsl_qdma_enqueue_desc_single(struct fsl_qdma_queue *fsl_queue, /* This entry is the last entry. */ csgf_dest->final = 1; - ret = fsl_qdma_enqueue_desc_to_ring(fsl_queue, 0); + ret = fsl_qdma_enqueue_desc_to_ring(fsl_queue, 1); if (ret) return ret; fsl_queue->ci = (fsl_queue->ci + 1) & (fsl_queue->n_cq - 1); @@ -689,81 +754,30 @@ fsl_qdma_enqueue_desc_single(struct fsl_qdma_queue *fsl_queue, return 0; } -static int -fsl_qdma_enqueue_overflow(struct fsl_qdma_queue *fsl_queue) -{ - int overflow = 0; - uint32_t reg; - uint16_t blk_drain, check_num, drain_num; - uint8_t *block = fsl_queue->block_vir; - const struct rte_dma_stats *st = &fsl_queue->stats; - struct fsl_qdma_engine *fsl_qdma = fsl_queue->engine; - - check_num = 0; -overflow_check: - if (fsl_qdma->is_silent || unlikely(s_hw_err_check)) { - reg = qdma_readl_be(block + - FSL_QDMA_BCQSR(fsl_queue->queue_id)); - overflow = (reg & FSL_QDMA_BCQSR_QF_XOFF_BE) ? - 1 : 0; - } else { - overflow = (fsl_qdma_queue_bd_in_hw(fsl_queue) >= - QDMA_QUEUE_CR_WM) ? 1 : 0; - } - - if (likely(!overflow)) { - return 0; - } else if (fsl_qdma->is_silent) { - check_num++; - if (check_num < 1000) - goto overflow_check; - return -ENOSPC; - } - - DPAA_QDMA_DP_DEBUG("TC%d/Q%d submitted(%"PRIu64")-completed(%"PRIu64") >= %d", - fsl_queue->block_id, fsl_queue->queue_id, - st->submitted, st->completed, QDMA_QUEUE_CR_WM); - drain_num = 0; - -drain_again: - blk_drain = dpaa_qdma_block_dequeue(fsl_qdma, - fsl_queue->block_id); - if (!blk_drain) { - drain_num++; - if (drain_num > 1000) { - DPAA_QDMA_ERR("TC%d failed drain, Q%d's %"PRIu64" bd in HW.", - fsl_queue->block_id, fsl_queue->queue_id, - st->submitted - st->completed); - return -ENOSPC; - } - goto drain_again; - } - check_num++; - if (check_num > 1000) { - DPAA_QDMA_ERR("TC%d failed check, Q%d's %"PRIu64" bd in HW.", - fsl_queue->block_id, fsl_queue->queue_id, - st->submitted - st->completed); - return -ENOSPC; - } - goto overflow_check; - - return -ENOSPC; -} - static int fsl_qdma_enqueue_desc_sg(struct fsl_qdma_queue *fsl_queue) { - uint8_t *block = fsl_queue->block_vir, i; + uint8_t *block = fsl_queue->block_vir; struct fsl_qdma_comp_sg_desc *csgf_src, *csgf_dest; struct fsl_qdma_cmpd_ft *ft; - uint32_t total_len = 0; - uint8_t num = fsl_queue->pending_num; - uint16_t start = fsl_queue->pending_start, idx; + uint32_t total_len; + uint16_t start, idx, num, i; int ret; #ifdef RTE_DMA_DPAA_ERRATA_ERR050757 struct fsl_qdma_sdf *sdf; #endif +eq_sg: + total_len = 0; + start = fsl_queue->pending_start; + if (fsl_queue->pending_num > FSL_QDMA_SG_MAX_ENTRY) + num = FSL_QDMA_SG_MAX_ENTRY; + else + num = fsl_queue->pending_num; + ret = fsl_qdma_enqueue_overflow(fsl_queue); + if (unlikely(ret)) + return ret; + ft = fsl_queue->ft[fsl_queue->ci]; csgf_src = &ft->desc_sbuf; csgf_dest = &ft->desc_dbuf; @@ -808,7 +822,7 @@ fsl_qdma_enqueue_desc_sg(struct fsl_qdma_queue *fsl_queue) } } #endif - ret = fsl_qdma_enqueue_desc_to_ring(fsl_queue, 1); + ret = fsl_qdma_enqueue_desc_to_ring(fsl_queue, num); if (ret) return ret; @@ -820,7 +834,9 @@ fsl_qdma_enqueue_desc_sg(struct fsl_qdma_queue *fsl_queue) fsl_queue->pending_start = (start + num) & (fsl_queue->pending_max - 1); - fsl_queue->pending_num = 0; + fsl_queue->pending_num -= num; + if (fsl_queue->pending_num > 0) + goto eq_sg; return 0; } @@ -831,10 +847,6 @@ fsl_qdma_enqueue_desc(struct fsl_qdma_queue *fsl_queue) uint16_t start = fsl_queue->pending_start; int ret; - ret = fsl_qdma_enqueue_overflow(fsl_queue); - if (unlikely(ret)) - return ret; - if (fsl_queue->pending_num == 1) { ret = fsl_qdma_enqueue_desc_single(fsl_queue, fsl_queue->pending_desc[start].dst, @@ -871,17 +883,19 @@ fsl_qdma_enqueue_desc(struct fsl_qdma_queue *fsl_queue) } static int -dpaa_info_get(const struct rte_dma_dev *dev, struct rte_dma_info *dev_info, - __rte_unused uint32_t info_sz) +dpaa_qdma_info_get(const struct rte_dma_dev *dev, + struct rte_dma_info *dev_info, __rte_unused uint32_t info_sz) { struct fsl_qdma_engine *fsl_qdma = dev->data->dev_private; dev_info->dev_capa = RTE_DMA_CAPA_MEM_TO_MEM | - RTE_DMA_CAPA_SILENT | RTE_DMA_CAPA_OPS_COPY; + RTE_DMA_CAPA_SILENT | RTE_DMA_CAPA_OPS_COPY | + RTE_DMA_CAPA_OPS_COPY_SG; dev_info->dev_capa |= RTE_DMA_CAPA_DPAAX_QDMA_FLAGS_INDEX; dev_info->max_vchans = fsl_qdma->n_queues; dev_info->max_desc = FSL_QDMA_MAX_DESC_NUM; dev_info->min_desc = QDMA_QUEUE_SIZE; + dev_info->max_sges = FSL_QDMA_SG_MAX_ENTRY; return 0; } @@ -985,9 +999,9 @@ dpaa_qdma_enqueue(void *dev_private, uint16_t vchan, uint16_t idx; int ret; - if (pending >= FSL_QDMA_SG_MAX_ENTRY) { - DPAA_QDMA_ERR("Too many pending jobs on queue%d", - vchan); + if (pending >= fsl_queue->pending_max) { + DPAA_QDMA_ERR("Too many pending jobs(%d) on queue%d", + pending, vchan); return -ENOSPC; } idx = (start + pending) & (fsl_queue->pending_max - 1); @@ -1253,7 +1267,7 @@ dpaa_qdma_burst_capacity(const void *dev_private, uint16_t vchan) } static struct rte_dma_dev_ops dpaa_qdma_ops = { - .dev_info_get = dpaa_info_get, + .dev_info_get = dpaa_qdma_info_get, .dev_configure = dpaa_qdma_configure, .dev_start = dpaa_qdma_start, .dev_close = dpaa_qdma_close, diff --git a/drivers/dma/dpaa/dpaa_qdma.h b/drivers/dma/dpaa/dpaa_qdma.h index f2aa6fdd34..b5d76776cb 100644 --- a/drivers/dma/dpaa/dpaa_qdma.h +++ b/drivers/dma/dpaa/dpaa_qdma.h @@ -270,7 +270,7 @@ struct fsl_qdma_queue { struct fsl_qdma_desc *pending_desc; uint16_t pending_max; uint16_t pending_start; - uint8_t pending_num; + uint16_t pending_num; uint16_t complete_start; dma_addr_t bus_addr; void *engine; -- 2.25.1