From patchwork Tue Jan 3 19:19:07 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Kirsher, Jeffrey T" X-Patchwork-Id: 134062 X-Patchwork-Delegate: davem@davemloft.net Return-Path: X-Original-To: patchwork-incoming@ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 258821007D8 for ; Wed, 4 Jan 2012 06:19:53 +1100 (EST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754820Ab2ACTTu (ORCPT ); Tue, 3 Jan 2012 14:19:50 -0500 Received: from mga02.intel.com ([134.134.136.20]:57343 "EHLO mga02.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754736Ab2ACTTp (ORCPT ); Tue, 3 Jan 2012 14:19:45 -0500 Received: from orsmga002.jf.intel.com ([10.7.209.21]) by orsmga101.jf.intel.com with ESMTP; 03 Jan 2012 11:19:22 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="4.67,351,1309762800"; d="scan'208";a="94057845" Received: from unknown (HELO jtkirshe-mobl.amr.corp.intel.com) ([10.255.13.131]) by orsmga002.jf.intel.com with ESMTP; 03 Jan 2012 11:19:21 -0800 From: Jeff Kirsher To: davem@davemloft.net Cc: Eric Dumazet , netdev@vger.kernel.org, gospo@redhat.com, sassmann@redhat.com, Alexander Duyck , Jeff Kirsher Subject: [net-next 02/11] igb: Add support for byte queue limits. Date: Tue, 3 Jan 2012 11:19:07 -0800 Message-Id: <1325618356-2655-3-git-send-email-jeffrey.t.kirsher@intel.com> X-Mailer: git-send-email 1.7.7.5 In-Reply-To: <1325618356-2655-1-git-send-email-jeffrey.t.kirsher@intel.com> References: <1325618356-2655-1-git-send-email-jeffrey.t.kirsher@intel.com> Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org From: Eric Dumazet 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 CC: Alexander Duyck Tested-by: Aaron Brown Signed-off-by: Jeff Kirsher --- 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);