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 59C9445ADE; Tue, 8 Oct 2024 12:59:56 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id EC5D640ED0; Tue, 8 Oct 2024 12:58:48 +0200 (CEST) Received: from EUR03-VI1-obe.outbound.protection.outlook.com (mail-vi1eur03on2041.outbound.protection.outlook.com [40.107.103.41]) by mails.dpdk.org (Postfix) with ESMTP id DF1FE40E1F for ; Tue, 8 Oct 2024 12:58:44 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=N3OPg9azRJwfSEqyrG9hDUmEqzT2RpAeM0Max1kh4JaSjj6jyHXFj/V3u9tCZSl93HvekFh4HBzMseVeUzBLsnDbFZ0ZSjYd3lX2uesYBcvJ+T2fkOFR4Uy8U4aXTWLDtEmmpxrYbHL/F2GtOab6G0pSrtxzhYeFzwBu7q47QvhO+Ryxa52f+xhumNLP1djEH2hKJhT/zL0IwTVbVKaeF0oeiRYUrGa0XW+2vmEzthB1tB8RVdqROmLdnZJLVRERaf+Ph6c9dDQu4tFJBmcM39C8IH3bQlqPemMqwUkm6UN35IOZUq1PhevnFS/b2YFQRtDhM+5fEkvWHg4h2NFtSQ== 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=9x8ZQrAULZvgdejyokOXiDKn9jGuAodRlY+QLURSOS4=; b=QpuPTjQaR+0hyeXIU+4UQDe3OTryx77FKWz36oqoXaQqsFabU4fKs82O4wei/eEjzD0SrPtkHaqgu1RnB4BwlSJ5NAu0pAikaCE+pttyIYYeqZ3We98kXUlZMGI+yqPjcmxwHLhwcG6SQ/aCIZlGjLpbSy7FSvZu79jTNswUa4Vk+FCMDexyNPQvJyUoZPfwnmbU3D1tplbHmVML1Zlib7eB7Il0u7yto7Oh0kV1E6anzcw+EJWlUbd3Ei6RS8NSvg9olskJRJ0WtIeD4XqMmml61xgBvJE2uy8RbOtAbsYo4WsMSYqJdi4inMzTmvU9GwDz1Vj1dzyFuWGtFo30mg== 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=9x8ZQrAULZvgdejyokOXiDKn9jGuAodRlY+QLURSOS4=; b=WPvwO4dSUxifcZ4OpFEH80/xoG3sRikZjeH4rSuo4deFfR+AK3kRHvP9QZ6cc5C94Gq+vgzdprT2jLLUcQDHtzmrKe0bjQ6eatnSuQ5p6TVhBl9kPlZtmcsBwmWRsftUIX5TVt/RWYRtNy0etsmUEWd2BnvFKfTd/WfOXudER0J+on57/pwV+mV+6NsMGeJgZ1tRYeDpAAhbwuAL7p4og6ROCc4l6LJYRrrSch9+EOAaCiRxeu0huGwxdORHAw0vA6UaUFFx+ETf4FOAm/8LVf12Un16YTTk6evj8tCfsVhVogB6daecFBxPqdQr4kh/+jT2HtFg6EA4N0PJw1udXQ== 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:43 +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:43 +0000 From: Gagandeep Singh To: dev@dpdk.org, Sachin Saxena Cc: Jun Yang Subject: [v5 10/15] dma/dpaa: add silent mode support Date: Tue, 8 Oct 2024 16:28:05 +0530 Message-Id: <20241008105810.1454133-11-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: 9eb9fcb2-0208-4247-aa54-08dce7882c77 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?DjqhWEP0WuOqKwOWXDZx2JpbwE6ACDMUw/LzBc7Oo0EQ6jdkJSE3S6UIHXXm?= =?us-ascii?Q?dGVK0j8dvBNktR3zlhvbZ/+tnLjqEuePtcxpG263f0TzPgMG8x8koXjaplE9?= =?us-ascii?Q?3yXzwT1mS9ubEQkvQA8hJDj7Jiy0BkdyjIcp1wP2z0FgOxCEPNqi2HJtQ2Gx?= =?us-ascii?Q?GT2sflyggiIPnunM3SfaK92hf6GVQdJyF+ukuQxiwBKGFGyJWSjuA050/Twe?= =?us-ascii?Q?KEF6jAYUw71nwu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?Q?MaXCuLmAfmg05wwBU8lgXJu4mXBwjJwJWf5QJnOxxX7m5YpCVMkIFSVhlY5l?= =?us-ascii?Q?ZW1ZprXLprxy8Hd36KoPFP26x52cm9fxcvEfmzZPfLAg/PqIRmESylfICUZ8?= =?us-ascii?Q?WLdtYFjyPHXRkElEQpe2EYGi9ve5vJ6Wqn+qS+rd1fHUOuZafad8UmE5utbb?= =?us-ascii?Q?KENDlkw+KtiHC/N3CyJvVaow0k5YUiHwMJ7ZSLWKbIOyHQ=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)(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?bQf/+QR3dczQM4wZp2pdBA4x+gqHamTPMCw3k17iCHVptuUaxt1gCAprqoN3?= =?us-ascii?Q?KbNvMzHWkJ3Se+gSH+H2bI8DF3vZvTm6C1Ir5LvL9dQaqFWAgxHOCKOHwoVK?= =?us-ascii?Q?Ys4L1c0v1BV4knby/mpZXCplKfDjAF2I/7Y1SsBHocWkBnAhy5/xF6zfMMNB?= =?us-ascii?Q?7VOPNpzZi4DWSf5YNZVAeo3bAfzmEqYUvev31yvFDYonwJ/NNP8uYZBk3Zqq?= =?us-ascii?Q?xcABjtLCOwFJhjLEUl/Hapq95B4J61aPHqxQAW0rpVYARI0h6n8TVYGWnsAe?= =?us-ascii?Q?SMOdhDBMW7QM35RsFxXuDuAnHnTRf23RwpZhlFTiEAdWRhaAqI7KsBX9zZmM?= =?us-ascii?Q?KDUlBsJFOFR+r/eoRUYqyu3jYSLWKp4utEi2efFTLtEYJ/kn445v41SIap2C?= =?us-ascii?Q?76QjAK85851ppUDDd0tK6ag2vn+A93D8sZL0N1lD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Fswr91555vkz3Z3z9kKcEVM6ZFOMCCn3r9vfKyZLt8kjaXW3pb6ORumht1?= =?us-ascii?Q?xbb9X6zcF4byFnMwUMwKnw3ECJtT8Xivq2KvQuIICTfWbxt74wSJXBO1me0+?= =?us-ascii?Q?UmUGhYxGZr7NcBhctP3wO5XZ2v8QeNpJ6NVOk8DBjDkYvBE4RgSkMMgPeZOt?= =?us-ascii?Q?+7AGo1C+gBK6uKVFu6gjDHtZ36x+2fUPhZfhXmQUNcHslbJ8a8KXH/yJxoxv?= =?us-ascii?Q?2drdAFE5olK1bCrh0vU=3D?= X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 9eb9fcb2-0208-4247-aa54-08dce7882c77 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:43.0493 (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: gVn6scRaGNUmJFauSprSp5DhQ4MX+p0X4QeMvLHdTkCKTUUADKk3tRY3Lbjd40e7 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 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 94be9c5fd1..02f8685c48 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; @@ -575,9 +577,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: @@ -622,17 +627,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, @@ -877,10 +899,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; } @@ -966,6 +991,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)", @@ -995,6 +1026,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