netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jitendra Kalsaria <jitendra.kalsaria@qlogic.com>
To: davem@davemloft.net
Cc: netdev@vger.kernel.org, ron.mercer@qlogic.com,
	Dept_NX_Linux_NIC_Driver@qlogic.com,
	Jitendra Kalsaria <jitendra.kalsaria@qlogic.com>
Subject: [PATCH net-next 1/9] qlge: Fix TX queue stoppage due to full condition.
Date: Tue, 10 Jul 2012 20:57:31 -0400	[thread overview]
Message-ID: <1341968259-18931-2-git-send-email-jitendra.kalsaria@qlogic.com> (raw)
In-Reply-To: <1341968259-18931-1-git-send-email-jitendra.kalsaria@qlogic.com>

From: Jitendra Kalsaria <jitendra.kalsaria@qlogic.com>

TX queue was being stopped at beginning of send path instead
of at the end when last descriptor is used.

Signed-off-by: Jitendra Kalsaria <jitendra.kalsaria@qlogic.com>
---
 drivers/net/ethernet/qlogic/qlge/qlge_main.c |   12 +++++++++++-
 1 files changed, 11 insertions(+), 1 deletions(-)

diff --git a/drivers/net/ethernet/qlogic/qlge/qlge_main.c b/drivers/net/ethernet/qlogic/qlge/qlge_main.c
index 09d8d33..ce2d37f 100644
--- a/drivers/net/ethernet/qlogic/qlge/qlge_main.c
+++ b/drivers/net/ethernet/qlogic/qlge/qlge_main.c
@@ -2558,7 +2558,7 @@ static netdev_tx_t qlge_send(struct sk_buff *skb, struct net_device *ndev)
 
 	if (unlikely(atomic_read(&tx_ring->tx_count) < 2)) {
 		netif_info(qdev, tx_queued, qdev->ndev,
-			   "%s: shutting down tx queue %d du to lack of resources.\n",
+			   "%s: BUG! shutting down tx queue %d due to lack of resources.\n",
 			   __func__, tx_ring_idx);
 		netif_stop_subqueue(ndev, tx_ring->wq_id);
 		atomic_inc(&tx_ring->queue_stopped);
@@ -2612,6 +2612,16 @@ static netdev_tx_t qlge_send(struct sk_buff *skb, struct net_device *ndev)
 		     tx_ring->prod_idx, skb->len);
 
 	atomic_dec(&tx_ring->tx_count);
+
+	if (unlikely(atomic_read(&tx_ring->tx_count) < 2)) {
+		netif_stop_subqueue(ndev, tx_ring->wq_id);
+		if ((atomic_read(&tx_ring->tx_count) > (tx_ring->wq_len / 4)))
+			/*
+			 * The queue got stopped because the tx_ring was full.
+			 * Wake it up, because it's now at least 25% empty.
+			 */
+			netif_wake_subqueue(qdev->ndev, tx_ring->wq_id);
+	}
 	return NETDEV_TX_OK;
 }
 
-- 
1.7.1

  reply	other threads:[~2012-07-11  1:14 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-07-11  0:57 [PATCH net-next 0/9] qlge: bug fix Jitendra Kalsaria
2012-07-11  0:57 ` Jitendra Kalsaria [this message]
2012-07-11  0:57 ` [PATCH net-next 2/9] qlge: Cleanup atomic queue threshold check Jitendra Kalsaria
2012-07-11  0:57 ` [PATCH net-next 3/9] qlge: Fix ethtool WOL calls to operate only on devices that support WOL Jitendra Kalsaria
2012-07-11  0:57 ` [PATCH net-next 4/9] qlge: Clean up ethtool set WOL routine Jitendra Kalsaria
2012-07-11  0:57 ` [PATCH net-next 5/9] qlge: Added missing case statement to ethtool get_strings Jitendra Kalsaria
2012-07-11  0:57 ` [PATCH net-next 6/9] qlge: Fixed double pci free upon tx_ring->q allocation failure Jitendra Kalsaria
2012-07-11  0:57 ` [PATCH net-next 7/9] qlge: Moving low level frame error to ethtool statistics Jitendra Kalsaria
2012-07-11  0:57 ` [PATCH net-next 8/9] qlge: Refactoring of ethtool stats Jitendra Kalsaria
2012-07-11  0:57 ` [PATCH net-next 9/9] qlge: Bumped driver version to 1.00.00.31 Jitendra Kalsaria
2012-07-11  6:28 ` [PATCH net-next 0/9] qlge: bug fix David Miller

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=1341968259-18931-2-git-send-email-jitendra.kalsaria@qlogic.com \
    --to=jitendra.kalsaria@qlogic.com \
    --cc=Dept_NX_Linux_NIC_Driver@qlogic.com \
    --cc=davem@davemloft.net \
    --cc=netdev@vger.kernel.org \
    --cc=ron.mercer@qlogic.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).