Message ID | 20240722115843.1830105-11-g.singh@nxp.com (mailing list archive) |
---|---|
State | Superseded, archived |
Delegated to: | Thomas Monjalon |
Headers |
Return-Path: <dev-bounces@dpdk.org> X-Original-To: patchwork@inbox.dpdk.org Delivered-To: patchwork@inbox.dpdk.org Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 0AB0D4567F; Mon, 22 Jul 2024 14:00:01 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id D19BC402E3; Mon, 22 Jul 2024 13:59:23 +0200 (CEST) Received: from DUZPR83CU001.outbound.protection.outlook.com (mail-northeuropeazon11013054.outbound.protection.outlook.com [52.101.67.54]) by mails.dpdk.org (Postfix) with ESMTP id 17A014029C for <dev@dpdk.org>; Mon, 22 Jul 2024 13:59:21 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=Oh6/a1LOvoJHvOJbeMfNbYXrxVbD74qSEg2sQGz2/sXGq7FgCc9wL7zjHpVUrkgiGB8bBDrnKoJqOO9Imx+vTtmxL23rWwKf1EhkSvTNRkFl4awg5wW5FcqGlnn41rj1ZqxT/Yhp/BSY3kSqfD7NdVPHKZK0FKT0xLKhv6ggmbMS0oLMWI80YLwXYj65kDiBrYg9Wgr4hQkEGRuO91C5b/TtVS9+lApccwHFGUlRNmLELk8pFVX+vCY2RpzMAO4ZmAKlgXR/mczJW6KnI9OCCwOLwkeF4e+cv/NFo61hgyQ++lruLBJig/UWGH5xc6QMTUSEJtHwplOdHVLCocJk6Q== 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=JaxRxahU3QaZAJZ/ihNruRikbsiV3STsZrdgg2c2nMlXPKh7vEjikyu/gqlQbQrCYJ4IyLLj8InNmGYtBAaRHl2jJdS9wnIgH/cL1x/r8qyGsTtBVc/pNQ1wXbR4fzn/XtW2ow/sGpgSmjaJh1GjuzhFPLqVFAG3Qas/FaPR/eW1monXNOmCFkoeZt2TBUSY5wHsBE4xO2820gEFEjDZPqUkS27NrFJ4J+LIYPZUemmH7lINiX1Lk92tcB9RKbZGBz3VwHHp9zy2vsy0cLY6kjaqAmj9vl6ljr8Wlar4SxbJSvxdpbUpvjUiN7fUk18rf8FuiIm16MNJZ+d8z2rAXg== 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=4q1fxoQiPsmfQAfJiuVe7Z6muFKkjz958KbTBYfNvSM=; b=OcRXsVZ+RE3+VzaWnKsA/oDIeVmLSzFWZsYrWCv6QkelS9PUhFDkunGhx3i3I6FtbZgHPDeCY5IxwLLNORa2fb3F+7Sz8H29Oc0+iYBnCsfpLW7LIs+M5lrcub5G3OezH3qMqwyAnqKDJLI2nDyIKcTku/zGWyk4ZZJcgzRpuQ4= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=nxp.com; Received: from AS8SPR01MB0024.eurprd04.prod.outlook.com (2603:10a6:20b:3d0::24) by AM8PR04MB7970.eurprd04.prod.outlook.com (2603:10a6:20b:24f::9) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7762.29; Mon, 22 Jul 2024 11:59:19 +0000 Received: from AS8SPR01MB0024.eurprd04.prod.outlook.com ([fe80::c634:479e:8f8a:a325]) by AS8SPR01MB0024.eurprd04.prod.outlook.com ([fe80::c634:479e:8f8a:a325%7]) with mapi id 15.20.7784.017; Mon, 22 Jul 2024 11:59:19 +0000 From: Gagandeep Singh <g.singh@nxp.com> To: dev@dpdk.org, Hemant Agrawal <hemant.agrawal@nxp.com> Cc: Jun Yang <jun.yang@nxp.com> Subject: [v2 10/30] dma/dpaa2: limit the max descriptor number Date: Mon, 22 Jul 2024 17:28:23 +0530 Message-Id: <20240722115843.1830105-11-g.singh@nxp.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20240722115843.1830105-1-g.singh@nxp.com> References: <20240719100126.1150373-1-g.singh@nxp.com> <20240722115843.1830105-1-g.singh@nxp.com> Content-Transfer-Encoding: 8bit Content-Type: text/plain X-ClientProxiedBy: SI2PR02CA0025.apcprd02.prod.outlook.com (2603:1096:4:195::21) To AS8SPR01MB0024.eurprd04.prod.outlook.com (2603:10a6:20b:3d0::24) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: AS8SPR01MB0024:EE_|AM8PR04MB7970:EE_ X-MS-Office365-Filtering-Correlation-Id: b181bfc0-796c-4b49-703d-08dcaa45b7f4 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; ARA:13230040|1800799024|366016|52116014|376014|38350700014; X-Microsoft-Antispam-Message-Info: zAkeLBhp6rDfwWIEaNRh05ZLI8TY+pBhAKXFUpEa2YszpRoQ3rfYBUwGj1uzGILhegs+Lccadmb1paVXSQj7ZSgBSOxayTDennnsRXunw3v+n3jYrLAWvrwGJywGgO4bfDx+T8pPw93fNMnu/NIXS/c9MfY1OULMxkPQjLYQqQbpFNJa56B9SasoF3gTV0Pd03p+h3U0g42PriB5O8stu04C0vfa51Qpe4uIeYC0t5exdkS4zxiMSgud7V5ewcFQo/x5BgRjd9YXNGqNvwnIA555b4dCwhfpjEr/C7/9tXQ1qG/M/U1u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HZvKKDJyPwI+7WP3R37LcMZIsh7g== X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:AS8SPR01MB0024.eurprd04.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230040)(1800799024)(366016)(52116014)(376014)(38350700014); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: o+WNO71dDKCMaXhgU/nZQcn6X28XYRNhwr2+eETAkeIQVuS560gvcGAm4j2aRiHnq/xjMIOE7yYab7Mk39ODlOTQkGI2ygFLh8Fn6+uWEiTy84PnrLsyw3cXitEAmgCJodkDVmV5rL+uCeQzHZLK0a0DDlM1Dja8mUHVPdlY17Rpa92BK7Nm17mvXPTuAERAWFJxa/gaRVtL47GaFuOzhK0XLKIVkODBIhEB4xoeLluVMNCtxPgVmvIfAti7+/n/oYLg7JUXgxoLEts+VlSB+vKi83lNADKNr7buVvzFuMvSOsC4MNWilvycPYoFm6QTf5pX6YyzBGsn33WtHbZapGL4Nt6kwgQ/AVN9i1vag7pCX52SDUPZVRBNCMirKQdPFxeDRs5NKsKIUUAKVnrp6dHxV81p2Tt/PVou+eFdNnOoFJI2pz4B4gfwonzqSvi2F3kXPjb8idq9YOzDHObvOOqsNziU3l0+d5SK/AIIvwZ4EhjZwUj2aVYbWVSCMDa3OJO8s28/HCUPUHnfchyI8xuNyMnRl2jphdg0qbnAPFpyG2FRduVmjPtKqqa0qD+Mcpa8g+c2ZRHFpIBwRNNhtpu0yNyv/htyiV1HS0oNrHM5OnBIzmQfsM/wuKyPUuxMCyvgQD23BWdeB2/wBgEaxBy4hcxYqsF/hcdP6vcO0g2eLvhuLlAqaPv9RT9WjZS/mE/Wz9kP1/eP5Ecyt/K7UaRXAQwJjsJeqmAEFzEZbDhg2fxThvO5oNGLgi/I7t9yCTiDfibEHz5qUqxo6vsmwf/oaEsHVY4ZH3PqA3REoX4Gb0OKhTJrhXDfm4yVSgGJLokbdHqh698ceEh1eI8CxvZhgtNfa0kD2ThipLUcQx0J+a1KnaX8i1EVeZS9Lvc4Q/ySgEmlXaYNU/SEsGHWB07xNb4f5h3tWG69mCBgposNS9A4i7m+7pdWVvaknhsKVHSN95oi/aT7NPAguuXSB4HNriCG5HKyjaFYWhvBRIWQ9jdRjqH0mwl+0J7eTw0jS0Ve+J5GXiXlLJzy9sVR0+duOUiANaFX/LQ3iwFIF7BtRag8GPUj6XZcELfSBrtxNRK3L1fYkczCTAG77+da5Deh3onMp6cRaWJhm6QPBA6fy7So8mClnz08jiMubrKtMuPSO3cr9amZW/HBDNJP3LvomPesDNdrRD0xQz9vpB4QduWb7Y4CIiPa4s1w06EvHw/MuOUnOjXjzuehih7rojdtYaOcHRDjSTNFqmNFw5BuapKiVGekjMz/e7r2e9kg1MCUxaQ4/lkLOdFCCv5/ISYgVLrImPkks9azr/r0tNkdQTw4UDQOA4ovbOniKaQEAcZ2TikGHFXCHu29R0WBe5h3jRq/kmwrgdyrhKwpVi9F3Ff9RhYwuCW0iiGW6V7jw+AQvhApzWC/NdUm2gxAi8QDfcmN75vkI/IHfHYqRmTzDz7MvmLKjJZel3ZgB/HUGgGOhvPBBgqq0k7J1KU2xb++A7Xdpes6j3UlLC1ybBKEBnVQ93VfFKUHlPfuU7nmz/HmDFI8q3s5UrEukvkK2JsT/yfu4drlNaCws8oz7FzJy7n0p7/Rdrb5mnK3wuuk X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: b181bfc0-796c-4b49-703d-08dcaa45b7f4 X-MS-Exchange-CrossTenant-AuthSource: AS8SPR01MB0024.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 22 Jul 2024 11:59:19.7907 (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: Y6b9TMeDbH2jxsW/le7nQ99ciJny+ji2EJOELBlUzmEr1rWo+l/skhdpke7sm8oI X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM8PR04MB7970 X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions <dev.dpdk.org> List-Unsubscribe: <https://mails.dpdk.org/options/dev>, <mailto:dev-request@dpdk.org?subject=unsubscribe> List-Archive: <http://mails.dpdk.org/archives/dev/> List-Post: <mailto:dev@dpdk.org> List-Help: <mailto:dev-request@dpdk.org?subject=help> List-Subscribe: <https://mails.dpdk.org/listinfo/dev>, <mailto:dev-request@dpdk.org?subject=subscribe> Errors-To: dev-bounces@dpdk.org |
Series |
NXP DMA driver fixes and Enhancements
|
|
Checks
Context | Check | Description |
---|---|---|
ci/checkpatch | success | coding style OK |
Commit Message
Gagandeep Singh
July 22, 2024, 11:58 a.m. UTC
From: Jun Yang <jun.yang@nxp.com> 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 <jun.yang@nxp.com> --- 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); }