From patchwork Mon Jul 22 16:39:11 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Gagandeep Singh X-Patchwork-Id: 142630 X-Patchwork-Delegate: thomas@monjalon.net Return-Path: X-Original-To: patchwork@inbox.dpdk.org Delivered-To: patchwork@inbox.dpdk.org Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 6A76145683; Mon, 22 Jul 2024 18:41:28 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 9849F40E3E; Mon, 22 Jul 2024 18:40:09 +0200 (CEST) Received: from DU2PR03CU002.outbound.protection.outlook.com (mail-northeuropeazon11012039.outbound.protection.outlook.com [52.101.66.39]) by mails.dpdk.org (Postfix) with ESMTP id 6FCAD40E2E for ; Mon, 22 Jul 2024 18:40:06 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=fIKrn1ZdDBmqVuklgxovvUJIXhk4gdpN7R/FjyOWK/tLBJ5eJg2ZX2BHg0H8mtEpadw3FpFMRKNJR/l3RUYamZPaXlki+Dm4EW8QYYUHSDk+nE8UV1rPMk/xeKc9vr9OfqR2F8/2BmhixPesakRrFGvLzGnS0pB2/rYjSoGOFp5fd1LB0+4CZ7pJykTOk8vWaUmksTMTmSIY4NsnbTdtn4M8pLhA3TQKsiVNLR80/YC9lO15aCTuMqwgK42fbAbpbhaGlTgT3IJA4QsYK4edwCLZab1Ohh0H2mMRryUHTYyfIuHfm/aBvCxgLUGljAN0CjAipu0Wm63ZhEPSyyAtiA== 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=yWsPspSFq1BN9HBYI4pESd6xE9rIijDhbgtkawU0EoA=; b=m6ykQoW9Iiw45Gz+xxrEQeezeiExeC/R6iiWpXcGD98O4WsRaFxQHESIP/Ez18soi0wxiDgIdRpCDjpEX64Uj5ESksh/HGv49nYpmjoEHxurj9O44QAtngaOvz8LQVMdHnNsSyPPhasw1LtWq5AoTjPV8svzeXWa+1ECIn3h0wiHsEovEZeVX/0Hp5iGHd1u91JGgYG9ckVOo6GeaA19dzBLMreqoz3WZQHn5nrTzJsxT0F+od7ir0hg1k4boF1Mhl2b0xxjkrzf4+OVLLhUT11HNZIgWR8C2kbqTAWpgP/F8jeB6mGGsHRxHcPeWRslnfLqNmQYb1cP4eFEAs43ww== 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=yWsPspSFq1BN9HBYI4pESd6xE9rIijDhbgtkawU0EoA=; b=nzJHdeyf1J//AWfxDUoYOLsI5Y0LXXhgj4MXnUxjBbMWiu1RH0tESD+kvbI9opuuk4dzZjwqTWQJiiezCbjahMxE0XTPYDBcEXcKgZctwmLBo+O0Zao6YdLLHyiGTushah/CBoMVIe9CFMsc3dnM1d/CdW+XQBufLK2IAQY2oE4= 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 PA1PR04MB10652.eurprd04.prod.outlook.com (2603:10a6:102:491::5) 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:05 +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:05 +0000 From: Gagandeep Singh To: dev@dpdk.org, Hemant Agrawal Cc: Jun Yang Subject: [v3 11/30] dma/dpaa2: change the DMA copy return value Date: Mon, 22 Jul 2024 22:09:11 +0530 Message-Id: <20240722163930.2171568-12-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> 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_|PA1PR04MB10652:EE_ X-MS-Office365-Filtering-Correlation-Id: 8e37594b-2b48-451c-28a0-08dcaa6cf0c6 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; ARA:13230040|52116014|376014|366016|1800799024|38350700014; X-Microsoft-Antispam-Message-Info: Y1MMgt+pkqydBd4BYin5BBtQ5JJhCBeD7udkeI6nQmCNXIF8XKqjF2LPgARTfGfRhkzCTTIyeCV7HuwdRJuyEMS2xK1g6szIAio4v6KKESZppdB3/edSLmcbtbpfFmrTcS+Hvf5QJQ8et05QtezGREQSEdWVl1Rs5pnGsPinTXLxpzlIfssAxKiqgZWpdlsinOSgMpG8MKTspLaDTpbKYGPLlkyGeLrVn9xeb6SQTCUDuYlNnPbbaai7YjbWivwzZJD68vmszPzpT728LwiHimJINNkzeuzKFUGLU8+0WXle2iD7iNv8laL+TqLmcvjIZEc+Z9fRcsRvYQwkx1zodx8gse/BXeUEEuG5NfdbadwcD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.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:AS8SPR01MB0024.eurprd04.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230040)(52116014)(376014)(366016)(1800799024)(38350700014); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: je+xs0T6rGmyo+aKt8k3y7m6BUvNAhKuPVMjTtA426JH4MEFsY+YLxzp8npYu94qzqL6bpNcuigB8doKvz4OiEyY+7rD+zQqPFdMXTb2OOIFECIgSJ284PBZMIMuVIzXavG0H5VIp/TD3EAsUMH7HKi1iAXlEf2oaBsYxwX4X+ywLFENsmZtCKa/8mN3JMOSnpI0bfze1YPG36Altimy2XKNWdrn6dGamDyx1q0xJxKjHrITu151MFUHO9srJQe86ywj5sUv423+mtrFfLtmMHHa+gC5lDd9qw8a0GEtrUYKsIkVz0PKZUkw7Rbxqsgk0g8XUfiy0gQ9LYpQpVUlzb+oQGX96v10Y+EV00cb5CSsBIhHUTbflgMs6eD57JisyXHZ+g86F1Y0plB4Gc/82bxncMNJRaDW9rBBeI41TQVjUvwGfY498hg1nJQL1VFWx4xxIk/L2gbMij/gzhEG8IiCQAVHwEyJXhLb3hg3cceNCo9Q/sSIyNiup0IxLv01JUprPWx+OCDP/b47VdH+C1gWczxJUGdbnIpHaviIbZ7vnp/Nw5Wm6H5ypimMC7WrWCwyRpsWX7Ze6HKmKfUbeXeTtR07ekOPRCpwGoFXG8kTXlmxId3eYK51kkkamaMlZQOfKgGBpLWxlUDfu+iDUDf04RjYayj9jcYzRCgoDyDbQ0RJS47rBlejVbAprRMjw6PyJTxcourhlVDSx2VPp7Y3Wdw4PxTrg5zICKFU0RYr0FHG1vlk6DAJAnCvnHiWZA8fKjj37D5sJPMVhi8I7MrCsitY22AR/PKoPjx423NPvAfSM0kNmDTMbowoVB+V5cpIRWKEjf0jG7Pylyeu/s3lklbIG1tCJSBP4AymArbxxXAV5Zf2pCMMK7rpeiZekf86X8cXrH+NZY3OSZV0NAMzwx4AcIvKko9mkuJa9g6uGPu9JZaBFoPNnFP9rbp3JM3MFdQhTvr34UagW52nC1mxfkGUr7oZcm0x83qtr7cB1/Gy1lVGUvEzWsj5uRQtZZuynxAqGYlZI5TyP9PWQ5LdyhvOJoV/sUDEqGzS4MtpHXjRlHwp3C6/jySTVdX/St7AsvzVuoDB6Kh3bDdeawCNUnrhV4VpDQZIm6NwLAh7GwwynLNS1QKOntAj1GK2nqx4B7LoJs+8IiKAp0T1+l0+6oaq9+5CoML+LTFrNcWSYWUachlZ2Mm5yEmaSLb75vLbFKGLm9/IKwrgByqzX4Yzjy76QdS1lTTEB5kilPQG35inL8AaX4csPrTWl+DoMLrqMgA0iGauyZErPJE1QJgi3ftTdZS4swLXaCNg28oSvLWrcNmtrSQAvToNLYxPT6/xBIKm3tUasxzkq+KtrjA6qUqRDvQaWblvNXVa5BM46krHppeVVia2FwOBUWE/rqpeEhBcP2asV0oIDQNLN4J5Y8aLWWN/o9QCtRsWyz1BIcwsoyXCjf7UpqZM/RAR1tB1Ymyj6SgPtMJek6h+K0gHXE0iAH4+YjlOYsDg1PQmIMydHXz3g0yNsw29nKRLWEjzS7dXHpiKHgsFhiM75S6sR4+uXNjIkj4WhxUn8o96+6FN46ncHaiausBDCduM X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 8e37594b-2b48-451c-28a0-08dcaa6cf0c6 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:05.5631 (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: jBUcYdmPWAWlKX1HVokmWudMKpqiWIwshgFj6BJXCERgXmjUf1AOwFdQyPENTynx X-MS-Exchange-Transport-CrossTenantHeadersStamped: PA1PR04MB10652 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 The return value of DMA copy/sg copy should be index of descriptor copied in success. Signed-off-by: Jun Yang --- drivers/dma/dpaa2/dpaa2_qdma.c | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/drivers/dma/dpaa2/dpaa2_qdma.c b/drivers/dma/dpaa2/dpaa2_qdma.c index d1358b686c..b70750fede 100644 --- a/drivers/dma/dpaa2/dpaa2_qdma.c +++ b/drivers/dma/dpaa2/dpaa2_qdma.c @@ -605,6 +605,11 @@ dpaa2_qdma_copy_sg(void *dev_private, return -ENOTSUP; } + if (unlikely(!nb_src)) { + DPAA2_QDMA_ERR("No SG entry specified"); + return -EINVAL; + } + if (unlikely(nb_src > RTE_DPAA2_QDMA_JOB_SUBMIT_MAX)) { DPAA2_QDMA_ERR("SG entry number(%d) > MAX(%d)", nb_src, RTE_DPAA2_QDMA_JOB_SUBMIT_MAX); @@ -681,10 +686,13 @@ dpaa2_qdma_copy_sg(void *dev_private, if (flags & RTE_DMA_OP_FLAG_SUBMIT) { expected = qdma_vq->fd_idx; ret = dpaa2_qdma_multi_eq(qdma_vq); - if (likely(ret == expected)) - return 0; + if (likely(ret == expected)) { + qdma_vq->copy_num += nb_src; + return (qdma_vq->copy_num - 1) & UINT16_MAX; + } } else { - return 0; + qdma_vq->copy_num += nb_src; + return (qdma_vq->copy_num - 1) & UINT16_MAX; } return ret;