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 94EB045B40; Tue, 15 Oct 2024 09:15:00 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 0C9E7406B7; Tue, 15 Oct 2024 09:14:38 +0200 (CEST) Received: from EUR05-DB8-obe.outbound.protection.outlook.com (mail-db8eur05on2051.outbound.protection.outlook.com [40.107.20.51]) by mails.dpdk.org (Postfix) with ESMTP id C380540674 for ; Tue, 15 Oct 2024 09:14:31 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=qalSR3r2Q6vYzWn6gKyOF0A4HeswgwoKZKb9TVO+QL7219TQqX4JbsMDrZpymRR30fGR1CJHeRn73AzC+YAprA0aNJy6akBV8VA0wYCq/2tKk9WXXx2UIAXmbB4+ldKUdGL38IK+HdsIjTBurcijyskGqaKPArZ4TdgG9VmhNIyOH1lPGhSN/L3eSVHK/BQQmgABphLzJn7J/B8XD2wWId9AA6jaWDuM4KBNxtVGKqJ8dr2q6tCpf5m0ktllyu6Qh74LmJndppP2lduLhP36XlbJWSzwSJkbSY+i2iNdJT2ftju1mnHgZS6O5QnUDXF4TlHz2w0nxCHKPRLvgsl2NQ== 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=kUIv9kVSWAfDyAJFdws8RU4AZQFnvjT8hKiZdxx7CoHT85l9koitoDlvo2pAD8dd4cvd4ZDqRkahNWnIlJFUmXx2cuM0p+pAlJ7GteisgjAmZI85AyI6NHCKZ5JDkfEG3maI0xNQXmgd/nFePn6SwD+CzPPn7KNfHWA+4Gzrngky3b1tuqVC6ZClfHM56y1Q4UqfnhqMSoceUDiLnBF6t8fihW/o+rX9TlB+6mu6S2m6LBsBnZTyycHyBkRdpq76qtoY+R4sJC9QaiY9aMpuILWVGrfbfHBDkqrDC+lYXDW4lFGYj7Lgwdd+bcK62C6EuYsS6iLzPmmYUi3fIMLMpA== 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=4q1fxoQiPsmfQAfJiuVe7Z6muFKkjz958KbTBYfNvSM=; b=UyobLSbappzcKMUc7kqxz9lkpDNHfpDSMVJNd6AV630X7ENfRWqzpzJH7SMLzbCPGje2DuWh6NOySf+B6dhgJwkBuG4wUO7Ifvjb78UpxF4vIpBFTWEQyp4npTkQL0H3O3bpHyikgvPelw33srg+pE75t+dCE7a7VeHPJ3aCyNwDu75kAIu5K4vBROua04P3i8Vxhmm18GHrRanw64igiOTRDL09domcLWYzu4kqvUoA5dZpeq+XEflRbY613G7ZphhEt2Q1LyB243xakTW3sKJKHj0zlWoPhxlc+KJxP0sDTQA8iAmKqTBpCjPfJ6c9W3rp03ZnJQh46uN3UGGhUQ== 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:29 +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:29 +0000 From: Gagandeep Singh To: dev@dpdk.org, Hemant Agrawal Cc: Jun Yang Subject: [v7 05/15] dma/dpaa2: limit the max descriptor number Date: Tue, 15 Oct 2024 12:43:53 +0530 Message-Id: <20241015071403.1940833-6-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: aaefbee0-d0ba-4fe4-a82e-08dcece90247 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?aXZZKKHEjW7Ccx5yVdpffDSCAfzpFEBWSgcdcwlDnS7dbj5XcnNuJig0S06H?= =?us-ascii?Q?eVOvwaaQNQ3hogHG0phvJIRbckHzmiXcBdszFJxmR6BHrrR9oNw+b0P88v78?= =?us-ascii?Q?wGC7j9lbWWIKQrWOOJRxS8cO6wXl5BsArX/RGHqWZWHPeRpw2S3aYKn2x+nh?= =?us-ascii?Q?78vIdY9GfA33GcDcmkvvZYtUGSFefGRhm8jtUALORSABW5TZoh8ToHTt0XTS?= =?us-ascii?Q?riz/mcYpxIcrVAsiIiq8ac6EF44hDLW9Wc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ii?Q?1WFIrsHBHlZ1mLR6rQk89Aq9/SJb+ayz9nG2VqpUNI6+OHZ5SLc23xJOWlRM?= =?us-ascii?Q?7zDnHjzyV9VCx5d/JqoZ6eX4M2eawVI+SS9ZlCv45rr0FCyQcU12q4OtKksY?= =?us-ascii?Q?GirqWpAyNB4TVvE76hC3DxqN4lgu7W4ZdAnEXAarMm5VDOaFgP3wU6b4l8HP?= =?us-ascii?Q?6TstRXq6ePdL+8Zr9xgYarN4?= 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?TqlUz7NXahsJppnV0PNeeIp8El1+fN1NqYIb1OV/maQnR0NoP21QUz7/PM9j?= =?us-ascii?Q?9mi3DYAHgmZ6KoIuL/pAZGMAsh7doQ3eEnbuoGhXBgyjpa36f4miuyNiSbR7?= =?us-ascii?Q?d3jmQ4iOoej9i6FawlUNSygavUcBD1Ez0cvGUySbQsP6VNjczQtGFc49CCVO?= =?us-ascii?Q?zU1rW5bWF+Lz2zzvcz/S50kXUtTeUWoRYve3+/aVCLIPPaz+a2kWartvCa+v?= =?us-ascii?Q?b8k9O5i4PNfODdaH7L6bSwUY+HU9uJ4fW32hz1c/P5yNfjTB48bvR8nB364G?= =?us-ascii?Q?w1+5Jrs0hAWCeHpQycP6J6U1vK8Ibd5b6Dnsn+8kvsi9Vnbz+TfVgOOtdUxn?= =?us-ascii?Q?OyWcz39YvqsHU4i4cDEacmVOqKqqEdEyhGM4C5YeiM3UHzGG4knd0reFVc6i?= =?us-ascii?Q?bZoGw3YrGVNG86gzJZDcdUvqrJf8zkWVb34gIw0ZwHdLPUYo9x3DlXFvxVP3?= =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lkmTZwOn6w0r82i8SGa0XegQ?= =?us-ascii?Q?OZSPnRXfV7ZqtXbTbpZBaxLxxm+Zu5gcG0vwvo9Z3b9IZ2UF5h0cr9twPVIE?= =?us-ascii?Q?cdmBMoIs+8btFqaQKq3RNwCuBE3ebKKENwREeDEDv/Kz2xYY2hPs0z/eOVJ6?= =?us-ascii?Q?j0zOsKiTiPiBgiavRUa72PIdJ5KCMpA3xQXTHigIAIxgsvdyGOoDo4TMGh+v?= =?us-ascii?Q?/A0iS+NZNrrTYJ0Ui/J+dFVM07lLSJ06t4xLyLYM?= X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: aaefbee0-d0ba-4fe4-a82e-08dcece90247 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:29.1066 (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: LbT+PVg8W5wL74dgnyLrXY1VBeKO817csN28f7Vglbs/PnM5297hr/FuxtwGekPi 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 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