DPDK patches and discussions
 help / color / mirror / Atom feed
* [dpdk-dev] [RFC 1/4] test/virtual_pmd: enable getting device operations
@ 2021-06-17  8:14 Ferruh Yigit
  2021-06-17  8:14 ` [dpdk-dev] [RFC 2/4] test/virtual_pmd: clean rings on close Ferruh Yigit
                   ` (3 more replies)
  0 siblings, 4 replies; 16+ messages in thread
From: Ferruh Yigit @ 2021-06-17  8:14 UTC (permalink / raw)
  To: dev; +Cc: Ferruh Yigit

This will be used to overwrite the dev_ops for various tests.

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

diff --git a/app/test/virtual_pmd.c b/app/test/virtual_pmd.c
index 7036f401ed95..4d6ce302a563 100644
--- a/app/test/virtual_pmd.c
+++ b/app/test/virtual_pmd.c
@@ -350,8 +350,8 @@ virtual_ethdev_rx_burst_success(void *queue __rte_unused,
 
 static uint16_t
 virtual_ethdev_rx_burst_fail(void *queue __rte_unused,
-							 struct rte_mbuf **bufs __rte_unused,
-							 uint16_t nb_pkts __rte_unused)
+		struct rte_mbuf **bufs __rte_unused,
+		uint16_t nb_pkts __rte_unused)
 {
 	return 0;
 }
@@ -614,3 +614,13 @@ virtual_ethdev_create(const char *name, struct rte_ether_addr *mac_addr,
 
 	return -1;
 }
+
+struct eth_dev_ops *
+virtual_ethdev_ops_get(uint16_t port_id)
+{
+	struct rte_eth_dev *dev = &rte_eth_devices[port_id];
+	struct virtual_ethdev_private *dev_private = dev->data->dev_private;
+	struct eth_dev_ops *dev_ops = &dev_private->dev_ops;
+
+	return dev_ops;
+}
diff --git a/app/test/virtual_pmd.h b/app/test/virtual_pmd.h
index 120b58b27395..517dd0d2efa6 100644
--- a/app/test/virtual_pmd.h
+++ b/app/test/virtual_pmd.h
@@ -70,6 +70,12 @@ void
 virtual_ethdev_tx_burst_fn_set_tx_pkt_fail_count(uint16_t port_id,
 		uint8_t packet_fail_count);
 
+/* Let application get dev_ops to be able to overwrite some operations
+ * per the specific test needs.
+ */
+struct eth_dev_ops *
+virtual_ethdev_ops_get(uint16_t port_id);
+
 #ifdef __cplusplus
 }
 #endif
-- 
2.31.1


^ permalink raw reply	[flat|nested] 16+ messages in thread

end of thread, other threads:[~2023-08-22 21:15 UTC | newest]

Thread overview: 16+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-06-17  8:14 [dpdk-dev] [RFC 1/4] test/virtual_pmd: enable getting device operations Ferruh Yigit
2021-06-17  8:14 ` [dpdk-dev] [RFC 2/4] test/virtual_pmd: clean rings on close Ferruh Yigit
2021-06-17  8:14 ` [dpdk-dev] [RFC 3/4] test/virtual_pmd: enable updating device flags Ferruh Yigit
2021-06-17  8:14 ` [dpdk-dev] [RFC 4/4] test: support ethdev Ferruh Yigit
2021-07-16 14:27 ` [dpdk-dev] [RFC v2 1/8] test/virtual_pmd: clean rings on close Ferruh Yigit
2021-07-16 14:27   ` [dpdk-dev] [RFC v2 2/8] test/virtual_pmd: enable getting device operations Ferruh Yigit
2023-08-22 21:10     ` Stephen Hemminger
2021-07-16 14:27   ` [dpdk-dev] [RFC v2 3/8] test/virtual_pmd: enable updating device flags Ferruh Yigit
2021-07-16 14:27   ` [dpdk-dev] [RFC v2 4/8] test/virtual_pmd: enable getting device data Ferruh Yigit
2021-07-16 14:27   ` [dpdk-dev] [RFC v2 5/8] test/virtual_pmd: support get queue info device ops Ferruh Yigit
2021-07-16 14:27   ` [dpdk-dev] [RFC v2 6/8] test/virtual_pmd: provide descriptor limit info Ferruh Yigit
2021-07-16 14:27   ` [dpdk-dev] [RFC v2 7/8] test/virtual_pmd: support queue start/stop Ferruh Yigit
2023-08-22 21:11     ` Stephen Hemminger
2021-07-16 14:28   ` [dpdk-dev] [RFC v2 8/8] test: support ethdev Ferruh Yigit
2023-08-22 21:14     ` Stephen Hemminger
2023-08-22 21:15   ` [dpdk-dev] [RFC v2 1/8] test/virtual_pmd: clean rings on close Stephen Hemminger

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).