[RFC,v2,4/8] test/virtual_pmd: enable getting device data

Message ID 20210716142800.3853651-4-ferruh.yigit@intel.com (mailing list archive)
State Changes Requested, archived
Delegated to: Thomas Monjalon
Headers
Series [RFC,v2,1/8] test/virtual_pmd: clean rings on close |

Checks

Context Check Description
ci/checkpatch warning coding style issues

Commit Message

Ferruh Yigit July 16, 2021, 2:27 p.m. UTC
  Signed-off-by: Ferruh Yigit <ferruh.yigit@intel.com>
---
 app/test/virtual_pmd.c | 10 ++++++++++
 app/test/virtual_pmd.h |  4 ++++
 2 files changed, 14 insertions(+)
  

Patch

diff --git a/app/test/virtual_pmd.c b/app/test/virtual_pmd.c
index 615243e19aed..f2d807de8d89 100644
--- a/app/test/virtual_pmd.c
+++ b/app/test/virtual_pmd.c
@@ -639,3 +639,13 @@  virtual_ethdev_set_dev_flags(uint16_t port_id, uint32_t dev_flags)
 
 	return 0;
 }
+
+int
+virtual_ethdev_get_dev_data(uint16_t port_id, struct rte_eth_dev_data **data)
+{
+	struct rte_eth_dev *eth_dev = &rte_eth_devices[port_id];
+
+	*data = eth_dev->data;
+
+	return 0;
+}
diff --git a/app/test/virtual_pmd.h b/app/test/virtual_pmd.h
index 80d5d343579a..374bb4148f96 100644
--- a/app/test/virtual_pmd.h
+++ b/app/test/virtual_pmd.h
@@ -80,6 +80,10 @@  virtual_ethdev_ops_get(uint16_t port_id);
 int
 virtual_ethdev_set_dev_flags(uint16_t port_id, uint32_t dev_flags);
 
+/* Get device data for various checks */
+int
+virtual_ethdev_get_dev_data(uint16_t port_id, struct rte_eth_dev_data **data);
+
 #ifdef __cplusplus
 }
 #endif