patches for DPDK stable branches
 help / color / mirror / Atom feed
From: Bruce Richardson <bruce.richardson@intel.com>
To: dev@dpdk.org
Cc: fengchengwen@huawei.com,
	Bruce Richardson <bruce.richardson@intel.com>,
	conor.walsh@intel.com, stable@dpdk.org,
	Kevin Laatz <kevin.laatz@intel.com>
Subject: [PATCH v3 2/6] dma/ioat: fix incorrectly set indexes after restart
Date: Thu, 16 Feb 2023 11:09:15 +0000	[thread overview]
Message-ID: <20230216110919.373385-3-bruce.richardson@intel.com> (raw)
In-Reply-To: <20230216110919.373385-1-bruce.richardson@intel.com>

As part of the process of restarting a dma instance, the IOAT driver
will reset the HW addresses and state values. The read and write
indexes for SW use need to be similarly reset to keep HW and SW in
sync.

Fixes: 583f046dd404 ("dma/ioat: add start and stop")
Cc: conor.walsh@intel.com
Cc: stable@dpdk.org

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
Reviewed-by: Conor Walsh <conor.walsh@intel.com>
Acked-by: Kevin Laatz <kevin.laatz@intel.com>
---
 drivers/dma/ioat/ioat_dmadev.c | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/drivers/dma/ioat/ioat_dmadev.c b/drivers/dma/ioat/ioat_dmadev.c
index aff7bbbfde..072eb17cd9 100644
--- a/drivers/dma/ioat/ioat_dmadev.c
+++ b/drivers/dma/ioat/ioat_dmadev.c
@@ -146,6 +146,13 @@ ioat_dev_start(struct rte_dma_dev *dev)
 	/* Prime the status register to be set to the last element. */
 	ioat->status = ioat->ring_addr + ((ioat->qcfg.nb_desc - 1) * DESC_SZ);
 
+	/* reset all counters */
+	ioat->next_read = 0;
+	ioat->next_write = 0;
+	ioat->last_write = 0;
+	ioat->offset = 0;
+	ioat->failure = 0;
+
 	printf("IOAT.status: %s [0x%"PRIx64"]\n",
 			chansts_readable[ioat->status & IOAT_CHANSTS_STATUS],
 			ioat->status);
-- 
2.37.2


  parent reply	other threads:[~2023-02-16 11:09 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <20230116153714.554470-1-bruce.richardson@intel.com>
2023-01-16 15:37 ` [PATCH 1/5] dma/ioat: fix device stop if no copies done Bruce Richardson
2023-01-16 15:37 ` [PATCH 2/5] dma/ioat: fix incorrectly set indexes after restart Bruce Richardson
     [not found] ` <20230116173738.562322-1-bruce.richardson@intel.com>
2023-01-16 17:37   ` [PATCH v2 1/6] dma/ioat: fix device stop if no copies done Bruce Richardson
2023-01-18 10:47     ` Walsh, Conor
2023-02-14 16:04     ` Kevin Laatz
2023-01-16 17:37   ` [PATCH v2 2/6] dma/ioat: fix incorrectly set indexes after restart Bruce Richardson
2023-01-18 10:47     ` Walsh, Conor
2023-02-14 16:04     ` Kevin Laatz
2023-01-16 17:37   ` [PATCH v2 3/6] dma/ioat: fix incorrect error reporting on restart Bruce Richardson
2023-01-18 10:47     ` Walsh, Conor
2023-02-14 16:04     ` Kevin Laatz
     [not found] ` <20230216110919.373385-1-bruce.richardson@intel.com>
2023-02-16 11:09   ` [PATCH v3 1/6] dma/ioat: fix device stop if no copies done Bruce Richardson
2023-02-16 11:09   ` Bruce Richardson [this message]
2023-02-16 11:09   ` [PATCH v3 3/6] dma/ioat: fix incorrect error reporting on restart Bruce Richardson

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20230216110919.373385-3-bruce.richardson@intel.com \
    --to=bruce.richardson@intel.com \
    --cc=conor.walsh@intel.com \
    --cc=dev@dpdk.org \
    --cc=fengchengwen@huawei.com \
    --cc=kevin.laatz@intel.com \
    --cc=stable@dpdk.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).