[dpdk-dev] [PATCH 1/2] net/virtio: add data elements to turn on/off traffic flow

Zhiyong Yang zhiyong.yang at intel.com
Fri Mar 31 13:40:18 CEST 2017


Add "rte_atomic32_t started" to turn on/off the RX/TX flow from
per port perspective.

Add rte_atomic32_t allow_queuing to control traffic flow from
per Queue perspective.

Signed-off-by: Zhiyong Yang <zhiyong.yang at intel.com>
---
 drivers/net/virtio/virtio_pci.h  | 1 +
 drivers/net/virtio/virtio_rxtx.h | 6 ++++++
 2 files changed, 7 insertions(+)

diff --git a/drivers/net/virtio/virtio_pci.h b/drivers/net/virtio/virtio_pci.h
index 0362acd..952ad62 100644
--- a/drivers/net/virtio/virtio_pci.h
+++ b/drivers/net/virtio/virtio_pci.h
@@ -253,6 +253,7 @@ struct virtio_hw {
 	uint64_t    req_guest_features;
 	uint64_t    guest_features;
 	uint32_t    max_queue_pairs;
+	rte_atomic32_t started;
 	uint16_t	max_mtu;
 	uint16_t    vtnet_hdr_size;
 	uint8_t	    vlan_strip;
diff --git a/drivers/net/virtio/virtio_rxtx.h b/drivers/net/virtio/virtio_rxtx.h
index 28f82d6..03357ae 100644
--- a/drivers/net/virtio/virtio_rxtx.h
+++ b/drivers/net/virtio/virtio_rxtx.h
@@ -60,6 +60,9 @@ struct virtnet_rx {
 	struct virtnet_stats stats;
 
 	const struct rte_memzone *mz; /**< mem zone to populate RX ring. */
+
+	/* a flag indicates whether allow to receive pkts. */
+	rte_atomic32_t allow_queuing;
 };
 
 struct virtnet_tx {
@@ -75,6 +78,9 @@ struct virtnet_tx {
 	struct virtnet_stats stats;
 
 	const struct rte_memzone *mz;    /**< mem zone to populate TX ring. */
+
+	/* a flag indicates whether allow to transmit pkts. */
+	rte_atomic32_t allow_queuing;
 };
 
 struct virtnet_ctl {
-- 
2.7.4



More information about the dev mailing list