diff options
author | Alexander Duyck <alexander.h.duyck@intel.com> | 2012-09-24 20:29:37 -0400 |
---|---|---|
committer | Jeff Kirsher <jeffrey.t.kirsher@intel.com> | 2012-10-30 01:32:11 -0400 |
commit | f4de00ed58df50e522d920990976b39433a406aa (patch) | |
tree | 5d0b5ecbf6239ff80d44dca91f73864df4a6c21c /drivers/net/ethernet/intel/ixgbe | |
parent | 3970c3234bbaac962a6c9213536dfcabc421d0d0 (diff) |
ixgbe: Do not decrement budget in ixgbe_clean_rx_irq
This change makes it so that compare the total_rx_packets cleaned to budget
instead of decrementing budget. The advantage to this approach is that budget
can now be const and we only end up modifying total_rx_packets instead of
modifying both it and budget.
Signed-off-by: Alexander Duyck <alexander.h.duyck@intel.com>
Tested-by: Phil Schmitt <phillip.j.schmitt@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Diffstat (limited to 'drivers/net/ethernet/intel/ixgbe')
-rw-r--r-- | drivers/net/ethernet/intel/ixgbe/ixgbe_main.c | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c b/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c index ceab142bcf8a..a34ee7d63563 100644 --- a/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c +++ b/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c | |||
@@ -1794,7 +1794,7 @@ dma_sync: | |||
1794 | **/ | 1794 | **/ |
1795 | static bool ixgbe_clean_rx_irq(struct ixgbe_q_vector *q_vector, | 1795 | static bool ixgbe_clean_rx_irq(struct ixgbe_q_vector *q_vector, |
1796 | struct ixgbe_ring *rx_ring, | 1796 | struct ixgbe_ring *rx_ring, |
1797 | int budget) | 1797 | const int budget) |
1798 | { | 1798 | { |
1799 | unsigned int total_rx_bytes = 0, total_rx_packets = 0; | 1799 | unsigned int total_rx_bytes = 0, total_rx_packets = 0; |
1800 | #ifdef IXGBE_FCOE | 1800 | #ifdef IXGBE_FCOE |
@@ -1845,7 +1845,6 @@ static bool ixgbe_clean_rx_irq(struct ixgbe_q_vector *q_vector, | |||
1845 | 1845 | ||
1846 | /* probably a little skewed due to removing CRC */ | 1846 | /* probably a little skewed due to removing CRC */ |
1847 | total_rx_bytes += skb->len; | 1847 | total_rx_bytes += skb->len; |
1848 | total_rx_packets++; | ||
1849 | 1848 | ||
1850 | /* populate checksum, timestamp, VLAN, and protocol */ | 1849 | /* populate checksum, timestamp, VLAN, and protocol */ |
1851 | ixgbe_process_skb_fields(rx_ring, rx_desc, skb); | 1850 | ixgbe_process_skb_fields(rx_ring, rx_desc, skb); |
@@ -1878,8 +1877,8 @@ static bool ixgbe_clean_rx_irq(struct ixgbe_q_vector *q_vector, | |||
1878 | ixgbe_rx_skb(q_vector, skb); | 1877 | ixgbe_rx_skb(q_vector, skb); |
1879 | 1878 | ||
1880 | /* update budget accounting */ | 1879 | /* update budget accounting */ |
1881 | budget--; | 1880 | total_rx_packets++; |
1882 | } while (likely(budget)); | 1881 | } while (likely(total_rx_packets < budget)); |
1883 | 1882 | ||
1884 | u64_stats_update_begin(&rx_ring->syncp); | 1883 | u64_stats_update_begin(&rx_ring->syncp); |
1885 | rx_ring->stats.packets += total_rx_packets; | 1884 | rx_ring->stats.packets += total_rx_packets; |
@@ -1891,7 +1890,7 @@ static bool ixgbe_clean_rx_irq(struct ixgbe_q_vector *q_vector, | |||
1891 | if (cleaned_count) | 1890 | if (cleaned_count) |
1892 | ixgbe_alloc_rx_buffers(rx_ring, cleaned_count); | 1891 | ixgbe_alloc_rx_buffers(rx_ring, cleaned_count); |
1893 | 1892 | ||
1894 | return !!budget; | 1893 | return (total_rx_packets < budget); |
1895 | } | 1894 | } |
1896 | 1895 | ||
1897 | /** | 1896 | /** |