[v2] net/netvsc: set the correct queue state
Checks
Commit Message
From: Long Li <longli@microsoft.com>
Set the queue state when queue is started/stopped.
Signed-off-by: Long Li <longli@microsoft.com>
Acked-by: Stephen Hemminger <stephen@networkplumber.org>
---
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(-)
Comments
On 8/29/2023 7:29 PM, longli@linuxonhyperv.com wrote:
> From: Long Li <longli@microsoft.com>
>
> Set the queue state when queue is started/stopped.
>
> Signed-off-by: Long Li <longli@microsoft.com>
> Acked-by: Stephen Hemminger <stephen@networkplumber.org>
>
Applied to dpdk-next-net/main, thanks.
@@ -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