From patchwork Mon Jul 22 16:39:16 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Gagandeep Singh X-Patchwork-Id: 142635 X-Patchwork-Delegate: thomas@monjalon.net Return-Path: X-Original-To: patchwork@inbox.dpdk.org Delivered-To: patchwork@inbox.dpdk.org Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 00F2F45683; Mon, 22 Jul 2024 18:42:09 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 4387840EDB; Mon, 22 Jul 2024 18:40:18 +0200 (CEST) Received: from DU2PR03CU002.outbound.protection.outlook.com (mail-northeuropeazon11012051.outbound.protection.outlook.com [52.101.66.51]) by mails.dpdk.org (Postfix) with ESMTP id 633B140E8A for ; Mon, 22 Jul 2024 18:40:16 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=iCCS1RO207mHC0cMYMxz1ET0KwmWmGD12Sr7+sGlHmaNDB2O5l9hnjo9F5VMG71wXNtTrQHi30LfB36C5J2tNIp/2ncDE9/ATJulXgk+ddQLA5sGWvop214IXpAkv3YdLw6gA+MXMB0ISGA0XURjUKcv23wkAMD0zEncr9yEPMpu44jzaKVipgObn1IGUOnexfaLyVRh+ESKDKjj9MVch3+R18dSfCM5DdXmQOKW+YPBsjjNRHwlJ2hHi1nrWVcC+fFXA6tQ2o/9eidIyKeYPJ0K4Fj/ytcIbYccQ70vWKdCqpdj4UcrC+i5u8qorf7zwzxOb3tPxHrK0TVI18xifw== 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=PWUoMrkduhZmZKmC2LcLjnnDGF7Cw0n146YYyjYBPBI=; b=XfBZ6RkMnwlmS25nsDD3LMQTcC3kjWQzYE7WTpCZ0y1b1XxXvmQbGOTrEf3i0osPWpUNPWIamGxsw7LfWS+JGDEhbhCy5nQeph1vJeyJnZ3YGEYwFttTdBQEOyVKLc3QuSYWm+6T3dkWIUcuGaAZci1qiLgI272iePSEpIGKQ3M2KIYwBtKJAu3+8e+1BAmDO8NCNDyKIXbMJ9p3WLiwsPtT7PCrdSWhFeky1pDNUcW7yRf//mN4+B0UjXhXlk8zq8OALk6js2ZTWntrAjCArfTYk4KYAPJ9GZIY2M97yShB1ZlgjBMzSJCqJ4QVjGI/KtZE9nYU/mcIM/zcga8EtQ== 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=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=PWUoMrkduhZmZKmC2LcLjnnDGF7Cw0n146YYyjYBPBI=; b=IA+k0HE/kWdKoMNRCvG8nCGgDsDdLMbwmSlwWfCCATS4HSkKH0EKVfC+kITIg1tfitJQWqKFu3OOuOunSvqQ29xG6sUIzTTBofhonQJ3L5yhCTgFKG37DGyeX3ZfEZuLEG1NfZqJ+rrm82IG4MWCF1j+2E5DWCILvgfxddAQY7k= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=nxp.com; Received: from AS8SPR01MB0024.eurprd04.prod.outlook.com (2603:10a6:20b:3d0::24) by PA1PR04MB10652.eurprd04.prod.outlook.com (2603:10a6:102:491::5) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7784.16; Mon, 22 Jul 2024 16:40:14 +0000 Received: from AS8SPR01MB0024.eurprd04.prod.outlook.com ([fe80::c634:479e:8f8a:a325]) by AS8SPR01MB0024.eurprd04.prod.outlook.com ([fe80::c634:479e:8f8a:a325%7]) with mapi id 15.20.7784.017; Mon, 22 Jul 2024 16:40:14 +0000 From: Gagandeep Singh To: dev@dpdk.org, Wathsala Vithanage , Bruce Richardson , Sachin Saxena Subject: [v3 16/30] dma/dpaa: add workaround for ERR050757 Date: Mon, 22 Jul 2024 22:09:16 +0530 Message-Id: <20240722163930.2171568-17-g.singh@nxp.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20240722163930.2171568-1-g.singh@nxp.com> References: <20240722115843.1830105-1-g.singh@nxp.com> <20240722163930.2171568-1-g.singh@nxp.com> X-ClientProxiedBy: SG3P274CA0014.SGPP274.PROD.OUTLOOK.COM (2603:1096:4:be::26) To AS8SPR01MB0024.eurprd04.prod.outlook.com (2603:10a6:20b:3d0::24) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: AS8SPR01MB0024:EE_|PA1PR04MB10652:EE_ X-MS-Office365-Filtering-Correlation-Id: a5490dac-1f83-4cbc-9c75-08dcaa6cf667 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; ARA:13230040|366016|52116014|376014|1800799024|38350700014; X-Microsoft-Antispam-Message-Info: +Pa982c0TKyMXDt7Kx2iLReDRWBj+URmk3tevjRh+amVrWKccbTQfqEOPhAuFCpnZjK6XRuwrPvFNdmmUbh4tZ3UuND8h+o2VLFtQcVRrjfSU//Yx9Ou31YBpwckF5T2uBpFlmLq10l4sqoAVajE7mhIMCbQWsNkWBjCm9Sv/UQ+tNFojDEAckbZvceQUznHXZ7TpDSpVfMZMjt+syXj0TyRcIoUtrcxuLjFFUyJafjzE30YxDv8+3SHH2YLv8Li8zHzNtvnFSfSbHODHkmOStzc9IDzYtrF98LziztUek5Djov/4L6usEp7N/eL6FPncgle0mel5Fm4z47Ih6MI0hGAEMBz54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cw== X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:AS8SPR01MB0024.eurprd04.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230040)(366016)(52116014)(376014)(1800799024)(38350700014); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: rBP08yeS5u55GXIFCVcvGAqeqOYvGD2/BKYg+8AHt/PwBAMkiuibvY2KXCVhkEgfdSgTOK+T269dQR/20iJm4Yj6kWvAKju+QMq0DRO54u9bzG0tD1j/U/uhK1NPI37UZS/06Mk3Ltj2xQLSjG+x9Pf4OzRk3MUuyrS8XqgS8kAfaor/d/WyM19TBPT6E5uvvOz07QWFNvNLTcw4A4sN8SBuz8q4oB5MCy9yExnYGbrFkKAaBCyXdbcxDPEeq+3Mm/NxjJ+OBfHIPxfB+Rv0b8keMPSJmwKEVhlq5bKjCOKj5TF6MNP3Dd6jL4RARgNRfESJm450frrwAv8Hbs8HxTKyNHFPJRp7BboI7o11/baMCfgzujAimpP9awgGsaQ8Wcko7ZmseBAldP8M7uZojSSHWbIQvkzcm7Y6R9+RuKt0TGBZYkM3vp8CbYO6dD6YiTsvV+hDZ1hZOL1BgGDVil41hh+Om2n84Hfa1LPYZAP7tbP8RajN6gXbKOy4z3orX+W1aQou6kgtt6D6dp5moxfKBTqxZ6hN+tpQrD0LrEKBf4DxQrJhvl5Ewwo1iIzmoq+MX8c9AdLJ/F16AfNXaE3pAyANuL1e1mTbde1jWxSjW8VsITqtRV4QwhY9SKNwEDKDFfY8+TtYGOsW+sq6E6Fqai+I4LTTrW68fNaDhLcs2CFvsu1kMlCJVxEWhY/GrauyZ2p49ZJwL/d/JeQ2X2wakHzJMBN4bI9zZuzhRf8psPd2Ep5QKEKAlOMsoXAkoFF70ZLcZWR6g3CIOq2TBgshD5opIAind/IyBdaBO7kbyglqka28rOolH+5XQdE/zs+nwashXAUGk01eobSv6OYrge0teyIJwuZ4glAczXAxzubDB65FfoY7AwZMFJRuzOnJrjbh/OYfvptUqLPqaqFSKC4KkZBixnCDeHEjrV/sNsyhRQzsUoyWTWeUO8dDoJlbV6IEJ9wx80R5FhP5nzCHJ+RYPXX1OShRnle97U/cKKP2P726vZtF8crImRng+5hHJcKE/HxRAm0gvgG5LgmR4QMAmtxhKIBWfUn96ZBDgw5ZvoBMMEek1kWsJDbecwkeZCMxieqggAB1Py0M+K7tUJIq7Y1ko3NEUjfCwrifW4EsTHZIHQgEPRPEnwKdqwo8aROMIPTiUhIWLLMtDLW0N3V13VUZ9tXxA6Bt9PUUOrh/3KM9gSUN+Zj2+L6eLGw9NaaCFAv6mgBkPVmJ9AeDk7jBbL5yNNna38YD4NQ4HfVdyAIGjgXUG23CeRgG0aue/pEjp845X32cSxYmnRvOs9XnfWFDkL/GGm0EaKTVL/Ox8dVZyDKYHAy7COe6kYGf7rxJdeyZzi284Zit8JYjAWlJPXIawNMdaMP+9b2aoDD1a9SJrkP1NWzdVgkqae1UaZefNQ8ET7bi4nBPmnvJRFgzzbA4dJJzJQZkKfB8aRKJqMADYAADTYZQp/Iyek9NrKtFIGvqUFAd11QJzpbvtc7B41yqJgJOOWKLfFTimr2UkGiRUyHMAc+sLBoNM41t2XvDYrEmzuzyQJrQ8nBp/NaCt0+rDP3S9Hogmk8wFYOwV39CCsvCnEtn85ZE X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: a5490dac-1f83-4cbc-9c75-08dcaa6cf667 X-MS-Exchange-CrossTenant-AuthSource: AS8SPR01MB0024.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 22 Jul 2024 16:40:14.8544 (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: 4auAfroQgbgATMNeSCOVLfbh1B1f0HZpredMX62W0y7XQi32BAc2ZpNRkus3X/Ia X-MS-Exchange-Transport-CrossTenantHeadersStamped: PA1PR04MB10652 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 ERR050757 on LS104x indicates: For outbound PCIe read transactions, a completion buffer is used to store the PCIe completions till the data is passed back to the initiator. At most 16 outstanding transactions are allowed and maximum read request is 256 bytes. The completion buffer size inside the controller needs to be at least 4KB, but the PCIe controller has 3 KB of buffer. In case the size of pending outbound read transactions of more than 3KB, the PCIe controller may drop the incoming completions without notifying the initiator of the transaction, leaving transactions unfinished. All subsequent outbound reads to PCIe are blocked permanently. To avoid qDMA hang as it keeps waiting for data that was silently dropped, set stride mode for qDMA Signed-off-by: Gagandeep Singh --- config/arm/meson.build | 3 ++- doc/guides/dmadevs/dpaa.rst | 2 ++ drivers/dma/dpaa/dpaa_qdma.c | 18 ++++++++++++++++++ drivers/dma/dpaa/dpaa_qdma.h | 5 +++++ 4 files changed, 27 insertions(+), 1 deletion(-) diff --git a/config/arm/meson.build b/config/arm/meson.build index 012935d5d7..f81e466318 100644 --- a/config/arm/meson.build +++ b/config/arm/meson.build @@ -468,7 +468,8 @@ soc_dpaa = { ['RTE_MACHINE', '"dpaa"'], ['RTE_LIBRTE_DPAA2_USE_PHYS_IOVA', false], ['RTE_MAX_LCORE', 16], - ['RTE_MAX_NUMA_NODES', 1] + ['RTE_MAX_NUMA_NODES', 1], + ['RTE_DMA_DPAA_ERRATA_ERR050757', true] ], 'numa': false } diff --git a/doc/guides/dmadevs/dpaa.rst b/doc/guides/dmadevs/dpaa.rst index f99bfc6087..746919ec6b 100644 --- a/doc/guides/dmadevs/dpaa.rst +++ b/doc/guides/dmadevs/dpaa.rst @@ -42,6 +42,8 @@ Compilation For builds using ``meson`` and ``ninja``, the driver will be built when the target platform is dpaa-based. No additional compilation steps are necessary. +- ``RTE_DMA_DPAA_ERRATA_ERR050757`` - enable software workaround for Errata-A050757 + Initialization -------------- diff --git a/drivers/dma/dpaa/dpaa_qdma.c b/drivers/dma/dpaa/dpaa_qdma.c index bb6b54e583..a21279293c 100644 --- a/drivers/dma/dpaa/dpaa_qdma.c +++ b/drivers/dma/dpaa/dpaa_qdma.c @@ -159,6 +159,10 @@ fsl_qdma_comp_fill_memcpy(struct fsl_qdma_comp *fsl_comp, dma_addr_t dst, dma_addr_t src, u32 len) { struct fsl_qdma_format *csgf_src, *csgf_dest; +#ifdef RTE_DMA_DPAA_ERRATA_ERR050757 + struct fsl_qdma_sdf *sdf; + u32 cfg = 0; +#endif /* Note: command table (fsl_comp->virt_addr) is getting filled * directly in cmd descriptors of queues while enqueuing the descriptor @@ -171,6 +175,20 @@ fsl_qdma_comp_fill_memcpy(struct fsl_qdma_comp *fsl_comp, csgf_src = (struct fsl_qdma_format *)fsl_comp->virt_addr + 2; csgf_dest = (struct fsl_qdma_format *)fsl_comp->virt_addr + 3; +#ifdef RTE_DMA_DPAA_ERRATA_ERR050757 + sdf = (struct fsl_qdma_sdf *)fsl_comp->desc_virt_addr; + sdf->cmd = rte_cpu_to_le_32(FSL_QDMA_CMD_RWTTYPE << + FSL_QDMA_CMD_RWTTYPE_OFFSET); + if (len > FSL_QDMA_CMD_SSS_DISTANCE) { + sdf->cmd |= rte_cpu_to_le_32(FSL_QDMA_CMD_SSEN); + cfg |= rte_cpu_to_le_32(FSL_QDMA_CMD_SSS_STRIDE << + FSL_QDMA_CFG_SSS_OFFSET | + FSL_QDMA_CMD_SSS_DISTANCE); + sdf->cfg = cfg; + } else + sdf->cfg = 0; +#endif + /* Status notification is enqueued to status queue. */ qdma_desc_addr_set64(csgf_src, src); qdma_csgf_set_len(csgf_src, len); diff --git a/drivers/dma/dpaa/dpaa_qdma.h b/drivers/dma/dpaa/dpaa_qdma.h index 2092fb39f5..361f88856b 100644 --- a/drivers/dma/dpaa/dpaa_qdma.h +++ b/drivers/dma/dpaa/dpaa_qdma.h @@ -81,6 +81,11 @@ #define FSL_QDMA_CMD_RWTTYPE_OFFSET 28 #define FSL_QDMA_CMD_LWC_OFFSET 16 +#define FSL_QDMA_CMD_SSEN BIT(19) +#define FSL_QDMA_CFG_SSS_OFFSET 12 +#define FSL_QDMA_CMD_SSS_STRIDE 128 +#define FSL_QDMA_CMD_SSS_DISTANCE 128 + #define QDMA_CCDF_STATUS 20 #define QDMA_CCDF_OFFSET 20 #define QDMA_CCDF_MASK GENMASK(28, 20)