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 4AAC345ADF; Tue, 8 Oct 2024 09:26:09 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id A13C840DD3; Tue, 8 Oct 2024 09:23:49 +0200 (CEST) Received: from EUR05-VI1-obe.outbound.protection.outlook.com (mail-vi1eur05on2044.outbound.protection.outlook.com [40.107.21.44]) by mails.dpdk.org (Postfix) with ESMTP id 52C2140B94 for ; Tue, 8 Oct 2024 09:23:45 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=gMMWt5GNiQd/aa0WeU3KxRh3BCQ97Z1tSi2JLGgS/jmVswq8Hswg4qrceE8/j6nuoy57zfoi0iroJTezSGWCUmK1pEK8DJRMXppl1TNmC1iXcSS8awjrB1mgyQTcmebX7wzOBJR1Tp+6SdSKS9d3xfjeVbRDWrnx1ye76zYCuzL1yM4tF0ozVuqSpWRt8jU7H6K0KrfKyOGM1JuiCaTQi31SUaVFkmbhY3aKdBu6PoTwjcdzXdl8ODqK6z/yiAbhxACeSxCIpBTKi/m4pDDtoacnEEd0pUr0Xik5Q7UaIx7Y/AVXjC3ujqqsaSRzRDE+GpoV8xwtJnRZepAn8gfC1w== 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=1MtnHXCeouFh8kX1fO08y1tRjBDDoQm72WKx5lsaLcU=; b=Tb8LFSCBcJXVL4ncNxWsY0Dj2RhiZxKIlU9xRRC9twN+cZXkXZjalur8JOXFzFEEqccuH3FC6MPxmKWivDUHbeuOZVms2hT3qauftCEXS/t7MD9ypHXe4r7LZLu6FkueUMZ6X8Nvly7obdcMAq9iF+Ai9zS4Ei006/WkXyHgelM6LbzriwSEd5uwhm2asGiZj4Ps+WYNY1Rnghk8UPUoTtGMWDL1/hjmlKCyYHHbp5g+luSZJ84ByNQD+rGaNN9YjLenxx1UXWg94ucld4hvzViAZRsWJxpJMAOBf/amhKz8SGIP4NdKKQvM65ho5bRMJ15ZvAuxHP37odr8tZPDuA== 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=1MtnHXCeouFh8kX1fO08y1tRjBDDoQm72WKx5lsaLcU=; b=OqaMsF5/bEXOMHzasJOW+iUkPLVDNpqe08zFUTMCWIfuI96Rl6NDtAdL7A/XRTroUqnLZ39dbu+z4/ShHoHanS/LT4hzQvbS4utxUCdZqDUHuucqg1xdet4GnQ63HIv4OqdY9QmmLMVsskFvn1PAwQk3hCS/FIeaNrz0CvWd9cteb4CiR3xvSr4G9nUOmNB6qtb8T/DprZK/OgdlJcKFeXzo/FQxKHzUkgPMM8E6ADjbBFqwwaoVI2rMO12dXi2WTm1L9dtjg6y+YrKzYw5ciX7Sa5+kBoUOIWp5CvdGmh+YOwVR/Hj6pNnN4rgSAOwRkUDlmKgwNlqlbHI/ibTTgQ== 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 VI0PR04MB10829.eurprd04.prod.outlook.com (2603:10a6:800:26b::16) 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:44 +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:44 +0000 From: Gagandeep Singh To: dev@dpdk.org, Sachin Saxena Cc: Jun Yang Subject: [v4 10/15] dma/dpaa: add silent mode support Date: Tue, 8 Oct 2024 12:53:01 +0530 Message-Id: <20241008072306.1256445-11-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_|VI0PR04MB10829:EE_ X-MS-Office365-Filtering-Correlation-Id: 9bc8b8d0-79ea-4a56-6c4e-08dce76a2426 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; ARA:13230040|366016|376014|52116014|1800799024|38350700014; X-Microsoft-Antispam-Message-Info: =?us-ascii?Q?1nbDnhq7zVuDkSIxunSfHF/E1KXyP5ZZwSSiGaVByNlnweHZcjc9Csv6PRCB?= =?us-ascii?Q?KcSnLSUAv/7L0ApddS2pxIkzDoC222QVJYSpaC5oDJlgZ/0mM88tTzMVJRlm?= =?us-ascii?Q?puPHwtrc/oiE4+6INqWoUEjLQLZKvzyiGu3B4Tub98pwPyCAKU8KwxuIEG1F?= =?us-ascii?Q?+czSzU6uyZ9EAjx5Gb/7wCBYDR8ccRO8El8Pq16CQX4W04yFLhfTqoH1eKV5?= =?us-ascii?Q?HF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qrqMmzZVGQMAI/VDso5?= =?us-ascii?Q?GvVjjj4DDy1DTYVthQEp5BJ0/xBr+UcFosRodjXU5CbS95Z0Y6SDva2G6FKz?= =?us-ascii?Q?xQNXCjcxYk+WQJA0SJX0QQzRoEzkKbYlMEcJLAebxU1FrKYUhcv45M9HT6k6?= =?us-ascii?Q?PjkOS1oKoBqfBaaZkCcFd08ety0z3E++fPWwsUo9LGSZmBhjoQpB1IpyaOdv?= =?us-ascii?Q?7xDPHJX9BO5NJSVl5Ryh2uzywGLqxvOXPqYLnqCeWZPUTg=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)(366016)(376014)(52116014)(1800799024)(38350700014); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?us-ascii?Q?cB5D5dlU1kvP82e5rRtero05Jn9RMwIDkxRnh+Rl6fhnM1DxKC1cSnWY1PiW?= =?us-ascii?Q?5Ja4fG//atb6zi5dBj52Jo4CcKcF98lhppWuUVteoKoHa9djqHDmpI+ssE3y?= =?us-ascii?Q?+QVBZawgpVcq7FjtyPGYnimhzOgQ8RBLaJP6PMExvIGCafkkcRjCxg365dfF?= =?us-ascii?Q?wNnM/jPoUv5ad9G+u3qN8fgS3d07fZSSPWAEzogPT0RRMocXlvoK17npznG6?= =?us-ascii?Q?VB8B+imT5ZtMy+Zy99AnFg/vwD7zaNLjsszJ4UayLNMMK0o/nC35xhrE+U+p?= =?us-ascii?Q?sVOjGRLWl2hJV00THpeKaGg+ClQ7zR4SpdAkEdfB98Tmx7Ho4gjq3ihUD14h?= =?us-ascii?Q?jXW8gp3qBzb19GNZkv200TLkmQhhdH/bYFBsRXw8Pnwl51ciaaoTwdZ8Zxh/?= =?us-ascii?Q?+FR7wZEoAblF7Sq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= =?us-ascii?Q?LNCPbG9v4uSWIKS0U7ZKFDyuHtFqPBs1VhSYbPmDwQpmxmcoLaxdhO8hkDII?= =?us-ascii?Q?VyTj9Oj4IuM7seZX4L9mhVl0fLbhNVO5jmYKHoyfyKtWaGG96qD7JfuiD7Bl?= =?us-ascii?Q?IRv7ZvX+1N4YZSWpO5qZddlIj0U6cLeP5GYb36lHreGYYGWAHBxAnKfnN5Gm?= =?us-ascii?Q?5nCASH+Sani/rly0bcynPItUqxgRVRCJBcmNZdeJwKpy2mwTQPkiUb1eE5Mj?= =?us-ascii?Q?T6LvW/AGYNfOOwWJuQU=3D?= X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 9bc8b8d0-79ea-4a56-6c4e-08dce76a2426 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:44.1114 (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: utLlRjtqOWywD9zG/0GRaQ2ZG9i2Lksh/VX9tyN9chInYWLpr3BHNbOUzR+51dWM X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI0PR04MB10829 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..041446b5bc 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 slient 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 slient 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