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 C386645B36; Mon, 14 Oct 2024 11:37:36 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 24D6E4065E; Mon, 14 Oct 2024 11:37:14 +0200 (CEST) Received: from EUR05-AM6-obe.outbound.protection.outlook.com (mail-am6eur05on2062.outbound.protection.outlook.com [40.107.22.62]) by mails.dpdk.org (Postfix) with ESMTP id EB9304060B for ; Mon, 14 Oct 2024 11:37:04 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=v+JqXV93rqNafaAJDl0JG7n2dCGZQYkm2rmg/pjAeCOqhaW9DFG/l8Ix9h3ZkcpwJhPXu4zu9loRCn3MhQkYObBaBqklmHSLjbeIn4ykmMnUvqQfzGQpEwMoHOch/8UQmTiRcFl46Q7J59GYZmDGDhunbjfzTeI+aGJ6rxmGn+vkGaGGt/wGJ9noaWjvCwgKcWojMzefPemYwWKD2K+kOj9wHcjnDiMqXclcWpheIrNZfyWJ8CVCzyFiirT2OE72xnhZqkWqbpw57l+XNvSARarDEfcCeOUg7+JXIvv3oesKpjsVCcpI0Zr++caaPQOkys/ROCf92KJ8EPT1mTcl7w== 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=DIXj5xGBiXC/CITbTlYw5KtEJzXnvzehb/fk+Jd4ypFJqzoJiTFAKwlOjjgG5YvsTB/a9s0g73dofytxPduGAqaJIMR0tXJ5XbPCIulcFpZcGf6RraOtUMPdkQijncj9l0i2rAZ2a/n6FY9SS2IaLIk54ITnQwT+fPlRiXegHEcPeD8fgEksshcIa9shfePiSU4UCuR1bAm1Vn/Ea+UdR3nKmpKzDjLdozqpUpbvRKM1tTrYWnpQcr4m8xuMvEOCMEWu4UxII3PEvHnF6kjOyPc61d4eKbYBlEaPoeOrinojyIo3PbSUAAHve7sXpRITL3LcVF4g0f7lLLW0png9bA== 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=J53VO5BBj0DNIbp2i206MgNBQQIW7R0Dfex27q2Z06ZADHKPQYRllKPms6N1aIDODLtw6s29VbPHi9q/SIeCnLWfzQhIuBdsGHMVsc/x6CLNYfvfTIJ1xS0EXha7xLmSW55ke2L+c3P/enO5bmhAZpkFnFeist+RJS12uOIK9HC7iegUdFY46B2V7HLhIYyKsGeZotGQqeRUyM9ZJauhKkP92ZBNWo6tadjGzeGMexf4GSADjkBTszl+maJj8w6bLwmKgzf99/kQiabRfiAB0oJdS4URcv5AfBCys9JuoJ98FfwjxVcvxcsIIcYEgK7iHaAl18J2snp9OapEqZ9Ypw== 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:03 +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:03 +0000 From: Gagandeep Singh To: dev@dpdk.org, Hemant Agrawal Cc: Jun Yang Subject: [v6 05/15] dma/dpaa2: limit the max descriptor number Date: Mon, 14 Oct 2024 15:06:29 +0530 Message-Id: <20241014093639.553467-6-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: c82c4da5-d683-43da-f759-08dcec33c2ee 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?vPrU+yINZe5Cw1SdYJOXWPytqRoqY1LQmK3Va9oXSOyMhuvi1JdfUIHKmRQi?= =?us-ascii?Q?WLTqKko54iDgTHMsdxWx+lCfU5kMvQSd3TcOsFLYEf5e9TKQza7rRZVMyYKa?= =?us-ascii?Q?ZHbZXOtJgLwendFyg+i8AsZDB6tWxZ9Td/HDAE8BCyay6pb+S7vVxL/RdjRW?= =?us-ascii?Q?Qyc7EInYPitnrqwJ5YD4LAM+GHUDozcdDxORA0iPAE48XWovVompjr3P4rjJ?= =?us-ascii?Q?2HerHV0DBuuKjTXFudGAZvAzNRiseNcIOosOex3Lmr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?ofPAM1rZo8ECRJ8bJmWr9l0yYhQ6QeaweINlHGYJxZR09kmnfZzcLJvqZlAy?= =?us-ascii?Q?G2bZcHi9I82o6aujGG9WDzntoNgP/c0+/OwyYIV5/y0ew0Sj/TjQIm3IEy2k?= =?us-ascii?Q?nrwl1tIWMV9IONNNK1DFO9Kl1vFIUJW4OM+lgHqujurEj+uYha6whQZ4MBQf?= =?us-ascii?Q?B2j7o+iCc2YG7ryDeOhFS6Nb?= 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?zPWbTt4XqJl8YbntUbAwurchXGLyYqxgdfmmdLHrDGINZxqMSu4/zu3G+vS0?= =?us-ascii?Q?Z4VUPHlExZ0C2ORE0TvL7wxim3YOdpN5dVhv2VA8KugJyebHcd6RMk+Rq5Mz?= =?us-ascii?Q?VeVqSZVQRC22zH1Pru32L1Z42evC05Czi5aTInpq+zXXuQwvMpM1kncNmR3e?= =?us-ascii?Q?/mDN9ZzIS0neJ5Y+hn19dI/A97mq33xuOetQEPcUlIVWqCw6BshOYMRwaiCj?= =?us-ascii?Q?ffknBocNDcTcSZRIHyWU7FQYhCjHMFvgf10mt2wGlN1Y0YEldAqIxlLWYvyp?= =?us-ascii?Q?P8OuQBeaO8xRnRtW+Nwd3XZkvrSfYsu/S24URH5kVfUhIAl81eiNjHb+JtQ/?= =?us-ascii?Q?icDLRYKcsEo7F4e7VBAY8y5fh/bUcSUSkGeeuuuRU6eBshLVTMjioHFq+83O?= =?us-ascii?Q?C3jF0Td6yUMks8W+77hn3/AgclCvEPM/fgQ4Wa7f59RZVQtBrbbmmxpOnSnj?= =?us-ascii?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qyEKxEaW9pZh+lNFVUy?= =?us-ascii?Q?XJ9vnWRPhVniUKe2nVzWiU2Ugml7f0vrbM/38J+RIVh1JJrKRQKno51Aadt6?= =?us-ascii?Q?5FeyzoudD6RhHkWy5eEHIOwYDfXUSB1mNgqc7nj26b78ZmGohFbKPS3YGwLB?= =?us-ascii?Q?QIssQsTM6G+GiBLsq7VvqtLKrnnTbsHkEiMWy2RJnmJRwuplY2G6j8AnRiGY?= =?us-ascii?Q?brcE3toiM+jZwUvii+w=3D?= X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: c82c4da5-d683-43da-f759-08dcec33c2ee 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:03.9339 (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: SkJnAj4RiTKkzcCjF7gmiKw6bsIoS6P3s2fRi0hh04huyC8KdLNrd42lu2iypIz8 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 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