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 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> 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_|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: =?us-ascii?Q?Y1MMgt+pkqydBd4BYin5BBtQ5JJhCBeD7udkeI6nQmCNXIF8XKqjF2LPgART?= =?us-ascii?Q?fGfRhkzCTTIyeCV7HuwdRJuyEMS2xK1g6szIAio4v6KKESZppdB3/edSLmcb?= =?us-ascii?Q?tbpfFmrTcS+Hvf5QJQ8et05QtezGREQSEdWVl1Rs5pnGsPinTXLxpzlIfssA?= =?us-ascii?Q?xKiqgZWpdlsinOSgMpG8MKTspLaDTpbKYGPLlkyGeLrVn9xeb6SQTCUDuYlN?= =?us-ascii?Q?nPbbaai7YjbWivwzZJD68vmszPzpT728LwiHimJINNkzeuzKFUGLU8+0WXle?= =?us-ascii?Q?2iD7iNv8laL+TqLmcvjIZEc+Z9fRcsRvYQwkx1zodx8gse/BXeUEEuG5Nfdb?= =?us-ascii?Q?adwcDnb/kY/vIvjl3q/PwB2jE68M6uPYtWZEYSm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q7psB2MotniRb0tPyNjFEOj6WQb6HHeitSpqpo+m4d?= =?us-ascii?Q?ycLRSNzjx4knJlEl5kDyy8N2HO5ZkzCw8tWpzZP2uqInzBfm8vH54ukVoOtA?= =?us-ascii?Q?QtqacA7E4n64xrPFLKwZOk+lcDnKxhIJVxqQSi19ZIM9mJf28g=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)(52116014)(376014)(366016)(1800799024)(38350700014); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?us-ascii?Q?je+xs0T6rGmyo+aKt8k3y7m6BUvNAhKuPVMjTtA426JH4MEFsY+YLxzp8npY?= =?us-ascii?Q?u94qzqL6bpNcuigB8doKvz4OiEyY+7rD+zQqPFdMXTb2OOIFECIgSJ284PBZ?= =?us-ascii?Q?MIMuVIzXavG0H5VIp/TD3EAsUMH7HKi1iAXlEf2oaBsYxwX4X+ywLFENsmZt?= =?us-ascii?Q?CKa/8mN3JMOSnpI0bfze1YPG36Altimy2XKNWdrn6dGamDyx1q0xJxKjHrIT?= =?us-ascii?Q?u151MFUHO9srJQe86ywj5sUv423+mtrFfLtmMHHa+gC5lDd9qw8a0GEtrUYK?= =?us-ascii?Q?sIkVz0PKZUkw7Rbxqsgk0g8XUfiy0gQ9LYpQpVUlzb+oQGX96v10Y+EV00cb?= =?us-ascii?Q?5CSsBIhHUTbflgMs6eD57JisyXHZ+g86F1Y0plB4Gc/82bxncMNJRaDW9rBB?= =?us-ascii?Q?eI41TQVjUvwGfY498hg1nJQL1VFWx4xxIk/L2gbMij/gzhEG8IiCQAVHwEyJ?= =?us-ascii?Q?XhLb3hg3cceNCo9Q/sSIyNiup0IxLv01JUprPWx+OCDP/b47VdH+C1gWczxJ?= =?us-ascii?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oIDQNLN4J5Y8aLWWN/?= =?us-ascii?Q?o9QCtRsWyz1BIcwsoyXCjf7UpqZM/RAR1tB1Ymyj6SgPtMJek6h+K0gHXE0i?= =?us-ascii?Q?AH4+YjlOYsDg1PQmIMydHXz3g0yNsw29nKRLWEjzS7dXHpiKHgsFhiM75S6s?= =?us-ascii?Q?R4+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; -- 2.25.1