diff mbox series

[RFC,v2,3/8] test/virtual_pmd: enable updating device flags

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

Checks

Context Check Description
ci/checkpatch success coding style OK

Commit Message

Ferruh Yigit July 16, 2021, 2:27 p.m. UTC
To be able to test various dev_flags.

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(+)
diff mbox series

Patch

diff --git a/app/test/virtual_pmd.c b/app/test/virtual_pmd.c
index 17f28c5a304c..615243e19aed 100644
--- a/app/test/virtual_pmd.c
+++ b/app/test/virtual_pmd.c
@@ -629,3 +629,13 @@  virtual_ethdev_ops_get(uint16_t port_id)
 
 	return dev_ops;
 }
+
+int
+virtual_ethdev_set_dev_flags(uint16_t port_id, uint32_t dev_flags)
+{
+	struct rte_eth_dev *eth_dev = &rte_eth_devices[port_id];
+
+	eth_dev->data->dev_flags = dev_flags;
+
+	return 0;
+}
diff --git a/app/test/virtual_pmd.h b/app/test/virtual_pmd.h
index 517dd0d2efa6..80d5d343579a 100644
--- a/app/test/virtual_pmd.h
+++ b/app/test/virtual_pmd.h
@@ -76,6 +76,10 @@  virtual_ethdev_tx_burst_fn_set_tx_pkt_fail_count(uint16_t port_id,
 struct eth_dev_ops *
 virtual_ethdev_ops_get(uint16_t port_id);
 
+/* For application to be able to alter the device flags */
+int
+virtual_ethdev_set_dev_flags(uint16_t port_id, uint32_t dev_flags);
+
 #ifdef __cplusplus
 }
 #endif