aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/ethernet
diff options
context:
space:
mode:
authorAlexander Duyck <aduyck@mirantis.com>2016-03-07 12:30:09 -0500
committerJeff Kirsher <jeffrey.t.kirsher@intel.com>2016-04-07 18:55:25 -0400
commit8220bbc12d39175964cb56e100fabcedd59c48da (patch)
tree05596483d5f5c5e0e181444d61d7f1463027ee95 /drivers/net/ethernet
parentaf7419017626b93ccdf76b12c2b1dc8fe17da4ad (diff)
ixgbe/ixgbevf: Add support for bulk free in Tx cleanup & cleanup boolean logic
This patch enables bulk free in Tx cleanup for ixgbevf and cleans up the boolean logic in the polling routines for ixgbe and ixgbevf in the hopes of avoiding any mix-ups similar to what occurred with i40e and i40evf. Signed-off-by: Alexander Duyck <aduyck@mirantis.com> Tested-by: Andrew Bowers <andrewx.bowers@intel.com> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Diffstat (limited to 'drivers/net/ethernet')
-rw-r--r--drivers/net/ethernet/intel/ixgbe/ixgbe_main.c10
-rw-r--r--drivers/net/ethernet/intel/ixgbevf/ixgbevf_main.c14
2 files changed, 16 insertions, 8 deletions
diff --git a/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c b/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c
index 19bf3860d3d8..d5509cc30abd 100644
--- a/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c
+++ b/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c
@@ -1111,6 +1111,7 @@ static int ixgbe_tx_maxrate(struct net_device *netdev,
1111 * ixgbe_clean_tx_irq - Reclaim resources after transmit completes 1111 * ixgbe_clean_tx_irq - Reclaim resources after transmit completes
1112 * @q_vector: structure containing interrupt and ring information 1112 * @q_vector: structure containing interrupt and ring information
1113 * @tx_ring: tx ring to clean 1113 * @tx_ring: tx ring to clean
1114 * @napi_budget: Used to determine if we are in netpoll
1114 **/ 1115 **/
1115static bool ixgbe_clean_tx_irq(struct ixgbe_q_vector *q_vector, 1116static bool ixgbe_clean_tx_irq(struct ixgbe_q_vector *q_vector,
1116 struct ixgbe_ring *tx_ring, int napi_budget) 1117 struct ixgbe_ring *tx_ring, int napi_budget)
@@ -2807,8 +2808,10 @@ int ixgbe_poll(struct napi_struct *napi, int budget)
2807 ixgbe_update_dca(q_vector); 2808 ixgbe_update_dca(q_vector);
2808#endif 2809#endif
2809 2810
2810 ixgbe_for_each_ring(ring, q_vector->tx) 2811 ixgbe_for_each_ring(ring, q_vector->tx) {
2811 clean_complete &= !!ixgbe_clean_tx_irq(q_vector, ring, budget); 2812 if (!ixgbe_clean_tx_irq(q_vector, ring, budget))
2813 clean_complete = false;
2814 }
2812 2815
2813 /* Exit if we are called by netpoll or busy polling is active */ 2816 /* Exit if we are called by netpoll or busy polling is active */
2814 if ((budget <= 0) || !ixgbe_qv_lock_napi(q_vector)) 2817 if ((budget <= 0) || !ixgbe_qv_lock_napi(q_vector))
@@ -2826,7 +2829,8 @@ int ixgbe_poll(struct napi_struct *napi, int budget)
2826 per_ring_budget); 2829 per_ring_budget);
2827 2830
2828 work_done += cleaned; 2831 work_done += cleaned;
2829 clean_complete &= (cleaned < per_ring_budget); 2832 if (cleaned >= per_ring_budget)
2833 clean_complete = false;
2830 } 2834 }
2831 2835
2832 ixgbe_qv_unlock_napi(q_vector); 2836 ixgbe_qv_unlock_napi(q_vector);
diff --git a/drivers/net/ethernet/intel/ixgbevf/ixgbevf_main.c b/drivers/net/ethernet/intel/ixgbevf/ixgbevf_main.c
index 50b6bfffaf32..007cbe094990 100644
--- a/drivers/net/ethernet/intel/ixgbevf/ixgbevf_main.c
+++ b/drivers/net/ethernet/intel/ixgbevf/ixgbevf_main.c
@@ -288,9 +288,10 @@ static void ixgbevf_tx_timeout(struct net_device *netdev)
288 * ixgbevf_clean_tx_irq - Reclaim resources after transmit completes 288 * ixgbevf_clean_tx_irq - Reclaim resources after transmit completes
289 * @q_vector: board private structure 289 * @q_vector: board private structure
290 * @tx_ring: tx ring to clean 290 * @tx_ring: tx ring to clean
291 * @napi_budget: Used to determine if we are in netpoll
291 **/ 292 **/
292static bool ixgbevf_clean_tx_irq(struct ixgbevf_q_vector *q_vector, 293static bool ixgbevf_clean_tx_irq(struct ixgbevf_q_vector *q_vector,
293 struct ixgbevf_ring *tx_ring) 294 struct ixgbevf_ring *tx_ring, int napi_budget)
294{ 295{
295 struct ixgbevf_adapter *adapter = q_vector->adapter; 296 struct ixgbevf_adapter *adapter = q_vector->adapter;
296 struct ixgbevf_tx_buffer *tx_buffer; 297 struct ixgbevf_tx_buffer *tx_buffer;
@@ -328,7 +329,7 @@ static bool ixgbevf_clean_tx_irq(struct ixgbevf_q_vector *q_vector,
328 total_packets += tx_buffer->gso_segs; 329 total_packets += tx_buffer->gso_segs;
329 330
330 /* free the skb */ 331 /* free the skb */
331 dev_kfree_skb_any(tx_buffer->skb); 332 napi_consume_skb(tx_buffer->skb, napi_budget);
332 333
333 /* unmap skb header data */ 334 /* unmap skb header data */
334 dma_unmap_single(tx_ring->dev, 335 dma_unmap_single(tx_ring->dev,
@@ -1013,8 +1014,10 @@ static int ixgbevf_poll(struct napi_struct *napi, int budget)
1013 int per_ring_budget, work_done = 0; 1014 int per_ring_budget, work_done = 0;
1014 bool clean_complete = true; 1015 bool clean_complete = true;
1015 1016
1016 ixgbevf_for_each_ring(ring, q_vector->tx) 1017 ixgbevf_for_each_ring(ring, q_vector->tx) {
1017 clean_complete &= ixgbevf_clean_tx_irq(q_vector, ring); 1018 if (!ixgbevf_clean_tx_irq(q_vector, ring, budget))
1019 clean_complete = false;
1020 }
1018 1021
1019 if (budget <= 0) 1022 if (budget <= 0)
1020 return budget; 1023 return budget;
@@ -1035,7 +1038,8 @@ static int ixgbevf_poll(struct napi_struct *napi, int budget)
1035 int cleaned = ixgbevf_clean_rx_irq(q_vector, ring, 1038 int cleaned = ixgbevf_clean_rx_irq(q_vector, ring,
1036 per_ring_budget); 1039 per_ring_budget);
1037 work_done += cleaned; 1040 work_done += cleaned;
1038 clean_complete &= (cleaned < per_ring_budget); 1041 if (cleaned >= per_ring_budget)
1042 clean_complete = false;
1039 } 1043 }
1040 1044
1041#ifdef CONFIG_NET_RX_BUSY_POLL 1045#ifdef CONFIG_NET_RX_BUSY_POLL