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 625D845B36; Mon, 14 Oct 2024 11:38:25 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id E0E6E40A79; Mon, 14 Oct 2024 11:37:26 +0200 (CEST) Received: from EUR05-AM6-obe.outbound.protection.outlook.com (mail-am6eur05on2056.outbound.protection.outlook.com [40.107.22.56]) by mails.dpdk.org (Postfix) with ESMTP id 8C34140662 for ; Mon, 14 Oct 2024 11:37:14 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=oqRdBds2IWGAn8ppEXxhKX8DHbe+MQ9CVVlimP2zB6rAcS3tTIb06eBtTmZySeAjySDLJ4YSi3Wqp9XwpWeLpTNawb78yGdg3us9OIbr+aCt/RvJkx1Zx20VzVo8ld8l+ucnf4ZsxoTweJ8v87RbrMZXLIbwMwooMjfs6La1snZIs02lDWz6wyLLvANynr8aS3mE+lAgyxbt3jAqd0e9BKHAq6+IbZpHX1Grb+d7etoX6EgGTf2TuKaRSyUOrtVk8BWH0VbZ9PFRcJRA2KL5wOll8WzI9W+Fb7blyL5hX2FRng/xqzOwU2d6+cpVYn4t0fyxeonaRbWctKO7vXFqgQ== 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=n5a6Fsan//A6PEVEXlr5f18VrQnwANVg45iaRYhDaWX8Gqy9dAR3NdAwfZNXBwnHmufJWOcDnENtTKTF5uBlrBgUgeuxQgBVIOcPsLKlX3xZoORQl6Nm511LURrEbnD8LHfbXPm4+2GlspFHC/HaQoY62RXsDvzQae28h7IaDlIGCVlPvrj8BATZSyr5DbbIInBRtZcxzLAx5V3LGsSnZE31G5CurHqrxrFqXHYtDilfYmZB0/krtQxuqosEt/Us9iANWCIrk5yYNtoao2xnOWUEdYz7yui5t45wZy4eidbmrn0xxiKFnlevTLNIAbDLGfsbaeT/eax/0mqBNRqvrA== 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=NT1LDWIYVKDxGaqtknMaoB+VQlPH0WobmQFJ7wl7X+uhIVqIVqB3gt38L+krcPnz2v3T0pvOKxvUEqSkd5DE8yGt6tTJtpHHXGtP1S9BZIXi4U42NR1OJV9k0w4YUXZWYkvZJR5dbnFv7lt70q3HV3Nns4rFFgTKyty4WoDhrjTgeq1A+k2JjpFD4v5+T5pBfawCPSj3pLzrvHqIY8OulGxnVfW9TVDceiW5itrbWDsLjcNytM6URMNRO/ITXMWl978M0ngf01S7u8jiRpqtc/FXXHw5KP4I++uEX51tzg3pOD9CrCh+YqFhZd0x5D+iXhe5DyCnLtbW6LlRvR+JYA== 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 PA1PR04MB10580.eurprd04.prod.outlook.com (2603:10a6:102:482::12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8048.25; Mon, 14 Oct 2024 09:37:13 +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; Mon, 14 Oct 2024 09:37:13 +0000 From: Gagandeep Singh To: dev@dpdk.org, Sachin Saxena Cc: Jun Yang Subject: [v6 10/15] dma/dpaa: add silent mode support Date: Mon, 14 Oct 2024 15:06:34 +0530 Message-Id: <20241014093639.553467-11-g.singh@nxp.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20241014093639.553467-1-g.singh@nxp.com> References: <20241008105810.1454133-2-g.singh@nxp.com> <20241014093639.553467-1-g.singh@nxp.com> Content-Transfer-Encoding: 8bit Content-Type: text/plain X-ClientProxiedBy: SI2P153CA0033.APCP153.PROD.OUTLOOK.COM (2603:1096:4:190::21) To AS8PR04MB8198.eurprd04.prod.outlook.com (2603:10a6:20b:3b0::14) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: AS8PR04MB8198:EE_|PA1PR04MB10580:EE_ X-MS-Office365-Filtering-Correlation-Id: 3a088b7e-5de8-4876-f4fa-08dcec33c89c X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; ARA:13230040|376014|52116014|366016|1800799024|38350700014; X-Microsoft-Antispam-Message-Info: =?us-ascii?Q?GjQ06tn7Bknh/a6+hmsDp3fcjjAf/OnnJW5Cn9InTAKNel5PghAk7o81UlMB?= =?us-ascii?Q?2ndKlkc1cxRDeC7f02xJ1VtS3WAHGYW+PlzqpLqYZ227YdMqEdshBzL4s1z7?= =?us-ascii?Q?OHEWcX2xQ7eloO6OyH7Sjykt9QX2IujllW3Bzy7lvFu6Z0PC1tq7tat9Lpat?= =?us-ascii?Q?W8BMqYpRmNX1hRMKZ1grfirl5LKS3VqVxZXQOl7zcjw6fv3QwYPHrp9S7eDs?= =?us-ascii?Q?K2c916JDolqlI8u7i5T+4/GmK2wR2Gtwv/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?80ZwmiXyCej8fDs95pDgzk1hMKM7gLmRYeG2CtE2um3+WzMcXKU6lX8f7z9a?= =?us-ascii?Q?sqzMU12eXwWdea/ge++T5WmjLPD4i2T3sGy8J0LEzwYVfeFeYv8LbbavUdRU?= =?us-ascii?Q?AmS6WD+sPXPW1Z1FChNdPyGhO+hmu8IExMWe0IrKxJ1Y/EuhZIpXs9G3reMg?= =?us-ascii?Q?S5BZtYNVAOgrDvyXfRPZg3pmjtNfLAKF5vEU8dcwbfD2dg=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)(376014)(52116014)(366016)(1800799024)(38350700014); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?us-ascii?Q?9ibEz68YLksrhJ9A2TI3nI/wFoTPbuVZHlpX8epEk81BbPk9HEO4Qhb+MHmt?= =?us-ascii?Q?GO57+Oivu0Tm4+KihOzc+RnGsgq82+tBtDdBXSBc09qeS1+okaUIlgRhy710?= =?us-ascii?Q?JMOC/k7EPUl3lWnFREGLU602hpyB79IbJ3fPHxCNaSUQzecGAlM2XtuePA/g?= =?us-ascii?Q?eNWiKSemdmwk2uSgk1mh1W1BICJaCsAFBg/743SnKarFR62rSX8JVUS18ZbI?= =?us-ascii?Q?1CkZX6cpRvPQJEeTLr+TA0FH+/N3lOkBjuDbW/M+TgKcmUbw9R8PUNvrAqdP?= =?us-ascii?Q?oJmzKWSADofY62kc7a2pyQt77h1le765Gzsptn3thAh9Y6SB0OuPizMRQLtE?= =?us-ascii?Q?lgPiutHWwTorcakcIBZfT5bDZO08srMCN20z4Gts3/w1Js4TqeecpkJq+adK?= =?us-ascii?Q?mCUpXm6LglKwpzLY05tY1/orykvK3HjX9xO5rmAff+zIT914KPPYdTGwjQzt?= =?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mMGWZwMzEV46IrOy6Bfa0T?= =?us-ascii?Q?otPwITFMbmFU7JGo05gjiiYz1QWYOqv9ihZb6Kfudvd7z28CPkJlQPh8KiVD?= =?us-ascii?Q?LzthUlfGV9sgwOEeR2EFDCcCc/mqCwzq0am0XWsKBJP2DN8gW/cESRzB+IKb?= =?us-ascii?Q?VGiIjZsnSoovvkv6SP71LpESTs5Mgieu0o28++Mkzv++Wk5OwO7XeqXjvvd4?= =?us-ascii?Q?ebL+WtwmzC4f4kyfilY=3D?= X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 3a088b7e-5de8-4876-f4fa-08dcec33c89c X-MS-Exchange-CrossTenant-AuthSource: AS8PR04MB8198.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 14 Oct 2024 09:37:13.4679 (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: BPTzQgfKJC7+E5kcOj78+4Qjezd61dAr9TPvaj1/ssMS4Df76eHPxEl/kZlIAJ+C X-MS-Exchange-Transport-CrossTenantHeadersStamped: PA1PR04MB10580 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