To be able to test various dev_flags.

Signed-off-by: Ferruh Yigit <ferruh.yi...@intel.com>
---
 app/test/virtual_pmd.c | 10 ++++++++++
 app/test/virtual_pmd.h |  4 ++++
 2 files changed, 14 insertions(+)

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
-- 
2.31.1

Reply via email to