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 9D75245B36; Mon, 14 Oct 2024 11:38:54 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 05D0240B97; Mon, 14 Oct 2024 11:37:33 +0200 (CEST) Received: from EUR05-VI1-obe.outbound.protection.outlook.com (mail-vi1eur05on2072.outbound.protection.outlook.com [40.107.21.72]) by mails.dpdk.org (Postfix) with ESMTP id 5E636406BB for ; Mon, 14 Oct 2024 11:37:24 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=gJl5oJ/sraZ5qijMQALO/GJS58gxyHClPET+7zpy6PXxXzH9TCYykSIxlmVERWwXcYxSl9K9TQ8w/nnosMaddSSsohfaNZmk1SQMmVEzFqdKJTlhG78XcPoIJtm1GHN8Ix5s0syOyzq0WLK/dk4rhucTl3ZiGfJz9+KU9dYf/U2u+KIOeTGlRUv5qAeD0k2isIJZpZtHOx4Ag9f/UVrU5btV3cR1dKvSZ4NbRqf3kX30T9sCYxxeM2KC4Y+UWqYjHAQw1Jbi8wMy3SI9V5jAac0rHuVWT1UIgADRFjugjUC+EMe36Q9zWE6dV0Uuk2slDCfsiUTU8KfWh+uD6sAbng== 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=w9I6ibAAebugO8E048jp9G4ZyyvnaLeyJrLR6vfxUkQ=; b=Bhm8l+dMaRDjSjquSyB0MTrI38bUiGFWrFtHhE0aZipaocK+mG+aAJ7CbK+ataSkla3YUbjLIaMukMM0lgjKCkwwK8yipKKEuVRfC6Z8flkl63QRfCCSGDe6lOTTTcZVqEGXbT4Wy3UZIFQaQjoECMC8UkBBemgxB1q57TjcXgkkoBJZJE5op19P4e6WUljykbrQGTDile1enXyafdHcDo6maTP5NhAOhpM89wr9USkr3LifM2cGf1LeAqK9UuEzC8vkvmTf/8fKSl5SxL+q7y9jYuYz7qimRmH6563IRtXXSufsfkKftRJVMwRYiMmHNtCcZhbu0qrejJrir5e/4A== 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=w9I6ibAAebugO8E048jp9G4ZyyvnaLeyJrLR6vfxUkQ=; b=QG4l8mX9JdmWSeems6NKBWqg/dbhn6r/2eaqlRqbDT+ar/SgqX2bIZWt224Rq8zbytIQhVk1lTfII/ply/zT9TB0LQVmu4n+nafns+NW96BEj3X27F0LsrjS75NTYqGgfF61OQkwPpnS/nCNdu8bi5dQoM/rV4DL6DK3Jg4ko4rxFctvm0JhA7yiuEnmo42SWIXm0WLB736Ru+gfAbvRO2Q1uftLs/LTMRuEOaoeqc2M9h2zYlIwNfC3D8cgUpNM9/Y1JYIovrRL0U39x+keJ4UfoyjLnn3eiEXNRUcVyxCM4CJrekK+uyREB0m7j2ZldCBTgNWJi1J32xSiKZ4C5Q== 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 DB9PR04MB9500.eurprd04.prod.outlook.com (2603:10a6:10:361::5) 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:22 +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:22 +0000 From: Gagandeep Singh To: dev@dpdk.org, Sachin Saxena , Hemant Agrawal Cc: Jun Yang Subject: [v6 14/15] dma/dpaa: add DMA error checks Date: Mon, 14 Oct 2024 15:06:38 +0530 Message-Id: <20241014093639.553467-15-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_|DB9PR04MB9500:EE_ X-MS-Office365-Filtering-Correlation-Id: 274cadfb-3749-460a-1ca0-08dcec33cdc9 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?JKlHZFACYjJ3xMu9g/VqTdu98fGWoew8aVaAbs6ucKCXkHulFr8kHUfOs9Az?= =?us-ascii?Q?3L6eLA4mnkxikKUa2QCIsWgJLd4Vo5142D3j1P8Mvab2PrTIFNmPPtAq54jx?= =?us-ascii?Q?mFD8iwJNzkGRi5IvekGBBu42rrGcRJehUKs/so4Dnpij9r3nTshpLjUzNugI?= =?us-ascii?Q?Hn0Ukx0wbyJecP/4BaksabOq8YOAMIhqT6heKRVR2mcXa4VIDB70f3//OEQj?= =?us-ascii?Q?iozNkkYufW5G4aYFi/Mts8P9qM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?us-ascii?Q?eZGtDc8x1GkhZzxrySS7rh6KIRswj+pnwENkntB9jye6nfwCqoUhVIHsccmZ?= =?us-ascii?Q?F2i2jNuovyU/z+b7fkf05RSPOBHq2Ek0KZl4avCOwHb9PBQKg9ggAv8+NjZS?= =?us-ascii?Q?FJ6ud3W/+7Kswa4lcPiBWHAtBlCGtchUdKAttpO3n2HHYJOIFBpkrJlHao+5?= =?us-ascii?Q?rNkfmf+eXSn2O3nmXinEaZb4?= 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?Iug6r/e4slruFWrMKULCYyodi8KLGHG3397rmk1StOT7JRm9QWwcbYm8Omg+?= =?us-ascii?Q?AdVeamhzNbq1ClNOw2dqUmPl9hMUw0Ng+WGOiArpDbN9a+ZsdOzWajZDCDms?= =?us-ascii?Q?f7LjaKo5cnhVkMNUYiTFPAyIzaCP5AiYPKZPY2A94aMyTUam0UHqvbE5p5eQ?= =?us-ascii?Q?w/F5x8L47KVzhrvmMIfW2BGSAojPyLxo4gK+59xZHSIgSCSakS/EFzkyX4YZ?= =?us-ascii?Q?rQVcgFIwhlrmpZ3kQ0vNr4Zt0h02gmUjhtjpSIvlnpXA/SqdHgy6jO2S1p2x?= =?us-ascii?Q?bbFA+f/+5iZlhrzk3Tf85M9/5ssP4WZDWYdbUgOTGUONOn3lT1m3/pTLwUCS?= =?us-ascii?Q?8BX+6cDM0BsZRCIgL64lQJKG3m7KXYiYu8zzr3I3fORQd9xBjPhjDYHxST4m?= =?us-ascii?Q?fqW/uBL1Jj3oXNNcb0bflZ6UPuOKPeNJKBdiZdoVugYR7wr4HnDbCSrMvmL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VLpETNGFdx+kb+dGlauU7giSRgsL6Qn7?= =?us-ascii?Q?yqPOeuXeICFZz0ylwphfL9/+bjpw3S00qTr+RbqfaPixiahmahfywS35rL3t?= =?us-ascii?Q?SfhPZd5s8WLlwi4viM7RmaUUdHDQu9evnYR43I5CqghjoNlKiQgEyi1z+Qt8?= =?us-ascii?Q?BKABFlHmIVKY7dS/799rbSAn0FJSlGpF1FucwI5eFKrHwonbfpu8mN3CEQXU?= =?us-ascii?Q?NDQiYwE3i3l7fvdaQvo=3D?= X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 274cadfb-3749-460a-1ca0-08dcec33cdc9 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:22.2682 (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: AKEjdjdNso5LVVXo7A6cIWb6ilBaYvh2SuZB58IZjuwrMAe9Ym0QICW/FWKV7Xeh X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB9PR04MB9500 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 93b88acef8..408418f032 100644 --- a/drivers/net/dpaa2/dpaa2_ethdev.c +++ b/drivers/net/dpaa2/dpaa2_ethdev.c @@ -2685,7 +2685,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