DPDK patches and discussions
 help / color / mirror / Atom feed
* [dpdk-dev] [PATCH] fm10k: fix 2 bugs in rxtx_queue_disable and fm10k_dev_start
@ 2015-07-31  5:05 Wang Xiao W
  2015-07-31  5:45 ` Chen, Jing D
  0 siblings, 1 reply; 3+ messages in thread
From: Wang Xiao W @ 2015-07-31  5:05 UTC (permalink / raw)
  To: dev; +Cc: Wang Xiao W

In Rx and Tx queue_disable functions, the index of queue should
be qnum other than i which is the iteration of time expiration.
When a Tx queue fails to start in fm10k_dev_start, all Rx queues
and Tx queues that are started should be cleaned before the
function returns an error.

Signed-off-by: Wang Xiao W <xiao.w.wang@intel.com>
---
 drivers/net/fm10k/fm10k_ethdev.c | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/drivers/net/fm10k/fm10k_ethdev.c b/drivers/net/fm10k/fm10k_ethdev.c
index 902ccae..35f34bb 100644
--- a/drivers/net/fm10k/fm10k_ethdev.c
+++ b/drivers/net/fm10k/fm10k_ethdev.c
@@ -180,7 +180,7 @@ rx_queue_disable(struct fm10k_hw *hw, uint16_t qnum)
 	/* Wait 100us at most */
 	for (i = 0; i < FM10K_QUEUE_DISABLE_TIMEOUT; i++) {
 		rte_delay_us(1);
-		reg = FM10K_READ_REG(hw, FM10K_RXQCTL(i));
+		reg = FM10K_READ_REG(hw, FM10K_RXQCTL(qnum));
 		if (!(reg & FM10K_RXQCTL_ENABLE))
 			break;
 	}
@@ -269,7 +269,7 @@ tx_queue_disable(struct fm10k_hw *hw, uint16_t qnum)
 	/* Wait 100us at most */
 	for (i = 0; i < FM10K_QUEUE_DISABLE_TIMEOUT; i++) {
 		rte_delay_us(1);
-		reg = FM10K_READ_REG(hw, FM10K_TXDCTL(i));
+		reg = FM10K_READ_REG(hw, FM10K_TXDCTL(qnum));
 		if (!(reg & FM10K_TXDCTL_ENABLE))
 			break;
 	}
@@ -784,6 +784,9 @@ fm10k_dev_start(struct rte_eth_dev *dev)
 		diag = fm10k_dev_tx_queue_start(dev, i);
 		if (diag != 0) {
 			int j;
+			for (j = 0; j < i; ++j)
+				tx_queue_clean(dev->data->tx_queues[j]);
+
 			for (j = 0; j < dev->data->nb_rx_queues; ++j)
 				rx_queue_clean(dev->data->rx_queues[j]);
 			return diag;
-- 
1.9.3

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

* Re: [dpdk-dev] [PATCH] fm10k: fix 2 bugs in rxtx_queue_disable and fm10k_dev_start
  2015-07-31  5:05 [dpdk-dev] [PATCH] fm10k: fix 2 bugs in rxtx_queue_disable and fm10k_dev_start Wang Xiao W
@ 2015-07-31  5:45 ` Chen, Jing D
  2015-08-03 14:53   ` Thomas Monjalon
  0 siblings, 1 reply; 3+ messages in thread
From: Chen, Jing D @ 2015-07-31  5:45 UTC (permalink / raw)
  To: Wang, Xiao W, dev; +Cc: Wang, Xiao W



> -----Original Message-----
> From: dev [mailto:dev-bounces@dpdk.org] On Behalf Of Wang Xiao W
> Sent: Friday, July 31, 2015 1:06 PM
> To: dev@dpdk.org
> Cc: Wang, Xiao W
> Subject: [dpdk-dev] [PATCH] fm10k: fix 2 bugs in rxtx_queue_disable and
> fm10k_dev_start
> 
> In Rx and Tx queue_disable functions, the index of queue should
> be qnum other than i which is the iteration of time expiration.
> When a Tx queue fails to start in fm10k_dev_start, all Rx queues
> and Tx queues that are started should be cleaned before the
> function returns an error.
> 
> Signed-off-by: Wang Xiao W <xiao.w.wang@intel.com>
Acked-by: Jing Chen <jing.d.chen@intel.com>	

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

* Re: [dpdk-dev] [PATCH] fm10k: fix 2 bugs in rxtx_queue_disable and fm10k_dev_start
  2015-07-31  5:45 ` Chen, Jing D
@ 2015-08-03 14:53   ` Thomas Monjalon
  0 siblings, 0 replies; 3+ messages in thread
From: Thomas Monjalon @ 2015-08-03 14:53 UTC (permalink / raw)
  To: Wang, Xiao W; +Cc: dev

> > In Rx and Tx queue_disable functions, the index of queue should
> > be qnum other than i which is the iteration of time expiration.
> > When a Tx queue fails to start in fm10k_dev_start, all Rx queues
> > and Tx queues that are started should be cleaned before the
> > function returns an error.
> > 
> > Signed-off-by: Wang Xiao W <xiao.w.wang@intel.com>
> Acked-by: Jing Chen <jing.d.chen@intel.com>	

Applied in 2 patches, thanks

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

end of thread, other threads:[~2015-08-03 14:55 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-07-31  5:05 [dpdk-dev] [PATCH] fm10k: fix 2 bugs in rxtx_queue_disable and fm10k_dev_start Wang Xiao W
2015-07-31  5:45 ` Chen, Jing D
2015-08-03 14:53   ` Thomas Monjalon

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).