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>
---
drivers/net/netvsc/hn_ethdev.c | 15 ++++++++++++++-
1 file changed, 14 insertions(+), 1 deletion(-)
Comments
On Fri, 7 Jul 2023 11:53:16 -0700
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>
> ---
> drivers/net/netvsc/hn_ethdev.c | 15 ++++++++++++++-
> 1 file changed, 14 insertions(+), 1 deletion(-)
Interesting that not all drivers do this.
Acked-by: Stephen Hemminger <stephen@networkplumber.org>
The ones not doing it.
af_packet
af_xdp
avp
axgbe
bnx2x
bonding
dpaa
dpaa2
e1000
ena
enetfec
gve
hinic
igc
ipn3ke
kni
liquidio
mana
memif
mlx4
netvsc
nfp
null
octeon_ep
pfe
ring
softnic
vdev_netvsc
vhost
virtio
vmxnet3
> Subject: Re: [PATCH] net/netvsc: set the correct queue state
>
> On Fri, 7 Jul 2023 11:53:16 -0700
> 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>
> > ---
> > drivers/net/netvsc/hn_ethdev.c | 15 ++++++++++++++-
> > 1 file changed, 14 insertions(+), 1 deletion(-)
>
> Interesting that not all drivers do this.
>
> Acked-by: Stephen Hemminger <stephen@networkplumber.org>
>
> The ones not doing it.
> af_packet
> af_xdp
> avp
> axgbe
> bnx2x
> bonding
> dpaa
> dpaa2
> e1000
> ena
> enetfec
> gve
> hinic
> igc
> ipn3ke
> kni
> liquidio
> mana
> memif
> mlx4
> netvsc
> nfp
> null
> octeon_ep
> pfe
> ring
> softnic
> vdev_netvsc
> vhost
> virtio
> vmxnet3
Testpmd added the check for stopped queues:
3c4426db54 app/testpmd: do not poll stopped queues
To pass testpmd, PMD needs to set queue state.
On Fri, 7 Jul 2023 20:43:51 +0000
Long Li <longli@microsoft.com> wrote:
> > Subject: Re: [PATCH] net/netvsc: set the correct queue state
> >
> > On Fri, 7 Jul 2023 11:53:16 -0700
> > 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>
> > > ---
> > > drivers/net/netvsc/hn_ethdev.c | 15 ++++++++++++++-
> > > 1 file changed, 14 insertions(+), 1 deletion(-)
> >
> > Interesting that not all drivers do this.
> >
> > Acked-by: Stephen Hemminger <stephen@networkplumber.org>
> >
> > The ones not doing it.
> > af_packet
> > af_xdp
> > avp
> > axgbe
> > bnx2x
> > bonding
> > dpaa
> > dpaa2
> > e1000
> > ena
> > enetfec
> > gve
> > hinic
> > igc
> > ipn3ke
> > kni
> > liquidio
> > mana
> > memif
> > mlx4
> > netvsc
> > nfp
> > null
> > octeon_ep
> > pfe
> > ring
> > softnic
> > vdev_netvsc
> > vhost
> > virtio
> > vmxnet3
>
> Testpmd added the check for stopped queues:
> 3c4426db54 app/testpmd: do not poll stopped queues
>
> To pass testpmd, PMD needs to set queue state.
So there are 20 drivers broken by that change!
Sounds like it needs to be reverted.
On 7/8/2023 2:52 AM, Stephen Hemminger wrote:
> On Fri, 7 Jul 2023 20:43:51 +0000
> Long Li <longli@microsoft.com> wrote:
>
>>> Subject: Re: [PATCH] net/netvsc: set the correct queue state
>>>
>>> On Fri, 7 Jul 2023 11:53:16 -0700
>>> 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>
>>>> ---
>>>> drivers/net/netvsc/hn_ethdev.c | 15 ++++++++++++++-
>>>> 1 file changed, 14 insertions(+), 1 deletion(-)
>>>
>>> Interesting that not all drivers do this.
>>>
>>> Acked-by: Stephen Hemminger <stephen@networkplumber.org>
>>>
>>> The ones not doing it.
>>> af_packet
>>> af_xdp
>>> avp
>>> axgbe
>>> bnx2x
>>> bonding
>>> dpaa
>>> dpaa2
>>> e1000
>>> ena
>>> enetfec
>>> gve
>>> hinic
>>> igc
>>> ipn3ke
>>> kni
>>> liquidio
>>> mana
>>> memif
>>> mlx4
>>> netvsc
>>> nfp
>>> null
>>> octeon_ep
>>> pfe
>>> ring
>>> softnic
>>> vdev_netvsc
>>> vhost
>>> virtio
>>> vmxnet3
>>
>> Testpmd added the check for stopped queues:
>> 3c4426db54 app/testpmd: do not poll stopped queues
>>
>> To pass testpmd, PMD needs to set queue state.
>
> So there are 20 drivers broken by that change!
> Sounds like it needs to be reverted.
>
testpmd change is already reverted in the next-net, but planned to merge
it back in next release, and we need driver changes in next release.
@@ -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