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
Subject: [net-next 03/14] ixgbe: add support for byte queue limits
Date: Mon, 12 Mar 2012 21:03:41 -0700	[thread overview]
Message-ID: <1331611432-30109-4-git-send-email-jeffrey.t.kirsher@intel.com> (raw)
In-Reply-To: <1331611432-30109-1-git-send-email-jeffrey.t.kirsher@intel.com>

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

This adds support for byte queue limits (BQL).

Based on patch from Eric Dumazet for igb.

Signed-off-by: Alexander Duyck <alexander.h.duyck@intel.com>
Tested-by: Stephen Ko <stephen.s.ko@intel.com>
---
 drivers/net/ethernet/intel/ixgbe/ixgbe.h      |    5 +++++
 drivers/net/ethernet/intel/ixgbe/ixgbe_main.c |    7 +++++++
 2 files changed, 12 insertions(+), 0 deletions(-)

diff --git a/drivers/net/ethernet/intel/ixgbe/ixgbe.h b/drivers/net/ethernet/intel/ixgbe/ixgbe.h
index 2807a25..f05bfdb 100644
--- a/drivers/net/ethernet/intel/ixgbe/ixgbe.h
+++ b/drivers/net/ethernet/intel/ixgbe/ixgbe.h
@@ -643,4 +643,9 @@ extern int ixgbe_fcoe_get_hbainfo(struct net_device *netdev,
 				  struct netdev_fcoe_hbainfo *info);
 #endif /* IXGBE_FCOE */
 
+static inline struct netdev_queue *txring_txq(const struct ixgbe_ring *ring)
+{
+	return netdev_get_tx_queue(ring->netdev, ring->queue_index);
+}
+
 #endif /* _IXGBE_H_ */
diff --git a/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c b/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c
index 23a4665..0609643 100644
--- a/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c
+++ b/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c
@@ -840,6 +840,9 @@ static bool ixgbe_clean_tx_irq(struct ixgbe_q_vector *q_vector,
 		return true;
 	}
 
+	netdev_tx_completed_queue(txring_txq(tx_ring),
+				  total_packets, total_bytes);
+
 #define TX_WAKE_THRESHOLD (DESC_NEEDED * 2)
 	if (unlikely(total_packets && netif_carrier_ok(tx_ring->netdev) &&
 		     (ixgbe_desc_unused(tx_ring) >= TX_WAKE_THRESHOLD))) {
@@ -2617,6 +2620,8 @@ void ixgbe_configure_tx_ring(struct ixgbe_adapter *adapter,
 	/* enable queue */
 	IXGBE_WRITE_REG(hw, IXGBE_TXDCTL(reg_idx), txdctl);
 
+	netdev_tx_reset_queue(txring_txq(ring));
+
 	/* TXDCTL.EN will return 0 on 82598 if link is down, so skip it */
 	if (hw->mac.type == ixgbe_mac_82598EB &&
 	    !(IXGBE_READ_REG(hw, IXGBE_LINKS) & IXGBE_LINKS_UP))
@@ -6808,6 +6813,8 @@ static void ixgbe_tx_map(struct ixgbe_ring *tx_ring,
 	tx_buffer_info->gso_segs = gso_segs;
 	tx_buffer_info->skb = skb;
 
+	netdev_tx_sent_queue(txring_txq(tx_ring), tx_buffer_info->bytecount);
+
 	/* set the timestamp */
 	first->time_stamp = jiffies;
 
-- 
1.7.7.6

  parent reply	other threads:[~2012-03-13  4:03 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-03-13  4:03 [net-next 00/14][pull request] Intel Wired LAN Driver Updates Jeff Kirsher
2012-03-13  4:03 ` [net-next 01/14] igb: fix ethtool offline test Jeff Kirsher
2012-03-13  4:03 ` [net-next 02/14] ixgbe: remove tie between NAPI work limits and interrupt moderation Jeff Kirsher
2012-03-13  4:03 ` Jeff Kirsher [this message]
2012-03-13  4:03 ` [net-next 04/14] net: Fix issue with netdev_tx_reset_queue not resetting queue from XOFF state Jeff Kirsher
2012-04-20 21:19   ` Tom Herbert
2012-04-20 21:31     ` John Fastabend
2012-04-21  3:24       ` Alexander Duyck
2012-04-21  6:01         ` Tom Herbert
2012-04-21 16:27           ` John Fastabend
2012-04-21 20:18             ` David Miller
2012-04-23  3:21               ` John Fastabend
2012-03-13  4:03 ` [net-next 05/14] net: Add memory barriers to prevent possible race in byte queue limits Jeff Kirsher
2012-03-13  4:03 ` [net-next 06/14] ixgbe: Do no clear Tx status bits since eop_desc provides enough info Jeff Kirsher
2012-03-13  4:03 ` [net-next 07/14] ixgbe: Reorder adapter contents for better cache utilization Jeff Kirsher
2012-03-13  4:03 ` [net-next 08/14] ixgbe: Address issues with Tx WHTRESH value not being set correctly Jeff Kirsher
2012-03-13  4:03 ` [net-next 09/14] ixgbe: Correct Adaptive Interrupt Moderation so that it will change values Jeff Kirsher
2012-03-13  4:03 ` [net-next 10/14] ixgbe: Default to queue pairs when number of queues is less than CPUs Jeff Kirsher
2012-03-13  4:03 ` [net-next 11/14] ixgbe: Drop unnecessary napi_schedule_prep and spare blank line from ixgbe_intr Jeff Kirsher
2012-03-13  4:03 ` [net-next 12/14] ixgbe: Allocate rings as part of the q_vector Jeff Kirsher
2012-03-13  4:03 ` [net-next 13/14] ixgbe: Add iterator for cycling through rings on a q_vector Jeff Kirsher
2012-03-13  4:03 ` [net-next 14/14] ixgbe: Simplify logic for ethtool loopback frame creation and testing Jeff Kirsher
2012-03-13  5:55 ` [net-next 00/14][pull request] Intel Wired LAN Driver Updates 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=1331611432-30109-4-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).