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

Message ID 20210617081449.2045195-3-ferruh.yigit@intel.com (mailing list archive)
State Superseded, archived
Delegated to: Thomas Monjalon
Headers
Series [RFC,1/4] test/virtual_pmd: enable getting device operations |

Checks

Context Check Description
ci/checkpatch success coding style OK

Commit Message

Ferruh Yigit June 17, 2021, 8:14 a.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(+)
  

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