netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
To: davem@davemloft.net
Cc: Eric Dumazet <eric.dumazet@gmail.com>,
	netdev@vger.kernel.org, gospo@redhat.com, sassmann@redhat.com,
	Alexander Duyck <alexander.h.duyck@intel.com>,
	Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Subject: [net-next 02/11] igb: Add support for byte queue limits.
Date: Tue,  3 Jan 2012 11:19:07 -0800	[thread overview]
Message-ID: <1325618356-2655-3-git-send-email-jeffrey.t.kirsher@intel.com> (raw)
In-Reply-To: <1325618356-2655-1-git-send-email-jeffrey.t.kirsher@intel.com>

From: Eric Dumazet <eric.dumazet@gmail.com>

This adds support for byte queue limits (BQL)

Since this driver collects bytes count in 'bytecount' field, use it also
in igb_tx_map()

Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com>
CC: Alexander Duyck <alexander.h.duyck@intel.com>
Tested-by: Aaron Brown <aaron.f.brown@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
---
 drivers/net/ethernet/intel/igb/igb.h      |    5 +++++
 drivers/net/ethernet/intel/igb/igb_main.c |    5 +++++
 2 files changed, 10 insertions(+), 0 deletions(-)

diff --git a/drivers/net/ethernet/intel/igb/igb.h b/drivers/net/ethernet/intel/igb/igb.h
index c69feeb..3d12e67 100644
--- a/drivers/net/ethernet/intel/igb/igb.h
+++ b/drivers/net/ethernet/intel/igb/igb.h
@@ -447,4 +447,9 @@ static inline s32 igb_get_phy_info(struct e1000_hw *hw)
 	return 0;
 }
 
+static inline struct netdev_queue *txring_txq(const struct igb_ring *tx_ring)
+{
+	return netdev_get_tx_queue(tx_ring->netdev, tx_ring->queue_index);
+}
+
 #endif /* _IGB_H_ */
diff --git a/drivers/net/ethernet/intel/igb/igb_main.c b/drivers/net/ethernet/intel/igb/igb_main.c
index 89d576c..dcc68cc 100644
--- a/drivers/net/ethernet/intel/igb/igb_main.c
+++ b/drivers/net/ethernet/intel/igb/igb_main.c
@@ -3201,6 +3201,7 @@ static void igb_clean_tx_ring(struct igb_ring *tx_ring)
 		buffer_info = &tx_ring->tx_buffer_info[i];
 		igb_unmap_and_free_tx_resource(tx_ring, buffer_info);
 	}
+	netdev_tx_reset_queue(txring_txq(tx_ring));
 
 	size = sizeof(struct igb_tx_buffer) * tx_ring->count;
 	memset(tx_ring->tx_buffer_info, 0, size);
@@ -4238,6 +4239,8 @@ static void igb_tx_map(struct igb_ring *tx_ring,
 		frag++;
 	}
 
+	netdev_tx_sent_queue(txring_txq(tx_ring), first->bytecount);
+
 	/* write last descriptor with RS and EOP bits */
 	cmd_type |= cpu_to_le32(size) | cpu_to_le32(IGB_TXD_DCMD);
 	tx_desc->read.cmd_type_len = cmd_type;
@@ -5777,6 +5780,8 @@ static bool igb_clean_tx_irq(struct igb_q_vector *q_vector)
 		}
 	}
 
+	netdev_tx_completed_queue(txring_txq(tx_ring),
+				  total_packets, total_bytes);
 	i += tx_ring->count;
 	tx_ring->next_to_clean = i;
 	u64_stats_update_begin(&tx_ring->tx_syncp);
-- 
1.7.7.4

  parent reply	other threads:[~2012-01-03 19:19 UTC|newest]

Thread overview: 29+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-01-03 19:19 [net-next 00/11][pull request] Intel Wired LAN Driver Updates Jeff Kirsher
2012-01-03 19:19 ` [net-next 01/11] e1000: fix lockdep splat in shutdown handler Jeff Kirsher
2012-01-03 19:19 ` Jeff Kirsher [this message]
2012-01-03 19:19 ` [net-next 03/11] igb: add basic runtime PM support Jeff Kirsher
2012-01-03 19:19 ` [net-next 04/11] igb: reset PHY after recovering from PHY power down Jeff Kirsher
2012-01-03 19:19 ` [net-next 05/11] netdev: FCoE: Add new ndo_get_fcoe_hbainfo() call Jeff Kirsher
2012-01-03 20:07   ` David Miller
2012-01-03 20:53     ` Parikh, Neerav
2012-01-03 19:19 ` [net-next 06/11] ixgbe: FCoE: Add support for " Jeff Kirsher
2012-01-03 19:19 ` [net-next 07/11] e1000e: cleanup Rx checksum offload code Jeff Kirsher
2012-01-03 20:08   ` David Miller
2012-01-03 20:17     ` Allan, Bruce W
2012-01-03 21:00     ` Ben Hutchings
2012-01-03 21:15       ` David Miller
2012-01-03 21:24         ` Ben Hutchings
2012-01-03 22:02           ` David Miller
2012-01-03 19:19 ` [net-next 08/11] e1000e: add Receive Packet Steering (RPS) support Jeff Kirsher
2012-01-03 20:09   ` David Miller
2012-01-03 20:16     ` Allan, Bruce W
2012-01-03 20:27       ` David Miller
2012-01-03 20:28         ` Allan, Bruce W
2012-01-04  0:12           ` Joe Perches
2012-01-04  2:06             ` Harvey Harrison
2012-01-03 21:05   ` Ben Hutchings
2012-01-06 17:22     ` Allan, Bruce W
2012-01-06 17:31       ` Ben Hutchings
2012-01-03 19:19 ` [net-next 09/11] e1000e: re-enable alternate MAC address for all devices which support it Jeff Kirsher
2012-01-03 19:19 ` [net-next 10/11] e1000e: convert head, tail and itr_register offsets to __iomem pointers Jeff Kirsher
2012-01-03 19:19 ` [net-next 11/11] e1000e: pass pointer to ring struct instead of adapter struct 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=1325618356-2655-3-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=eric.dumazet@gmail.com \
    --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).