patch 'dma/ioat: fix device stop if no copies done' has been queued to stable release 21.11.4
Kevin Traynor
ktraynor at redhat.com
Thu Feb 23 16:06:22 CET 2023
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 <bruce.richardson at intel.com>
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 <bruce.richardson at intel.com>
Reviewed-by: Conor Walsh <conor.walsh at intel.com>
Acked-by: Kevin Laatz <kevin.laatz at intel.com>
---
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 at dpdk.org
@@ -26 +27 @@
-index 5906eb45aa..aff7bbbfde 100644
+index a230496b11..644670337a 100644
More information about the stable
mailing list