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 4860345ADF; Tue, 8 Oct 2024 09:24:19 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 3E588406B6; Tue, 8 Oct 2024 09:23:37 +0200 (CEST) Received: from AM0PR83CU005.outbound.protection.outlook.com (mail-westeuropeazon11010008.outbound.protection.outlook.com [52.101.69.8]) by mails.dpdk.org (Postfix) with ESMTP id F326540693 for ; Tue, 8 Oct 2024 09:23:34 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=HnCAaXucKUrimFNa5nO0yKbDWx11AJ/7h/R/fO7zFh8IkYg/8PQsv8rvuQU9YbJX+/GJP3Bo7WF9po7pzh08B2QiNHnoAW7BWANROGWg0WcUgA8QetDnyyuqxuPzAKdCZ5OZ09GZvAacTzutJSn01TK8LwTcD37l8lBFNB4t+GfyLCu4Ti0UuPkHhGXDgYIbXdJwY5uokyX/ta6u25vk5ydAlzNZTdzzc1ehAnAkzgoI6QfVUAC1z0PlrL0DcaslAKO0v8qNGlPvjNXf2gy3eHztMimZ0iNUaysgMAVvSgvyiMW3EHPCbux4rMuTgYRw0VV6gPOOZ2Y57D93B/wr3Q== 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=FDav/yHjKomJjiqOqQTZgjA4f0Jat9jr7xLz72Wi7GKUUH8LuZy65uADyL0biNtL4NG6D4uOoqMkNDswaI/eIHvlOYZEnar/esRDrHZBYtsYDWmsH3vwrNbr/4bBRcvyMHQjgGyeUOOZ/W/rCGm/vrjMjrwRQCFdu3bWYdNWFOX/lpwxZGCOyK5Ksk7sZevENRvJNyKzZIvyj+gA1t4gcapbCNmV5H2pH9tLd3Jo2w64YuCKuxGwLPpp5ePkVMYZYR5JjpZp9ZYrE3Yn0YvC3RuZovRJ6JrwFJlWm70dCCdAld0v3oFcN9/eEFcwhI2gmMOL03nUzSr5AqZ0SwDpSQ== 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=jtE6gAmVDQelvWBZH0Ua+BoLE/iIWm1rSirVNwswhZ1ystmuXvMbbQ29cq0UCblb48A7lTBopk3ozbXjrPfQIjtiqsHO+b0y+tIJgFTqhZIO0y/R3cCWB/7h9Vuy5hWZuPeLF4oZfWXBZYLWwyzFum2h28MQX5ErbzqH/dsDVYLTFr6e5RMC3oEMs3jyD663tFJjdIfs3DjjCkOsBYRxav5L3cxVhRMMOG/KzawSYSY9d/fqfEs88+LNdyS6xsJCyLkS/c37Y2LyrdHUVo6hIlQ4RL3qO0WvPz0JfFI5FQDoYidhQkKbnt97hH0dvHNGTOGbYnGKtwDf4pB0JG0OfQ== 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 DU0PR04MB9346.eurprd04.prod.outlook.com (2603:10a6:10:356::18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8026.23; Tue, 8 Oct 2024 07:23:33 +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.8026.020; Tue, 8 Oct 2024 07:23:32 +0000 From: Gagandeep Singh To: dev@dpdk.org, Hemant Agrawal Cc: Jun Yang Subject: [v4 05/15] dma/dpaa2: limit the max descriptor number Date: Tue, 8 Oct 2024 12:52:56 +0530 Message-Id: <20241008072306.1256445-6-g.singh@nxp.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20241008072306.1256445-1-g.singh@nxp.com> References: <20240722163930.2171568-2-g.singh@nxp.com> <20241008072306.1256445-1-g.singh@nxp.com> Content-Transfer-Encoding: 8bit Content-Type: text/plain X-ClientProxiedBy: SG2PR06CA0221.apcprd06.prod.outlook.com (2603:1096:4:68::29) To AS8PR04MB8198.eurprd04.prod.outlook.com (2603:10a6:20b:3b0::14) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: AS8PR04MB8198:EE_|DU0PR04MB9346:EE_ X-MS-Office365-Filtering-Correlation-Id: b7c45397-7849-4bc2-3760-08dce76a1d4f X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; ARA:13230040|376014|366016|1800799024|52116014|38350700014; X-Microsoft-Antispam-Message-Info: =?us-ascii?Q?2TZfKhoWphZ5XCOtCdcvqB6d4z+axux/UaOS1GJr7izkhR2+HOdcDlejPCaN?= =?us-ascii?Q?18mFJOa+QYzM19tqdc/pUtIJ+Z7Su5YzuxW5zCmvPS1MAPDGNuIh22l0EGly?= =?us-ascii?Q?0G/lPohJkJGKL/ltBgHcU2rbKQu5E/cNxOg4xmDfi0Pi1Oo+tjQFtYjXuWZF?= =?us-ascii?Q?JJ7jjsBWKVU53KLrfcs1dwufcIMPAu6EtIRYgpecTHsMjOZBedDWVtNOZTxe?= =?us-ascii?Q?dxVu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I4c/UPH/s/7h+1wpjr?= =?us-ascii?Q?V06o9AKKKfdON6o5KMS6gMplZokIJkUvQHoxDK61gWE/Kd0WUBOzYPYrCZfO?= =?us-ascii?Q?4zVtL8hfgmlbz89JJhqRjNIKSM5BSCJBgsgLqL4wEyCV0inlfz1S/ZxMo7fj?= =?us-ascii?Q?oGKG7ISY0ru++s0dSObfGagpdXuoAx7HFA/XYAhTxFtApe9qN4vQjVPA3as4?= =?us-ascii?Q?CtlVwuJ6w/lS510CgaGa1nus?= 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)(366016)(1800799024)(52116014)(38350700014); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?us-ascii?Q?/x69R9halXA1+eKlgeVNjXlVEFJpR8yD0/ZaHukSa62umykDd8l7sUzRz069?= =?us-ascii?Q?bKjQmPiZx/Ig9mlgx+hLnkz9LYmWVRlbrOQjxb3P2VQA4UeXZslRphRx9G58?= =?us-ascii?Q?0zJePXeTAHo7QVjnJr9DQ+DKqKZzejGdL02oYBAuttf321RcAvTE107QRdqN?= =?us-ascii?Q?cEakUxMfMVBdgX7K4rf63F9/WwCu8QDKBxg2FmFsQzoJgpsRPGKAmpLz9PM/?= =?us-ascii?Q?5HLL6cfBeoq/ANymNmeTUSh8U07GDWS9C3sjNJYlH805VWfOZtP/8rwz6uTZ?= =?us-ascii?Q?ixPZoynTaQxB3Gcv3cmR0p23eqYbscXeD/gRS/eo+82rkh9ifeOyBZ1ot30b?= =?us-ascii?Q?BrfTG+DICQOQ8tpqbTV89xK8+4uwkjTKhEua98uxTCpz/VAgJtv/RkXl8ApM?= =?us-ascii?Q?QhHEh+biOHscZ/aGpUy0wU9en4bPFnEX5F1YNCJT5Sb2d1UfUJ1Pm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JJh7d8QqR5Bk2CVOrZXZfW9PfNtTwj09lOlT?= =?us-ascii?Q?HJ2F0eR+R2o5c3qVcO819JOHgmvnFtTV6/xrCs8newZ+WkAjdkJ0oHUhJG/k?= =?us-ascii?Q?NDnPrmJ6vYuIl6FsmAxbKHG/C8IlX5lRa7F9ry9AF0jMX2RZFqgHVEFaKdF1?= =?us-ascii?Q?qCYGz+9HYV92/7y9k4g1CTFpHKShRaVC5fJfSpkVmd9Q14NV6J+ljfUGSPJK?= =?us-ascii?Q?TbSjMuCLd74WIUgMzvk=3D?= X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: b7c45397-7849-4bc2-3760-08dce76a1d4f X-MS-Exchange-CrossTenant-AuthSource: AS8PR04MB8198.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 08 Oct 2024 07:23:32.6589 (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: wVDKKLMU9ZosQrx3hHYknp3la+8Pc1R3oMGCzwPQ3s92xPjhwztbcXUMoUUsWToX X-MS-Exchange-Transport-CrossTenantHeadersStamped: DU0PR04MB9346 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