aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/ethernet/intel/igb/igb_main.c
diff options
context:
space:
mode:
authorAlexander Duyck <aduyck@mirantis.com>2016-03-07 12:30:21 -0500
committerJeff Kirsher <jeffrey.t.kirsher@intel.com>2016-04-06 15:26:36 -0400
commit7f0ba845607364c76009e396a31651fa3a24bd1c (patch)
treefae041c0cc887d5990de2d06feaea1c5ddecf6e1 /drivers/net/ethernet/intel/igb/igb_main.c
parent415cd2a645b2573f173cc52419049f9caacf9a47 (diff)
igb: Add support for bulk Tx cleanup & cleanup boolean logic
This patch enables bulk free in Tx cleanup for igb and cleans up the boolean logic in the polling routines for igb 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: Aaron Brown <aaron.f.brown@intel.com> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Diffstat (limited to 'drivers/net/ethernet/intel/igb/igb_main.c')
-rw-r--r--drivers/net/ethernet/intel/igb/igb_main.c12
1 files changed, 7 insertions, 5 deletions
diff --git a/drivers/net/ethernet/intel/igb/igb_main.c b/drivers/net/ethernet/intel/igb/igb_main.c
index 36814a2e326d..e40983ca35b4 100644
--- a/drivers/net/ethernet/intel/igb/igb_main.c
+++ b/drivers/net/ethernet/intel/igb/igb_main.c
@@ -150,7 +150,7 @@ static void igb_update_dca(struct igb_q_vector *);
150static void igb_setup_dca(struct igb_adapter *); 150static void igb_setup_dca(struct igb_adapter *);
151#endif /* CONFIG_IGB_DCA */ 151#endif /* CONFIG_IGB_DCA */
152static int igb_poll(struct napi_struct *, int); 152static int igb_poll(struct napi_struct *, int);
153static bool igb_clean_tx_irq(struct igb_q_vector *); 153static bool igb_clean_tx_irq(struct igb_q_vector *, int);
154static int igb_clean_rx_irq(struct igb_q_vector *, int); 154static int igb_clean_rx_irq(struct igb_q_vector *, int);
155static int igb_ioctl(struct net_device *, struct ifreq *, int cmd); 155static int igb_ioctl(struct net_device *, struct ifreq *, int cmd);
156static void igb_tx_timeout(struct net_device *); 156static void igb_tx_timeout(struct net_device *);
@@ -6522,13 +6522,14 @@ static int igb_poll(struct napi_struct *napi, int budget)
6522 igb_update_dca(q_vector); 6522 igb_update_dca(q_vector);
6523#endif 6523#endif
6524 if (q_vector->tx.ring) 6524 if (q_vector->tx.ring)
6525 clean_complete = igb_clean_tx_irq(q_vector); 6525 clean_complete = igb_clean_tx_irq(q_vector, budget);
6526 6526
6527 if (q_vector->rx.ring) { 6527 if (q_vector->rx.ring) {
6528 int cleaned = igb_clean_rx_irq(q_vector, budget); 6528 int cleaned = igb_clean_rx_irq(q_vector, budget);
6529 6529
6530 work_done += cleaned; 6530 work_done += cleaned;
6531 clean_complete &= (cleaned < budget); 6531 if (cleaned >= budget)
6532 clean_complete = false;
6532 } 6533 }
6533 6534
6534 /* If all work not completed, return budget and keep polling */ 6535 /* If all work not completed, return budget and keep polling */
@@ -6545,10 +6546,11 @@ static int igb_poll(struct napi_struct *napi, int budget)
6545/** 6546/**
6546 * igb_clean_tx_irq - Reclaim resources after transmit completes 6547 * igb_clean_tx_irq - Reclaim resources after transmit completes
6547 * @q_vector: pointer to q_vector containing needed info 6548 * @q_vector: pointer to q_vector containing needed info
6549 * @napi_budget: Used to determine if we are in netpoll
6548 * 6550 *
6549 * returns true if ring is completely cleaned 6551 * returns true if ring is completely cleaned
6550 **/ 6552 **/
6551static bool igb_clean_tx_irq(struct igb_q_vector *q_vector) 6553static bool igb_clean_tx_irq(struct igb_q_vector *q_vector, int napi_budget)
6552{ 6554{
6553 struct igb_adapter *adapter = q_vector->adapter; 6555 struct igb_adapter *adapter = q_vector->adapter;
6554 struct igb_ring *tx_ring = q_vector->tx.ring; 6556 struct igb_ring *tx_ring = q_vector->tx.ring;
@@ -6587,7 +6589,7 @@ static bool igb_clean_tx_irq(struct igb_q_vector *q_vector)
6587 total_packets += tx_buffer->gso_segs; 6589 total_packets += tx_buffer->gso_segs;
6588 6590
6589 /* free the skb */ 6591 /* free the skb */
6590 dev_consume_skb_any(tx_buffer->skb); 6592 napi_consume_skb(tx_buffer->skb, napi_budget);
6591 6593
6592 /* unmap skb header data */ 6594 /* unmap skb header data */
6593 dma_unmap_single(tx_ring->dev, 6595 dma_unmap_single(tx_ring->dev,