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 DDFF445B40; Tue, 15 Oct 2024 09:15:42 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id EBD4340A76; Tue, 15 Oct 2024 09:14:52 +0200 (CEST) Received: from EUR05-DB8-obe.outbound.protection.outlook.com (mail-db8eur05on2066.outbound.protection.outlook.com [40.107.20.66]) by mails.dpdk.org (Postfix) with ESMTP id F016940A4B for ; Tue, 15 Oct 2024 09:14:39 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=c8oPWztCtJRpYUxmz4AnN1H4ryE6HxBBbQfUf41eF+jdIdVxBXeHzQeIZX9y/e4oUiKFDVd3mTuEM8aVZjfBnm3ZmF9kT5+BamWKX7sY/g7Km1pDxfl1fAQDy+8799GvF1YvcUlK/eYrZaeSY/E6Z9bLByak4TGiU5MyMsSO+fOh6BXre1uDsPbiMITNvbzcXEWZ5acF6MyATzflq381w9VOgsWo/lwfBKbd4vXpNcRHGLEQFvE1GPeYGwes1RXBygzcyvymyVV6NJvkQkhYY9nqhKuwPKNVbQcJb47x/twDO7iDXvslAymc+Gnh6M5JT+P62fSxgD4Hz+gZX7w1lg== 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=wdgi1+5MQa6j6MIxHakHljkykUgCtHLJQmrmraOaGH8=; b=IKPH9O0z6+1PhbiRWYLZpidqE+bDX6qCApC3zuXQ1Zimp93OMgmYcpLvDbc8lIEh7Yw2aalThqQh5C11mzmwhkEOqQewbTEezH0cTrU/60GpdA9JY1OZPn8UPOzPRZayAyZTTHuxrqzL7v7NVzF0mdo0g8SXrZGQaZ1nhd9iBKSBUnNA+BiQmjPRggF6o6hwEQ1G+xOb4FsF0iRBzBl2uG8SDUOWfOH3cYe0MlNEFGduPK2bHXcL/g9yFcRghXQiWT23z65QdBSMXvGLnZO7TQUFlejuWoTfpQZHe0yCsjIuzhAYRN9UfOMVB9i2UIghIC2iyTQzjFlgi4TIrePtjw== 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=wdgi1+5MQa6j6MIxHakHljkykUgCtHLJQmrmraOaGH8=; b=W3baBGsFehwrjldYQeMPD7p5mPS+JWT/AHfk1otGEy2X0UkXZdRMFR5qRPvCrvt31ERPNCoVBoX9KgzcChGkKWHsCyE6vdnOmONNmF1xRNf/DCi1vQD6ZkFaTvh7Bp0g0diVrUGJVtXICWjBxrixUWpgFZ0DpKGXNMrM+q359U8Edd7soz9F9uXIwqTE0YYSCA6OitGdKLeWuOuSvGKHcY6KRcxbnh1rvJiWUXiHQfofwUG8DjEMKDwzov9ocvYsvGYUd7Y7FunOO6pdmIUWSzkSq183befazgpjK9rWaTLCVNeV1ywRRyLF4YROyeZyzkfV+JX6wpHOmz8VPXnBgw== 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 AM9PR04MB7522.eurprd04.prod.outlook.com (2603:10a6:20b:282::6) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8048.22; Tue, 15 Oct 2024 07:14:38 +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; Tue, 15 Oct 2024 07:14:38 +0000 From: Gagandeep Singh To: dev@dpdk.org, Sachin Saxena Cc: Jun Yang Subject: [v7 10/15] dma/dpaa: add silent mode support Date: Tue, 15 Oct 2024 12:43:58 +0530 Message-Id: <20241015071403.1940833-11-g.singh@nxp.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20241015071403.1940833-1-g.singh@nxp.com> References: <20241014093639.553467-1-g.singh@nxp.com> <20241015071403.1940833-1-g.singh@nxp.com> Content-Transfer-Encoding: 8bit Content-Type: text/plain X-ClientProxiedBy: SG2PR02CA0058.apcprd02.prod.outlook.com (2603:1096:4:54::22) To AS8PR04MB8198.eurprd04.prod.outlook.com (2603:10a6:20b:3b0::14) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: AS8PR04MB8198:EE_|AM9PR04MB7522:EE_ X-MS-Office365-Filtering-Correlation-Id: 6103b8b4-2173-42f8-ef8e-08dcece90816 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; ARA:13230040|52116014|376014|1800799024|366016|38350700014; X-Microsoft-Antispam-Message-Info: =?us-ascii?Q?bByfMKrFTH/b3WMxSuLWbgWHkGjuvg3UO+M2xhfAwaZbBhb18elas9lRWmq1?= =?us-ascii?Q?h0mANmrlioV9Fc4XO+HK9IDm4o9uYE7nDI9Ds6DTNEDvNEPoswwnARBFOD5I?= =?us-ascii?Q?OmM+bWl57aIYXFmkflI0Ya5baYQhg9M977QdNs6iXUpN2N9+RaYVgR2+ZocZ?= =?us-ascii?Q?OT+jYlx/duyhzmY9EcYbqsJ41PffSUWmShAYZ+anMuY//iNESSdDUknL/wBW?= =?us-ascii?Q?MFoyYz4YbybjgM0uACxJUz4St19zTrF/ltUwJDGS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puThqf9pgPZINOcvqp8IqGd22iZ+vCFI6vIXPtQmPSoQoJFf?= =?us-ascii?Q?dvBluulS165/pVXwp6f/R10ggFQwC/AI6lsc0+WReKPT49+T/Nt0CLgzlHmp?= =?us-ascii?Q?pjxG5TuMwxWiN6J7zJbY9USq9G1YcMgkhsjMgm31GBSqkE7Ff6196Et01Bu0?= =?us-ascii?Q?uANgUFr0Hr6MfThN40Aqp+RYk+lABhXg2gY/S9xOYbvonA=3D=3D?= 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)(52116014)(376014)(1800799024)(366016)(38350700014); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?us-ascii?Q?g4bd8sY8EnUeh6cOqn4kAhHdon7nGLY3qxCCrXQAyD2XZNsZk+J5zufO5NHY?= =?us-ascii?Q?b+OuSDDEvRz6vqeHVS8/ambnRWfnCqzDGL787Ej/RxcslRTJpLMywdUZE03j?= =?us-ascii?Q?y1TnJEsDy9pObHJ/SrKAfRai4OlpRXoxL966NWXw9P+9o4faiPCKZiWDNj/O?= =?us-ascii?Q?tJ+yIeGT69wAGkCEChZJ3hCpqvNpNJeJsWktACi3B7PcKMJQYJ4ioUZvoBjV?= =?us-ascii?Q?DMs4M6bOAwyZtF17mFahZt6z/YgI97/B2LD7HqI/WM6/8wfHcqiDSKBOWnd8?= =?us-ascii?Q?yeCxRkUGV0g78hUbUrHTRhHf8CwmdrdWNjyqeBlXeHgjlreZ4bkyth4d19z/?= =?us-ascii?Q?GRwfK9lPds4G9TmiZoe6lYu2KxZaF+yD5na9f80Y2oNbc19maP8dGUR0Kj3H?= =?us-ascii?Q?16xtmNYPvPUxlflAa/dljiMOZeFrucyFuhbU7Ii599+gvKFw2ZYUMVAG1u5/?= =?us-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WfP6XGosHKdrHrUsjb4q?= =?us-ascii?Q?cma3RmBEtFe5L/FmXK9VYrZPsofJvrik+Xo0n/IzUHLJnFtJ2jkU2aWzRMEG?= =?us-ascii?Q?w1aRcWjkc23Bb07l5pU8KxkUXoz75VTG1aoM8oHynxasZ8UO5GagbggoQnhK?= =?us-ascii?Q?Idc7EChW982WwNxY66xe9YMfQ4r5ybxwr5gqTio7veG1CY2GS0UJKatqDwab?= =?us-ascii?Q?T5j0NQRNCGrVRoE+dMY=3D?= X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 6103b8b4-2173-42f8-ef8e-08dcece90816 X-MS-Exchange-CrossTenant-AuthSource: AS8PR04MB8198.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 15 Oct 2024 07:14:38.9012 (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: gkx+lSL2mdgj0/KOweQUreVb+Y0oc868kESfvCx2nZThab5ZuSZvPLCMpe3OWBGH X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM9PR04MB7522 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 add silent mode support. Signed-off-by: Jun Yang Signed-off-by: Gagandeep Singh --- drivers/dma/dpaa/dpaa_qdma.c | 46 ++++++++++++++++++++++++++++++++---- drivers/dma/dpaa/dpaa_qdma.h | 1 + 2 files changed, 42 insertions(+), 5 deletions(-) diff --git a/drivers/dma/dpaa/dpaa_qdma.c b/drivers/dma/dpaa/dpaa_qdma.c index bb0d1a2bd4..3ae87fdf80 100644 --- a/drivers/dma/dpaa/dpaa_qdma.c +++ b/drivers/dma/dpaa/dpaa_qdma.c @@ -119,6 +119,7 @@ dma_pool_alloc(char *nm, int size, int aligned, dma_addr_t *phy_addr) static int fsl_qdma_pre_comp_sd_desc(struct fsl_qdma_queue *queue) { + struct fsl_qdma_engine *fsl_qdma = queue->engine; struct fsl_qdma_sdf *sdf; struct fsl_qdma_ddf *ddf; struct fsl_qdma_comp_cmd_desc *ccdf; @@ -173,7 +174,8 @@ fsl_qdma_pre_comp_sd_desc(struct fsl_qdma_queue *queue) ccdf = &queue->cq[i]; qdma_desc_addr_set64(ccdf, phy_ft); ccdf->format = FSL_QDMA_COMP_SG_FORMAT; - + if (!fsl_qdma->is_silent) + ccdf->ser = 1; ccdf->queue = queue->queue_id; } queue->ci = 0; @@ -579,9 +581,12 @@ static int fsl_qdma_enqueue_desc_to_ring(struct fsl_qdma_queue *fsl_queue, uint16_t num) { + struct fsl_qdma_engine *fsl_qdma = fsl_queue->engine; uint16_t i, idx, start, dq; int ret, dq_cnt; + if (fsl_qdma->is_silent) + return 0; fsl_queue->desc_in_hw[fsl_queue->ci] = num; eq_again: @@ -626,17 +631,34 @@ static int fsl_qdma_enqueue_overflow(struct fsl_qdma_queue *fsl_queue) { int overflow = 0; + uint32_t reg; uint16_t blk_drain, check_num, drain_num; + uint8_t *block = fsl_queue->block_vir; const struct rte_dma_stats *st = &fsl_queue->stats; struct fsl_qdma_engine *fsl_qdma = fsl_queue->engine; check_num = 0; overflow_check: - overflow = (fsl_qdma_queue_bd_in_hw(fsl_queue) >= + if (fsl_qdma->is_silent) { + reg = qdma_readl_be(block + + FSL_QDMA_BCQSR(fsl_queue->queue_id)); + overflow = (reg & FSL_QDMA_BCQSR_QF_XOFF_BE) ? + 1 : 0; + } else { + overflow = (fsl_qdma_queue_bd_in_hw(fsl_queue) >= QDMA_QUEUE_CR_WM) ? 1 : 0; + } - if (likely(!overflow)) + if (likely(!overflow)) { return 0; + } else if (fsl_qdma->is_silent) { + check_num++; + if (check_num >= 10000) { + DPAA_QDMA_WARN("Waiting for HW complete in silent mode"); + check_num = 0; + } + goto overflow_check; + } DPAA_QDMA_DP_DEBUG("TC%d/Q%d submitted(%"PRIu64")-completed(%"PRIu64") >= %d", fsl_queue->block_id, fsl_queue->queue_id, @@ -881,10 +903,13 @@ dpaa_get_channel(struct fsl_qdma_engine *fsl_qdma, } static int -dpaa_qdma_configure(__rte_unused struct rte_dma_dev *dmadev, - __rte_unused const struct rte_dma_conf *dev_conf, +dpaa_qdma_configure(struct rte_dma_dev *dmadev, + const struct rte_dma_conf *dev_conf, __rte_unused uint32_t conf_sz) { + struct fsl_qdma_engine *fsl_qdma = dmadev->data->dev_private; + + fsl_qdma->is_silent = dev_conf->enable_silent; return 0; } @@ -970,6 +995,12 @@ dpaa_qdma_dequeue_status(void *dev_private, uint16_t vchan, struct fsl_qdma_desc *desc_complete[nb_cpls]; uint16_t i, dq_num; + if (unlikely(fsl_qdma->is_silent)) { + DPAA_QDMA_WARN("Can't dq in silent mode"); + + return 0; + } + dq_num = dpaa_qdma_block_dequeue(fsl_qdma, fsl_queue->block_id); DPAA_QDMA_DP_DEBUG("%s: block dq(%d)", @@ -999,6 +1030,11 @@ dpaa_qdma_dequeue(void *dev_private, struct fsl_qdma_desc *desc_complete[nb_cpls]; uint16_t i, dq_num; + if (unlikely(fsl_qdma->is_silent)) { + DPAA_QDMA_WARN("Can't dq in silent mode"); + + return 0; + } *has_error = false; dq_num = dpaa_qdma_block_dequeue(fsl_qdma, diff --git a/drivers/dma/dpaa/dpaa_qdma.h b/drivers/dma/dpaa/dpaa_qdma.h index 75c014f32f..9b69db517e 100644 --- a/drivers/dma/dpaa/dpaa_qdma.h +++ b/drivers/dma/dpaa/dpaa_qdma.h @@ -257,6 +257,7 @@ struct fsl_qdma_engine { struct fsl_qdma_queue *chan[QDMA_BLOCKS * QDMA_QUEUES]; uint32_t num_blocks; int block_offset; + int is_silent; }; #endif /* _DPAA_QDMA_H_ */ -- 2.25.1