netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
To: davem@davemloft.net
Cc: Alexander Duyck <alexander.h.duyck@intel.com>,
	netdev@vger.kernel.org, gospo@redhat.com, sassmann@redhat.com,
	Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Subject: [net-next 06/14] ixgbe: Do not decrement budget in ixgbe_clean_rx_irq
Date: Fri, 26 Oct 2012 04:58:14 -0700	[thread overview]
Message-ID: <1351252702-16532-7-git-send-email-jeffrey.t.kirsher@intel.com> (raw)
In-Reply-To: <1351252702-16532-1-git-send-email-jeffrey.t.kirsher@intel.com>

From: Alexander Duyck <alexander.h.duyck@intel.com>

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>
---
 drivers/net/ethernet/intel/ixgbe/ixgbe_main.c | 9 ++++-----
 1 file 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 ceab142..a34ee7d 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:
  **/
 static bool ixgbe_clean_rx_irq(struct ixgbe_q_vector *q_vector,
 			       struct ixgbe_ring *rx_ring,
-			       int budget)
+			       const int budget)
 {
 	unsigned int total_rx_bytes = 0, total_rx_packets = 0;
 #ifdef IXGBE_FCOE
@@ -1845,7 +1845,6 @@ static bool ixgbe_clean_rx_irq(struct ixgbe_q_vector *q_vector,
 
 		/* probably a little skewed due to removing CRC */
 		total_rx_bytes += skb->len;
-		total_rx_packets++;
 
 		/* populate checksum, timestamp, VLAN, and protocol */
 		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,
 		ixgbe_rx_skb(q_vector, skb);
 
 		/* update budget accounting */
-		budget--;
-	} while (likely(budget));
+		total_rx_packets++;
+	} while (likely(total_rx_packets < budget));
 
 	u64_stats_update_begin(&rx_ring->syncp);
 	rx_ring->stats.packets += total_rx_packets;
@@ -1891,7 +1890,7 @@ static bool ixgbe_clean_rx_irq(struct ixgbe_q_vector *q_vector,
 	if (cleaned_count)
 		ixgbe_alloc_rx_buffers(rx_ring, cleaned_count);
 
-	return !!budget;
+	return (total_rx_packets < budget);
 }
 
 /**
-- 
1.7.11.7

  parent reply	other threads:[~2012-10-26 11:58 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-10-26 11:58 [net-next 00/14][pull request] Intel Wired LAN Driver Updates Jeff Kirsher
2012-10-26 11:58 ` [net-next 01/14] ixgbe: Add support for pipeline reset Jeff Kirsher
2012-10-26 11:58 ` [net-next 02/14] ixgbe: Fix return value from macvlan filter function Jeff Kirsher
2012-10-26 11:58 ` [net-next 03/14] net, ixgbe: handle link local multicast addresses in SR-IOV mode Jeff Kirsher
2012-10-26 11:58 ` [net-next 04/14] ixgbe: clean up the condition for turning on/off the laser Jeff Kirsher
2012-10-26 11:58 ` [net-next 05/14] ixgbe: Return success or failure on VF MAC filter set Jeff Kirsher
2012-10-26 11:58 ` Jeff Kirsher [this message]
2012-10-26 11:58 ` [net-next 07/14] ixgbe: eliminate Smatch warnings in ixgbe_debugfs.c Jeff Kirsher
2012-10-26 12:41   ` Dan Carpenter
2012-10-26 11:58 ` [net-next 08/14] ixgbe: add/udpate descriptor maps in comments Jeff Kirsher
2012-10-26 11:58 ` [net-next 09/14] ixgbevf: Do not forward LLDP type frames Jeff Kirsher
2012-10-26 11:58 ` [net-next 10/14] ixgbevf: make sure probe fails on MSI-X enable error Jeff Kirsher
2012-10-26 12:43   ` Kicinski, Jakub
2012-10-26 16:32     ` Greg Rose
2012-10-26 11:58 ` [net-next 11/14] igbvf: Check for error on dma_map_single call Jeff Kirsher
2012-10-26 11:58 ` [net-next 12/14] igb: Enable auto-crossover during forced operation on 82580 and above Jeff Kirsher
2012-10-26 11:58 ` [net-next 13/14] igb: Update firmware version info for ethtool output Jeff Kirsher
2012-10-26 11:58 ` [net-next 14/14] igb: Fix sparse warning in igb_ptp_rx_pktstamp Jeff Kirsher

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1351252702-16532-7-git-send-email-jeffrey.t.kirsher@intel.com \
    --to=jeffrey.t.kirsher@intel.com \
    --cc=alexander.h.duyck@intel.com \
    --cc=davem@davemloft.net \
    --cc=gospo@redhat.com \
    --cc=netdev@vger.kernel.org \
    --cc=sassmann@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).