DPDK patches and discussions
 help / color / mirror / Atom feed
* [dpdk-dev] [PATCH] net/pcap: set queue started and stopped
@ 2018-07-09 20:21 Gage Eads
  2018-07-18  9:13 ` Ferruh Yigit
  2018-07-18 16:30 ` [dpdk-dev] [PATCH v2] " Gage Eads
  0 siblings, 2 replies; 9+ messages in thread
From: Gage Eads @ 2018-07-09 20:21 UTC (permalink / raw)
  To: dev; +Cc: ferruh.yigit

Set the rx and tx queue state appropriately when the queues or device are
started or stopped.

Signed-off-by: Gage Eads <gage.eads@intel.com>
---
 drivers/net/pcap/rte_eth_pcap.c | 42 +++++++++++++++++++++++++++++++++++++++++
 1 file changed, 42 insertions(+)

diff --git a/drivers/net/pcap/rte_eth_pcap.c b/drivers/net/pcap/rte_eth_pcap.c
index 6bd4a7d79..21e466bcd 100644
--- a/drivers/net/pcap/rte_eth_pcap.c
+++ b/drivers/net/pcap/rte_eth_pcap.c
@@ -430,6 +430,10 @@ eth_dev_start(struct rte_eth_dev *dev)
 				return -1;
 			rx->pcap = tx->pcap;
 		}
+
+		dev->data->tx_queue_state[0] = RTE_ETH_QUEUE_STATE_STARTED;
+		dev->data->rx_queue_state[0] = RTE_ETH_QUEUE_STATE_STARTED;
+
 		goto status_up;
 	}
 
@@ -490,6 +494,8 @@ eth_dev_stop(struct rte_eth_dev *dev)
 		pcap_close(tx->pcap);
 		tx->pcap = NULL;
 		rx->pcap = NULL;
+		dev->data->tx_queue_state[0] = RTE_ETH_QUEUE_STATE_STOPPED;
+		dev->data->rx_queue_state[0] = RTE_ETH_QUEUE_STATE_STOPPED;
 		goto status_down;
 	}
 
@@ -643,6 +649,38 @@ eth_tx_queue_setup(struct rte_eth_dev *dev,
 	return 0;
 }
 
+static int
+eth_rx_queue_start(struct rte_eth_dev *dev, uint16_t rx_queue_id)
+{
+	dev->data->rx_queue_state[rx_queue_id] = RTE_ETH_QUEUE_STATE_STARTED;
+
+	return 0;
+}
+
+static int
+eth_tx_queue_start(struct rte_eth_dev *dev, uint16_t tx_queue_id)
+{
+	dev->data->tx_queue_state[tx_queue_id] = RTE_ETH_QUEUE_STATE_STARTED;
+
+	return 0;
+}
+
+static int
+eth_rx_queue_stop(struct rte_eth_dev *dev, uint16_t rx_queue_id)
+{
+	dev->data->rx_queue_state[rx_queue_id] = RTE_ETH_QUEUE_STATE_STOPPED;
+
+	return 0;
+}
+
+static int
+eth_tx_queue_stop(struct rte_eth_dev *dev, uint16_t tx_queue_id)
+{
+	dev->data->tx_queue_state[tx_queue_id] = RTE_ETH_QUEUE_STATE_STOPPED;
+
+	return 0;
+}
+
 static const struct eth_dev_ops ops = {
 	.dev_start = eth_dev_start,
 	.dev_stop = eth_dev_stop,
@@ -651,6 +689,10 @@ static const struct eth_dev_ops ops = {
 	.dev_infos_get = eth_dev_info,
 	.rx_queue_setup = eth_rx_queue_setup,
 	.tx_queue_setup = eth_tx_queue_setup,
+	.rx_queue_start = eth_rx_queue_start,
+	.tx_queue_start = eth_tx_queue_start,
+	.rx_queue_stop = eth_rx_queue_stop,
+	.tx_queue_stop = eth_tx_queue_stop,
 	.rx_queue_release = eth_queue_release,
 	.tx_queue_release = eth_queue_release,
 	.link_update = eth_link_update,
-- 
2.13.6

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

end of thread, other threads:[~2018-07-19  9:56 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-07-09 20:21 [dpdk-dev] [PATCH] net/pcap: set queue started and stopped Gage Eads
2018-07-18  9:13 ` Ferruh Yigit
2018-07-18 14:17   ` Eads, Gage
2018-07-18 14:25     ` Ferruh Yigit
2018-07-18 16:04       ` Eads, Gage
2018-07-18 16:06         ` Ferruh Yigit
2018-07-18 16:30 ` [dpdk-dev] [PATCH v2] " Gage Eads
2018-07-19  9:32   ` Ferruh Yigit
2018-07-19  9:56     ` Ferruh Yigit

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).