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 C82D545ADF; Tue, 8 Oct 2024 09:27:49 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 6D15340E31; Tue, 8 Oct 2024 09:23:56 +0200 (CEST) Received: from EUR05-DB8-obe.outbound.protection.outlook.com (mail-db8eur05on2085.outbound.protection.outlook.com [40.107.20.85]) by mails.dpdk.org (Postfix) with ESMTP id 3C5AB40E0C for ; Tue, 8 Oct 2024 09:23:54 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=ZnI8oeT+M2Opd/9XaUVJXPLT1L6RgmbBZffGugJ/yLO7iqDelBzMVejvN+5MY60ZycpmW1Y0/FZZB1nUH6YV1WF8Tdzya1WFFh9RXqBb8JrmFBNOeBGitOqi6/h+7dpPj9EYUU/k8Y2eFns2V40sEgainrQoUdndTSY2kB1a6SrjXui1b2LFN3g34B926n8zgdyE6/X3wKf+7LXgyTgWp+PZzsv+QNvHLU9Wem5h9qfOE9xcM13yFRAXaEKX3MzI7+jLBsoty6L5I8SDRKwRg7/+Dri8MLgBg/MWNjUG9Wqh49U33QnzISNjxk/GiwQf3/7Q+5TjlMvRI0vno4CCtQ== 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=jT4QvPrY8lyLcMp66aYwt2oi8Xxqv/nRhl5bgpNxUrM=; b=E+k6emP110o2dazmbNsyyHQe3LluTndNfAf4FdsfycYmsv0SKurMLhpPOW7Xa5wc7pm0yNDLfu8X9AudyH73FzxIVLteisiZPzHhd4Ulc+TgYbEIszmxpN4Dust2LwXvmixTjaL715eCf2OTylwAnNL0ahSfpecrV/wgcNKU3h4dD0mpDlzhg+ceqMubu8XWGyJ1HXXI19rSzkm6g6Rot4alKCJgxZq6WtJvdyntm0m2cLQth5sPhpWpk8gNKfUVL1hXbvvV6s2S6Re0aEamWo9NhTdIQdb4x2qf8IEFfmZd0xODvlOVtaGOHrsYhtXOV6YMh6tAKDuXRERYZ1OHAQ== 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=jT4QvPrY8lyLcMp66aYwt2oi8Xxqv/nRhl5bgpNxUrM=; b=Am3QlB3aKQgvTIpiU2PMWryH4oOp9FY3PnZvioPuH449G9sIVV32FAxorzWVx1TJKbEwhVND2qiBoQptn/SU2oqwnvpEqR9FuaSxWaG06HxBAtA00sYw9cx6OT1SH4LP5qYAvTei31G3qFAbzi6hnQcy3QVjjw2srCNdQ2inMn7GeqZW5SpfqjyfSfA9EI220iRHN0uN9YE4Lq34MPe6WiH1seey2106EVYuYt8xGRfYMCw9zJQ53u8aFLFtvSX8m/+J0t8EoKYcXLH8/Fqu9Gxetv8W9rfFGRur+o4qbxnnUtkg5h16bUB4zZBK3By37PV9Sf2DBSoNY0NDPjVn4Q== 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:53 +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:53 +0000 From: Gagandeep Singh To: dev@dpdk.org, Sachin Saxena , Hemant Agrawal Cc: Jun Yang Subject: [v4 14/15] dma/dpaa: add DMA error checks Date: Tue, 8 Oct 2024 12:53:05 +0530 Message-Id: <20241008072306.1256445-15-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: c938649a-0ff1-461d-056d-08dce76a2979 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?TjhhbtW3PNodBsiVpZ6o04BaHpbuHdTi9RhdoHUdiFIJm2LnWaIJKs/AOHa9?= =?us-ascii?Q?Z0xRgvQdHqCsHTaogTz4gFtMBVdYMbQltUBH/MkO7oSnEEqxC9/DVoXQdfbZ?= =?us-ascii?Q?s0Un6IFESlcawhFMbW32+7Y+xm7lAnCh9F0c5k2SL4OZzRwbKSNXlMxwZHgT?= =?us-ascii?Q?jvyVPA6zMBHNyLgIFneNpZk/kvkeD0pwfpPUP6nSLzgdjtjCJk6ZnSZCfuOn?= =?us-ascii?Q?2+eJQLzbN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yliA8?= =?us-ascii?Q?dbpDdP0sK8005VwtFrbp0rEOuah/YUOtVKq+00Y0LoMhYhCVxuL9PouSAaiC?= =?us-ascii?Q?HLCN1A/QaViwNCMTjpHvv1lvVU7/uhnfAbPNaghTcHOQrdCez/6OFkHt3b0M?= =?us-ascii?Q?hqJFHKk56M7seU7lrk3Zn8Cxj+LPUXg0f2lBDxyF2rC7s3VcyGk1Q6eWPmCi?= =?us-ascii?Q?XSJ76rf61Ty+DHdlO+PcuzVx?= 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?BDRPSL9lj0UVYfANrFW8Uj0tW5G6I4Sp+vWBnhAm6I7zH9HhWJnFMFh99PJW?= =?us-ascii?Q?ouwaPn6rHFJcS/T3C9yvqRofB5T/1+uUB3fWhMAADfLUJPQfcNdO+sAL6ZG5?= =?us-ascii?Q?m8wDRtEOBw5vgn2NaAka8N6cTbMepXnpmmsb/Wh/LTP/dDqexQpQz9dXz0nX?= =?us-ascii?Q?O+PxOlmPwrSKz7U6yVtXcA7VO8Hm4NWBYw/dvNwNxc3nIhR8licA/fPl7xPI?= =?us-ascii?Q?HKd17Ia5wgxsMbano7DuAxjXIRWVOyFKHr2sCNO7hi50zLSNL6XK0kt/lzOn?= =?us-ascii?Q?4cCF59Mc3QQstheTYoQ6VGcl/GcjjTrzJFoUpoKA8nc9EOaFAD2gql2ZvYN3?= =?us-ascii?Q?KMwetidHsnCEGHCLGcc6jQG7ZhpSPAOGz5l55Sczcq76XVAzZRjtnL5y8FNE?= =?us-ascii?Q?rDENKbkXjHnKhlDNDFelbaUWp4sMGRdJUmPEf7BXoNjQLU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0AeU68DbZ/JTMnyvXAmSBAs2TH5+HiTBnsgAwW?= =?us-ascii?Q?bexcxzDacZ78udDUSwlQsfvCAwACDcsVD7/jJKg0DOqMGvuH4gRPjBcgA6xc?= =?us-ascii?Q?C2LQra/QJfDT8KZ4liQJEnXEY40KVqvtB4PVWDCR25z/X+SEAyJ/D/EPxCqO?= =?us-ascii?Q?C1AxZljhMJ/MjoN7LXtOshfJdyhjL45RhoBbsVwxsJ3DjNACx7OUC80+3gr+?= =?us-ascii?Q?1dgxnQKKwLNqybtXSsE=3D?= X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: c938649a-0ff1-461d-056d-08dce76a2979 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:53.0227 (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: Ev4AhoJgTHbdIFcZWBWfzPxlxCf/04etMQrhbjAftwwpPVf84Wmy4FQ02stGlCo+ 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 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 0aa3575fe9..3fcd9b8904 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