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 C9FF645ADE; Tue, 8 Oct 2024 13:00:24 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id AF53540EE3; Tue, 8 Oct 2024 12:58:55 +0200 (CEST) Received: from EUR03-DBA-obe.outbound.protection.outlook.com (mail-dbaeur03on2040.outbound.protection.outlook.com [40.107.104.40]) by mails.dpdk.org (Postfix) with ESMTP id AACF340E78 for ; Tue, 8 Oct 2024 12:58:52 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=dFE42Fww+V4Jr8Nh5RRV4ytasbhEPymQw1X8JCswXAtlN+6T3yOFsyE9OMZSzfio7NdhxyiODdLnHpzLAjEv4eYWZvB2CuHln4ujJNza9NpcX8dSH2JkJ8ovu8/BoW9WkRsLjKfe16xVxQ2FCxE8xRX7jdVQe2q+kB4B2vvmOYtMP1qFZKxey0RjwaN/z83RisWnKVfd6FnjaDeW/vGnGY2fcfkiiDO1ogT9q88wLtN0MFp0XSThV5p/Fhzpa9R98SMijh+SXFoRyWNoUdLhJqnGK3eS3byQx89AqBLsFjVQu61+8zCzbYIC9Op69+ryYW5aDszrjps0QeeO+Py25w== 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=0vzmJZ7Vim6eEBEIYofJBy6VhUk2AgrsE0yADvuJtbY=; b=AoPrSEBN/FYyHv0BQdI2sQG7fijIf2WxHP5x6gDv+whWeH2f4TgaiyO3V+HuhmdcqBk52FO2qzN9BXScx5B3gxx+wiUc//gZt7Y1uVOJqFHSGlObJV5yhfz8DYwOF6wIHiGYUcAG960KaaBan/PFQkuHpFtTlpgIDVXbmzP84P/IRq3X0rHfgJigylycz0BJ3W3XmNtJY3KbCOMW9TUwmtT/QUKZl3Yl28qb6XIbEMyut+eZkLQfQrk4NY11HpXI42MTBWKLice2GJ4KyFme8vik6FnIKF+kHnwV65FjH5K3+1dn9OJbhr0RyJ353GE/wMUZKG64DImb67AiT6aPWA== 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=0vzmJZ7Vim6eEBEIYofJBy6VhUk2AgrsE0yADvuJtbY=; b=GOo96T1q5KZGboKFdl223NwdTkqm4CsaK7C3JN1/n1tYuVxTZwuf3sbz0tkLhWFboWhd47FsjTaxYGexRJy6MnVzV6T5s+0K0uce2eoSDp8HTAYw3dnQL2czp0X31hO3veKDlDfkL7+bF8y0/hZn83XDBfduvWQDibgtYxy3SDEGviwJgvr0iYg7xxpkUZXBxDCy03CT0ZGDvU8zBkAtiE/hfLO+nrez8d91qrGQBkZlMQyWp93/0Bih3RwM/i+AuTPChQ9dFcR8i9zaQhLhzcPZXgs66KVzsMKN6rNxvgk/2aCuZp2d+9uuWjc/1kQAoyugn+n9Mk+i8ZhXZvAn0g== 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:51 +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:51 +0000 From: Gagandeep Singh To: dev@dpdk.org, Sachin Saxena , Hemant Agrawal Cc: Jun Yang Subject: [v5 14/15] dma/dpaa: add DMA error checks Date: Tue, 8 Oct 2024 16:28:09 +0530 Message-Id: <20241008105810.1454133-15-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: 10ccdb40-5c1f-44f6-c175-08dce7883173 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?QOMMH+wYsElG1/DiUy5F8edZqVzcqhz0WBPKBHZEdGtU57nh1rPC+ZGvnwjW?= =?us-ascii?Q?B5BYJKphpTMRgKNvMphP9vWeEuL7xRJTgPNvo0QwjAr3rx097D7uV9zWyAv6?= =?us-ascii?Q?s/Nc6JkTeRoxvFQ7Atg6Fi26457BtqZsrtO2Tsmq0wlfhLk2oCwS4Cs1tr00?= =?us-ascii?Q?j91nXlnRyP0CYHVqsk4eecItBGn5RbIAor6CqCGFdsGWqs0KPfK1oJs5sYgh?= =?us-ascii?Q?QFxYh8Xbf59iermAvAB+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Bj+wOWnvxQeujiskdf1rJjWOEUtoe7+IiWyq+9sr/dcNJ/3FchbxZDh?= =?us-ascii?Q?zE16Mrya/7q/1/C3g82/U1B8O7sm4nksoCQ9n8dK/MCJrwHBljywa2FEdqQy?= =?us-ascii?Q?tXYJMhT2FiT6cpPB4QjpXh+4rhSSFFtqQ54pc0Qx4G5D4rtS9yLXR3ppud7e?= =?us-ascii?Q?lAOMo79rsQE+ssE7G4YdZI1D?= 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?oMMmCC4Zt9+HoyCYWhRzvq4X/HuRCH6lJHbf9LChHDJDxoEX0SQgaK6sS6gc?= =?us-ascii?Q?GMddOLqvoXWRFpQT7UCg/QlKKCxO14A02KY3q/JKZ1R9Q9CUttjK2pOKXP2b?= =?us-ascii?Q?h2HHJUAaT8OEbGSrXMzOGYf/DVs4sWlbL3ykmhPA7ED2nh3gqKGLLzGmvoci?= =?us-ascii?Q?FdgXB4TrN6Mc/FEAstnnZrVRiQtFaAaQjGv9JgPyrbDba6RlpU7/YzU8cqGs?= =?us-ascii?Q?XjTREdsYjLT6lXb6cptNIVVWRJtrnTUTsdWVs/H7wdT3KMfSS68oU8nB5xbh?= =?us-ascii?Q?EpGetIcjuqDxpPpEHqUS0VMsZQpggcLi4SMwdUg2NNpNBXrcXCehmnzLnQhe?= =?us-ascii?Q?Xy3nylJRimXDJTQsuplzeFNRm6gvkKjMy4exhdUiUyYZ6IvwGdtDZAmnb2NB?= =?us-ascii?Q?dwRKzvhOdTqRn/gDRlQn5HkcJZY4UrYMhdPwEGpvFAqMUtaDc5uxOMe/6jVX?= =?us-asc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BrPtmZMz?= =?us-ascii?Q?i3CNpPfSeMVVLi4AjD7oXHVADRHmfPUT54HFnH3LUi7R5HmqhoQSpB8yr1Oc?= =?us-ascii?Q?dkC2IcaUwvNX1GmUjvCYyFjG9JVnJkhSgMaRIJoVg5BuU5bI9QlKSoyVQ9qs?= =?us-ascii?Q?duKlTRzooW7/nrL9sdHmt0cm4HJkTLFu0u79jt772ufRrp2vPWDQyHB2UEuJ?= =?us-ascii?Q?/r35m9kus58I4m2FeTE=3D?= X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 10ccdb40-5c1f-44f6-c175-08dce7883173 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:51.3028 (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: WO/UXP6/dFfj55+zOk5eKRmHXqjGyJMlfkFppSHU2mqHfvRiwNn/M+WHqlfaWStk 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 user configurable DMA error checks. Signed-off-by: Jun Yang Signed-off-by: Gagandeep Singh --- doc/guides/dmadevs/dpaa.rst | 6 ++ drivers/dma/dpaa/dpaa_qdma.c | 135 ++++++++++++++++++++++++++++++- drivers/dma/dpaa/dpaa_qdma.h | 42 ++++++++++ drivers/net/dpaa2/dpaa2_ethdev.c | 2 +- 4 files changed, 183 insertions(+), 2 deletions(-) diff --git a/doc/guides/dmadevs/dpaa.rst b/doc/guides/dmadevs/dpaa.rst index 8a7c0befc3..a60457229a 100644 --- a/doc/guides/dmadevs/dpaa.rst +++ b/doc/guides/dmadevs/dpaa.rst @@ -69,3 +69,9 @@ Platform Requirement DPAA DMA driver for DPDK can only work on NXP SoCs as listed in the `Supported DPAA SoCs`_. + +Device Arguments +---------------- + +Use dev arg option ``dpaa_dma_err_check=1`` to check DMA errors at +driver level. usage example: ``dpaa_bus:dpaa_qdma-1,dpaa_dma_err_check=1`` diff --git a/drivers/dma/dpaa/dpaa_qdma.c b/drivers/dma/dpaa/dpaa_qdma.c index 7c199b6dd0..7b9d893cbe 100644 --- a/drivers/dma/dpaa/dpaa_qdma.c +++ b/drivers/dma/dpaa/dpaa_qdma.c @@ -4,11 +4,15 @@ #include #include +#include #include "dpaa_qdma.h" #include "dpaa_qdma_logs.h" static uint32_t s_sg_max_entry_sz = 2000; +static bool s_hw_err_check; + +#define DPAA_DMA_ERROR_CHECK "dpaa_dma_err_check" static inline void qdma_desc_addr_set64(struct fsl_qdma_comp_cmd_desc *ccdf, u64 addr) @@ -638,7 +642,7 @@ fsl_qdma_enqueue_overflow(struct fsl_qdma_queue *fsl_queue) check_num = 0; overflow_check: - if (fsl_qdma->is_silent) { + if (fsl_qdma->is_silent || unlikely(s_hw_err_check)) { reg = qdma_readl_be(block + FSL_QDMA_BCQSR(fsl_queue->queue_id)); overflow = (reg & FSL_QDMA_BCQSR_QF_XOFF_BE) ? @@ -1076,13 +1080,81 @@ dpaa_qdma_copy_sg(void *dev_private, return ret; } +static int +dpaa_qdma_err_handle(struct fsl_qdma_err_reg *reg) +{ + struct fsl_qdma_err_reg local; + size_t i, offset = 0; + char err_msg[512]; + + local.dedr_be = rte_read32(®->dedr_be); + if (!local.dedr_be) + return 0; + offset = sprintf(err_msg, "ERR detected:"); + if (local.dedr.ere) { + offset += sprintf(&err_msg[offset], + " ere(Enqueue rejection error)"); + } + if (local.dedr.dde) { + offset += sprintf(&err_msg[offset], + " dde(Destination descriptor error)"); + } + if (local.dedr.sde) { + offset += sprintf(&err_msg[offset], + " sde(Source descriptor error)"); + } + if (local.dedr.cde) { + offset += sprintf(&err_msg[offset], + " cde(Command descriptor error)"); + } + if (local.dedr.wte) { + offset += sprintf(&err_msg[offset], + " wte(Write transaction error)"); + } + if (local.dedr.rte) { + offset += sprintf(&err_msg[offset], + " rte(Read transaction error)"); + } + if (local.dedr.me) { + offset += sprintf(&err_msg[offset], + " me(Multiple errors of the same type)"); + } + DPAA_QDMA_ERR("%s", err_msg); + for (i = 0; i < FSL_QDMA_DECCD_ERR_NUM; i++) { + local.deccd_le[FSL_QDMA_DECCD_ERR_NUM - 1 - i] = + QDMA_IN(®->deccd_le[i]); + } + local.deccqidr_be = rte_read32(®->deccqidr_be); + local.decbr = rte_read32(®->decbr); + + offset = sprintf(err_msg, "ERR command:"); + offset += sprintf(&err_msg[offset], + " status: %02x, ser: %d, offset:%d, fmt: %02x", + local.err_cmd.status, local.err_cmd.ser, + local.err_cmd.offset, local.err_cmd.format); + offset += sprintf(&err_msg[offset], + " address: 0x%"PRIx64", queue: %d, dd: %02x", + (uint64_t)local.err_cmd.addr_hi << 32 | + local.err_cmd.addr_lo, + local.err_cmd.queue, local.err_cmd.dd); + DPAA_QDMA_ERR("%s", err_msg); + DPAA_QDMA_ERR("ERR command block: %d, queue: %d", + local.deccqidr.block, local.deccqidr.queue); + + rte_write32(local.dedr_be, ®->dedr_be); + + return -EIO; +} + static uint16_t dpaa_qdma_dequeue_status(void *dev_private, uint16_t vchan, const uint16_t nb_cpls, uint16_t *last_idx, enum rte_dma_status_code *st) { struct fsl_qdma_engine *fsl_qdma = dev_private; + int err; struct fsl_qdma_queue *fsl_queue = fsl_qdma->chan[vchan]; + void *status = fsl_qdma->status_base; struct fsl_qdma_desc *desc_complete[nb_cpls]; uint16_t i, dq_num; @@ -1107,6 +1179,12 @@ dpaa_qdma_dequeue_status(void *dev_private, uint16_t vchan, st[i] = RTE_DMA_STATUS_SUCCESSFUL; } + if (s_hw_err_check) { + err = dpaa_qdma_err_handle(status + + FSL_QDMA_ERR_REG_STATUS_OFFSET); + if (err) + fsl_queue->stats.errors++; + } return dq_num; } @@ -1117,7 +1195,9 @@ dpaa_qdma_dequeue(void *dev_private, uint16_t *last_idx, bool *has_error) { struct fsl_qdma_engine *fsl_qdma = dev_private; + int err; struct fsl_qdma_queue *fsl_queue = fsl_qdma->chan[vchan]; + void *status = fsl_qdma->status_base; struct fsl_qdma_desc *desc_complete[nb_cpls]; uint16_t i, dq_num; @@ -1138,6 +1218,16 @@ dpaa_qdma_dequeue(void *dev_private, for (i = 0; i < dq_num; i++) last_idx[i] = desc_complete[i]->flag; + if (s_hw_err_check) { + err = dpaa_qdma_err_handle(status + + FSL_QDMA_ERR_REG_STATUS_OFFSET); + if (err) { + if (has_error) + *has_error = true; + fsl_queue->stats.errors++; + } + } + return dq_num; } @@ -1189,6 +1279,43 @@ static struct rte_dma_dev_ops dpaa_qdma_ops = { .stats_reset = dpaa_qdma_stats_reset, }; +static int +check_devargs_handler(__rte_unused const char *key, const char *value, + __rte_unused void *opaque) +{ + if (strcmp(value, "1")) + return -1; + + return 0; +} + +static int +dpaa_get_devargs(struct rte_devargs *devargs, const char *key) +{ + struct rte_kvargs *kvlist; + + if (!devargs) + return 0; + + kvlist = rte_kvargs_parse(devargs->args, NULL); + if (!kvlist) + return 0; + + if (!rte_kvargs_count(kvlist, key)) { + rte_kvargs_free(kvlist); + return 0; + } + + if (rte_kvargs_process(kvlist, key, + check_devargs_handler, NULL) < 0) { + rte_kvargs_free(kvlist); + return 0; + } + rte_kvargs_free(kvlist); + + return 1; +} + static int dpaa_qdma_init(struct rte_dma_dev *dmadev) { @@ -1199,6 +1326,11 @@ dpaa_qdma_init(struct rte_dma_dev *dmadev) int ret; uint32_t i, j, k; + if (dpaa_get_devargs(dmadev->device->devargs, DPAA_DMA_ERROR_CHECK)) { + s_hw_err_check = true; + DPAA_QDMA_INFO("Enable DMA error checks"); + } + fsl_qdma->n_queues = QDMA_QUEUES * QDMA_BLOCKS; fsl_qdma->num_blocks = QDMA_BLOCKS; fsl_qdma->block_offset = QDMA_BLOCK_OFFSET; @@ -1340,4 +1472,5 @@ static struct rte_dpaa_driver rte_dpaa_qdma_pmd = { }; RTE_PMD_REGISTER_DPAA(dpaa_qdma, rte_dpaa_qdma_pmd); +RTE_PMD_REGISTER_PARAM_STRING(dpaa_qdma, DPAA_DMA_ERROR_CHECK "="); RTE_LOG_REGISTER_DEFAULT(dpaa_qdma_logtype, INFO); diff --git a/drivers/dma/dpaa/dpaa_qdma.h b/drivers/dma/dpaa/dpaa_qdma.h index 1e820d0207..91eaf1455a 100644 --- a/drivers/dma/dpaa/dpaa_qdma.h +++ b/drivers/dma/dpaa/dpaa_qdma.h @@ -199,6 +199,48 @@ struct fsl_qdma_cmpd_ft { uint64_t phy_df; } __rte_packed; +#define FSL_QDMA_ERR_REG_STATUS_OFFSET 0xe00 + +struct fsl_qdma_dedr_reg { + uint32_t me:1; + uint32_t rsv0:1; + uint32_t rte:1; + uint32_t wte:1; + uint32_t cde:1; + uint32_t sde:1; + uint32_t dde:1; + uint32_t ere:1; + uint32_t rsv1:24; +}; + +struct fsl_qdma_deccqidr_reg { + uint32_t rsv:27; + uint32_t block:2; + uint32_t queue:3; +}; + +#define FSL_QDMA_DECCD_ERR_NUM \ + (sizeof(struct fsl_qdma_comp_cmd_desc) / sizeof(uint32_t)) + +struct fsl_qdma_err_reg { + uint32_t deier; + union { + rte_be32_t dedr_be; + struct fsl_qdma_dedr_reg dedr; + }; + uint32_t rsv0[2]; + union { + rte_le32_t deccd_le[FSL_QDMA_DECCD_ERR_NUM]; + struct fsl_qdma_comp_cmd_desc err_cmd; + }; + uint32_t rsv1[4]; + union { + rte_be32_t deccqidr_be; + struct fsl_qdma_deccqidr_reg deccqidr; + }; + rte_be32_t decbr; +}; + #define DPAA_QDMA_IDXADDR_FROM_SG_FLAG(flag) \ ((void *)(uintptr_t)((flag) - ((flag) & DPAA_QDMA_SG_IDX_ADDR_MASK))) diff --git a/drivers/net/dpaa2/dpaa2_ethdev.c b/drivers/net/dpaa2/dpaa2_ethdev.c index c411ad5a97..814aaf0996 100644 --- a/drivers/net/dpaa2/dpaa2_ethdev.c +++ b/drivers/net/dpaa2/dpaa2_ethdev.c @@ -2682,7 +2682,7 @@ dpaa2_dev_init(struct rte_eth_dev *eth_dev) if (dpaa2_get_devargs(dev->devargs, DRIVER_ERROR_QUEUE)) { dpaa2_enable_err_queue = 1; - DPAA2_PMD_INFO("Enable error queue"); + DPAA2_PMD_INFO("Enable DMA error checks"); } /* Allocate memory for hardware structure for queues */ -- 2.25.1