[dpdk-dev,1/2] net/virtio: add data elements to turn on/off traffic flow
Checks
Commit Message
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@intel.com>
---
drivers/net/virtio/virtio_pci.h | 1 +
drivers/net/virtio/virtio_rxtx.h | 6 ++++++
2 files changed, 7 insertions(+)
@@ -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;
@@ -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 {