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 2D0A345B36; Mon, 14 Oct 2024 11:37:44 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 531BF40669; Mon, 14 Oct 2024 11:37:15 +0200 (CEST) Received: from EUR05-AM6-obe.outbound.protection.outlook.com (mail-am6eur05on2044.outbound.protection.outlook.com [40.107.22.44]) by mails.dpdk.org (Postfix) with ESMTP id 578354042C for ; Mon, 14 Oct 2024 11:37:09 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=t8QlPHXT0xwktdEvUzdBbu6ekVtI2+eCRYVWojE4O+sUqD2MeY8jvxRpuv8LrayH+z1y2mVsU6mHndxykSQtB9jVygqex80vH6xnFsiXHDfa6+sXF27vL3RJ97uhZFx+c67CyD8WMvDU5X02g7kEhBOwKD5AdS1RA8nRYXT3y3pRbn8DPrHtcaLjdq9lMS9gz3QWVyRWfP78WzTg3E+sWc8a8TUV4J730R3u3j0INwZQY/yKilsWGB2Xi1+sgK8J3jeVnNib/pIlfjmsRAkfnm0EkJr3yJOQZiR9jFn1pPZBaQ5OcMu7oKKHqPaxlXUCoh9F/J5o2DaVK6eNcW37Cg== 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=/hWC3pgP5+4bLbZ/6SwRogwXM/n9zL7WlfcpdBv3iRo=; b=DY5xGCrZp3lRp5NE3XhmQvFMoTGFe1EnNtNjQCNRIDvESvb+kZSmwepLfRWCJU55Ws/vJnSmUFPZNx6/64vDyCKqqqBCGAIe0KEJtoPA9d3dWcufO404+RZ4AjwKUyaNHZi+YArLzdZxb7ixIIodzJpUDrz/MkFUmlhUFV+4Z8WThhjPkbghENZGTSUl7NV6IPnm7fU4PFb81IRBepy9OKTfEM2Og7CivCEMmwnuThuIe+zTVRTptPCn8sQW15navvAMnuzf/aq+BVKHShl7wxn4oCSxmNuVx7vDHpbwBdSTTCorCYapjLiTOSAOk9ZlvehE4L0ZKdLyaR8fcJps4w== 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=/hWC3pgP5+4bLbZ/6SwRogwXM/n9zL7WlfcpdBv3iRo=; b=A9C+EWFcgZjwAcH4oEpHl3wrvSj/Oj8Xci8R1E6p8irwW+VToXeqsQx5u8jqVuCYUhcz42p29Yq4XYBBD6Aveg5mRGzZVJsiyQDlGFHYM7Aw8MDFMmSuSQ5Z7udkkMOJc3aYqu7QZ42GR238LQTZul5AzgJksvcWA++m0ZOX314YSYMNe4fpgLLKkV3z5IwYGULoUMj7Am7ZIl7xs2E5au4PAsrU0WGxmuA0oK+W31T3BLtdniqcDSsKKfgLaXwfzi/BRHwVRXezDiDVODe97SRFnB9EHtty1MYb6XpzzBNcjFiiq5o7XZPfVpa9ENtkcSz0sAgEVHwrnJRoP0qQkw== 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 PA1PR04MB10580.eurprd04.prod.outlook.com (2603:10a6:102:482::12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8048.25; Mon, 14 Oct 2024 09:37:05 +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.8048.020; Mon, 14 Oct 2024 09:37:05 +0000 From: Gagandeep Singh To: dev@dpdk.org, Hemant Agrawal Cc: Jun Yang Subject: [v6 06/15] dma/dpaa2: change the DMA copy return value Date: Mon, 14 Oct 2024 15:06:30 +0530 Message-Id: <20241014093639.553467-7-g.singh@nxp.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20241014093639.553467-1-g.singh@nxp.com> References: <20241008105810.1454133-2-g.singh@nxp.com> <20241014093639.553467-1-g.singh@nxp.com> Content-Transfer-Encoding: 8bit Content-Type: text/plain X-ClientProxiedBy: SI2P153CA0033.APCP153.PROD.OUTLOOK.COM (2603:1096:4:190::21) To AS8PR04MB8198.eurprd04.prod.outlook.com (2603:10a6:20b:3b0::14) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: AS8PR04MB8198:EE_|PA1PR04MB10580:EE_ X-MS-Office365-Filtering-Correlation-Id: bd71f43e-8f8b-4848-a3aa-08dcec33c3fa X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; ARA:13230040|376014|52116014|366016|1800799024|38350700014; X-Microsoft-Antispam-Message-Info: =?us-ascii?Q?SljW3pon1EPRZvh1zzLKqZ8YipB9+DXx1k7P8/reQnT+tUoO+MUCBmFQ0Xyr?= =?us-ascii?Q?7lXgVErKLpQsrDvfb1+EEqri6rDPvxKRQL9S1Fs6XVuexUDIN28a4tp/8aEz?= =?us-ascii?Q?udsY4yVwG6nvCYZDLJnhl5yM56rWiI84WGT95HXh8g9xEW4Y53fK+CvPO1ZL?= =?us-ascii?Q?7nKAQ8St2UAnzccCNtN3kj/aVOMYQuQZTA+ojTB8URJIMRS80ETr2sQNu/1U?= =?us-ascii?Q?ACQivN70iCAiTqzd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c?= =?us-ascii?Q?JmtpXMV6ZDhFj4O6GUerlyMG9lBio9zXnp71ETRFsChrItKK1LSg00xdyEti?= =?us-ascii?Q?J1TJVzZc2+tMQnd/3zKje7RvHAlGHXlF7MufFZ3TP3TIOvi5ljnf7orlL6v6?= =?us-ascii?Q?Vniy8X7hVOYe4wnUokHBspTyoXJ4AFh7F7jA6d/9oYuw0pA9MynafJ8S0kYp?= =?us-ascii?Q?Xd6vPLCHBmM79JnixxQUissX71BBgfsMmQYeItTjviESQQ=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)(376014)(52116014)(366016)(1800799024)(38350700014); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?us-ascii?Q?6OjfKUR9DAiNOcAhCZlllXPgBu1vS/XAqB4ru8gxe2f0ecTBhHkC6sWt6a1Z?= =?us-ascii?Q?Xdu/V6oCYZBtdk4kIi0gdUvwAcXFR2KQocLcfYV6EF5MR38aCqTRFvmv5POm?= =?us-ascii?Q?Ff+kF+2SogpKMAxlnULm4pI/nZUvLTYs+EtySssuw5XyzNVAbk/wnjxdY9sw?= =?us-ascii?Q?2Eo/EqzSv9Iee9GIXmJdDWLjhU4jKn2x+3OeHOBS1mBUdzsWnS23spVYvE2K?= =?us-ascii?Q?nTOgx5qiLJuCORYxdJgppLUz84NLQ7iD3/2qEnf8kS0jeNKdVdmwm62aZgpL?= =?us-ascii?Q?bqdlvkA4dz03BHDI81H6jAaLTdeYXaSKuh0M97nVMeIJbU3ZvGLYKD/t5ayq?= =?us-ascii?Q?fhgWzFdYD7KDTbyJpBoAaqkMXCUQ0O3SV1GkzgtuTiF/hCIgk91WBSVD0ul7?= =?us-ascii?Q?hP40zKK1pG9muJfhwiOOtm9TtRihPveIl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KCe7WMA7isuGbNuHPCMTN+3rzUKa3OVBe/c3uZbGW/fDTxlxk24Ja5cWo2kq?= =?us-ascii?Q?CGo8Cfsg5GzMdK8QLETh/UDORRdr45MJF0w13CHgGdQY7p/UPK5Vfn+JJDKO?= =?us-ascii?Q?xRs43okiXsLPUiKGwk5ktj/HW3QZtJsIefPxJvxptCe67YXl43c0f8km/d6M?= =?us-ascii?Q?p7zDbScepMf77Sus/2Z3KqB2NRS17ySM6/iNj+pQP4u7QVI1zm6FpuSADJI0?= =?us-ascii?Q?a+E3lP0gqeyt1bb4JuY=3D?= X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: bd71f43e-8f8b-4848-a3aa-08dcec33c3fa X-MS-Exchange-CrossTenant-AuthSource: AS8PR04MB8198.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 14 Oct 2024 09:37:05.7888 (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: NFq0fLUSEUgA23D+VOEAvo/9szoDdihuBsbQFx0g0LSZtMHvSFthbl1OBvWlDaU/ X-MS-Exchange-Transport-CrossTenantHeadersStamped: PA1PR04MB10580 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 df52d2d6b3..5e7640ae08 100644 --- a/drivers/dma/dpaa2/dpaa2_qdma.c +++ b/drivers/dma/dpaa2/dpaa2_qdma.c @@ -636,6 +636,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); @@ -712,10 +717,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