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 56F804564F; Fri, 19 Jul 2024 12:05:18 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 15E6F42FA7; Fri, 19 Jul 2024 12:02:49 +0200 (CEST) Received: from DUZPR83CU001.outbound.protection.outlook.com (mail-northeuropeazon11013044.outbound.protection.outlook.com [52.101.67.44]) by mails.dpdk.org (Postfix) with ESMTP id 3C9EA42F59 for ; Fri, 19 Jul 2024 12:02:33 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=E9EdYP4S7SIVjpspPWLnn5NfX/05JeVs0EHWymG2IFOJbK/GdWBtj/4MBrMxydntMPH+Wbka6wfz7PZuuf/Jz+keXHsuoqlP2riga6BclaTrlIbojq4eoWhplVBz5y0ahNFV0wxzcX/9LaivDfA8wVCz8Xh80HRcTZwedLQ2fNfu5LCEtr5iJEz8qwl/qVTkbr1Mdc/mszzVGwWTZdFSt9A/sEbnNwEWJ+cYGL6EDHs1CF3tUxIpsVuCOHSFLSk3eScg40VfPYNc94PLyLL/TQMyWLdFi07BoV1yBcuXDLyOZkEZ8tDDxEahGDmJYC/1W67Mv6aSc71UvfE3Jnv0Hw== 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=o9+fbiBjlwRjQUl6XPQWIZthFSInM59AebYztNbAoxo=; b=gzspaIq9/aX7yqV9NEdi8RY6q1vPKFy4pwsnzfF+AXzsEZySixJ3N1L+q5HXsDRFY+Ouks86dN2yYkAwxk3i8xZ7acyEOX3d6/PHSNk2wk7rCnVKY520U0NeTgSdF17VEnOytJsPTJANZbn1tkp2EBbTs8HJF73wqOU1NddGDwEGQrfX9UMKxKTvPAVyGhK76/0KpDbaOtyQQw9wl1RjLmJXrNOoqarYcFSlvDeK++fSlJ87pbchtIKDfLgFjFTX7eTp4xWtOq6TZ5+cZSqYyu+qGCJ7GAWYJrbrx9DU2MODZK/79qXtCuy8IHXIqIbxctjlCDkDRocql/nkIsFlAw== 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=o9+fbiBjlwRjQUl6XPQWIZthFSInM59AebYztNbAoxo=; b=RMnXyo5JXL77jCAsZWxdIgUWbg0RezTxhvhxBabkLw1e1v9j+dkrzV5icSDyyetATLCkvL4OHye34pF7uiffL+/ZS5PS52DHeB56MoBoMF1rXMENMePDYXCTCcszdIgtqFviVI2vOrg+me8dEctUZdBayKvKFgcT2+DMxVABcSo= 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 AM0PR04MB7108.eurprd04.prod.outlook.com (2603:10a6:208:19e::21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7784.20; Fri, 19 Jul 2024 10:02:32 +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:32 +0000 From: Gagandeep Singh To: dev@dpdk.org, Sachin Saxena Cc: Jun Yang Subject: [PATCH 29/30] dma/dpaa: support max SG entry size Date: Fri, 19 Jul 2024 15:31:25 +0530 Message-Id: <20240719100126.1150373-29-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_|AM0PR04MB7108:EE_ X-MS-Office365-Filtering-Correlation-Id: d72e5ccd-ed3a-4330-5da2-08dca7d9e789 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; ARA:13230040|366016|1800799024|376014|52116014|38350700014; X-Microsoft-Antispam-Message-Info: =?us-ascii?Q?1R/p88eaas2UR+s7hKHf+yaReQAT1jt6eyVy/XIjXVlizTYID6QIVOQ9MOD4?= =?us-ascii?Q?KNb6lPqaDOniWQHruDBD7nls/S0eZ0DUOQXPOLxUCaPgukz3cWFvpXZ7aO9p?= =?us-ascii?Q?7UBKIqyL0e7xPMaOMO06kehsT7b8LbXg3M9EuRFwKfZQllxPqqxSDsJBhHo5?= =?us-ascii?Q?PWiUci/gLoKAtkKbQP7/IvM1jxAv37Yp48hVxIciO4tAYmR5NufqynICNlXc?= =?us-ascii?Q?Qcj6KEfOgOJrjbIHv5JbCeXiVrWD9VnNxqRrrzHN+Tes8MU1mwvFRjb7uG7r?= =?us-ascii?Q?HPZQvNymauFNKBZfsL/NL2E0eut1IX7mq6wE8sbdCkvx0icuoVA19YmuaUbb?= =?us-ascii?Q?QN9oqGReqn5fV+k7xmDBEz0bJjJwKnzBLgGblSzF2oXQAUIoRQh6BFyXOqI+?= =?us-ascii?Q?bYZ4m44sWMYm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iOQwq?= =?us-ascii?Q?JaImEARmqqGwOAUNf3OqmYk73VdYryrnuVDkR1JKJPAImhfHmcNbP7r1DtBP?= =?us-ascii?Q?xQsMVHm7O5wOdLLspbBlh9ZneEwXI+ImhaYHMeN7tkjyXympJA=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)(366016)(1800799024)(376014)(52116014)(38350700014); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?us-ascii?Q?2/ugfAB+AI9Y4qtyBjFj8do0HmdtmHoV8wwWkUJcS7QUucDPPrBeYT0I2DCp?= =?us-ascii?Q?bwfiv4/udCvB3XQTA1Gkm9UrsRxZxqBeuX0qb4yYQEG7GXoRgrezrZpsbc6l?= =?us-ascii?Q?KvaD2axvDK7HEGjjOVlRLBoacaRdgkqj/8rEB3K/rhLUo18U/tK1QXRAwkAr?= =?us-ascii?Q?gqc+gZsnTZ1dpSBeFo1ODQC6KOkJcwi2kK2s1dK0onDVFNI+HoGlwjeJ2uZw?= =?us-ascii?Q?Gs0b1lFcC7L12Hyc2rNBN6F7KVhN4sg/WlR/TerRYwli3vzBOLKt+DbmJbbI?= =?us-ascii?Q?+6ZsKUFoU9h3P5ClipBq6ohdkrwHoVa/vMqhav4RPtO7ZqeyEQDl+EWEOP9z?= =?us-ascii?Q?5/VoTXNipds+GVwTM9DlekV4D/LwvlvR7aIaTWwYDX+KTCPJZwm462K7kN72?= =?us-ascii?Q?MTGqNfnXjkHC+hkPCQUntQEM0IN22SQhY4kWSYLrMoxEMBib60u7nVru7SSI?= =?us-ascii?Q?mb6L+daWkqf7lpoqhEmQfXtfVMAxMz/2Vpy1BRtId2sZziVIxQyK1fSUtOD7?= =?us-ascii?Q?h3d43DMcq14dtR+uUcTE0o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= =?us-ascii?Q?j2agsyH/0wH9GthUWhZb4YroG2PMKiJIVpivnr9PmCkc9GesBr/raU9OBMWP?= =?us-ascii?Q?PHjxnNW92PeuCPAA1Wwg9tvk8t6q4sfDeyFw5MaCrLpcz5Vt+dwoI/ibQ4GJ?= =?us-ascii?Q?Z9/mNoxhvy7PbemnEcjIKwYUBGpsCj9437Z+H+m2?= X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: d72e5ccd-ed3a-4330-5da2-08dca7d9e789 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:32.0569 (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: tMZVxtTWxS6ha+XeckQaDhCnn5YxdNcfRfn7WpBgkdwvbFuFaMH3tIetG42ywtOh X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM0PR04MB7108 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 d0df97447a..bc925fc521 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