From mboxrd@z Thu Jan 1 00:00:00 1970 From: Zhiyong Yang Subject: [PATCH 1/2] net/virtio: add data elements to turn on/off traffic flow Date: Fri, 31 Mar 2017 19:40:18 +0800 Message-ID: <1490960419-16779-2-git-send-email-zhiyong.yang@intel.com> References: <1490960419-16779-1-git-send-email-zhiyong.yang@intel.com> Cc: yuanhan.liu@linux.intel.com, maxime.coquelin@redhat.com, Zhiyong Yang To: dev@dpdk.org Return-path: Received: from mga11.intel.com (mga11.intel.com [192.55.52.93]) by dpdk.org (Postfix) with ESMTP id 3CFE6108D for ; Fri, 31 Mar 2017 13:44:12 +0200 (CEST) In-Reply-To: <1490960419-16779-1-git-send-email-zhiyong.yang@intel.com> List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" 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 --- 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