DPDK patches and discussions
 help / color / mirror / Atom feed
* [dpdk-dev] [PATCH] ethdev: fix checking Rx/Tx queue status
@ 2018-05-11  8:22 Yanglong Wu
  2018-05-11  8:39 ` Ananyev, Konstantin
  0 siblings, 1 reply; 8+ messages in thread
From: Yanglong Wu @ 2018-05-11  8:22 UTC (permalink / raw)
  To: dev; +Cc: qi.z.zhang, wenzhuo.lu, Yanglong Wu

Relax the check for queue setup, since some device
may not update queue states during dev_stop.

Fixes: cac923cfea47 ("ethdev: support runtime queue setup")
Signed-off-by: Yanglong Wu <yanglong.wu@intel.com>
---
 lib/librte_ethdev/rte_ethdev.c | 10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)

diff --git a/lib/librte_ethdev/rte_ethdev.c b/lib/librte_ethdev/rte_ethdev.c
index a357ee09f..34379642a 100644
--- a/lib/librte_ethdev/rte_ethdev.c
+++ b/lib/librte_ethdev/rte_ethdev.c
@@ -1479,8 +1479,9 @@ rte_eth_rx_queue_setup(uint16_t port_id, uint16_t rx_queue_id,
 			RTE_ETH_DEV_CAPA_RUNTIME_RX_QUEUE_SETUP))
 		return -EBUSY;
 
-	if (dev->data->rx_queue_state[rx_queue_id] !=
-		RTE_ETH_QUEUE_STATE_STOPPED)
+	if (dev->data->dev_started &&
+		(dev->data->rx_queue_state[rx_queue_id] !=
+			RTE_ETH_QUEUE_STATE_STOPPED))
 		return -EBUSY;
 
 	rxq = dev->data->rx_queues;
@@ -1611,8 +1612,9 @@ rte_eth_tx_queue_setup(uint16_t port_id, uint16_t tx_queue_id,
 			RTE_ETH_DEV_CAPA_RUNTIME_TX_QUEUE_SETUP))
 		return -EBUSY;
 
-	if (dev->data->tx_queue_state[tx_queue_id] !=
-		RTE_ETH_QUEUE_STATE_STOPPED)
+	if (dev->data->dev_started &&
+		(dev->data->tx_queue_state[tx_queue_id] !=
+			RTE_ETH_QUEUE_STATE_STOPPED))
 		return -EBUSY;
 
 	txq = dev->data->tx_queues;
-- 
2.11.0

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [dpdk-dev] [PATCH] ethdev: fix checking Rx/Tx queue status
  2018-05-11  8:22 [dpdk-dev] [PATCH] ethdev: fix checking Rx/Tx queue status Yanglong Wu
@ 2018-05-11  8:39 ` Ananyev, Konstantin
  2018-05-11  9:23   ` Zhang, Qi Z
  0 siblings, 1 reply; 8+ messages in thread
From: Ananyev, Konstantin @ 2018-05-11  8:39 UTC (permalink / raw)
  To: Wu, Yanglong, dev; +Cc: Zhang, Qi Z, Lu, Wenzhuo, Wu, Yanglong



> -----Original Message-----
> From: dev [mailto:dev-bounces@dpdk.org] On Behalf Of Yanglong Wu
> Sent: Friday, May 11, 2018 9:22 AM
> To: dev@dpdk.org
> Cc: Zhang, Qi Z <qi.z.zhang@intel.com>; Lu, Wenzhuo <wenzhuo.lu@intel.com>; Wu, Yanglong <yanglong.wu@intel.com>
> Subject: [dpdk-dev] [PATCH] ethdev: fix checking Rx/Tx queue status
> 
> Relax the check for queue setup, since some device
> may not update queue states during dev_stop.
> 
> Fixes: cac923cfea47 ("ethdev: support runtime queue setup")
> Signed-off-by: Yanglong Wu <yanglong.wu@intel.com>
> ---
>  lib/librte_ethdev/rte_ethdev.c | 10 ++++++----
>  1 file changed, 6 insertions(+), 4 deletions(-)
> 
> diff --git a/lib/librte_ethdev/rte_ethdev.c b/lib/librte_ethdev/rte_ethdev.c
> index a357ee09f..34379642a 100644
> --- a/lib/librte_ethdev/rte_ethdev.c
> +++ b/lib/librte_ethdev/rte_ethdev.c
> @@ -1479,8 +1479,9 @@ rte_eth_rx_queue_setup(uint16_t port_id, uint16_t rx_queue_id,
>  			RTE_ETH_DEV_CAPA_RUNTIME_RX_QUEUE_SETUP))
>  		return -EBUSY;
> 
> -	if (dev->data->rx_queue_state[rx_queue_id] !=
> -		RTE_ETH_QUEUE_STATE_STOPPED)
> +	if (dev->data->dev_started &&
> +		(dev->data->rx_queue_state[rx_queue_id] !=
> +			RTE_ETH_QUEUE_STATE_STOPPED))
>  		return -EBUSY;
> 
>  	rxq = dev->data->rx_queues;
> @@ -1611,8 +1612,9 @@ rte_eth_tx_queue_setup(uint16_t port_id, uint16_t tx_queue_id,
>  			RTE_ETH_DEV_CAPA_RUNTIME_TX_QUEUE_SETUP))
>  		return -EBUSY;
> 
> -	if (dev->data->tx_queue_state[tx_queue_id] !=
> -		RTE_ETH_QUEUE_STATE_STOPPED)
> +	if (dev->data->dev_started &&
> +		(dev->data->tx_queue_state[tx_queue_id] !=
> +			RTE_ETH_QUEUE_STATE_STOPPED))
>  		return -EBUSY;
> 
>  	txq = dev->data->tx_queues;
> --

That would break runtime queue setup.
Why not fix offending PMDs instead?

> 2.11.0

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [dpdk-dev] [PATCH] ethdev: fix checking Rx/Tx queue status
  2018-05-11  8:39 ` Ananyev, Konstantin
@ 2018-05-11  9:23   ` Zhang, Qi Z
  2018-05-11  9:51     ` Ananyev, Konstantin
  0 siblings, 1 reply; 8+ messages in thread
From: Zhang, Qi Z @ 2018-05-11  9:23 UTC (permalink / raw)
  To: Ananyev, Konstantin, Wu, Yanglong, dev; +Cc: Lu, Wenzhuo, Wu, Yanglong



> -----Original Message-----
> From: Ananyev, Konstantin
> Sent: Friday, May 11, 2018 4:39 PM
> To: Wu, Yanglong <yanglong.wu@intel.com>; dev@dpdk.org
> Cc: Zhang, Qi Z <qi.z.zhang@intel.com>; Lu, Wenzhuo
> <wenzhuo.lu@intel.com>; Wu, Yanglong <yanglong.wu@intel.com>
> Subject: RE: [dpdk-dev] [PATCH] ethdev: fix checking Rx/Tx queue status
> 
> 
> 
> > -----Original Message-----
> > From: dev [mailto:dev-bounces@dpdk.org] On Behalf Of Yanglong Wu
> > Sent: Friday, May 11, 2018 9:22 AM
> > To: dev@dpdk.org
> > Cc: Zhang, Qi Z <qi.z.zhang@intel.com>; Lu, Wenzhuo
> > <wenzhuo.lu@intel.com>; Wu, Yanglong <yanglong.wu@intel.com>
> > Subject: [dpdk-dev] [PATCH] ethdev: fix checking Rx/Tx queue status
> >
> > Relax the check for queue setup, since some device may not update
> > queue states during dev_stop.
> >
> > Fixes: cac923cfea47 ("ethdev: support runtime queue setup")
> > Signed-off-by: Yanglong Wu <yanglong.wu@intel.com>
> > ---
> >  lib/librte_ethdev/rte_ethdev.c | 10 ++++++----
> >  1 file changed, 6 insertions(+), 4 deletions(-)
> >
> > diff --git a/lib/librte_ethdev/rte_ethdev.c
> > b/lib/librte_ethdev/rte_ethdev.c index a357ee09f..34379642a 100644
> > --- a/lib/librte_ethdev/rte_ethdev.c
> > +++ b/lib/librte_ethdev/rte_ethdev.c
> > @@ -1479,8 +1479,9 @@ rte_eth_rx_queue_setup(uint16_t port_id,
> uint16_t rx_queue_id,
> >  			RTE_ETH_DEV_CAPA_RUNTIME_RX_QUEUE_SETUP))
> >  		return -EBUSY;
> >
> > -	if (dev->data->rx_queue_state[rx_queue_id] !=
> > -		RTE_ETH_QUEUE_STATE_STOPPED)
> > +	if (dev->data->dev_started &&
> > +		(dev->data->rx_queue_state[rx_queue_id] !=
> > +			RTE_ETH_QUEUE_STATE_STOPPED))
> >  		return -EBUSY;
> >
> >  	rxq = dev->data->rx_queues;
> > @@ -1611,8 +1612,9 @@ rte_eth_tx_queue_setup(uint16_t port_id,
> uint16_t tx_queue_id,
> >  			RTE_ETH_DEV_CAPA_RUNTIME_TX_QUEUE_SETUP))
> >  		return -EBUSY;
> >
> > -	if (dev->data->tx_queue_state[tx_queue_id] !=
> > -		RTE_ETH_QUEUE_STATE_STOPPED)
> > +	if (dev->data->dev_started &&
> > +		(dev->data->tx_queue_state[tx_queue_id] !=
> > +			RTE_ETH_QUEUE_STATE_STOPPED))
> >  		return -EBUSY;
> >
> >  	txq = dev->data->tx_queues;
> > --
> 
> That would break runtime queue setup.

Em... would you explain more, I can't figure out why this break runtime queue setup so far.

> Why not fix offending PMDs instead?

Ixgbe, i40e have this issue, not sure what about others.
probably we should fix at rte_eth_dev_stop to save all PMD?

> 
> > 2.11.0

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [dpdk-dev] [PATCH] ethdev: fix checking Rx/Tx queue status
  2018-05-11  9:23   ` Zhang, Qi Z
@ 2018-05-11  9:51     ` Ananyev, Konstantin
  2018-05-11 12:34       ` Zhang, Qi Z
  2018-05-11 15:43       ` Ferruh Yigit
  0 siblings, 2 replies; 8+ messages in thread
From: Ananyev, Konstantin @ 2018-05-11  9:51 UTC (permalink / raw)
  To: Zhang, Qi Z, Wu, Yanglong, dev; +Cc: Lu, Wenzhuo, Wu, Yanglong



> -----Original Message-----
> From: Zhang, Qi Z
> Sent: Friday, May 11, 2018 10:24 AM
> To: Ananyev, Konstantin <konstantin.ananyev@intel.com>; Wu, Yanglong <yanglong.wu@intel.com>; dev@dpdk.org
> Cc: Lu, Wenzhuo <wenzhuo.lu@intel.com>; Wu, Yanglong <yanglong.wu@intel.com>
> Subject: RE: [dpdk-dev] [PATCH] ethdev: fix checking Rx/Tx queue status
> 
> 
> 
> > -----Original Message-----
> > From: Ananyev, Konstantin
> > Sent: Friday, May 11, 2018 4:39 PM
> > To: Wu, Yanglong <yanglong.wu@intel.com>; dev@dpdk.org
> > Cc: Zhang, Qi Z <qi.z.zhang@intel.com>; Lu, Wenzhuo
> > <wenzhuo.lu@intel.com>; Wu, Yanglong <yanglong.wu@intel.com>
> > Subject: RE: [dpdk-dev] [PATCH] ethdev: fix checking Rx/Tx queue status
> >
> >
> >
> > > -----Original Message-----
> > > From: dev [mailto:dev-bounces@dpdk.org] On Behalf Of Yanglong Wu
> > > Sent: Friday, May 11, 2018 9:22 AM
> > > To: dev@dpdk.org
> > > Cc: Zhang, Qi Z <qi.z.zhang@intel.com>; Lu, Wenzhuo
> > > <wenzhuo.lu@intel.com>; Wu, Yanglong <yanglong.wu@intel.com>
> > > Subject: [dpdk-dev] [PATCH] ethdev: fix checking Rx/Tx queue status
> > >
> > > Relax the check for queue setup, since some device may not update
> > > queue states during dev_stop.
> > >
> > > Fixes: cac923cfea47 ("ethdev: support runtime queue setup")
> > > Signed-off-by: Yanglong Wu <yanglong.wu@intel.com>
> > > ---
> > >  lib/librte_ethdev/rte_ethdev.c | 10 ++++++----
> > >  1 file changed, 6 insertions(+), 4 deletions(-)
> > >
> > > diff --git a/lib/librte_ethdev/rte_ethdev.c
> > > b/lib/librte_ethdev/rte_ethdev.c index a357ee09f..34379642a 100644
> > > --- a/lib/librte_ethdev/rte_ethdev.c
> > > +++ b/lib/librte_ethdev/rte_ethdev.c
> > > @@ -1479,8 +1479,9 @@ rte_eth_rx_queue_setup(uint16_t port_id,
> > uint16_t rx_queue_id,
> > >  			RTE_ETH_DEV_CAPA_RUNTIME_RX_QUEUE_SETUP))
> > >  		return -EBUSY;
> > >
> > > -	if (dev->data->rx_queue_state[rx_queue_id] !=
> > > -		RTE_ETH_QUEUE_STATE_STOPPED)
> > > +	if (dev->data->dev_started &&
> > > +		(dev->data->rx_queue_state[rx_queue_id] !=
> > > +			RTE_ETH_QUEUE_STATE_STOPPED))
> > >  		return -EBUSY;
> > >
> > >  	rxq = dev->data->rx_queues;
> > > @@ -1611,8 +1612,9 @@ rte_eth_tx_queue_setup(uint16_t port_id,
> > uint16_t tx_queue_id,
> > >  			RTE_ETH_DEV_CAPA_RUNTIME_TX_QUEUE_SETUP))
> > >  		return -EBUSY;
> > >
> > > -	if (dev->data->tx_queue_state[tx_queue_id] !=
> > > -		RTE_ETH_QUEUE_STATE_STOPPED)
> > > +	if (dev->data->dev_started &&
> > > +		(dev->data->tx_queue_state[tx_queue_id] !=
> > > +			RTE_ETH_QUEUE_STATE_STOPPED))
> > >  		return -EBUSY;
> > >
> > >  	txq = dev->data->tx_queues;
> > > --
> >
> > That would break runtime queue setup.
> 
> Em... would you explain more, I can't figure out why this break runtime queue setup so far.

Ah yes, it was me not reading code properly.
So yep - you right  it wouldn't break things.

> 
> > Why not fix offending PMDs instead?
> 
> Ixgbe, i40e have this issue, not sure what about others.
> probably we should fix at rte_eth_dev_stop to save all PMD?

Probably yes, that's a good thing to do in long term anyway.

> 
> >
> > > 2.11.0

Acked-by: Konstantin Ananyev <konstantin.ananyev@intel.com>

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [dpdk-dev] [PATCH] ethdev: fix checking Rx/Tx queue status
  2018-05-11  9:51     ` Ananyev, Konstantin
@ 2018-05-11 12:34       ` Zhang, Qi Z
  2018-05-11 12:52         ` Ananyev, Konstantin
  2018-05-11 15:43       ` Ferruh Yigit
  1 sibling, 1 reply; 8+ messages in thread
From: Zhang, Qi Z @ 2018-05-11 12:34 UTC (permalink / raw)
  To: Ananyev, Konstantin, Wu, Yanglong, dev; +Cc: Lu, Wenzhuo, Wu, Yanglong



> -----Original Message-----
> From: Ananyev, Konstantin
> Sent: Friday, May 11, 2018 5:51 PM
> To: Zhang, Qi Z <qi.z.zhang@intel.com>; Wu, Yanglong
> <yanglong.wu@intel.com>; dev@dpdk.org
> Cc: Lu, Wenzhuo <wenzhuo.lu@intel.com>; Wu, Yanglong
> <yanglong.wu@intel.com>
> Subject: RE: [dpdk-dev] [PATCH] ethdev: fix checking Rx/Tx queue status
> 
> 
> 
> > -----Original Message-----
> > From: Zhang, Qi Z
> > Sent: Friday, May 11, 2018 10:24 AM
> > To: Ananyev, Konstantin <konstantin.ananyev@intel.com>; Wu, Yanglong
> > <yanglong.wu@intel.com>; dev@dpdk.org
> > Cc: Lu, Wenzhuo <wenzhuo.lu@intel.com>; Wu, Yanglong
> > <yanglong.wu@intel.com>
> > Subject: RE: [dpdk-dev] [PATCH] ethdev: fix checking Rx/Tx queue
> > status
> >
> >
> >
> > > -----Original Message-----
> > > From: Ananyev, Konstantin
> > > Sent: Friday, May 11, 2018 4:39 PM
> > > To: Wu, Yanglong <yanglong.wu@intel.com>; dev@dpdk.org
> > > Cc: Zhang, Qi Z <qi.z.zhang@intel.com>; Lu, Wenzhuo
> > > <wenzhuo.lu@intel.com>; Wu, Yanglong <yanglong.wu@intel.com>
> > > Subject: RE: [dpdk-dev] [PATCH] ethdev: fix checking Rx/Tx queue
> > > status
> > >
> > >
> > >
> > > > -----Original Message-----
> > > > From: dev [mailto:dev-bounces@dpdk.org] On Behalf Of Yanglong Wu
> > > > Sent: Friday, May 11, 2018 9:22 AM
> > > > To: dev@dpdk.org
> > > > Cc: Zhang, Qi Z <qi.z.zhang@intel.com>; Lu, Wenzhuo
> > > > <wenzhuo.lu@intel.com>; Wu, Yanglong <yanglong.wu@intel.com>
> > > > Subject: [dpdk-dev] [PATCH] ethdev: fix checking Rx/Tx queue
> > > > status
> > > >
> > > > Relax the check for queue setup, since some device may not update
> > > > queue states during dev_stop.
> > > >
> > > > Fixes: cac923cfea47 ("ethdev: support runtime queue setup")
> > > > Signed-off-by: Yanglong Wu <yanglong.wu@intel.com>
> > > > ---
> > > >  lib/librte_ethdev/rte_ethdev.c | 10 ++++++----
> > > >  1 file changed, 6 insertions(+), 4 deletions(-)
> > > >
> > > > diff --git a/lib/librte_ethdev/rte_ethdev.c
> > > > b/lib/librte_ethdev/rte_ethdev.c index a357ee09f..34379642a 100644
> > > > --- a/lib/librte_ethdev/rte_ethdev.c
> > > > +++ b/lib/librte_ethdev/rte_ethdev.c
> > > > @@ -1479,8 +1479,9 @@ rte_eth_rx_queue_setup(uint16_t port_id,
> > > uint16_t rx_queue_id,
> > > >  			RTE_ETH_DEV_CAPA_RUNTIME_RX_QUEUE_SETUP))
> > > >  		return -EBUSY;
> > > >
> > > > -	if (dev->data->rx_queue_state[rx_queue_id] !=
> > > > -		RTE_ETH_QUEUE_STATE_STOPPED)
> > > > +	if (dev->data->dev_started &&
> > > > +		(dev->data->rx_queue_state[rx_queue_id] !=
> > > > +			RTE_ETH_QUEUE_STATE_STOPPED))
> > > >  		return -EBUSY;
> > > >
> > > >  	rxq = dev->data->rx_queues;
> > > > @@ -1611,8 +1612,9 @@ rte_eth_tx_queue_setup(uint16_t port_id,
> > > uint16_t tx_queue_id,
> > > >  			RTE_ETH_DEV_CAPA_RUNTIME_TX_QUEUE_SETUP))
> > > >  		return -EBUSY;
> > > >
> > > > -	if (dev->data->tx_queue_state[tx_queue_id] !=
> > > > -		RTE_ETH_QUEUE_STATE_STOPPED)
> > > > +	if (dev->data->dev_started &&
> > > > +		(dev->data->tx_queue_state[tx_queue_id] !=
> > > > +			RTE_ETH_QUEUE_STATE_STOPPED))
> > > >  		return -EBUSY;
> > > >
> > > >  	txq = dev->data->tx_queues;
> > > > --
> > >
> > > That would break runtime queue setup.
> >
> > Em... would you explain more, I can't figure out why this break runtime
> queue setup so far.
> 
> Ah yes, it was me not reading code properly.
> So yep - you right  it wouldn't break things.
> 
> >
> > > Why not fix offending PMDs instead?
> >
> > Ixgbe, i40e have this issue, not sure what about others.
> > probably we should fix at rte_eth_dev_stop to save all PMD?
> 
> Probably yes, that's a good thing to do in long term anyway.

I'm thinking if it's better to move all queue state change into ethdev layer.
So there could be a patch to update queue states properly at dev_start/dev_stop/queue_start/queue_stop and maintainer help them self to cleanup PMD, and I think our proposed fix should be part of this.
But for now, can we just keep current simple fix?

Regards
Qi

> 
> >
> > >
> > > > 2.11.0
> 
> Acked-by: Konstantin Ananyev <konstantin.ananyev@intel.com>

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [dpdk-dev] [PATCH] ethdev: fix checking Rx/Tx queue status
  2018-05-11 12:34       ` Zhang, Qi Z
@ 2018-05-11 12:52         ` Ananyev, Konstantin
  2018-05-11 13:33           ` Zhang, Qi Z
  0 siblings, 1 reply; 8+ messages in thread
From: Ananyev, Konstantin @ 2018-05-11 12:52 UTC (permalink / raw)
  To: Zhang, Qi Z, Wu, Yanglong, dev; +Cc: Lu, Wenzhuo, Wu, Yanglong



> -----Original Message-----
> From: Zhang, Qi Z
> Sent: Friday, May 11, 2018 1:34 PM
> To: Ananyev, Konstantin <konstantin.ananyev@intel.com>; Wu, Yanglong <yanglong.wu@intel.com>; dev@dpdk.org
> Cc: Lu, Wenzhuo <wenzhuo.lu@intel.com>; Wu, Yanglong <yanglong.wu@intel.com>
> Subject: RE: [dpdk-dev] [PATCH] ethdev: fix checking Rx/Tx queue status
> 
> 
> 
> > -----Original Message-----
> > From: Ananyev, Konstantin
> > Sent: Friday, May 11, 2018 5:51 PM
> > To: Zhang, Qi Z <qi.z.zhang@intel.com>; Wu, Yanglong
> > <yanglong.wu@intel.com>; dev@dpdk.org
> > Cc: Lu, Wenzhuo <wenzhuo.lu@intel.com>; Wu, Yanglong
> > <yanglong.wu@intel.com>
> > Subject: RE: [dpdk-dev] [PATCH] ethdev: fix checking Rx/Tx queue status
> >
> >
> >
> > > -----Original Message-----
> > > From: Zhang, Qi Z
> > > Sent: Friday, May 11, 2018 10:24 AM
> > > To: Ananyev, Konstantin <konstantin.ananyev@intel.com>; Wu, Yanglong
> > > <yanglong.wu@intel.com>; dev@dpdk.org
> > > Cc: Lu, Wenzhuo <wenzhuo.lu@intel.com>; Wu, Yanglong
> > > <yanglong.wu@intel.com>
> > > Subject: RE: [dpdk-dev] [PATCH] ethdev: fix checking Rx/Tx queue
> > > status
> > >
> > >
> > >
> > > > -----Original Message-----
> > > > From: Ananyev, Konstantin
> > > > Sent: Friday, May 11, 2018 4:39 PM
> > > > To: Wu, Yanglong <yanglong.wu@intel.com>; dev@dpdk.org
> > > > Cc: Zhang, Qi Z <qi.z.zhang@intel.com>; Lu, Wenzhuo
> > > > <wenzhuo.lu@intel.com>; Wu, Yanglong <yanglong.wu@intel.com>
> > > > Subject: RE: [dpdk-dev] [PATCH] ethdev: fix checking Rx/Tx queue
> > > > status
> > > >
> > > >
> > > >
> > > > > -----Original Message-----
> > > > > From: dev [mailto:dev-bounces@dpdk.org] On Behalf Of Yanglong Wu
> > > > > Sent: Friday, May 11, 2018 9:22 AM
> > > > > To: dev@dpdk.org
> > > > > Cc: Zhang, Qi Z <qi.z.zhang@intel.com>; Lu, Wenzhuo
> > > > > <wenzhuo.lu@intel.com>; Wu, Yanglong <yanglong.wu@intel.com>
> > > > > Subject: [dpdk-dev] [PATCH] ethdev: fix checking Rx/Tx queue
> > > > > status
> > > > >
> > > > > Relax the check for queue setup, since some device may not update
> > > > > queue states during dev_stop.
> > > > >
> > > > > Fixes: cac923cfea47 ("ethdev: support runtime queue setup")
> > > > > Signed-off-by: Yanglong Wu <yanglong.wu@intel.com>
> > > > > ---
> > > > >  lib/librte_ethdev/rte_ethdev.c | 10 ++++++----
> > > > >  1 file changed, 6 insertions(+), 4 deletions(-)
> > > > >
> > > > > diff --git a/lib/librte_ethdev/rte_ethdev.c
> > > > > b/lib/librte_ethdev/rte_ethdev.c index a357ee09f..34379642a 100644
> > > > > --- a/lib/librte_ethdev/rte_ethdev.c
> > > > > +++ b/lib/librte_ethdev/rte_ethdev.c
> > > > > @@ -1479,8 +1479,9 @@ rte_eth_rx_queue_setup(uint16_t port_id,
> > > > uint16_t rx_queue_id,
> > > > >  			RTE_ETH_DEV_CAPA_RUNTIME_RX_QUEUE_SETUP))
> > > > >  		return -EBUSY;
> > > > >
> > > > > -	if (dev->data->rx_queue_state[rx_queue_id] !=
> > > > > -		RTE_ETH_QUEUE_STATE_STOPPED)
> > > > > +	if (dev->data->dev_started &&
> > > > > +		(dev->data->rx_queue_state[rx_queue_id] !=
> > > > > +			RTE_ETH_QUEUE_STATE_STOPPED))
> > > > >  		return -EBUSY;
> > > > >
> > > > >  	rxq = dev->data->rx_queues;
> > > > > @@ -1611,8 +1612,9 @@ rte_eth_tx_queue_setup(uint16_t port_id,
> > > > uint16_t tx_queue_id,
> > > > >  			RTE_ETH_DEV_CAPA_RUNTIME_TX_QUEUE_SETUP))
> > > > >  		return -EBUSY;
> > > > >
> > > > > -	if (dev->data->tx_queue_state[tx_queue_id] !=
> > > > > -		RTE_ETH_QUEUE_STATE_STOPPED)
> > > > > +	if (dev->data->dev_started &&
> > > > > +		(dev->data->tx_queue_state[tx_queue_id] !=
> > > > > +			RTE_ETH_QUEUE_STATE_STOPPED))
> > > > >  		return -EBUSY;
> > > > >
> > > > >  	txq = dev->data->tx_queues;
> > > > > --
> > > >
> > > > That would break runtime queue setup.
> > >
> > > Em... would you explain more, I can't figure out why this break runtime
> > queue setup so far.
> >
> > Ah yes, it was me not reading code properly.
> > So yep - you right  it wouldn't break things.
> >
> > >
> > > > Why not fix offending PMDs instead?
> > >
> > > Ixgbe, i40e have this issue, not sure what about others.
> > > probably we should fix at rte_eth_dev_stop to save all PMD?
> >
> > Probably yes, that's a good thing to do in long term anyway.
> 
> I'm thinking if it's better to move all queue state change into ethdev layer.
> So there could be a patch to update queue states properly at dev_start/dev_stop/queue_start/queue_stop and maintainer help
> them self to cleanup PMD, and I think our proposed fix should be part of this.
> But for now, can we just keep current simple fix?

Yes, I think that's a good one, that's why I acked it, see below.
Konstantin

> 
> Regards
> Qi
> 
> >
> > >
> > > >
> > > > > 2.11.0
> >
> > Acked-by: Konstantin Ananyev <konstantin.ananyev@intel.com>

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [dpdk-dev] [PATCH] ethdev: fix checking Rx/Tx queue status
  2018-05-11 12:52         ` Ananyev, Konstantin
@ 2018-05-11 13:33           ` Zhang, Qi Z
  0 siblings, 0 replies; 8+ messages in thread
From: Zhang, Qi Z @ 2018-05-11 13:33 UTC (permalink / raw)
  To: Ananyev, Konstantin, Wu, Yanglong, dev; +Cc: Lu, Wenzhuo, Wu, Yanglong



> -----Original Message-----
> From: Ananyev, Konstantin
> Sent: Friday, May 11, 2018 8:53 PM
> To: Zhang, Qi Z <qi.z.zhang@intel.com>; Wu, Yanglong
> <yanglong.wu@intel.com>; dev@dpdk.org
> Cc: Lu, Wenzhuo <wenzhuo.lu@intel.com>; Wu, Yanglong
> <yanglong.wu@intel.com>
> Subject: RE: [dpdk-dev] [PATCH] ethdev: fix checking Rx/Tx queue status
> 
> 
> 
> > -----Original Message-----
> > From: Zhang, Qi Z
> > Sent: Friday, May 11, 2018 1:34 PM
> > To: Ananyev, Konstantin <konstantin.ananyev@intel.com>; Wu, Yanglong
> > <yanglong.wu@intel.com>; dev@dpdk.org
> > Cc: Lu, Wenzhuo <wenzhuo.lu@intel.com>; Wu, Yanglong
> > <yanglong.wu@intel.com>
> > Subject: RE: [dpdk-dev] [PATCH] ethdev: fix checking Rx/Tx queue
> > status
> >
> >
> >
> > > -----Original Message-----
> > > From: Ananyev, Konstantin
> > > Sent: Friday, May 11, 2018 5:51 PM
> > > To: Zhang, Qi Z <qi.z.zhang@intel.com>; Wu, Yanglong
> > > <yanglong.wu@intel.com>; dev@dpdk.org
> > > Cc: Lu, Wenzhuo <wenzhuo.lu@intel.com>; Wu, Yanglong
> > > <yanglong.wu@intel.com>
> > > Subject: RE: [dpdk-dev] [PATCH] ethdev: fix checking Rx/Tx queue
> > > status
> > >
> > >
> > >
> > > > -----Original Message-----
> > > > From: Zhang, Qi Z
> > > > Sent: Friday, May 11, 2018 10:24 AM
> > > > To: Ananyev, Konstantin <konstantin.ananyev@intel.com>; Wu,
> > > > Yanglong <yanglong.wu@intel.com>; dev@dpdk.org
> > > > Cc: Lu, Wenzhuo <wenzhuo.lu@intel.com>; Wu, Yanglong
> > > > <yanglong.wu@intel.com>
> > > > Subject: RE: [dpdk-dev] [PATCH] ethdev: fix checking Rx/Tx queue
> > > > status
> > > >
> > > >
> > > >
> > > > > -----Original Message-----
> > > > > From: Ananyev, Konstantin
> > > > > Sent: Friday, May 11, 2018 4:39 PM
> > > > > To: Wu, Yanglong <yanglong.wu@intel.com>; dev@dpdk.org
> > > > > Cc: Zhang, Qi Z <qi.z.zhang@intel.com>; Lu, Wenzhuo
> > > > > <wenzhuo.lu@intel.com>; Wu, Yanglong <yanglong.wu@intel.com>
> > > > > Subject: RE: [dpdk-dev] [PATCH] ethdev: fix checking Rx/Tx queue
> > > > > status
> > > > >
> > > > >
> > > > >
> > > > > > -----Original Message-----
> > > > > > From: dev [mailto:dev-bounces@dpdk.org] On Behalf Of Yanglong
> > > > > > Wu
> > > > > > Sent: Friday, May 11, 2018 9:22 AM
> > > > > > To: dev@dpdk.org
> > > > > > Cc: Zhang, Qi Z <qi.z.zhang@intel.com>; Lu, Wenzhuo
> > > > > > <wenzhuo.lu@intel.com>; Wu, Yanglong <yanglong.wu@intel.com>
> > > > > > Subject: [dpdk-dev] [PATCH] ethdev: fix checking Rx/Tx queue
> > > > > > status
> > > > > >
> > > > > > Relax the check for queue setup, since some device may not
> > > > > > update queue states during dev_stop.
> > > > > >
> > > > > > Fixes: cac923cfea47 ("ethdev: support runtime queue setup")
> > > > > > Signed-off-by: Yanglong Wu <yanglong.wu@intel.com>
> > > > > > ---
> > > > > >  lib/librte_ethdev/rte_ethdev.c | 10 ++++++----
> > > > > >  1 file changed, 6 insertions(+), 4 deletions(-)
> > > > > >
> > > > > > diff --git a/lib/librte_ethdev/rte_ethdev.c
> > > > > > b/lib/librte_ethdev/rte_ethdev.c index a357ee09f..34379642a
> > > > > > 100644
> > > > > > --- a/lib/librte_ethdev/rte_ethdev.c
> > > > > > +++ b/lib/librte_ethdev/rte_ethdev.c
> > > > > > @@ -1479,8 +1479,9 @@ rte_eth_rx_queue_setup(uint16_t port_id,
> > > > > uint16_t rx_queue_id,
> > > > > >  			RTE_ETH_DEV_CAPA_RUNTIME_RX_QUEUE_SETUP))
> > > > > >  		return -EBUSY;
> > > > > >
> > > > > > -	if (dev->data->rx_queue_state[rx_queue_id] !=
> > > > > > -		RTE_ETH_QUEUE_STATE_STOPPED)
> > > > > > +	if (dev->data->dev_started &&
> > > > > > +		(dev->data->rx_queue_state[rx_queue_id] !=
> > > > > > +			RTE_ETH_QUEUE_STATE_STOPPED))
> > > > > >  		return -EBUSY;
> > > > > >
> > > > > >  	rxq = dev->data->rx_queues;
> > > > > > @@ -1611,8 +1612,9 @@ rte_eth_tx_queue_setup(uint16_t port_id,
> > > > > uint16_t tx_queue_id,
> > > > > >  			RTE_ETH_DEV_CAPA_RUNTIME_TX_QUEUE_SETUP))
> > > > > >  		return -EBUSY;
> > > > > >
> > > > > > -	if (dev->data->tx_queue_state[tx_queue_id] !=
> > > > > > -		RTE_ETH_QUEUE_STATE_STOPPED)
> > > > > > +	if (dev->data->dev_started &&
> > > > > > +		(dev->data->tx_queue_state[tx_queue_id] !=
> > > > > > +			RTE_ETH_QUEUE_STATE_STOPPED))
> > > > > >  		return -EBUSY;
> > > > > >
> > > > > >  	txq = dev->data->tx_queues;
> > > > > > --
> > > > >
> > > > > That would break runtime queue setup.
> > > >
> > > > Em... would you explain more, I can't figure out why this break
> > > > runtime
> > > queue setup so far.
> > >
> > > Ah yes, it was me not reading code properly.
> > > So yep - you right  it wouldn't break things.
> > >
> > > >
> > > > > Why not fix offending PMDs instead?
> > > >
> > > > Ixgbe, i40e have this issue, not sure what about others.
> > > > probably we should fix at rte_eth_dev_stop to save all PMD?
> > >
> > > Probably yes, that's a good thing to do in long term anyway.
> >
> > I'm thinking if it's better to move all queue state change into ethdev layer.
> > So there could be a patch to update queue states properly at
> > dev_start/dev_stop/queue_start/queue_stop and maintainer help them self
> to cleanup PMD, and I think our proposed fix should be part of this.
> > But for now, can we just keep current simple fix?
> 
> Yes, I think that's a good one, that's why I acked it, see below.
> Konstantin

oh, I missed that :)
> 
> >
> > Regards
> > Qi
> >
> > >
> > > >
> > > > >
> > > > > > 2.11.0
> > >
> > > Acked-by: Konstantin Ananyev <konstantin.ananyev@intel.com>

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [dpdk-dev] [PATCH] ethdev: fix checking Rx/Tx queue status
  2018-05-11  9:51     ` Ananyev, Konstantin
  2018-05-11 12:34       ` Zhang, Qi Z
@ 2018-05-11 15:43       ` Ferruh Yigit
  1 sibling, 0 replies; 8+ messages in thread
From: Ferruh Yigit @ 2018-05-11 15:43 UTC (permalink / raw)
  To: Ananyev, Konstantin, Zhang, Qi Z, Wu, Yanglong, dev; +Cc: Lu, Wenzhuo

On 5/11/2018 10:51 AM, Ananyev, Konstantin wrote:
> 
> 
>> -----Original Message-----
>> From: Zhang, Qi Z
>> Sent: Friday, May 11, 2018 10:24 AM
>> To: Ananyev, Konstantin <konstantin.ananyev@intel.com>; Wu, Yanglong <yanglong.wu@intel.com>; dev@dpdk.org
>> Cc: Lu, Wenzhuo <wenzhuo.lu@intel.com>; Wu, Yanglong <yanglong.wu@intel.com>
>> Subject: RE: [dpdk-dev] [PATCH] ethdev: fix checking Rx/Tx queue status
>>
>>
>>
>>> -----Original Message-----
>>> From: Ananyev, Konstantin
>>> Sent: Friday, May 11, 2018 4:39 PM
>>> To: Wu, Yanglong <yanglong.wu@intel.com>; dev@dpdk.org
>>> Cc: Zhang, Qi Z <qi.z.zhang@intel.com>; Lu, Wenzhuo
>>> <wenzhuo.lu@intel.com>; Wu, Yanglong <yanglong.wu@intel.com>
>>> Subject: RE: [dpdk-dev] [PATCH] ethdev: fix checking Rx/Tx queue status
>>>
>>>
>>>
>>>> -----Original Message-----
>>>> From: dev [mailto:dev-bounces@dpdk.org] On Behalf Of Yanglong Wu
>>>> Sent: Friday, May 11, 2018 9:22 AM
>>>> To: dev@dpdk.org
>>>> Cc: Zhang, Qi Z <qi.z.zhang@intel.com>; Lu, Wenzhuo
>>>> <wenzhuo.lu@intel.com>; Wu, Yanglong <yanglong.wu@intel.com>
>>>> Subject: [dpdk-dev] [PATCH] ethdev: fix checking Rx/Tx queue status
>>>>
>>>> Relax the check for queue setup, since some device may not update
>>>> queue states during dev_stop.
>>>>
>>>> Fixes: cac923cfea47 ("ethdev: support runtime queue setup")
>>>> Signed-off-by: Yanglong Wu <yanglong.wu@intel.com>

> Acked-by: Konstantin Ananyev <konstantin.ananyev@intel.com>

Applied to dpdk-next-net/master, thanks.

^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2018-05-11 15:43 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-05-11  8:22 [dpdk-dev] [PATCH] ethdev: fix checking Rx/Tx queue status Yanglong Wu
2018-05-11  8:39 ` Ananyev, Konstantin
2018-05-11  9:23   ` Zhang, Qi Z
2018-05-11  9:51     ` Ananyev, Konstantin
2018-05-11 12:34       ` Zhang, Qi Z
2018-05-11 12:52         ` Ananyev, Konstantin
2018-05-11 13:33           ` Zhang, Qi Z
2018-05-11 15:43       ` Ferruh Yigit

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).