linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Ondrej Puzman <puzman@gmail.com>
To: davem@davemloft.net
Cc: netdev@vger.kernel.org, linux-kernel@vger.kernel.org,
	Ondrej Puzman <puzman@gmail.com>
Subject: [PATCH 3/4] pch_gbe: Add DQL support to the driver
Date: Thu, 28 Nov 2013 10:44:41 +0100	[thread overview]
Message-ID: <1385631882-12827-4-git-send-email-puzman@gmail.com> (raw)
In-Reply-To: <20131127.203929.1379316258754767343.davem@davemloft.net>

Add dynamic queue limits support to the driver.

Signed-off-by: Ondrej Puzman <puzman@gmail.com>
---
 .../net/ethernet/oki-semi/pch_gbe/pch_gbe_main.c   |    9 +++++++++
 1 files changed, 9 insertions(+), 0 deletions(-)

diff --git a/drivers/net/ethernet/oki-semi/pch_gbe/pch_gbe_main.c b/drivers/net/ethernet/oki-semi/pch_gbe/pch_gbe_main.c
index d967603..2c14e2e 100644
--- a/drivers/net/ethernet/oki-semi/pch_gbe/pch_gbe_main.c
+++ b/drivers/net/ethernet/oki-semi/pch_gbe/pch_gbe_main.c
@@ -994,6 +994,8 @@ static void pch_gbe_clean_tx_ring(struct pch_gbe_adapter *adapter,
 	netdev_dbg(adapter->netdev,
 		   "call pch_gbe_unmap_and_free_tx_resource() %d count\n", i);
 
+	netdev_reset_queue(adapter->netdev);
+
 	size = (unsigned long)sizeof(struct pch_gbe_buffer) * tx_ring->count;
 	memset(tx_ring->buffer_info, 0, size);
 
@@ -1544,6 +1546,7 @@ pch_gbe_clean_tx(struct pch_gbe_adapter *adapter,
 	unsigned int cleaned_count = 0;
 	bool cleaned = false;
 	int unused, thresh;
+	unsigned int bytes_compl = 0, pkts_compl = 0;
 
 	netdev_dbg(adapter->netdev, "next_to_clean : %d\n",
 		   tx_ring->next_to_clean);
@@ -1622,6 +1625,8 @@ pch_gbe_clean_tx(struct pch_gbe_adapter *adapter,
 			buffer_info->mapped = false;
 		}
 		if (buffer_info->skb) {
+			bytes_compl += buffer_info->skb->len;
+			pkts_compl++;
 			netdev_dbg(adapter->netdev,
 				   "trim buffer_info->skb : %d\n", i);
 			skb_trim(buffer_info->skb, 0);
@@ -1641,6 +1646,9 @@ pch_gbe_clean_tx(struct pch_gbe_adapter *adapter,
 		   "called pch_gbe_unmap_and_free_tx_resource() %d count\n",
 		   cleaned_count);
 	if (cleaned_count > 0)  { /*skip this if nothing cleaned*/
+		netdev_completed_queue(adapter->netdev,
+				       pkts_compl, bytes_compl);
+
 		/* Recover from running out of Tx resources in xmit_frame */
 		spin_lock(&tx_ring->tx_lock);
 		if (unlikely(cleaned && (netif_queue_stopped(adapter->netdev))))
@@ -2152,6 +2160,7 @@ static int pch_gbe_xmit_frame(struct sk_buff *skb, struct net_device *netdev)
 
 	/* CRC,ITAG no support */
 	pch_gbe_tx_queue(adapter, tx_ring, skb);
+	netdev_sent_queue(netdev, skb->len);
 
 	if (unlikely(!PCH_GBE_DESC_UNUSED(tx_ring)))
 		netif_stop_queue(netdev);
-- 
1.7.2.3


  parent reply	other threads:[~2013-11-28  9:46 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-11-27 23:29 [PATCH] pch_gbe: Fix transmit queue management Ondrej Puzman
2013-11-27 23:29 ` [PATCH] pch_gbe: Remove tx_queue_len setting from the driver Ondrej Puzman
2013-11-27 23:29   ` [PATCH] pch_gbe: Add DQL support to " Ondrej Puzman
2013-11-27 23:29     ` [PATCH] pch_gbe: Fix: Link configuration in module parameters was ignored Ondrej Puzman
2013-11-28  4:39   ` [PATCH] pch_gbe: Remove tx_queue_len setting from the driver David Miller
2013-11-28  9:44     ` [PATCH 0/4] pch_gbe fixes and enhancements Ondrej Puzman
2013-11-29 21:43       ` David Miller
2013-11-28  9:44     ` [PATCH 1/4] pch_gbe: Fix transmit queue management Ondrej Puzman
2013-11-29 21:42       ` David Miller
2013-11-30 22:41         ` Ondřej Pužman
2013-12-02 10:04         ` David Laight
2013-12-02 16:16           ` David Miller
2013-12-02 16:33             ` Eric Dumazet
2013-12-02 16:51               ` [PATCH] net: do not pretend FRAGLIST support Eric Dumazet
2013-12-02 22:17                 ` David Miller
2013-12-02 16:51               ` [PATCH 1/4] pch_gbe: Fix transmit queue management Eric Dumazet
2013-11-28  9:44     ` [PATCH 2/4] pch_gbe: Remove tx_queue_len setting from the driver Ondrej Puzman
2013-11-28  9:44     ` Ondrej Puzman [this message]
2013-11-28  9:44     ` [PATCH 4/4] pch_gbe: Fix: Link configuration in module parameters was ignored Ondrej Puzman

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=1385631882-12827-4-git-send-email-puzman@gmail.com \
    --to=puzman@gmail.com \
    --cc=davem@davemloft.net \
    --cc=linux-kernel@vger.kernel.org \
    --cc=netdev@vger.kernel.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).