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 2CE6C4564F; Fri, 19 Jul 2024 12:02:56 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 330A842ED8; Fri, 19 Jul 2024 12:02:05 +0200 (CEST) Received: from AS8PR04CU009.outbound.protection.outlook.com (mail-westeuropeazon11011035.outbound.protection.outlook.com [52.101.70.35]) by mails.dpdk.org (Postfix) with ESMTP id 0664342EB9 for ; Fri, 19 Jul 2024 12:01:59 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=uzoiaV6MGfEclmo//mOnhk/8O54P1MfO2feV6jZEm1JuP3kPGYUNO12xGlE9upnWx8LHrfGyv81qi0FMS90n6kH1MyxP0NM4wiXNwZ3n5nq+aCH4bHsGa2aW+v8O1tM4MUDE6zSYzEs6ad2w77zXj0Asn3qi2B3ggHg/HCS35QiGu0c9WS7WGk5aSseJRv6Ayl6gSageTKLKJTnLPjEVCB56CgfRvozgUhzXoJiRRgF0vkcis6536kE0GTbt82pBBfc/WsEW710h4FSs7EgO8O/zRTUxMPeZn76c5gh4aTHNnN1cD6mKQfKz9eCqiP+LTU5Kg1CwcYV7HpWnOPfDRw== 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=Z/m/Pv0/SwiZFDqEx5yYaphUAszMycza9/g8ncJc2SI=; b=cvgSSbl6NAmuSJuG8Lu/v/yREuwRBuZ/72jT5bkiwp3clh72U7qVorDCDLcPKRSbQhfZWZCxzeNeQMe/P4MD7IviYART3zDzQyZ5uUI9W8JjMh89Ph8VncO4jA6vc0tC1qdJ3cKGpgwtaYGZCYsWZfrH1gQ/f24/yt7HgDi9GAROnBqjgVsrLuGw7UOX2ihN+25SjydyvbQCI8/wijY7tJiXt9OxOaIKIjkOfCYzXEMLSnZ5hxL0cqPr1XFuBTkQCJXh5b6a3xiv4xlc6tAdcVfAjdNmEp2/SZ3ixei2o5nD6ryh7mdsYrH+oez9dvM7YmSLZ65Ou5hY04ul9AKohQ== 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=Z/m/Pv0/SwiZFDqEx5yYaphUAszMycza9/g8ncJc2SI=; b=ll7NjcrBwKL7peYT7hicV7QfWCZy1jXrVkqI/ZfBzSMZsUjI6jmGDKDclJ0IGv3sXf8JAPEXtmG5hBPdiTCkz71D/nik6acjPdVvhY045sUJ+UQmWQGPz4K5JA566pZxZQpUSe945EBBLk9QPym1EzsjH0++CzSIqJ8TizaCaLA= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=nxp.com; Received: from PAXPR04MB8205.eurprd04.prod.outlook.com (2603:10a6:102:1c2::20) by DB9PR04MB8345.eurprd04.prod.outlook.com (2603:10a6:10:246::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7784.19; Fri, 19 Jul 2024 10:01:57 +0000 Received: from PAXPR04MB8205.eurprd04.prod.outlook.com ([fe80::7633:884d:5973:174f]) by PAXPR04MB8205.eurprd04.prod.outlook.com ([fe80::7633:884d:5973:174f%6]) with mapi id 15.20.7784.016; Fri, 19 Jul 2024 10:01:57 +0000 From: Gagandeep Singh To: dev@dpdk.org, Hemant Agrawal Cc: Jun Yang Subject: [PATCH 10/30] dma/dpaa2: limit the max descriptor number Date: Fri, 19 Jul 2024 15:31:06 +0530 Message-Id: <20240719100126.1150373-10-g.singh@nxp.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20240719100126.1150373-1-g.singh@nxp.com> References: <20240719100126.1150373-1-g.singh@nxp.com> Content-Transfer-Encoding: 8bit Content-Type: text/plain X-ClientProxiedBy: SG2PR01CA0184.apcprd01.prod.exchangelabs.com (2603:1096:4:189::9) To PAXPR04MB8205.eurprd04.prod.outlook.com (2603:10a6:102:1c2::20) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: PAXPR04MB8205:EE_|DB9PR04MB8345:EE_ X-MS-Office365-Filtering-Correlation-Id: 8e566d1c-feb3-40bf-82d1-08dca7d9d362 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; ARA:13230040|52116014|366016|1800799024|376014|38350700014; X-Microsoft-Antispam-Message-Info: =?us-ascii?Q?RCm67CmwJOEbeG62HHNMLUfoype3MIP4z9CtXj1chrinRCBl3sftGkaSsJO2?= =?us-ascii?Q?GuNcha5XBoRvBMA5E3WyeVyfbs3+6oGwPumalhbARVOOrZKUm45pwqUfGJyf?= =?us-ascii?Q?8PBEkhb/olvpvBMPQ17i2WEx3ylM8bLzPLAL3s/Tc1MpWGz+Rb6jfXQabyZp?= =?us-ascii?Q?stmfo6OJPS4BfjZsEoALcHkJsS8tzVpIyz+ULwLg1Dh4anxQgswekMQq26nj?= =?us-ascii?Q?riZT7Nk1JPk5PDyskin12htzYb2D4pV3NXDWZmRI+osQxflehwmxyYM/oDo/?= =?us-ascii?Q?eGuwHGul0LtGT2Rp8Zq06hw7OqcNkum75G3Zvz3YGA9Yfvn3UemPl3/+yoxA?= =?us-ascii?Q?/1ORflYJmzHk5PBcVcQZrZuzrgeM94N8iuOQKPo8lnFjsUTNgC6gzyI9hJiI?= =?us-ascii?Q?6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ZcdCC1e/thX?= =?us-ascii?Q?jkEhZjOmifX8XAy5QCz0eJz1hBNuVAgAGKJg0KycG2nGWF1cf9D+9OhM0qCU?= =?us-ascii?Q?I5wiDi6NlrgQ9pYYbN+GQyHd8PdYRqfVUHofvPAjXgOBVlgbxg=3D=3D?= X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:PAXPR04MB8205.eurprd04.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230040)(52116014)(366016)(1800799024)(376014)(38350700014); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?us-ascii?Q?f3b3DjMkftCWg/Ff8kPCsr20ayXWzlmzuDXMfCnr+J8hEB9VtmPbbEXBeksn?= =?us-ascii?Q?tJiCCiwX5PICErrahxd9oZwSTwZJUD2hfBPjYixfe0Xpfiq9DhAZq7e5AY6l?= =?us-ascii?Q?Ke8dYaenIKx6lLpfh6okTCHkUEHQl4zHI0U1pNJYKwDfO2GuhBg+2ed1HIa8?= =?us-ascii?Q?ky6N9FqTCgq/YMd1KGo6l9FR9Uzn87rmmDA8vrIGFRH7II1Fyp9j5YSP8mSC?= =?us-ascii?Q?tmrGuYDZePtkcJr7ZhnsfPCtUS6KJcDVnwemID/Jh0o+zHOOCLKCTT2S4pc0?= =?us-ascii?Q?LJ4N9Lh4XTQfyosk1b3q/oYbAQ9RqQmklZkQDwQXil00w+dPd5r4pKNvKHng?= =?us-ascii?Q?6X8Y7Kt0uZ4T3H/dOJt7ShHam1Ox3bwtP2Xur93Aqka4G9AaCvD4tCC+Ej99?= =?us-ascii?Q?TbDW5oAZ8e7ojZUh2zxZ+lyg78+E6fIAf2zx81KdwhIi0qycLsviLbOjwDfN?= =?us-ascii?Q?iDKQFP9MPZuR8vmvH1KtBoEjg5J1OmAAxY5XX2TKmiIZlUlGwBTqUKUYxUbk?= =?us-ascii?Q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UVTTCmBPcrS86K?= =?us-ascii?Q?VGWRS4K9hqpznIEZP0eDzqi0S+ntEXm+t+E3AvSIxR1xF5u1STGvAE+Rp40F?= =?us-ascii?Q?WZNplMk+ViwEfcEDwcg3VWpwSP9RtCTBUO6znmTm0Pq70W1t0bo8wDRdvRTT?= =?us-ascii?Q?zpBekZQIGEU3L/RQssHATDItbNPzD28PduTv39+8?= X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 8e566d1c-feb3-40bf-82d1-08dca7d9d362 X-MS-Exchange-CrossTenant-AuthSource: PAXPR04MB8205.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 19 Jul 2024 10:01:57.7445 (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: PJCHtXz/XgbvMhYoj8oKhrN9akPaNOV6792G3zXm4cnI8KOvyxnhrEahqMq0Nqb4 X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB9PR04MB8345 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 252d2b1c74..1a4b611c08 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