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 B181C45ADE; Tue, 8 Oct 2024 12:59:21 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 54FA040E3E; Tue, 8 Oct 2024 12:58:39 +0200 (CEST) Received: from EUR03-DBA-obe.outbound.protection.outlook.com (mail-dbaeur03on2043.outbound.protection.outlook.com [40.107.104.43]) by mails.dpdk.org (Postfix) with ESMTP id 5F62140E18 for ; Tue, 8 Oct 2024 12:58:36 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=qJDxysxqBxWk4FwpwTxOZCHM6SBRBgY0CXSbC3u0B/+AFOaHuOrvFuRtmuIozz+8+pYSUrNydptWmOtfhtGMYqAnbw3VJ0ogwqjE4dsndB7chXGj1jUCGG73z6O/1RhAERJeWM6YOzJRJ12ogQR6MPYqmT/77mm76ufKZriZugoYkLkWeYYO1N3lpfBx4gYrqEYF2+pK1OgcB1RTA7yecGa9Axa1QySz5QMRYRs32LDwqEUOhAa52ihei7SNC2o/bHP6/PD2gJR5SKRG1mAQJtc5nziUUoJ6x/Qxn7rHoZhPzhG/ec4TgNk4c8gi7W2x1MBdZhGPq5AXeh1Mn3kMbQ== 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=xSIMcpK4YPYxbPvNJ9l5HqtCnxMv2uDnq3W0SLdMXYI=; b=snAZEJGM7Yi0q/Y8D3GV78QbHx5FNruioO1ib+FovsTdRX/dTgUHzlK8g9ow608AUJEXoMYJsfbv6rqv6FQqPwizGp6UaCMyQliVKPIT8Mxe3lW8O2Q8Nyq0nGOmMK+WFSj6vqwyWCxd0EwjYRJeyugMjUrk7pWkj+dz4vfZA2QUjIK9mABkjVa/1p9WklRmDErexujeXmz63Xrcn6g/GLZw3vgy0HlO/0JA1JbTqEHm3ET0zoOqeRFzX+PzF+0GHulbaU1/cnmpNo6zlW/EJbX981g6bi2nuCmJMkPXsT4NMXqtDe1DcaWL1T59j3TOPXoZN0jBxlSkt7SQiJoljg== 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=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=xSIMcpK4YPYxbPvNJ9l5HqtCnxMv2uDnq3W0SLdMXYI=; b=hgYnVTE9zWpDCP0kOu8e/MbYq2hs17HFubi0VOKPxVvscItDz17swRtAdVp6S1+TP+AfgmclONblAW63Ym1adKfzejIooHEVKLEdOSqY2VmreY+axlHsE8T7IK91FMEEAPMdw9H5TN+oNNBo4dgFseTFY3j1IEvVB4vM8djoCiByREIBs0WrILoV7jl3OmQc/BxmaBP0AvRGRlEI/hNTRQ8StcnKE4SJ1amGhWdWiMIwn7BgnOcz1Dmyk2vlz8baiYVYLvkfujtWevEgLh12FOcPaqnHCsr6Fb9StCH+wEpgs8xUoLIWpDMaJGXJMef0arL1jKVMPXTIoECJ5Dt/zw== Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=nxp.com; Received: from AS8PR04MB8198.eurprd04.prod.outlook.com (2603:10a6:20b:3b0::14) by AM0PR04MB6932.eurprd04.prod.outlook.com (2603:10a6:208:182::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8026.23; Tue, 8 Oct 2024 10:58:35 +0000 Received: from AS8PR04MB8198.eurprd04.prod.outlook.com ([fe80::2e32:1a4a:7d29:195]) by AS8PR04MB8198.eurprd04.prod.outlook.com ([fe80::2e32:1a4a:7d29:195%4]) with mapi id 15.20.8026.020; Tue, 8 Oct 2024 10:58:35 +0000 From: Gagandeep Singh To: dev@dpdk.org, Hemant Agrawal Cc: Jun Yang Subject: [v5 06/15] dma/dpaa2: change the DMA copy return value Date: Tue, 8 Oct 2024 16:28:01 +0530 Message-Id: <20241008105810.1454133-7-g.singh@nxp.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20241008105810.1454133-1-g.singh@nxp.com> References: <20241008072306.1256445-2-g.singh@nxp.com> <20241008105810.1454133-1-g.singh@nxp.com> Content-Transfer-Encoding: 8bit Content-Type: text/plain X-ClientProxiedBy: SG2PR03CA0123.apcprd03.prod.outlook.com (2603:1096:4:91::27) To AS8PR04MB8198.eurprd04.prod.outlook.com (2603:10a6:20b:3b0::14) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: AS8PR04MB8198:EE_|AM0PR04MB6932:EE_ X-MS-Office365-Filtering-Correlation-Id: 1c11ecb5-61b4-42bb-2d3c-08dce78827d9 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; ARA:13230040|1800799024|366016|376014|52116014|38350700014; X-Microsoft-Antispam-Message-Info: =?us-ascii?Q?CFVfr1fnX0zHBSp0ZxsEbZq9YpXSG3FA4Xal1wqZmjRLle0dGht+35OGJEk1?= =?us-ascii?Q?iIfI5loMX8E6p7+rfS/O36DhZEVhYNXeY0Gw5ecXdehrE//aVA9SN7HzPkaD?= =?us-ascii?Q?JM4LncH/w2l6RZZo1cIf7kh4dcvpCyQyech+jYOqPiRmrg2AfalyZnPiy+6g?= =?us-ascii?Q?+5Q0V3R1o9lZclxI3cMJSuQUhrYA4vx/jQuIfiEjpHYjQJjAsthRg0Lqy66z?= =?us-ascii?Q?TIKFG23lxuUv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Tl7E6IOaEDY?= =?us-ascii?Q?SrP4HLLl7HodVfLQeUJq0hBzIxxCPAtYSgN5ZvjC/c+aeFXHClECmigaEBEs?= =?us-ascii?Q?eq5z145Xu3OK2CrMCE66aAq38tzLXi3JtSbxndrWBY1/z2NEJdXgN4cqh5wK?= =?us-ascii?Q?fTdgzt2HvBy0XvsjTxF80CUJ9ImyMrKE7pfBkpkDszb4lDyQooP6oWfWuGIr?= =?us-ascii?Q?WZOEfwgR3VRgyswDpqkDy2KGU5mheZs9UPTFI4xjeoFZnw=3D=3D?= X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:AS8PR04MB8198.eurprd04.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230040)(1800799024)(366016)(376014)(52116014)(38350700014); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?us-ascii?Q?lzwyL0zG1YfjAk0uACs1kHvfmntMEQEGSZiSb+jPp3q7/TErVL12nLoKez4k?= =?us-ascii?Q?h964NLv3VDNgSteE2IHNuTFmLvb7szM+ZKP55E9iQcDEoyvCcI9Oxyh993+8?= =?us-ascii?Q?Yi/gOzyUhJXF6bbuxPpaPijCzE/sgA7nK1qNCiN0qRoNJ8h4aOds5ZbcTwmF?= =?us-ascii?Q?7eFTwOXfhzXzIDtLD4viPFzqfYqqEzVHmXr4DyWSThTmeDogXz4PQlnDn5k+?= =?us-ascii?Q?in1JMYtLZPqRXMGX1lnMj4qpePqorsAbUbfQsiDJm2qycwLoRdfapy+0uliI?= =?us-ascii?Q?bZtrFE+e4N/J4/rL3smtsycDHhmogVIeeWmzkWK+J8PJ7e08n/qyIHtLBZbD?= =?us-ascii?Q?e5nSR1gp+gLOJtb3X80/fbXIkPxhyQuiOfusuUyEAI9919NWrkJCPHdGT0h4?= =?us-ascii?Q?dKu1es8DfTnp502RoWYEES1L4p5IZCo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5lpiQtx0/G/3zad0/qH0pLw5euXIQZPkFvPCRaMdnlBm8DxkMCKatg?= =?us-ascii?Q?ryO0kVe+CXDhTxDdc20hfS8RIcWOFPkeYPe52rJAuDUpc+dG5Q8cWI7s3MqH?= =?us-ascii?Q?LUyRrtRh8TEUTonKW95/ja3GeX8zFgMQL/D20VR2y427XhzYAN3g3gEmdFlP?= =?us-ascii?Q?pU1yhydGlLPDzeB8xqXQDZTXVxtJGdH8UgWt6TyS8EJ5CVEQh3HTDNyR6KAJ?= =?us-ascii?Q?E0pHrxVot8Pu3N2eB3g=3D?= X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 1c11ecb5-61b4-42bb-2d3c-08dce78827d9 X-MS-Exchange-CrossTenant-AuthSource: AS8PR04MB8198.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 08 Oct 2024 10:58:35.3354 (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: g1uG7nf42WOeGeE78qtcClbppI5ZYnPeGn7xE3hoE1PK57SdR2lGh4oJeU9/kwxi X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM0PR04MB6932 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 23ecf4c5ac..180ffb3468 100644 --- a/drivers/dma/dpaa2/dpaa2_qdma.c +++ b/drivers/dma/dpaa2/dpaa2_qdma.c @@ -644,6 +644,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); @@ -720,10 +725,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