!282 [sync] PR-280: dma/hisilicon: support vchan status query

From: @openeuler-sync-bot 
Reviewed-by: @li-huisong 
Signed-off-by: @li-huisong
This commit is contained in:
openeuler-ci-bot 2022-12-16 06:53:02 +00:00 committed by Gitee
commit 43c285eba9
No known key found for this signature in database
GPG Key ID: 173E9B9CA92EEF8F
2 changed files with 100 additions and 1 deletions

View File

@ -0,0 +1,95 @@
From 400f952c52abac8906cc64c0ef644cb450ef7deb Mon Sep 17 00:00:00 2001
From: Chengwen Feng <fengchengwen@huawei.com>
Date: Fri, 27 May 2022 11:40:55 +0800
Subject: dma/hisilicon: support vchan status query
[ upstream commit 157e8326e9ef627dc6bca8110a103496bfb6fd88 ]
This patch adds support for vchan-status ops.
Signed-off-by: Chengwen Feng <fengchengwen@huawei.com>
---
drivers/dma/hisilicon/hisi_dmadev.c | 30 +++++++++++++++++++++++++++++
drivers/dma/hisilicon/hisi_dmadev.h | 7 ++++++-
2 files changed, 36 insertions(+), 1 deletion(-)
diff --git a/drivers/dma/hisilicon/hisi_dmadev.c b/drivers/dma/hisilicon/hisi_dmadev.c
index fbe09284ed..9494b60779 100644
--- a/drivers/dma/hisilicon/hisi_dmadev.c
+++ b/drivers/dma/hisilicon/hisi_dmadev.c
@@ -461,6 +461,27 @@ hisi_dma_stats_reset(struct rte_dma_dev *dev, uint16_t vchan)
return 0;
}
+static int
+hisi_dma_vchan_status(const struct rte_dma_dev *dev, uint16_t vchan,
+ enum rte_dma_vchan_status *status)
+{
+ struct hisi_dma_dev *hw = dev->data->dev_private;
+ uint32_t val;
+
+ RTE_SET_USED(vchan);
+
+ val = hisi_dma_read_queue(hw, HISI_DMA_QUEUE_FSM_REG);
+ val = FIELD_GET(HISI_DMA_QUEUE_FSM_STS_M, val);
+ if (val == HISI_DMA_STATE_RUN)
+ *status = RTE_DMA_VCHAN_ACTIVE;
+ else if (val == HISI_DMA_STATE_CPL)
+ *status = RTE_DMA_VCHAN_IDLE;
+ else
+ *status = RTE_DMA_VCHAN_HALTED_ERROR;
+
+ return 0;
+}
+
static void
hisi_dma_dump_range(struct hisi_dma_dev *hw, FILE *f, uint32_t start,
uint32_t end)
@@ -816,6 +837,14 @@ hisi_dma_gen_dev_name(const struct rte_pci_device *pci_dev,
* dev_stop| |
* | v
* ------------------
+ * | CPL |
+ * ------------------
+ * ^ |
+ * hardware | |
+ * completed all| |dev_submit
+ * descriptors | |
+ * | |
+ * ------------------
* | RUN |
* ------------------
*
@@ -829,6 +858,7 @@ static const struct rte_dma_dev_ops hisi_dmadev_ops = {
.vchan_setup = hisi_dma_vchan_setup,
.stats_get = hisi_dma_stats_get,
.stats_reset = hisi_dma_stats_reset,
+ .vchan_status = hisi_dma_vchan_status,
.dev_dump = hisi_dma_dump,
};
diff --git a/drivers/dma/hisilicon/hisi_dmadev.h b/drivers/dma/hisilicon/hisi_dmadev.h
index 90b85322ca..deb1357eea 100644
--- a/drivers/dma/hisilicon/hisi_dmadev.h
+++ b/drivers/dma/hisilicon/hisi_dmadev.h
@@ -132,11 +132,16 @@ enum {
/**
* In fact, there are multiple states, but it need to pay attention to
- * the following two states for the driver:
+ * the following three states for the driver:
*/
enum {
HISI_DMA_STATE_IDLE = 0,
HISI_DMA_STATE_RUN,
+ /**
+ * All of the submitted descriptor are finished, and the queue
+ * is waiting for new descriptors.
+ */
+ HISI_DMA_STATE_CPL,
};
/**
--
2.23.0

View File

@ -1,6 +1,6 @@
Name: dpdk
Version: 21.11
Release: 26
Release: 27
Packager: packaging@6wind.com
URL: http://dpdk.org
%global source_version 21.11
@ -231,6 +231,7 @@ Patch9210: 0210-app-procinfo-dump-RSS-RETA.patch
Patch9211: 0211-app-procinfo-dump-module-EEPROM-info.patch
Patch9212: 0212-app-procinfo-add-burst-mode-to-Rx-Tx-queue-info.patch
Patch9213: 0213-app-procinfo-dump-detailed-info-for-Rx-Tx-descriptor.patch
Patch9214: 0214-dma-hisilicon-support-vchan-status-query.patch
Summary: Data Plane Development Kit core
Group: System Environment/Libraries
@ -373,6 +374,9 @@ strip -g $RPM_BUILD_ROOT/lib/modules/%{kern_devel_ver}/extra/dpdk/igb_uio.ko
/usr/sbin/depmod
%changelog
* Wed Dec 14 2022 chenjiji <chenjiji09@163.com> - 21.11-27
- dma/hisilicon: support vchan status query
* Wed Nov 16 2022 chenjiji <chenjiji09@163.com> - 21.11-26
proc-info adds dumping the following features:
- dpdk version