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 50C274564F; Fri, 19 Jul 2024 12:03:03 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 831B242EE5; Fri, 19 Jul 2024 12:02:06 +0200 (CEST) Received: from AM0PR83CU005.outbound.protection.outlook.com (mail-westeuropeazon11010025.outbound.protection.outlook.com [52.101.69.25]) by mails.dpdk.org (Postfix) with ESMTP id 5BF4442ECB for ; Fri, 19 Jul 2024 12:02:01 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=UbM1k+R7XFQzok1Jz3VSI/KeO9a/J4Mr5zBuqBlAuMX4+aDxPo1rvqYfXZuIrkXDXJ6ZRVDK9XyZx4KhMwNLyc399yEmNaSl5ARNIGGwhdSzOA0MhudjY6ZTzGIVJyabQrpsXY/Vg98l2Ltn0jH0ZsJdUFARzBtgi8niahJmK/KmYBQ9HN85ChfEderYv072vCHB90eVYSXQl8Y5O/wQ+7DfQfEReKhTPgkgP45LxMFAMOXzc4Fv2z9vpnOR8fHP8+UWhIyhVKqXJEk2C4WKrG2YhLrGYpKxyUngX2iP5x91I+Q0/JmYRQy0/zBdYTIyOp+xLjNjeHhKXfgg71wluA== 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=ymNZCGHjfKgajfDa8pSFRKrHqKxRKTbvnL6VmuQGO0c=; b=MhKsEGqgAZk/soVYWceaPRTSFBAc28WNu2wns0orVFBZQ0Jp4DJwea0VPfjsP6qy0NValnAoOELeyK3SCTi3NJj4c6/8aV5DrkTEUAFO45r2uNg7DqLko5VtXmODCyTN3q2m9tYZgK2NWHkR5r41GlcAm+CiXC82J/daFoO7+B/a67ZC6iKDs4vzs18Z5aWi1wUb85gkD3xmX3ydlYfVMZaLoEY/W+VNurIxx5mlBtqrLJwH3smwCwFLGVJxxV8aahaT/ibV60QGcbnuOP7X1qG7BKflypPLhkmBi0MHksHAgev/+IFuzvb6/V6CaXg/Y/FCw9wCqa3e9kmA+pNnlQ== 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=ymNZCGHjfKgajfDa8pSFRKrHqKxRKTbvnL6VmuQGO0c=; b=RPV2MlFVFjugmnlMPgUyF9ZtwEFZdRKGEq4enVH7CJOB/lF3OI1D/q+gcOkw490jkwf9JEnr11AryJTm6codyL8sgduM4uxZWVZZOWkASPUM652/0M1Cp7DFdJKIoFy116Pi/iGG8JPHxf9Y53NkAolsMN76ZgpgM65gIA/TEyE= 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 DB9PR04MB8345.eurprd04.prod.outlook.com (2603:10a6:10:246::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7784.19; Fri, 19 Jul 2024 10:01:59 +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:01:59 +0000 From: Gagandeep Singh To: dev@dpdk.org, Hemant Agrawal Cc: Jun Yang Subject: [PATCH 11/30] dma/dpaa2: change the DMA copy return value Date: Fri, 19 Jul 2024 15:31:07 +0530 Message-Id: <20240719100126.1150373-11-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_|DB9PR04MB8345:EE_ X-MS-Office365-Filtering-Correlation-Id: 9e46078a-6a20-4342-e797-08dca7d9d459 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; ARA:13230040|52116014|366016|1800799024|376014|38350700014; X-Microsoft-Antispam-Message-Info: =?us-ascii?Q?Vn4WJylfulXocRqlN50dXWZm3CAdnn8hIF6WOR2V4kjU1YMUvNcC/iW5td7N?= =?us-ascii?Q?V5g28aeiTtizd1yjghyMSNs9Lkt55JS0zbCje3uR5Pan9oOYvUftrN2F/rML?= =?us-ascii?Q?5iUmuC7+O2FBAhqnhZ+zjmeMlvYn+WEVwSVhxZbSBkcbOIFpQTdy9KHiGy0R?= =?us-ascii?Q?I7zeSqUPGXEG6Mr4sSMMEkJLj85xFzxnpLiB1lO3n8HiGNTxN+Pgodv4SV09?= =?us-ascii?Q?fZzDAzkZ4wknZE0id4fRKtgDSUNJ/hclutXp8cOFrCEBu4vmYuVubgs7As1B?= =?us-ascii?Q?JBOx79PN21mEepblCg7y/w2YFY8Z6UDlKnzEVlrYiFN71/Hh5NDp4AKM3jy3?= =?us-ascii?Q?P/nwP963iOP7ravTJHEK3HXeLrx6qP5OhOBTc0lavOOM+7KKoyu5mD+hfDHI?= =?us-ascii?Q?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4WAL6bm2umztqBbcpxpGM?= =?us-ascii?Q?JYktJ3T22W+MnEtJEG/nGR/9/YqVIOS+J/Iz0Hi/QL5Cb6Oip0VT9Dwn+Wvo?= =?us-ascii?Q?4jgTgQ49a7oSlT9G7IcxYsw3eOKqjpNGZ63MXLQj1XdCI6+PMg=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)(52116014)(366016)(1800799024)(376014)(38350700014); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?us-ascii?Q?uk5vfNUPXSICuj20oepKrMbC6jgmqE65AejePNKnTfDDnVqTrO84ir00lvLs?= =?us-ascii?Q?s3lCNr9kYQFKhEcesQZe3GJeFQjAhDP1TOYitXCyf8UaEojJyiI4Clal3syZ?= =?us-ascii?Q?/L8dz7FN7aGI55EUa3fzlvwsuPdNV3uS0K65Aj5Mrc+4/U+hWVudZ81NSPF/?= =?us-ascii?Q?EkDIZl7T2aHcON7B1QwMr5aF0OE7ARO8wq1KQNLeBNNAoQbe2RKF1pKVsNyZ?= =?us-ascii?Q?cKGtLeyYGiHCyVU9FIVaoWC0H5WdmdXEdTywIUbmQ8QJFXpYTYmpUMs5Baa/?= =?us-ascii?Q?DYAQm/VdlvaqdnQhcgs3YaAVK5YxWOte0SdpPNQLrWcqWEGI390V41vBlinD?= =?us-ascii?Q?06ZrH61diOzsbkVGMopVRBqIo2auhU1iUEGQbWH1M7DXn4IPlXhVEhkn4JDX?= =?us-ascii?Q?jQkjg+a2m2crONjphEsy155KvzSB6US2+b3JGELqUKOVykIHDhSCtWow060C?= =?us-ascii?Q?jwDDuumRQI4ZLGFKLCjAcE1cl13brhZpgVcPdVZYalZVVm9q0afrQbnHVoJb?= =?us-ascii?Q?lhe9djCD8ujxQu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XTGM?= =?us-ascii?Q?PPsQBxQWUNYfJbFwrO7FHCqEN8MQE5UscaHB/VgQ3/rw3jhsXO0HHkLmux1x?= =?us-ascii?Q?wr5NKJB0LohbNW81WJHCSZBvAfDQN3QXmHNKMErNezfbif5AXB4FVEh7XPEF?= =?us-ascii?Q?DOhb2VakwVXEg7DYUddzWOVCP8OECdhSZL37Ydg+?= X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 9e46078a-6a20-4342-e797-08dca7d9d459 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:01:59.5395 (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: U6SORTiQSSBavZfyfUmRzzIMEnnToRgC57IsrakcV0iuqPtvgzcNPlPDabwkSJvh X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB9PR04MB8345 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 eb2d96a35e..c3e6f84a48 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