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 9622D45ADE; Tue, 8 Oct 2024 12:59:12 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id AD85D40E2D; Tue, 8 Oct 2024 12:58:37 +0200 (CEST) Received: from EUR03-DBA-obe.outbound.protection.outlook.com (mail-dbaeur03on2084.outbound.protection.outlook.com [40.107.104.84]) by mails.dpdk.org (Postfix) with ESMTP id AF56340BA4 for ; Tue, 8 Oct 2024 12:58:34 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=N4PmXoQj8OuGqDsDfFqHb8pYwcYZ3kTA9jUky7yZ3hqnGWp8C7fnfGfDZCDfIF/8rRiNSPBpKlImGGxzc6CJqsWlDZ7uCTyH4EG8XbAhPKnEU33+EHOA9kINx2nyd4vtxSKhJ0oFwMQV0YzsMVNoWF8SxcSXr14p+kAICHC2KZ48v1Y1Lg9NT5XxphxYztQ5DC0omZAmIyOL42kLkuCyljpi8CG29JrOJv7I6R6e/4sFreF71MQf+g5d8EpSHCMi86MhX7qxJRRyjDCEQ+nrzOg1AADzGxiOD6SArYFNe+SNFEHDy9Uv1oYHseTsme355I4Ms5rKTf2m4yWtmRGt3g== 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=At3ltqrSJr0Fv9pkUCsjwByigRnmm2Ob2CG0XQz8Tlx0Sqro53Zhrt9HZbJYAt8bqW/4BI+zCfv4wSpFZVtzZjS+94f0g1AUKN7g2jKP5zRZY4qoTbGcCe083YxY7A3/zMAR4jaITA3E8BD5ZEqOrPiY5vgyynj/m8ZIgLqgSlYzRy9kwusfdqfLS4JllUl2pU2UdUuIM5mNsXpKSgZj9cwT2ca5XqHFe7pwzbxsU7GdYuSBraNTzinjlscD53Cz8ECHe1jZpb0m+xbfXNw1Q0R5VhoS/Aqrw682MgEyWR4EVKREhOa6Nhk77D4WB9TZWguFC401gKnT9tqRNhugZA== 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=m4pdce72H7anUO6qCfKAI3R35RZ7DhRBIFxmEznsDasilC6kXvcyfq+tlHEa3zPJkWkhM9c4qiwIjsofAcLUECRZYZrziAM043gPhAtwECtUqK8v2nK7pC2zu8kU36g/EpZExMTBD1OREx8R467w/xObquWCXQRs0DDZFpLHizd9aWC78IFA/wOkqsP4oAoFfqnZE2hAwZbb62IdIgzzRyHzUWOjzsMLlmKT+0C/HK6LajqVZDj1vU5Glw/ZVmyATDUSHlPZzNVDjqMxkTscHg8tfwSlCwHCGzW+wEcFEhPCckkd5kz29vfkzwl0lzyttr6YIdzkXFW7i/N4Of5QSw== 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 AM0PR04MB6932.eurprd04.prod.outlook.com (2603:10a6:208:182::22) 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 10:58: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 10:58:33 +0000 From: Gagandeep Singh To: dev@dpdk.org, Hemant Agrawal Cc: Jun Yang Subject: [v5 05/15] dma/dpaa2: limit the max descriptor number Date: Tue, 8 Oct 2024 16:28:00 +0530 Message-Id: <20241008105810.1454133-6-g.singh@nxp.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20241008105810.1454133-1-g.singh@nxp.com> References: <20241008072306.1256445-2-g.singh@nxp.com> <20241008105810.1454133-1-g.singh@nxp.com> Content-Transfer-Encoding: 8bit Content-Type: text/plain X-ClientProxiedBy: SG2PR03CA0123.apcprd03.prod.outlook.com (2603:1096:4:91::27) To AS8PR04MB8198.eurprd04.prod.outlook.com (2603:10a6:20b:3b0::14) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: AS8PR04MB8198:EE_|AM0PR04MB6932:EE_ X-MS-Office365-Filtering-Correlation-Id: d3af26e6-13b0-4645-daa3-08dce78826ce X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; ARA:13230040|1800799024|366016|376014|52116014|38350700014; X-Microsoft-Antispam-Message-Info: =?us-ascii?Q?McYBSiCxaog8+6/D+yumALeuVgQd7mXSvyR1kcBRRXUWLb0AYn8XVa5l0ra2?= =?us-ascii?Q?Zu6nwdqk07u4bxIVQx6z4gIoU9wadlOHOP1Bb/Wr2vPvpPQI0VSpMtiTN7Jq?= =?us-ascii?Q?PrAAV0dZwsX1cnZJ3gyzfEGzpt2WnONEu68awvCcmGj8AwscF5SWXfYQYJlh?= =?us-ascii?Q?FL0+WRaUPgWP4sq74NYlaJsIZEvonKo3OD/BQ3G0ScI2013b9t12Y7f7YNtR?= =?us-ascii?Q?AmX/u2msBRCOR+WwS6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wAY?= =?us-ascii?Q?AZJJs74to8UWq5aFzWa/IXI5NClrmSYeILmWfh36KIXMnbFfIhypo56HF4vO?= =?us-ascii?Q?+1n5HuPDR5WKuP+93XRvBEDDV/3qbey8nk9NQ2DlESPa8JNhc48qp4m4mMK7?= =?us-ascii?Q?3fwmSaflnFt8xJGos9vOJK89Ej4bD+sXq2CI7x3Na7htkzaju6EFk/Bzj6rh?= =?us-ascii?Q?PuSDcxNPYRgPvcyAPye/z7ma?= 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)(1800799024)(366016)(376014)(52116014)(38350700014); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?us-ascii?Q?XzG6LURriNKN+9mhsLepHGN0t+gXWDfGPeeie3T1MlzutNcut5HZtIqL2BWZ?= =?us-ascii?Q?lqmJgylxDGZSU4BtzZfLuG5efZBarlYr9JwakgxRszyqcXZ6o5NdTRWEVGo2?= =?us-ascii?Q?QImJiOsC0gCuHu88el+mJWn0j5TYNhRqhozjuSxxdK9wipSXlYXpKfZY4wx9?= =?us-ascii?Q?OkBKyAu0Jv3mKK7cQWcD/cQ1EW3QNskBa3c+Ou9CKe4xDUx6u+vtm+Wq/Z1a?= =?us-ascii?Q?UVaZNtskX2pkPUqProl4ADv/7xrMF2rMBKv76PGKLVR5Rs2gMt3YXqDRrzA9?= =?us-ascii?Q?u//+cjhQUjW9WyDPUTpoQiC51ehviW7I0N+PEvtA4utMMfamFYJk7WPjBQxb?= =?us-ascii?Q?pKSKazsraBP3rxWR3ewW911z0pep85AePmklvG6jQCnSneHz+86dh3+mK+17?= =?us-ascii?Q?B0FrC29RM7XHDKvBCCXHgX2mjFMQ8+tUfM63wE+J+1fq9K8N/l2ZN6v+3LS2?= =?us-ascii?Q?2DN2lE9+TnCwI9xzn4PvrctY9PqoCoLXCORmoYUrGOwx0ani6KOKOwprvGFi?= =?us-ascii?Q?VENHBecKiHg9x3ua8BINW/uANkRMBnS65m6saYx0AHVz+lq3lqw48sNjyTUp?= =?us-ascii?Q?9sFflMnkbf0xteImNiFT8s3jVh2tsuGIey4C00uYtrOXOHZNhTGvkrErZgYr?= =?us-ascii?Q?8pTpE8i+Ax7cMwjJOt/UkCtBfJuiSMPy624seXQXzM35n9jdRjxnutCA+9N9?= =?us-ascii?Q?SpOBueolyiyFplhwluRIbH2iO9gacNSAAbOrKwpq8shIuAcj7sDQPRWXaUwD?= =?us-ascii?Q?/NEe+lUYlvo6C0Z7T9iDbvRLhEj5IT0yBE3cvftDdarceE+oVpOtcfgfGwP4?= =?us-ascii?Q?XaUUkV2k5wbNwlIlMISy9BYloDtmWBPM0zC25vewm4bg/mCQmoi9mJFykfdW?= =?us-ascii?Q?s276urE9UFOfqmSSekSLKyqYKq40BzOergsl9TdiY8jxMy2aAPt+JACmbC+K?= =?us-ascii?Q?UmpxlpJkAiBULQJXA2IB1G1xMnCV85t+WfmGpv7w9wGzWda4hOz/f/wsAQSJ?= =?us-ascii?Q?aszNy6l9yDu1uKQV9LPet/0koeUnVS4dYe+afMLa2ag/bVRGsAjpXi/D5D/D?= =?us-ascii?Q?ij4tasiN+bpauy8GSnjUkqf+LCvqLdnbyN/6nUhx+2/d6YO6SzWv2xP+bQdW?= =?us-ascii?Q?tO6ujCoIXvs8OSbeupLAEosEzwJNYLAX8PaXbNLfc0IrbHC7gxoU/kLeouCg?= =?us-ascii?Q?C7/wahe/JSUuSsEhkABiCdQtOsVRp6+C1bJgYHyoE4JOfvtitG8bNE/FtHDz?= =?us-ascii?Q?34bssZqhra6W0fGu3Hs/9WkXy/SqxxukdK2yvWrJwNSkSY6B5jFSXXGeMmwJ?= =?us-ascii?Q?XTLfq52iVAbj50g8oBEdzDtfDq5Od6GY+GH732T7LWWIndn3Z+Jfjo46MD/2?= =?us-ascii?Q?jvs8nCo+TaA9+Oq38xwMoudOGfeKFUUvM7rV2+DA7YWBgnC/okKcq7kEEZgl?= =?us-ascii?Q?biHEeMd4dqEevEtdGLFbQpA4YDbVEVaBi7KQMx7tPiMMseSULkvUTu5ESf0l?= =?us-ascii?Q?VpufYQj0jyls1roRA/fAeH5DznPlEI66bV4Alz7BMwhHxdiNfaqniQA5LIhn?= =?us-ascii?Q?VL36LGOdwPc2ayc3Hng=3D?= X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: d3af26e6-13b0-4645-daa3-08dce78826ce X-MS-Exchange-CrossTenant-AuthSource: AS8PR04MB8198.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 08 Oct 2024 10:58:33.4275 (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: qaYO8ahqCps8sydtrPH8giy48Sx+hHzk+IzQ72aQviSQWdK79YND4773M6hsrt4X X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM0PR04MB6932 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