[dpdk-dev] fm10k: fix 2 bugs in rxtx_queue_disable and fm10k_dev_start

Message ID 1438319147-23633-1-git-send-email-xiao.w.wang@intel.com (mailing list archive)
State Accepted, archived
Headers

Commit Message

Xiao Wang July 31, 2015, 5:05 a.m. UTC
  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(-)
  

Comments

Chen, Jing D July 31, 2015, 5:45 a.m. UTC | #1
> -----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>
  
Thomas Monjalon Aug. 3, 2015, 2:53 p.m. UTC | #2
> > 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
  

Patch

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;