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 86D1A45681; Mon, 22 Jul 2024 14:00:12 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 8E18B402DD; Mon, 22 Jul 2024 13:59:25 +0200 (CEST) Received: from DUZPR83CU001.outbound.protection.outlook.com (mail-northeuropeazon11013015.outbound.protection.outlook.com [52.101.67.15]) by mails.dpdk.org (Postfix) with ESMTP id D75E0402BB for ; Mon, 22 Jul 2024 13:59:22 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=zV5QfLynqb3iPr/e9eEbM82PdW50wSlyr+ZFlx6UPN2ZZsbk1/VUvDBrLYXoA79tZ+9OxinLVgiPsynBzvEHZAH7ZKdBHTMjH4UYNQKwxIn6244CTNlV9Y2AwS3aw2FdS/j/IUn0XJhmNDuZYa5M4kFJ1Xm7rSXm3+SauLMRJbxXRrNbU0EVEPg8aPWmoTESmWIrdL1Hf/o6DANPiD1aJZPcuGOCxq82pe2qLuVvUy07n+FCMk8Q7QlZPZCoW7q1evg2anm7TzWV9LDVzL7N6s2ALKSPKfsCMIe2Fy0iUFriDkYbKQHlzAXZ83K/B2RYwn2DcNjPcGPwdXFX/mr23Q== 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=E31a4e5wnpocmYVGgkSsX9JzovRCUnFLMSquJBph60n1DhFiLf3mLQO/0cxtPSSW0DMp0Pb2+6FWnUGN1IITwk/++0Bd7bbN8RynIVTbpIn0j6wjWqkrgW6qcEvJvgyXnM1H6c4pkvoQg+kpmscGbSjRAiy++GJl1/gahh1xwtdJwsOe/EQsTZfWau+Lg3N/nMC+mwdLqX0d4cXD6+RfG9J4zi1XKx30DyDzAdK4AgqkiAwpewfjbpvnXc0WJqMvr23FGB3wYgisOlzGZeeBoMKVviSufW/v3wZ/oZs2E4HFYNDR6xaDW8hGzFlBL7IpRrFBroY5g7daa76zz4hiGw== 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=dDRG99yrOSlBDZpDJUKM+/QB75ynWBa7pkiWefdr1AOxXnrQtJInC5/+AWZvZQqy6fum5LoXPKcpg9+gOKTFgIryBRWCaE74JxqFovzEzmHlVya/P0+VQiGuQCV006coqNsLmRwUh6JZAxC22Cjhwu4eFq1lZB4jWCmw6T8L43o= 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 AM8PR04MB7970.eurprd04.prod.outlook.com (2603:10a6:20b:24f::9) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7762.29; Mon, 22 Jul 2024 11:59:21 +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 11:59:21 +0000 From: Gagandeep Singh To: dev@dpdk.org, Hemant Agrawal Cc: Jun Yang Subject: [v2 11/30] dma/dpaa2: change the DMA copy return value Date: Mon, 22 Jul 2024 17:28:24 +0530 Message-Id: <20240722115843.1830105-12-g.singh@nxp.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20240722115843.1830105-1-g.singh@nxp.com> References: <20240719100126.1150373-1-g.singh@nxp.com> <20240722115843.1830105-1-g.singh@nxp.com> Content-Transfer-Encoding: 8bit Content-Type: text/plain X-ClientProxiedBy: SI2PR02CA0025.apcprd02.prod.outlook.com (2603:1096:4:195::21) To AS8SPR01MB0024.eurprd04.prod.outlook.com (2603:10a6:20b:3d0::24) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: AS8SPR01MB0024:EE_|AM8PR04MB7970:EE_ X-MS-Office365-Filtering-Correlation-Id: 5b1d0aca-525e-496f-2948-08dcaa45b90b X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; ARA:13230040|1800799024|366016|52116014|376014|38350700014; X-Microsoft-Antispam-Message-Info: =?us-ascii?Q?Zh6zCWTIjpQ2JrHkWiU5lRKTIp83bJXmDLd5ZtzrOcaT0qEKz91jn7TIumpd?= =?us-ascii?Q?3GvJD/23/3AMnVL+ZVvUrsZpp/emZ18j5aKq/J/iuRi/wEJiMC2pjFIwklmp?= =?us-ascii?Q?cnkTdu17FB0IQAYNzhqqhMeAVDDn+y0/vbwkjsjZIj6CaLbZK8jaEqERKHtv?= =?us-ascii?Q?4W9mwgtgvcvutuOaTIPBxty9hC7C2bRqqwqrAE3fv4vce6akhBLIhPpNV/zA?= =?us-ascii?Q?QZmMl5FobiQYQWI6fSjF5X7DmDMaAEC+Yay27mhB3HqxwOH/xio3nf52vqM+?= =?us-ascii?Q?uOaP+EEfR4R0oePmZ9tD67lwHQfGPuQ006qdASLH+IwwD2WIcIWkycQka4u3?= =?us-ascii?Q?BTumNuJzjh+y28MIVEPBSxfDIY1fTXsY2E9vlhjr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0JkEyJF5v0vKpr5tpbmI43UBdckKAdXzRBYMzLWsHQhy23/v4?= =?us-ascii?Q?jKUdOU3/X6k1SpFtcoPFVi6tcuO+8lQt67w98Cd0aXdCGmcAc4pyEv7ibXWf?= =?us-ascii?Q?YoEgO5PebJI/PWtuW5G9gPppJOy4F+vje+fk/mM5WHP2E4ms3g=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)(1800799024)(366016)(52116014)(376014)(38350700014); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?us-ascii?Q?l/FFkxQ7OoPKqeWCs7V5F1n8U+bj2iBLYwEfkwJpUr4tVRXa2sEv5L74Mrga?= =?us-ascii?Q?+ZSfEwAzOODZnzo/iICgvSm88FX6dvRe63WNyQc9BH9Ly71A9mcXQw1vqtdD?= =?us-ascii?Q?j8Bqv0O6R9DNU66xt/0PPzXDfiN5dx4vXktF6pyPZPDJzTcEcmVgYDZVe1bU?= =?us-ascii?Q?gvPR+yZhGFesrD+jK2AyUek9Jz4sz7Dq05yPcdJSrZDpsVEjKdbeITjka6z8?= =?us-ascii?Q?aAZZgT2NJpz5nMkvzNl/LTPNQxgnZvRyDhC+6AJUYSjbAsv9lqnldPfJKIpY?= =?us-ascii?Q?j44YPuLApdXcxRt6n6q7/NDk42Ar8wyQPjH2lUsVB72hM1+eYwvLw/Xhbk8F?= =?us-ascii?Q?+59A3DXyUzbHo61msdGI2OmOSzIfT0eAIJC/OeMt40p3LL5TUgSuI7IvGEXW?= =?us-ascii?Q?8XXUdO9V8fxIqEr8CiCIktwnBKizjXyBxE4Tk6nMsZYpzFi6ZblKC+qeJ5nl?= =?us-ascii?Q?1/Z1y0lC/juvIuWvVStSb6J9vPfHpwPUZv8Jw1xe+JE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ihk+ilRgKQM0mB6Uby3INrMAVGQiRO9Gzf46OFBknmhhadz9H?= =?us-ascii?Q?R2E98FqZAKwiggX+Dg3AGvuS7b1lAobi0xm6vUHaad9Vnwygyss/2elndVWY?= =?us-ascii?Q?x7cKcZbVTOtAEqTNxwFjzOyTEdNX0zjHKGCAEQGcIRubUQO3TO5MV5Fa3vdW?= =?us-ascii?Q?A80BNC+Dm49tmRoRPP1cKDmwTU9Ptx7NLBe4eMIZ?= X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 5b1d0aca-525e-496f-2948-08dcaa45b90b X-MS-Exchange-CrossTenant-AuthSource: AS8SPR01MB0024.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 22 Jul 2024 11:59:21.7388 (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: tFJeTmopzqEViMR70Zwq1yC45qLbaGHyKJS6ZfmBvF/YAuIiA+CFhK4rBNqIroUi X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM8PR04MB7970 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