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 0AB0D4567F; Mon, 22 Jul 2024 14:00:01 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id D19BC402E3; Mon, 22 Jul 2024 13:59:23 +0200 (CEST) Received: from DUZPR83CU001.outbound.protection.outlook.com (mail-northeuropeazon11013054.outbound.protection.outlook.com [52.101.67.54]) by mails.dpdk.org (Postfix) with ESMTP id 17A014029C for ; Mon, 22 Jul 2024 13:59:21 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=Oh6/a1LOvoJHvOJbeMfNbYXrxVbD74qSEg2sQGz2/sXGq7FgCc9wL7zjHpVUrkgiGB8bBDrnKoJqOO9Imx+vTtmxL23rWwKf1EhkSvTNRkFl4awg5wW5FcqGlnn41rj1ZqxT/Yhp/BSY3kSqfD7NdVPHKZK0FKT0xLKhv6ggmbMS0oLMWI80YLwXYj65kDiBrYg9Wgr4hQkEGRuO91C5b/TtVS9+lApccwHFGUlRNmLELk8pFVX+vCY2RpzMAO4ZmAKlgXR/mczJW6KnI9OCCwOLwkeF4e+cv/NFo61hgyQ++lruLBJig/UWGH5xc6QMTUSEJtHwplOdHVLCocJk6Q== 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=4q1fxoQiPsmfQAfJiuVe7Z6muFKkjz958KbTBYfNvSM=; b=JaxRxahU3QaZAJZ/ihNruRikbsiV3STsZrdgg2c2nMlXPKh7vEjikyu/gqlQbQrCYJ4IyLLj8InNmGYtBAaRHl2jJdS9wnIgH/cL1x/r8qyGsTtBVc/pNQ1wXbR4fzn/XtW2ow/sGpgSmjaJh1GjuzhFPLqVFAG3Qas/FaPR/eW1monXNOmCFkoeZt2TBUSY5wHsBE4xO2820gEFEjDZPqUkS27NrFJ4J+LIYPZUemmH7lINiX1Lk92tcB9RKbZGBz3VwHHp9zy2vsy0cLY6kjaqAmj9vl6ljr8Wlar4SxbJSvxdpbUpvjUiN7fUk18rf8FuiIm16MNJZ+d8z2rAXg== 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=4q1fxoQiPsmfQAfJiuVe7Z6muFKkjz958KbTBYfNvSM=; b=OcRXsVZ+RE3+VzaWnKsA/oDIeVmLSzFWZsYrWCv6QkelS9PUhFDkunGhx3i3I6FtbZgHPDeCY5IxwLLNORa2fb3F+7Sz8H29Oc0+iYBnCsfpLW7LIs+M5lrcub5G3OezH3qMqwyAnqKDJLI2nDyIKcTku/zGWyk4ZZJcgzRpuQ4= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=nxp.com; Received: from AS8SPR01MB0024.eurprd04.prod.outlook.com (2603:10a6:20b:3d0::24) by AM8PR04MB7970.eurprd04.prod.outlook.com (2603:10a6:20b:24f::9) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7762.29; Mon, 22 Jul 2024 11:59:19 +0000 Received: from AS8SPR01MB0024.eurprd04.prod.outlook.com ([fe80::c634:479e:8f8a:a325]) by AS8SPR01MB0024.eurprd04.prod.outlook.com ([fe80::c634:479e:8f8a:a325%7]) with mapi id 15.20.7784.017; Mon, 22 Jul 2024 11:59:19 +0000 From: Gagandeep Singh To: dev@dpdk.org, Hemant Agrawal Cc: Jun Yang Subject: [v2 10/30] dma/dpaa2: limit the max descriptor number Date: Mon, 22 Jul 2024 17:28:23 +0530 Message-Id: <20240722115843.1830105-11-g.singh@nxp.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20240722115843.1830105-1-g.singh@nxp.com> References: <20240719100126.1150373-1-g.singh@nxp.com> <20240722115843.1830105-1-g.singh@nxp.com> Content-Transfer-Encoding: 8bit Content-Type: text/plain X-ClientProxiedBy: SI2PR02CA0025.apcprd02.prod.outlook.com (2603:1096:4:195::21) To AS8SPR01MB0024.eurprd04.prod.outlook.com (2603:10a6:20b:3d0::24) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: AS8SPR01MB0024:EE_|AM8PR04MB7970:EE_ X-MS-Office365-Filtering-Correlation-Id: b181bfc0-796c-4b49-703d-08dcaa45b7f4 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; ARA:13230040|1800799024|366016|52116014|376014|38350700014; X-Microsoft-Antispam-Message-Info: =?us-ascii?Q?zAkeLBhp6rDfwWIEaNRh05ZLI8TY+pBhAKXFUpEa2YszpRoQ3rfYBUwGj1uz?= =?us-ascii?Q?GILhegs+Lccadmb1paVXSQj7ZSgBSOxayTDennnsRXunw3v+n3jYrLAWvrwG?= =?us-ascii?Q?JywGgO4bfDx+T8pPw93fNMnu/NIXS/c9MfY1OULMxkPQjLYQqQbpFNJa56B9?= =?us-ascii?Q?SasoF3gTV0Pd03p+h3U0g42PriB5O8stu04C0vfa51Qpe4uIeYC0t5exdkS4?= =?us-ascii?Q?zxiMSgud7V5ewcFQo/x5BgRjd9YXNGqNvwnIA555b4dCwhfpjEr/C7/9tXQ1?= =?us-ascii?Q?qG/M/U1uc64W7LzON1SLLM5KrU24F64ecE1F0TIw7W6wnYYdwqHz24hcYsqM?= =?us-ascii?Q?xEukJisyLq0dc0wTr0dz/QezVKcx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3f32IDIGdNVtq0mcHGCtm+b/3urGTjW7ZZXFTtrZlJn1wkPuPA7p?= =?us-ascii?Q?TmA/4/78o5VJDAjLwVnf7QELX2bhjN7EetvLmkOIfW0Dm7pHYh3I7KgIU7LD?= =?us-ascii?Q?uihYd2RH+qNAfOedpK9uzMHZvKKDJyPwI+7WP3R37LcMZIsh7g=3D=3D?= X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:AS8SPR01MB0024.eurprd04.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230040)(1800799024)(366016)(52116014)(376014)(38350700014); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?us-ascii?Q?o+WNO71dDKCMaXhgU/nZQcn6X28XYRNhwr2+eETAkeIQVuS560gvcGAm4j2a?= =?us-ascii?Q?RiHnq/xjMIOE7yYab7Mk39ODlOTQkGI2ygFLh8Fn6+uWEiTy84PnrLsyw3cX?= =?us-ascii?Q?itEAmgCJodkDVmV5rL+uCeQzHZLK0a0DDlM1Dja8mUHVPdlY17Rpa92BK7Nm?= =?us-ascii?Q?17mvXPTuAERAWFJxa/gaRVtL47GaFuOzhK0XLKIVkODBIhEB4xoeLluVMNCt?= =?us-ascii?Q?xPgVmvIfAti7+/n/oYLg7JUXgxoLEts+VlSB+vKi83lNADKNr7buVvzFuMvS?= =?us-ascii?Q?OsC4MNWilvycPYoFm6QTf5pX6YyzBGsn33WtHbZapGL4Nt6kwgQ/AVN9i1va?= =?us-ascii?Q?g7pCX52SDUPZVRBNCMirKQdPFxeDRs5NKsKIUUAKVnrp6dHxV81p2Tt/PVou?= =?us-ascii?Q?+eFdNnOoFJI2pz4B4gfwonzqSvi2F3kXPjb8idq9YOzDHObvOOqsNziU3l0+?= =?us-ascii?Q?d5SK/AIIvwZ4EhjZwUj2aVYbWVSCMDa3OJO8s28/HCUPUHnfchyI8x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ff9RhYwuCW0iiGW6V7jw+AQvhApzWC/NdUm2gxAi8QDfcmN75vk?= =?us-ascii?Q?I/IHfHYqRmTzDz7MvmLKjJZel3ZgB/HUGgGOhvPBBgqq0k7J1KU2xb++A7Xd?= =?us-ascii?Q?pes6j3UlLC1ybBKEBnVQ93VfFKUHlPfuU7nmz/HmDFI8q3s5UrEukvkK2JsT?= =?us-ascii?Q?/yfu4drlNaCws8oz7FzJy7n0p7/Rdrb5mnK3wuuk?= X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: b181bfc0-796c-4b49-703d-08dcaa45b7f4 X-MS-Exchange-CrossTenant-AuthSource: AS8SPR01MB0024.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 22 Jul 2024 11:59:19.7907 (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: Y6b9TMeDbH2jxsW/le7nQ99ciJny+ji2EJOELBlUzmEr1rWo+l/skhdpke7sm8oI X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM8PR04MB7970 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 For non-SG format, the index is saved in FD with DPAA2_QDMA_FD_ATT_TYPE_OFFSET(13) bits width. The max descriptor number of ring is power of 2, so the eventual max number is: ((1 << DPAA2_QDMA_FD_ATT_TYPE_OFFSET) / 2) Signed-off-by: Jun Yang --- drivers/dma/dpaa2/dpaa2_qdma.h | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/drivers/dma/dpaa2/dpaa2_qdma.h b/drivers/dma/dpaa2/dpaa2_qdma.h index 0be65e1cc6..250c83c83c 100644 --- a/drivers/dma/dpaa2/dpaa2_qdma.h +++ b/drivers/dma/dpaa2/dpaa2_qdma.h @@ -8,8 +8,6 @@ #include "portal/dpaa2_hw_pvt.h" #include "portal/dpaa2_hw_dpio.h" -#define DPAA2_QDMA_MAX_DESC 4096 -#define DPAA2_QDMA_MIN_DESC 1 #define DPAA2_QDMA_MAX_VHANS 64 #define DPAA2_DPDMAI_MAX_QUEUES 16 @@ -169,10 +167,15 @@ enum dpaa2_qdma_fd_type { }; #define DPAA2_QDMA_FD_ATT_TYPE_OFFSET 13 +#define DPAA2_QDMA_FD_ATT_MAX_IDX \ + ((1 << DPAA2_QDMA_FD_ATT_TYPE_OFFSET) - 1) #define DPAA2_QDMA_FD_ATT_TYPE(att) \ (att >> DPAA2_QDMA_FD_ATT_TYPE_OFFSET) #define DPAA2_QDMA_FD_ATT_CNTX(att) \ - (att & ((1 << DPAA2_QDMA_FD_ATT_TYPE_OFFSET) - 1)) + (att & DPAA2_QDMA_FD_ATT_MAX_IDX) + +#define DPAA2_QDMA_MAX_DESC ((DPAA2_QDMA_FD_ATT_MAX_IDX + 1) / 2) +#define DPAA2_QDMA_MIN_DESC 1 static inline void dpaa2_qdma_fd_set_addr(struct qbman_fd *fd, @@ -186,6 +189,7 @@ static inline void dpaa2_qdma_fd_save_att(struct qbman_fd *fd, uint16_t job_idx, enum dpaa2_qdma_fd_type type) { + RTE_ASSERT(job_idx <= DPAA2_QDMA_FD_ATT_MAX_IDX); fd->simple_ddr.rsv1_att = job_idx | (type << DPAA2_QDMA_FD_ATT_TYPE_OFFSET); } -- 2.25.1