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 7EC0E45ADF; Tue, 8 Oct 2024 09:25:49 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 24B8040BA5; Tue, 8 Oct 2024 09:23:48 +0200 (CEST) Received: from AM0PR83CU005.outbound.protection.outlook.com (mail-westeuropeazon11010019.outbound.protection.outlook.com [52.101.69.19]) by mails.dpdk.org (Postfix) with ESMTP id 3353640A87 for ; Tue, 8 Oct 2024 09:23:44 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=rIOaaMl9Ofk1D7zZ+Z//z5nI66NgYQXNO6/0cU+jTWgfNLqPrz7NceePjrjPBBY6K69JXj8iqSDAEBG2h2AHaAmgkqJC0aSuj3EQxHRIiJhjp0DY1qYN2XE/ADf80RGZMkH6jFCxDi1834Z+uJhfUhFC8G/L6Lk7XQnearYU3zIpyOwDpFngTq1P24+5HDwWKzg4hYUb7+tABc4farNxd2LYawiJcqYDcIObd8q366GReqSsp9tyAgJ5fAVUEZZtTThpe4ZaWdhtNhHWQDXwjSs4y1Tr9YXkIXdawTuuCqd6JSJ6MxiCVErqUoDYZIGym2ZD3eIqChurcXiWYA8HPw== 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=cWFv7uZkPob87lT/sC5npGORFz9xCbfHWCuBOIFPxoiK1uLfKIDuBf1tof14ZP8GBed2L35fQz7yKX0hBIZyP+Z5jLN+Ne8Uxgy5/yVvtB60k/AclpU6ZaEIWGBZuzDgY+zdczw1uynZqnAEDhJp6sQWMf1+BAjuyNC63DeWdr9bRGwyHLyhwrCn9L9UTdxxOkBjunf+SmYURPxww6ufhgBl3pTaG6pwb88Au3reczlaNS58S85R3ohjRCxrFCfx3s4kQYMH+r8E+vLNUS07d9Ud90lvzNUBE9N/bhGdQ7sEqlxJRx3zq+qgjVl2XCnOTHLkoCTYBORnM7CFsCI5LQ== 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=OZJUqvqOd8QO2F0zPjRAeYrf+ExsvkzlqvSIgEYYF4D7nLxd1JWWfjUWf+AnZ+8+cetz5fgk+JKS57E3cQoWedkwY+FMrpH1R13ZNRKJF6g5viSCIDQi4yYDkLzk54Znam7sBlGk2kzx64xE11feds/ae1Z9nU5RWMdklxCyXF5ePObo2hySMxn7VR5IgRKRnqERtCuv9G8hacbkYKigNSxm1AqfPMPx54YGX1Tt2smymPg+j87ye7XGZ/shgJfrFL8e/PnjlJKxarTvSNeKkY3lN33v08lr702FViMHzNv0g+2kGqYrCcLsmNSq7hlfAWubuY7WPGuf5cqH77S75A== 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 DU0PR04MB9346.eurprd04.prod.outlook.com (2603:10a6:10:356::18) 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 07:23: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 07:23:35 +0000 From: Gagandeep Singh To: dev@dpdk.org, Hemant Agrawal Cc: Jun Yang Subject: [v4 06/15] dma/dpaa2: change the DMA copy return value Date: Tue, 8 Oct 2024 12:52:57 +0530 Message-Id: <20241008072306.1256445-7-g.singh@nxp.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20241008072306.1256445-1-g.singh@nxp.com> References: <20240722163930.2171568-2-g.singh@nxp.com> <20241008072306.1256445-1-g.singh@nxp.com> Content-Transfer-Encoding: 8bit Content-Type: text/plain X-ClientProxiedBy: SG2PR06CA0221.apcprd06.prod.outlook.com (2603:1096:4:68::29) To AS8PR04MB8198.eurprd04.prod.outlook.com (2603:10a6:20b:3b0::14) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: AS8PR04MB8198:EE_|DU0PR04MB9346:EE_ X-MS-Office365-Filtering-Correlation-Id: 097da71f-1c59-4a24-4a33-08dce76a1e6a X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; ARA:13230040|376014|366016|1800799024|52116014|38350700014; X-Microsoft-Antispam-Message-Info: =?us-ascii?Q?sQz8YEJjSDssXmSnPZXP9gIwVxAS3Dtj4/xe63F+38kmlYj58J4NRTd3GyF8?= =?us-ascii?Q?oSO2Gsbi6fPtUKBpvWg/3SHWUZ1KBByMSiVkCHxlRJV4H0BGw+6gQqaFal0O?= =?us-ascii?Q?YlQKj8MDCBYpeJx2LZLn0egn/NOBYbE6NV3IcFCBDAom1ebTBYKHm351akGp?= =?us-ascii?Q?5N76IToLiB1dX5FoIaRN5nkTLkNsopXW8j880SOJbtrMIn9hKKTAJv4E+hDU?= =?us-ascii?Q?gWSAdO/tw3q5L+rwCu5oaU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q?D7wuanCm7u7Anp2zql1VG50piY9kTb3U0BtJiPJHJTE9SIOA4ePZZLhO4E+S?= =?us-ascii?Q?O6py18w7Knfdd6iedflyMUOwIxqFCv+e+ABYVJG9Sg3B9nEU9eW0ihEL0PYa?= =?us-ascii?Q?omXl4LirCeG0PbjzZK//wTvZbz3OJctiD7erClkfdcCibbK1WHm8Baklj+7F?= =?us-ascii?Q?YX4fgWLrPpmk26N6wk2aBk/22Q3LanKQr6Lw6O9X74cHvg=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)(366016)(1800799024)(52116014)(38350700014); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?us-ascii?Q?3vVREy+NcisNYsvdvsb9nDzY2ojO84A0PzRY1vXugaiEXB1k6aGZPjLcsBKc?= =?us-ascii?Q?HtLaZzn93Db/bU6J4fq+eQcBKfMZ5NtEsPsNS9/EC4jUEHue0wJ1AlcS57zq?= =?us-ascii?Q?tycWaXUo9o71fvhkdxYKKXdu8XCUdwUth90EUr8NQCXu0i4qsAXFAyJXoLyH?= =?us-ascii?Q?/XAjDTpFePdPAFpGxJIaSOF8EIM3Cp1h7F7f7PZBpNvDP0PC4Za4adm1/5/C?= =?us-ascii?Q?+ExDqODBVi3541s7BLPyk6kZ2uDvmmKQFi7eZwV+4FE+PpPk1sjMSScRm1Zn?= =?us-ascii?Q?qNYiez4sIweUxViBy7m8ODw/VmlMG5llE/l2iHTx9DWd+fBP2tVDx9QDGZUV?= =?us-ascii?Q?yCF5FZxaFqSLvjNfkQY6QmpXBs6hNSoz7wxIA899hmVxflVq8EdKpxdzIBJJ?= =?us-ascii?Q?vECHya/8+l4+mvIrAhTOUACHJ4fclRkkiAZ/yhxro0GoFHfjjmLw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8QFOaTygsI6cGFEM25Yaw5WLOQhstpJJB/Rs?= =?us-ascii?Q?1aVn2VEYkT3CcTbFe1QDTY8ez56PnS6q+cWEOapX1ZRh+uxrZKTLfaTiHvec?= =?us-ascii?Q?LBLZ0TRRJ8OYoGtedZ1Ou2iFhldrZyg8aiZmJIni1LU1NualHh78JGx574yy?= =?us-ascii?Q?EHRfdkFHz8cwf9W6pzsYtNB+xc4xygT6KnY3EpRqXphYWZFFPmPqXROIDNHT?= =?us-ascii?Q?T2rrBVdeE16g+TrodQ0=3D?= X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 097da71f-1c59-4a24-4a33-08dce76a1e6a X-MS-Exchange-CrossTenant-AuthSource: AS8PR04MB8198.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 08 Oct 2024 07:23:35.3598 (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: VZxAXgEb0I9k8tkiEkvctJJQEIhztJ2JmxRUNqehwauoP+5l07hVrVdYeqHqKRlF X-MS-Exchange-Transport-CrossTenantHeadersStamped: DU0PR04MB9346 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