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 1891F41D52 for ; Thu, 23 Feb 2023 16:08:45 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 1213F432C9; Thu, 23 Feb 2023 16:08:45 +0100 (CET) Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by mails.dpdk.org (Postfix) with ESMTP id 3D3E9432C9 for ; Thu, 23 Feb 2023 16:08:43 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1677164922; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=eOUa/mx2a+ETTkZ+182daJB4n+6978lo0WRjENs8al0=; b=CGuLrN4Zai3HBeP04c5MsYocY3svVd345+zadUOBB4xAO/t3scz3dwYWwL47hPzun62GV0 L2pkB70EAgMu20okeF9U9nRTkEYOuiWA71ZnSJwngkpFsXLljcnntWqVHAyD6SvHHYPeur UShIxVGjsJJGsT7Zr6X2xElVdOMIJTo= Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-608-f1PDwOk8Oq2pwBPH4aXmiA-1; Thu, 23 Feb 2023 10:08:39 -0500 X-MC-Unique: f1PDwOk8Oq2pwBPH4aXmiA-1 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.rdu2.redhat.com [10.11.54.6]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 2C0AC858F09; Thu, 23 Feb 2023 15:08:39 +0000 (UTC) Received: from rh.redhat.com (unknown [10.39.192.53]) by smtp.corp.redhat.com (Postfix) with ESMTP id 461172166B29; Thu, 23 Feb 2023 15:08:38 +0000 (UTC) From: Kevin Traynor 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 21.11.4 Date: Thu, 23 Feb 2023 15:06:22 +0000 Message-Id: <20230223150631.723699-91-ktraynor@redhat.com> In-Reply-To: <20230223150631.723699-1-ktraynor@redhat.com> References: <20230223150631.723699-1-ktraynor@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.1 on 10.11.54.6 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset="US-ASCII"; x-default=true 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 21.11.4 Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet. It will be pushed if I get no objections before 02/28/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://github.com/kevintraynor/dpdk-stable This queued commit can be viewed at: https://github.com/kevintraynor/dpdk-stable/commit/7e8fc5d99236ef3a2b08d6244e192bbc49a33854 Thanks. Kevin --- >From 7e8fc5d99236ef3a2b08d6244e192bbc49a33854 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 [ 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 a230496b11..644670337a 100644 --- a/drivers/dma/ioat/ioat_dmadev.c +++ b/drivers/dma/ioat/ioat_dmadev.c @@ -167,15 +167,26 @@ 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); - return ((ioat->regs->chansts & IOAT_CHANSTS_STATUS) == IOAT_CHANSTS_SUSPENDED) ? 0 : -1; + if (chansts == IOAT_CHANSTS_SUSPENDED || chansts == IOAT_CHANSTS_HALTED) + return 0; + + IOAT_PMD_WARN("Channel could not be suspended on stop. (chansts = %u [%s])", + chansts, chansts_readable[chansts]); + return -1; } -- 2.39.1 --- Diff of the applied patch vs upstream commit (please double-check if non-empty: --- --- - 2023-02-23 14:46:25.999174013 +0000 +++ 0091-dma-ioat-fix-device-stop-if-no-copies-done.patch 2023-02-23 14:46:23.884236363 +0000 @@ -1 +1 @@ -From 664fa1c3922c7f81047bff55c13fccd3ef6c4131 Mon Sep 17 00:00:00 2001 +From 7e8fc5d99236ef3a2b08d6244e192bbc49a33854 Mon Sep 17 00:00:00 2001 @@ -5,0 +6,2 @@ +[ upstream commit 664fa1c3922c7f81047bff55c13fccd3ef6c4131 ] + @@ -16 +17,0 @@ -Cc: stable@dpdk.org @@ -26 +27 @@ -index 5906eb45aa..aff7bbbfde 100644 +index a230496b11..644670337a 100644