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 9140C41D8E for ; Mon, 27 Feb 2023 08:17:52 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 8D49641148; Mon, 27 Feb 2023 08:17:52 +0100 (CET) Received: from NAM10-DM6-obe.outbound.protection.outlook.com (mail-dm6nam10on2048.outbound.protection.outlook.com [40.107.93.48]) by mails.dpdk.org (Postfix) with ESMTP id ACF4E410D3 for ; Mon, 27 Feb 2023 08:17:50 +0100 (CET) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=avEuaiSINIOG+1WFSLiHYmgnqqedUiNaHEKKUqwu/DSfz+xCJ6SVpH6pVNVLVWwua9gHL4hklUIK/HnofAXiNsePrWz07vfIJ8LeGihMHt1BxvTLZJimvTI0jx85UgKN9Fkit2AoSejfO+bJuRPqrFRQcAUKQXhBNNsHkAsB4f+ndyZdVtNKk33ZvuLqOYMJ/VdlySpwu3LiopUoIqP+fGja+6gCNY0pMXXz/QJzlgMSg6Xqe1Ycl/2irK83pzLRxlzRpG84wWO45g391EfUx3g8S9K86Z83yonhrNPYGbYQfQT10JKtq996Wk3k8FG/0px+iKLokPVpKEs2niOOMA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; 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=+JKKvYKmCxlypwrNucKILSS7ieXgQRioGCtEnykkv4g=; b=Y7h+UdRTdR7VkLLLpa8itOpeMPl17D5XwUfmKRK+q0O1tYiz4yxxsD+zoFknRu6jlOglJV2jxKZPcVLu4XodCijl0Kb6/UvI7IFTGkYajCJsa/ToDWD5waWWb2/qMLi+9m4wW5uU4zW5rPdnH6gXNsXd81bItcXQA2j2UBzQ3kKMl+7IcCdQ3nZAyfWK2StVIiqs47ILrk3Gt8+jS1/v+MB35Z/OQDTwsXq1n+HijAlb0PQXiYg2PB0gFx9q5haKFhcH5y198bpC543xInw+IS6gVaYEhKiECsB4IHsyIb4I/BhhDwKRAme7AcUqJ4R6aRjzmbPPVh+Sh9U+NKiXvw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 216.228.117.160) smtp.rcpttodomain=intel.com smtp.mailfrom=nvidia.com; dmarc=pass (p=reject sp=reject pct=100) action=none header.from=nvidia.com; dkim=none (message not signed); arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=Nvidia.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=+JKKvYKmCxlypwrNucKILSS7ieXgQRioGCtEnykkv4g=; b=ED1uM1t8MYZStW5Btw8j6HB1+WwGGTDKOBXpBFsWpXnma1pYzMBs3Wd8pO74tCSFuWID+0e3tBbvAZrP1Wgp7q6xac8GoYXqhR1wUirQPd0G7fALRkB5iCAFxhDVMdJRYUpeO/tNS5RhCDlEICXVFeVuScwxYYc7p/whwfUj3FO3MdPhdi73EV3bphEpnymH2yDS1ed54dAps//HN4/8cuAJp034dRrU7V0yRcp57axT5HsfYNY8M/LUm8swVlzymFCqSq4qQWwVvXGL0cl48G4lkTyACioGwy5Uzw+PrMs+t450OxeZZlE/rGJGVFa0w2lSKmd5+YpcRIWh21ChdQ== Received: from DM6PR06CA0068.namprd06.prod.outlook.com (2603:10b6:5:54::45) by MW3PR12MB4540.namprd12.prod.outlook.com (2603:10b6:303:52::12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6134.29; Mon, 27 Feb 2023 07:17:47 +0000 Received: from DM6NAM11FT073.eop-nam11.prod.protection.outlook.com (2603:10b6:5:54:cafe::45) by DM6PR06CA0068.outlook.office365.com (2603:10b6:5:54::45) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6134.29 via Frontend Transport; Mon, 27 Feb 2023 07:17:46 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 216.228.117.160) smtp.mailfrom=nvidia.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=nvidia.com; Received-SPF: Pass (protection.outlook.com: domain of nvidia.com designates 216.228.117.160 as permitted sender) receiver=protection.outlook.com; client-ip=216.228.117.160; helo=mail.nvidia.com; pr=C Received: from mail.nvidia.com (216.228.117.160) by DM6NAM11FT073.mail.protection.outlook.com (10.13.173.152) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6156.16 via Frontend Transport; Mon, 27 Feb 2023 07:17:46 +0000 Received: from rnnvmail201.nvidia.com (10.129.68.8) by mail.nvidia.com (10.129.200.66) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.986.36; Sun, 26 Feb 2023 23:17:35 -0800 Received: from nvidia.com (10.126.231.37) by rnnvmail201.nvidia.com (10.129.68.8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.986.37; Sun, 26 Feb 2023 23:17:28 -0800 From: Xueming Li To: Bruce Richardson CC: Conor Walsh , Kevin Laatz , dpdk stable Subject: patch 'dma/ioat: fix device stop if no copies done' has been queued to stable release 22.11.2 Date: Mon, 27 Feb 2023 15:00:59 +0800 Message-ID: <20230227070107.15664-151-xuemingl@nvidia.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20230227070107.15664-1-xuemingl@nvidia.com> References: <20230227062349.13764-1-xuemingl@nvidia.com> <20230227070107.15664-1-xuemingl@nvidia.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-Originating-IP: [10.126.231.37] X-ClientProxiedBy: rnnvmail202.nvidia.com (10.129.68.7) To rnnvmail201.nvidia.com (10.129.68.8) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DM6NAM11FT073:EE_|MW3PR12MB4540:EE_ X-MS-Office365-Filtering-Correlation-Id: ef4fd23a-e4f4-4612-77fe-08db1892ba10 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: TH33ee0y0Z09skPVMg9ceitbLx1LkS5fGEgLR4RPARJLm1/jaVwc+g/tELE7k0HOmV8NLv9PYIW7QXdZ9OXAk+egAj4GiIqDW04O8oem8LnE03LYkHVXStJ+SCIpC0o9FBTvGu3Llx19CVeH3EjKi98GN4qOWDYgX/V9YZdOpW0/tT4k0BFHo6DYvSMR3yb9m/88Fk3GSGnLjQWdjsFUlj1WZRqdrvg25tC0YJpwsrLMIhdLGx1LX546aBZIQSPpT1TauZUlKWbiLCgsp5yM3odhBPYpEAV6JKLoQn8WZuAS3XEodDM/buDL4a+rnn46NJRXsEaNaK8GQT4GzF5IomItxnDq4m6OrqIImhazqjOUeTJQdKW0UxVFBeUxge+PN1W8skFuprwbhefwHdJfcNqduzV+0RMbgtmiZU/RWQ6ASPCkh/V9ReXDCLfK157GLznwzc7yXZMuhSsmfMA8GuqJGXGpPkgKzrNg1PLHzpgGGPtqyPWWshugS7SY1Geb5zmA6j1hmDEYv2On21/kU6tvcNjOIbNkoi+jYQEzx5VZA60rbYQ+/ZiuOEwKgFWpg5kKW8BZgQlIT8wNK2dbPNsAuqHyi4obfsOYlYDIHpuqSOJj/W2ePIJ+Kca5bHWza9THOphDcPoe98vuKzs0r+IFAJdJkeLKxR0wzLEOF9PnANldjO7zktF/dEQUIxdRuWQW80wg+gqwLRIq+/NcN9J54/ozSXHqI9q3DkDw3/ZG3LNdeX3kU9uuHENWrRdHF8YWfEx72Sqg+a2yM5rVfkf0fa6WdtLwe3h67YU+r0GE71rI+PA0FVYF/edh92/V X-Forefront-Antispam-Report: CIP:216.228.117.160; CTRY:US; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:mail.nvidia.com; PTR:dc6edge1.nvidia.com; CAT:NONE; SFS:(13230025)(4636009)(396003)(376002)(136003)(39860400002)(346002)(451199018)(40470700004)(36840700001)(46966006)(36756003)(5660300002)(8936002)(1076003)(36860700001)(53546011)(82310400005)(82740400003)(6666004)(7636003)(336012)(16526019)(426003)(47076005)(83380400001)(6286002)(34020700004)(26005)(186003)(2616005)(86362001)(316002)(55016003)(40480700001)(40460700003)(41300700001)(70206006)(70586007)(54906003)(4326008)(6916009)(8676002)(7696005)(478600001)(356005)(966005)(2906002); DIR:OUT; SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 27 Feb 2023 07:17:46.7584 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: ef4fd23a-e4f4-4612-77fe-08db1892ba10 X-MS-Exchange-CrossTenant-Id: 43083d15-7273-40c1-b7db-39efd9ccc17a X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=43083d15-7273-40c1-b7db-39efd9ccc17a; Ip=[216.228.117.160]; Helo=[mail.nvidia.com] X-MS-Exchange-CrossTenant-AuthSource: DM6NAM11FT073.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: MW3PR12MB4540 X-BeenThere: stable@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: patches for DPDK stable branches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: stable-bounces@dpdk.org Hi, FYI, your patch has been queued to stable release 22.11.2 Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet. It will be pushed if I get no objections before 03/01/23. So please shout if anyone has objections. Also note that after the patch there's a diff of the upstream commit vs the patch applied to the branch. This will indicate if there was any rebasing needed to apply to the stable branch. If there were code changes for rebasing (ie: not only metadata diffs), please double check that the rebase was correctly done. Queued patches are on a temporary branch at: https://git.dpdk.org/dpdk-stable/log/?h=22.11-staging This queued commit can be viewed at: https://git.dpdk.org/dpdk-stable/commit/?h=22.11-staging&id=881919396f3331a98ea69c957df2c461588ecdd6 Thanks. Xueming Li --- >From 881919396f3331a98ea69c957df2c461588ecdd6 Mon Sep 17 00:00:00 2001 From: Bruce Richardson Date: Thu, 16 Feb 2023 11:09:14 +0000 Subject: [PATCH] dma/ioat: fix device stop if no copies done Cc: Xueming Li [ upstream commit 664fa1c3922c7f81047bff55c13fccd3ef6c4131 ] The HW DMA devices supported by IOAT driver do not transition to the "active" state until the first operation is started by the HW. Therefore, if the user calls "rte_dma_stop()" on a device without triggering any operations, the sequence of commands to be sent to the HW is different, as is the final device state. Update the IOAT driver "stop" function to take account of this difference. Fixes: 583f046dd404 ("dma/ioat: add start and stop") Signed-off-by: Bruce Richardson Reviewed-by: Conor Walsh Acked-by: Kevin Laatz --- drivers/dma/ioat/ioat_dmadev.c | 19 +++++++++++++++---- 1 file changed, 15 insertions(+), 4 deletions(-) diff --git a/drivers/dma/ioat/ioat_dmadev.c b/drivers/dma/ioat/ioat_dmadev.c index 5906eb45aa..aff7bbbfde 100644 --- a/drivers/dma/ioat/ioat_dmadev.c +++ b/drivers/dma/ioat/ioat_dmadev.c @@ -166,17 +166,28 @@ static int ioat_dev_stop(struct rte_dma_dev *dev) { struct ioat_dmadev *ioat = dev->fp_obj->dev_private; + unsigned int chansts; uint32_t retry = 0; - ioat->regs->chancmd = IOAT_CHANCMD_SUSPEND; + chansts = (unsigned int)(ioat->regs->chansts & IOAT_CHANSTS_STATUS); + if (chansts == IOAT_CHANSTS_ACTIVE || chansts == IOAT_CHANSTS_IDLE) + ioat->regs->chancmd = IOAT_CHANCMD_SUSPEND; + else + ioat->regs->chancmd = IOAT_CHANCMD_RESET; do { rte_pause(); retry++; - } while ((ioat->regs->chansts & IOAT_CHANSTS_STATUS) != IOAT_CHANSTS_SUSPENDED - && retry < 200); + chansts = (unsigned int)(ioat->regs->chansts & IOAT_CHANSTS_STATUS); + } while (chansts != IOAT_CHANSTS_SUSPENDED && + chansts != IOAT_CHANSTS_HALTED && retry < 200); + + if (chansts == IOAT_CHANSTS_SUSPENDED || chansts == IOAT_CHANSTS_HALTED) + return 0; - return ((ioat->regs->chansts & IOAT_CHANSTS_STATUS) == IOAT_CHANSTS_SUSPENDED) ? 0 : -1; + IOAT_PMD_WARN("Channel could not be suspended on stop. (chansts = %u [%s])", + chansts, chansts_readable[chansts]); + return -1; } /* Get device information of a device. */ -- 2.25.1 --- Diff of the applied patch vs upstream commit (please double-check if non-empty: --- --- - 2023-02-27 14:08:45.701704600 +0800 +++ 0152-dma-ioat-fix-device-stop-if-no-copies-done.patch 2023-02-27 14:08:40.959237000 +0800 @@ -1 +1 @@ -From 664fa1c3922c7f81047bff55c13fccd3ef6c4131 Mon Sep 17 00:00:00 2001 +From 881919396f3331a98ea69c957df2c461588ecdd6 Mon Sep 17 00:00:00 2001 @@ -4,0 +5,3 @@ +Cc: Xueming Li + +[ upstream commit 664fa1c3922c7f81047bff55c13fccd3ef6c4131 ] @@ -16 +18,0 @@ -Cc: stable@dpdk.org