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 8C85A42DFB; Fri, 7 Jul 2023 20:53:32 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 0358F40F16; Fri, 7 Jul 2023 20:53:30 +0200 (CEST) Received: from linux.microsoft.com (linux.microsoft.com [13.77.154.182]) by mails.dpdk.org (Postfix) with ESMTP id 8154C40ED8 for ; Fri, 7 Jul 2023 20:53:28 +0200 (CEST) Received: by linux.microsoft.com (Postfix, from userid 1004) id BF6E820C08F5; Fri, 7 Jul 2023 11:53:27 -0700 (PDT) DKIM-Filter: OpenDKIM Filter v2.11.0 linux.microsoft.com BF6E820C08F5 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxonhyperv.com; s=default; t=1688756007; bh=hO/jf5iPXh5ZGaytRSqTqT4N7pjmXUSkzNERiXBpG8Y=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Y5Xj9LlBa9o15kTdPpqRMwT8N9IfKo3/Drj2ASxELJAsd0QKvhpi179fF2u4cWuwt Te83luTUE7975JAQrkEHM2UDRvutyiK3ywiTIFBdYvA5V4RSHbAnGYqJjoNm9fZDbh I0RlJSxN3g4XNmPNO5X0BYmpwHeXH9l9OhPj/Qzk= From: longli@linuxonhyperv.com To: Ferruh Yigit , Andrew Rybchenko Cc: dev@dpdk.org, Ajay Sharma , Long Li Subject: [PATCH] net/netvsc: set the correct queue state Date: Fri, 7 Jul 2023 11:53:16 -0700 Message-Id: <1688755996-25172-2-git-send-email-longli@linuxonhyperv.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1688755996-25172-1-git-send-email-longli@linuxonhyperv.com> References: <1688755996-25172-1-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 --- drivers/net/netvsc/hn_ethdev.c | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/drivers/net/netvsc/hn_ethdev.c b/drivers/net/netvsc/hn_ethdev.c index d0bbc0a4c0..0c15f9f826 100644 --- a/drivers/net/netvsc/hn_ethdev.c +++ b/drivers/net/netvsc/hn_ethdev.c @@ -1017,6 +1017,11 @@ hn_dev_start(struct rte_eth_dev *dev) if (error == 0) hn_dev_link_update(dev, 0); + for (int 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 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 (int 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