[v2] net/i40e: remove redundant code

Message ID 20181213124928.25154-1-zhirun.yan@intel.com (mailing list archive)
State Accepted, archived
Delegated to: Qi Zhang
Headers
Series [v2] net/i40e: remove redundant code |

Checks

Context Check Description
ci/checkpatch success coding style OK
ci/Intel-compilation success Compilation OK
ci/mellanox-Performance-Testing success Performance Testing PASS
ci/intel-Performance-Testing success Performance Testing PASS

Commit Message

Yan, Zhirun Dec. 13, 2018, 12:49 p.m. UTC
  Before this patch, there are two functions will call
i40e_dev_free_queues to free queues. For rte_eth_dev_close(), its
redundant because of duplication. For rte_eth_dev_reset() its
redundant because of not necessary, since following dev_configure
is required after dev_reset and it will be updated correctly.

This patch removes redundant code in i40e_dev_free_queues().

Fixes: 6b4537128394 ("i40e: free queue memory when closing")

Signed-off-by: Zhirun Yan <zhirun.yan@intel.com>
Signed-off-by: Haiyue Wang <haiyue.wang@intel.com>
---
 drivers/net/i40e/i40e_rxtx.c | 2 --
 1 file changed, 2 deletions(-)
  

Comments

Qi Zhang Dec. 13, 2018, 9:57 a.m. UTC | #1
> -----Original Message-----
> From: Yan, Zhirun
> Sent: Thursday, December 13, 2018 8:49 PM
> To: dev@dpdk.org; Zhang, Qi Z <qi.z.zhang@intel.com>
> Cc: Yan, Zhirun <zhirun.yan@intel.com>; Wang, Haiyue <haiyue.wang@intel.com>
> Subject: [PATCH v2] net/i40e: remove redundant code
> 
> Before this patch, there are two functions will call i40e_dev_free_queues to free
> queues. For rte_eth_dev_close(), its redundant because of duplication. For
> rte_eth_dev_reset() its redundant because of not necessary, since following
> dev_configure is required after dev_reset and it will be updated correctly.
> 
> This patch removes redundant code in i40e_dev_free_queues().
> 
> Fixes: 6b4537128394 ("i40e: free queue memory when closing")
> 
> Signed-off-by: Zhirun Yan <zhirun.yan@intel.com>
> Signed-off-by: Haiyue Wang <haiyue.wang@intel.com>

Acked-by: Qi Zhang <qi.z.zhang@intel.com>

Applied to dpdk-next-net-intel.

Thanks
Qi
  

Patch

diff --git a/drivers/net/i40e/i40e_rxtx.c b/drivers/net/i40e/i40e_rxtx.c
index e1152ff0e..cc953ad58 100644
--- a/drivers/net/i40e/i40e_rxtx.c
+++ b/drivers/net/i40e/i40e_rxtx.c
@@ -2753,7 +2753,6 @@  i40e_dev_free_queues(struct rte_eth_dev *dev)
 		i40e_dev_rx_queue_release(dev->data->rx_queues[i]);
 		dev->data->rx_queues[i] = NULL;
 	}
-	dev->data->nb_rx_queues = 0;
 
 	for (i = 0; i < dev->data->nb_tx_queues; i++) {
 		if (!dev->data->tx_queues[i])
@@ -2761,7 +2760,6 @@  i40e_dev_free_queues(struct rte_eth_dev *dev)
 		i40e_dev_tx_queue_release(dev->data->tx_queues[i]);
 		dev->data->tx_queues[i] = NULL;
 	}
-	dev->data->nb_tx_queues = 0;
 }
 
 #define I40E_FDIR_NUM_TX_DESC  I40E_MIN_RING_DESC