From: Alexander Duyck <aduyck@mirantis.com>
To: intel-wired-lan@osuosl.org
Subject: [Intel-wired-lan] [PATCH 5/5] igb: Add support for bulk Tx cleanup & cleanup boolean logic
Date: Mon, 07 Mar 2016 09:30:21 -0800 [thread overview]
Message-ID: <20160307173021.5682.83995.stgit@localhost.localdomain> (raw)
In-Reply-To: <20160307172722.5682.38580.stgit@localhost.localdomain>
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>
---
drivers/net/ethernet/intel/igb/igb_main.c | 12 +++++++-----
1 file 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 1846b8584ef2..99d37b0605d9 100644
--- a/drivers/net/ethernet/intel/igb/igb_main.c
+++ b/drivers/net/ethernet/intel/igb/igb_main.c
@@ -151,7 +151,7 @@ static void igb_update_dca(struct igb_q_vector *);
static void igb_setup_dca(struct igb_adapter *);
#endif /* CONFIG_IGB_DCA */
static int igb_poll(struct napi_struct *, int);
-static bool igb_clean_tx_irq(struct igb_q_vector *);
+static bool igb_clean_tx_irq(struct igb_q_vector *, int);
static int igb_clean_rx_irq(struct igb_q_vector *, int);
static int igb_ioctl(struct net_device *, struct ifreq *, int cmd);
static void igb_tx_timeout(struct net_device *);
@@ -6534,13 +6534,14 @@ static int igb_poll(struct napi_struct *napi, int budget)
igb_update_dca(q_vector);
#endif
if (q_vector->tx.ring)
- clean_complete = igb_clean_tx_irq(q_vector);
+ clean_complete = igb_clean_tx_irq(q_vector, budget);
if (q_vector->rx.ring) {
int cleaned = igb_clean_rx_irq(q_vector, budget);
work_done += cleaned;
- clean_complete &= (cleaned < budget);
+ if (cleaned >= budget)
+ clean_complete = false;
}
/* If all work not completed, return budget and keep polling */
@@ -6557,10 +6558,11 @@ static int igb_poll(struct napi_struct *napi, int budget)
/**
* igb_clean_tx_irq - Reclaim resources after transmit completes
* @q_vector: pointer to q_vector containing needed info
+ * @napi_budget: Used to determine if we are in netpoll
*
* returns true if ring is completely cleaned
**/
-static bool igb_clean_tx_irq(struct igb_q_vector *q_vector)
+static bool igb_clean_tx_irq(struct igb_q_vector *q_vector, int napi_budget)
{
struct igb_adapter *adapter = q_vector->adapter;
struct igb_ring *tx_ring = q_vector->tx.ring;
@@ -6599,7 +6601,7 @@ static bool igb_clean_tx_irq(struct igb_q_vector *q_vector)
total_packets += tx_buffer->gso_segs;
/* free the skb */
- dev_consume_skb_any(tx_buffer->skb);
+ napi_consume_skb(tx_buffer->skb, napi_budget);
/* unmap skb header data */
dma_unmap_single(tx_ring->dev,
next prev parent reply other threads:[~2016-03-07 17:30 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-03-07 17:29 [Intel-wired-lan] [PATCH 0/5] Bulk Tx cleanup support for Intel wired Ethernet drivers Alexander Duyck
2016-03-07 17:29 ` [Intel-wired-lan] [PATCH 1/5] i40e/i40evf: Fix handling of boolean logic in polling routines Alexander Duyck
2016-03-10 18:37 ` Bowers, AndrewX
2016-03-07 17:30 ` [Intel-wired-lan] [PATCH 2/5] i40e/i40evf: Add support for bulk free in Tx cleanup Alexander Duyck
2016-03-08 19:39 ` Jesse Brandeburg
2016-03-08 19:58 ` Alexander Duyck
2016-03-10 18:38 ` Bowers, AndrewX
2016-03-07 17:30 ` [Intel-wired-lan] [PATCH 3/5] ixgbe/ixgbevf: Add support for bulk free in Tx cleanup & cleanup boolean logic Alexander Duyck
2016-03-10 18:41 ` Bowers, AndrewX
2016-03-07 17:30 ` [Intel-wired-lan] [PATCH 4/5] fm10k: Add support for bulk " Alexander Duyck
2016-04-14 22:50 ` Singh, Krishneil K
2016-03-07 17:30 ` Alexander Duyck [this message]
2016-03-12 0:44 ` [Intel-wired-lan] [PATCH 5/5] igb: " Brown, Aaron F
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=20160307173021.5682.83995.stgit@localhost.localdomain \
--to=aduyck@mirantis.com \
--cc=intel-wired-lan@osuosl.org \
/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).