From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga05.intel.com (mga05.intel.com [192.55.52.43]) by dpdk.org (Postfix) with ESMTP id AA7E48D4D for ; Mon, 9 Jul 2018 22:22:07 +0200 (CEST) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by fmsmga105.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 09 Jul 2018 13:22:06 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.51,330,1526367600"; d="scan'208";a="70885593" Received: from txasoft-yocto.an.intel.com ([10.123.72.192]) by fmsmga001.fm.intel.com with ESMTP; 09 Jul 2018 13:22:01 -0700 From: Gage Eads To: dev@dpdk.org Cc: ferruh.yigit@intel.com Date: Mon, 9 Jul 2018 15:21:59 -0500 Message-Id: <20180709202159.18726-1-gage.eads@intel.com> X-Mailer: git-send-email 2.13.6 Subject: [dpdk-dev] [PATCH] net/pcap: set queue started and stopped X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Jul 2018 20:22:08 -0000 Set the rx and tx queue state appropriately when the queues or device are started or stopped. Signed-off-by: Gage Eads --- 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