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 C3BED45683; Mon, 22 Jul 2024 18:44:13 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 82AC340E3B; Mon, 22 Jul 2024 18:41:20 +0200 (CEST) Received: from DUZPR83CU001.outbound.protection.outlook.com (mail-northeuropeazon11013004.outbound.protection.outlook.com [52.101.67.4]) by mails.dpdk.org (Postfix) with ESMTP id 23164410D4 for ; Mon, 22 Jul 2024 18:40:39 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=vzBriC9NohFp3Ks+EZ1xG14Eso15PHy6+JhGMYODrLMLtSAE0JXFdnYZ/6rErV7fGQwd8vFI9vhV1nSV7gaTJZ0mVIoHvFHLLVt1C9TbYblN/M1Gj1EVCZDboEeGAklhrFjXZ8wcpsFMhuQG2cRELohd8oa6ZGg1J8uwCJ7YvPh8m0hCioB9VmLu3pm7grb5komdBPKhyfR8AkW6ahgrtC1mEJ2rbRefdCJRFJlWBXG91uAssJj0Kmk2x27UKq+xHTIUUJfSxbLgqNVOkzVa2fzDk/Wr/fZeBvGh7aI7phTDz1FsvGXoFUih9lwjYXOy6KhlShLvjMY7EqPrOCJAbw== 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=CyIacJRP6zeJrrMmkQwX9RUwoPeer75zSeaT0riO7Vg=; b=lXHOvnLuW4C2oSNbDPW3FD8IQ5cifimbaHjD4+7Mjtt6jzKAIZLjKYBoyqhkhZGKU/wENIpwpDBRHzwaWqoC338Alqrz4xqPAn2fzDNm5sMeE6B3NYn0jqEtfLskF4ZjF+K8wqpWXBphqbPuFa2RYpPMr5dEBfQYxy0crDXycaVgSzWVMCyRGVFjGKjCoRoMwXxPQT79Az4ba+8vAqtHI8vqPLe5OIXGhyyvq/vLlhslNFw2bvOViIrcNgH2fNsrY/feMZUSzPQJVnVNFYL3HG+iYe3cdA7eKoN8E2NCdzr3RRESyFlrZex+8OT65U4TVGR/ZlIFglPItXq/F6tkpg== 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=CyIacJRP6zeJrrMmkQwX9RUwoPeer75zSeaT0riO7Vg=; b=UcVLdnw4tHcdiYFDwiX3bymBwiKeXhW5UTGmy2ffssqOsjlHsYvR0c4JdpZ2FUSHz24WCoMQ4LtcaAg4SAbLLnctFaDsbVNb/z23VoMROoNAP2qInHLQ26MdBcNB4JiBI6wuhdPEEIf1qShk/zpKIOkdvIcf1TpPmlOkmHUrkDo= 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:37 +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:37 +0000 From: Gagandeep Singh To: dev@dpdk.org, Sachin Saxena Cc: Jun Yang Subject: [v3 29/30] dma/dpaa: support max SG entry size Date: Mon, 22 Jul 2024 22:09:29 +0530 Message-Id: <20240722163930.2171568-30-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: 25e0e5c1-bf1d-406d-1691-08dcaa6d0425 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?q8Axi8FPbJZrvVKx9xdXzW6/RSJRHUuI0QWH+Y2vX1qPYhokgwiZSlilskoJ?= =?us-ascii?Q?n0/rHsmKxlzNFz9JPB6M9jOiJneVM13cRKr4axwayNnR2lgoEaEbIZYo8msW?= =?us-ascii?Q?olzzXJxT2sHoRxd0Fi92UDehZRL2acV41KLnZys27n5FhpW1YqVjoBx1JGDN?= =?us-ascii?Q?qtkRJY9coj536k35c5pdgGTqvludysjnF+c1i3Wi93kEHZbP0+wEMeXSTsMa?= =?us-ascii?Q?jmuh6ZGUWuybrjvs2AsYd+Z2u55d25VQUVkyNk+KJUEXN7PQPJbi91dTSUTJ?= =?us-ascii?Q?KNhIYG7vw0L/7hkT/iYHrdRblnhzMWB8tS97pJ8OlZlWbt75N5xtextyvhWb?= =?us-ascii?Q?DfR0z9MImWb6qnDQsXBr+pf8xZsWFJabdP0kvo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yYZxhPrAmxONp9OMxPoeDKS5dbcSXu6iyKYa+yJG76NCcZi?= =?us-ascii?Q?dK1WFh7MW4qzrphxigm7YZR4TVruuXgdGtGEUJQ9wXJ1FnSrPkxO+D/prVE3?= =?us-ascii?Q?8lk3OWa44RmX9Yb1+AzC86YsCZczkxFMU3C+52zFixFX3vyWSw=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?fpMLizIKupTlvVdLMSBsSE1zjRuG08JbPvYq0cjEzYMYlpN6SUuwoUxklD7M?= =?us-ascii?Q?qqtbhHr/0gMzImF5FRYCgCNs42z1Gr1D7RP7T9CmQjKH8VYdR/3vvxfe+k9L?= =?us-ascii?Q?HtTDkB8DqHvzUT44zCca5kQbZPxzmP/2v7imB1Ud2sZQ5vDeD1yqeBHMFVd+?= =?us-ascii?Q?Yc+V+OAWxdpWunmrP68WhA/314xEFuSxoRVOfiD0507ODg8XQU7RZl87Ar8R?= =?us-ascii?Q?gn7CxUtsMy/Cue9Ux82eQbEkaBe8jJ3zpXf60plxzphTfhNBpT9KVYZGU/1o?= =?us-ascii?Q?qM4OGDPj57095RXyCrRdXVbUPwQiMF7nqUE9IBU8/wajUxFdLYL11k2NudyL?= =?us-ascii?Q?iT3bR1Tck3SJY5QC9/LPdglD1L4PAmfQHP5D0rGaEE31YSF9yjoa02H16lHt?= =?us-ascii?Q?g86Aw/325fLceYdB6OaLT8TVthiyLB21eJjEttxH8rdK3Ae9kN0NjJpoYCLe?= =?us-ascii?Q?dAFEJDlGBCyc60u9VJhrc9X4inuIzvDadyGsMA5hUa9COl7Y3CaMzuhJNgIR?= =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xCq0ANbL8yS1XtjB5GMzbPo7iKLYJu?= =?us-ascii?Q?lUtwwG4SQD+TLNiXQpChDlB1mxb4j+uVdjq1El2BCnHhFiIwZ/YQAfkiy9cD?= =?us-ascii?Q?FyveSAyybtEOPzQdFCbX4SIxeiSgKwA3T5N2T6ml2aInIQTPpzbFzz9oNVZ4?= =?us-ascii?Q?ZZO3kIqfl7/9Srsd2L2Hc2Tgqv8RWuihowG9CkJo?= X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 25e0e5c1-bf1d-406d-1691-08dcaa6d0425 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:37.8757 (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: bm3VlUGADatPAOw+Qdasw5dqQvOkGUo/nDAy2jx3Mo99MJCIOLUwZYDIK5LnN8DU 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 SG transaction is not helpful for performance of large transaction size. Start single transaction for size > max SG entry size in SG copy. Default MAX SG entry size is 2000 bytes which is experiment data of mem to mem, user can change it according to experiment: export DPAA_QDMA_SG_MAX_ENTRY_SIZE=xxx Signed-off-by: Jun Yang --- drivers/dma/dpaa/dpaa_qdma.c | 41 ++++++++++++++++++++++++++++++++---- 1 file changed, 37 insertions(+), 4 deletions(-) diff --git a/drivers/dma/dpaa/dpaa_qdma.c b/drivers/dma/dpaa/dpaa_qdma.c index 383142fc75..e3f2777b40 100644 --- a/drivers/dma/dpaa/dpaa_qdma.c +++ b/drivers/dma/dpaa/dpaa_qdma.c @@ -12,6 +12,8 @@ static int s_data_validation; static int s_hw_err_check; static int s_sg_enable = 1; +static uint32_t s_sg_max_entry_sz = 2000; + #ifdef RTE_DMA_DPAA_ERRATA_ERR050757 static int s_pci_read = 1; #endif @@ -761,7 +763,7 @@ fsl_qdma_enqueue_desc_sg(struct fsl_qdma_queue *fsl_queue) struct fsl_qdma_comp_sg_desc *csgf_src, *csgf_dest; struct fsl_qdma_cmpd_ft *ft; uint32_t total_len; - uint16_t start, idx, num, i; + uint16_t start, idx, num, i, next_idx; int ret; #ifdef RTE_DMA_DPAA_ERRATA_ERR050757 struct fsl_qdma_sdf *sdf; @@ -770,13 +772,31 @@ fsl_qdma_enqueue_desc_sg(struct fsl_qdma_queue *fsl_queue) eq_sg: total_len = 0; start = fsl_queue->pending_start; + if (fsl_queue->pending_desc[start].len > s_sg_max_entry_sz || + fsl_queue->pending_num == 1) { + ret = fsl_qdma_enqueue_desc_single(fsl_queue, + fsl_queue->pending_desc[start].dst, + fsl_queue->pending_desc[start].src, + fsl_queue->pending_desc[start].len); + if (!ret) { + fsl_queue->pending_start = + (start + 1) & (fsl_queue->pending_max - 1); + fsl_queue->pending_num--; + } + if (fsl_queue->pending_num > 0) + goto eq_sg; + + return ret; + } + + ret = fsl_qdma_enqueue_overflow(fsl_queue); + if (unlikely(ret)) + return ret; + 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; @@ -799,7 +819,16 @@ fsl_qdma_enqueue_desc_sg(struct fsl_qdma_queue *fsl_queue) ft->desc_dsge[i].length = fsl_queue->pending_desc[idx].len; ft->desc_dsge[i].final = 0; total_len += fsl_queue->pending_desc[idx].len; + if ((i + 1) != num) { + next_idx = (idx + 1) & (fsl_queue->pending_max - 1); + if (fsl_queue->pending_desc[next_idx].len > + s_sg_max_entry_sz) { + num = i + 1; + break; + } + } } + ft->desc_ssge[num - 1].final = 1; ft->desc_dsge[num - 1].final = 1; csgf_src->length = total_len; @@ -1297,6 +1326,10 @@ dpaa_qdma_init(struct rte_dma_dev *dmadev) if (penv) s_sg_enable = atoi(penv); + penv = getenv("DPAA_QDMA_SG_MAX_ENTRY_SIZE"); + if (penv) + s_sg_max_entry_sz = atoi(penv); + #ifdef RTE_DMA_DPAA_ERRATA_ERR050757 penv = getenv("DPAA_QDMA_PCI_READ"); if (penv) -- 2.25.1