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 5914B45B40; Tue, 15 Oct 2024 09:15:07 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 5D8A240689; Tue, 15 Oct 2024 09:14:39 +0200 (CEST) Received: from EUR05-VI1-obe.outbound.protection.outlook.com (mail-vi1eur05on2074.outbound.protection.outlook.com [40.107.21.74]) by mails.dpdk.org (Postfix) with ESMTP id 4B7D840674 for ; Tue, 15 Oct 2024 09:14:32 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=Z+7OqlVYNJpOETKVKO2rjmfWYbPJO/5IrP3KBCB+5wY0zxKY+uwffKnLqssp87CdAyZi0Kjpr+UyyCKWkkFcnDJjA9VyaI44M82+vRcta24fQW9eV2HUFf0UsFkUShtImd0D0ERq+7b/cESDwaGXNZG0KF8SlpG8frGs82hkhymxrPOoGvnKG+sQolUIhjuvIM6ykHp2+hvD29DfWcbR/ry2/Y/PZ3AcJ2Ykd4WXvgAFXDl6DEtOKY429ovBfP9KiIC/6ZJqADuhav7tPwVmB35L1AXwrbgri6UWYJPZvOXkfh9Dzn4lFJOmE2j9FI1l+YAxsle4VpUOlQfkI0OHQw== 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=XXh3S9g0+mrMpgnc3/lIN5eK1HSGmmOo9OW7qCboshT5FaYrreXgWJxrShOiXjv9CpUFkqCkvQGgLUCa1K/g17ryzZN3EMpdFKCVOhbaRB6Bar91BCVQsfD4RS46wNtZSAmRV6kR/WMWPSFmlK34oD7q2+qUxkeXldlW03wqKwXPSZOADIbJmVUZAOsY95TvDaSm4TF9XAEGrDlRhnUzEwuMQQXB94HSNBWCgWl5X5iUkfTmXfwEx9Fdn8iIH8+ag29eDUrhlBArDXohFnLZLsKn6R3pCUWyFLlQxEWujIAvHWj7lLdQqoiV94eARWHuoX0skrWsZoJqIcdKrtQR9g== 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=Y6T//Dt+6bfxEWKI3Cym5rGZzSCeGsyX1zhognrHdcN8ZVb5vyfLxbz6SxSrbwOL9x//xF99zcmI/X8sKLx2IQCCjEFnJaNt6Rkcytl+5zgDp6ZqKRUVsHs9tyV7ZgYIqKyklGTB6CRaPY5viPC+lTLYHp93hzTr2Pt5ZhtzBEyemyA1gKxClMg0vC+L6Ip1Ipz37+rrGe8tVRyik7ifQ8Jwe77PHMe73WbZrt461PrhtRB6RPhm23xRJnBEohiBvaPFWOlxf04mxIhwXYzy8SKFgH1EztytEtfFsGNkfjVIZCSb9BtptYE1VMKmRoSksU8iOMgeRdJgBhYyc1JcPQ== 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 AM9PR04MB7522.eurprd04.prod.outlook.com (2603:10a6:20b:282::6) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8048.22; Tue, 15 Oct 2024 07:14:31 +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; Tue, 15 Oct 2024 07:14:31 +0000 From: Gagandeep Singh To: dev@dpdk.org, Hemant Agrawal Cc: Jun Yang Subject: [v7 06/15] dma/dpaa2: change the DMA copy return value Date: Tue, 15 Oct 2024 12:43:54 +0530 Message-Id: <20241015071403.1940833-7-g.singh@nxp.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20241015071403.1940833-1-g.singh@nxp.com> References: <20241014093639.553467-1-g.singh@nxp.com> <20241015071403.1940833-1-g.singh@nxp.com> Content-Transfer-Encoding: 8bit Content-Type: text/plain X-ClientProxiedBy: SG2PR02CA0058.apcprd02.prod.outlook.com (2603:1096:4:54::22) To AS8PR04MB8198.eurprd04.prod.outlook.com (2603:10a6:20b:3b0::14) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: AS8PR04MB8198:EE_|AM9PR04MB7522:EE_ X-MS-Office365-Filtering-Correlation-Id: 863e032a-4ee8-4943-ccfd-08dcece90359 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; ARA:13230040|52116014|376014|1800799024|366016|38350700014; X-Microsoft-Antispam-Message-Info: =?us-ascii?Q?k+fzqQI3hWDsdDlAP8hSOTh0jp8Xg19tpEsyKAdw9ffwF2HIVC2TM7u/xAVp?= =?us-ascii?Q?YLT8B0ELmnP9MSKN74Y3enI7VODCBo6+pItZJcBP9KK7uuwEMT0o31ztOwJC?= =?us-ascii?Q?9paHY29j8FCgQuCuD1UqBmJBu2jmhlY8BInDo8aKpjFvegTVVYONgVQmzvFM?= =?us-ascii?Q?JnK8I8WdG46wb2xJa70xUt20usHsp46PNyYA+RinfthgQGSvN2ov4rqmFdjz?= =?us-ascii?Q?PK1O34cXoJs9opwbA3c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Q?wbJDED5gt/i8cGyu6TYzQNDE6DQDXtILen6gp2ckgT2UYHRxEe0IXT9ehR9f?= =?us-ascii?Q?VJg4WXL2sp9ol9RlyADmlXX+i8koIAg4YSVLgs+a0pVJjWvclH1HDZWC/j28?= =?us-ascii?Q?yTFpmXcqrMaIm7fDEWfQ9yW6cNEtYPj41kHSI82G0MB5A6SIKu1K3UrQBEUI?= =?us-ascii?Q?uEtdpXRfUJxCFgPRomjpUVga/4ypd7NQIaVdp/hTgE3dbw=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)(52116014)(376014)(1800799024)(366016)(38350700014); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?us-ascii?Q?+DIo7No4zEIRVlz/V65kwzK4mhex8qdjOxIbdB4olQLZ3Q9avN5VspBUV3NU?= =?us-ascii?Q?fF/IB9fVwzaB5ltRfHv6N2BQYGpZu2P0yX4X8sPo0zlDU8FsPgvHMSkXQ8AK?= =?us-ascii?Q?Do/Un8whrUV/8Tvb9oUHcRzNQi764RWjyqWkbMFJE0DrW8pUs9A7dVmUO+FG?= =?us-ascii?Q?31KnZFyJXFgW0GGndfn4M/9t31Io0dHC7U3Hh9YeuabdhyCB2jAlU4rRDWsO?= =?us-ascii?Q?cCgcXPAPaHw1HFvXh36Vxbb5Y8/tuEbkMHqlDvrYcj7f8dWLCZ7O8H9QirOo?= =?us-ascii?Q?ZjMvw+rhS0cN5N9FFRw2uCAPqhmyj9Ngonh73l9UwUVAWFGI435Y4c4xbjU3?= =?us-ascii?Q?yPXou+tm7E76YjiY3WIm3KshI62l+yFydwQBMxv9+z8LEa+Y+1Q1XSSqJRuf?= =?us-ascii?Q?erB+ANfiOvMlbfTmpPCrsvx3W4fnqUcDenKM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ii?Q?gRire4TAcW7jNp4Mml80JAmwoLqVtayo+NMhUspnaDke8nbkXIgUdDvW49FR?= =?us-ascii?Q?s9Tcwwmsg8mAUlQYihPP/1t9FeLnJfL0AAoHTLTtj8Oa2gAPD0liaiabuzYw?= =?us-ascii?Q?3fuETdMavskKuz2QMCRDUb7Ww+2zFbTsE1ygasMcNNRlsAD1dEak/kx/rk8f?= =?us-ascii?Q?I8QT9QLcUxIXczrXObkwbRoFVup7X4JSxnGpJiFFJUKK3+zVgKil5mEYxqc5?= =?us-ascii?Q?rBqgbJgeNmAm5YFFZBY47zL0sBUZucJ4i88e0EaL?= X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 863e032a-4ee8-4943-ccfd-08dcece90359 X-MS-Exchange-CrossTenant-AuthSource: AS8PR04MB8198.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 15 Oct 2024 07:14:31.1007 (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: H170LfvrqdPm2o4832MGyJnEmDojbY3mf9oJ6xdeJRwqAY6GaKf5fF59xLWxxRMm X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM9PR04MB7522 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