From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id A239C41F61; Tue, 29 Aug 2023 20:29:36 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 456DB40270; Tue, 29 Aug 2023 20:29:36 +0200 (CEST) Received: from linux.microsoft.com (linux.microsoft.com [13.77.154.182]) by mails.dpdk.org (Postfix) with ESMTP id F3E694026A for ; Tue, 29 Aug 2023 20:29:34 +0200 (CEST) Received: by linux.microsoft.com (Postfix, from userid 1004) id 3B3E72129BE2; Tue, 29 Aug 2023 11:29:34 -0700 (PDT) DKIM-Filter: OpenDKIM Filter v2.11.0 linux.microsoft.com 3B3E72129BE2 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxonhyperv.com; s=default; t=1693333774; bh=mUt00P5jBkTSO0r+TzOsjwgvDU2c4bg5uam9WgtZzmg=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=mJNJZKqH/L0diYTLs0OBsnpl+u7HVxmX1hGOTmBHoA9+Nm9KiwDux4LxKYwuxX16I Ilcz+lNPzOn9y03h/VqkQ7cehChZFms3Prh1yRua+XR+2WICpAzKnalSCFyLWjdXHV G+1IfzjDs8DFKQiR8itLwfIaVnjQvbAcs3T8CMdg= From: longli@linuxonhyperv.com To: Ferruh Yigit , Andrew Rybchenko Cc: dev@dpdk.org, Ajay Sharma , Long Li Subject: [Patch v2] net/netvsc: set the correct queue state Date: Tue, 29 Aug 2023 11:29:29 -0700 Message-Id: <1693333769-10296-1-git-send-email-longli@linuxonhyperv.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1688755996-25172-2-git-send-email-longli@linuxonhyperv.com> References: <1688755996-25172-2-git-send-email-longli@linuxonhyperv.com> X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org From: Long Li Set the queue state when queue is started/stopped. Signed-off-by: Long Li Acked-by: Stephen Hemminger --- Change since v1: Fixed the following building error error: 'for' loop initial declarations are only allowed in C99 mode drivers/net/netvsc/hn_ethdev.c | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/drivers/net/netvsc/hn_ethdev.c b/drivers/net/netvsc/hn_ethdev.c index d0bbc0a4c0..a6a51088b8 100644 --- a/drivers/net/netvsc/hn_ethdev.c +++ b/drivers/net/netvsc/hn_ethdev.c @@ -990,7 +990,7 @@ static int hn_dev_start(struct rte_eth_dev *dev) { struct hn_data *hv = dev->data->dev_private; - int error; + int i, error; PMD_INIT_FUNC_TRACE(); @@ -1017,6 +1017,11 @@ hn_dev_start(struct rte_eth_dev *dev) if (error == 0) hn_dev_link_update(dev, 0); + for (i = 0; i < hv->num_queues; i++) { + dev->data->tx_queue_state[i] = RTE_ETH_QUEUE_STATE_STARTED; + dev->data->rx_queue_state[i] = RTE_ETH_QUEUE_STATE_STARTED; + } + return error; } @@ -1024,13 +1029,21 @@ static int hn_dev_stop(struct rte_eth_dev *dev) { struct hn_data *hv = dev->data->dev_private; + int i, ret; PMD_INIT_FUNC_TRACE(); dev->data->dev_started = 0; rte_dev_event_callback_unregister(NULL, netvsc_hotadd_callback, hv); hn_rndis_set_rxfilter(hv, 0); - return hn_vf_stop(dev); + ret = hn_vf_stop(dev); + + for (i = 0; i < hv->num_queues; i++) { + dev->data->tx_queue_state[i] = RTE_ETH_QUEUE_STATE_STOPPED; + dev->data->rx_queue_state[i] = RTE_ETH_QUEUE_STATE_STOPPED; + } + + return ret; } static int -- 2.34.1