From patchwork Tue Nov 15 19:25:40 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: david decotigny X-Patchwork-Id: 125866 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 76F33B6F7B for ; Wed, 16 Nov 2011 06:29:09 +1100 (EST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1757373Ab1KOT2n (ORCPT ); Tue, 15 Nov 2011 14:28:43 -0500 Received: from mail-qy0-f202.google.com ([209.85.216.202]:56971 "EHLO mail-qy0-f202.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1757312Ab1KOT0G (ORCPT ); Tue, 15 Nov 2011 14:26:06 -0500 X-Greylist: delayed 69263 seconds by postgrey-1.27 at vger.kernel.org; Tue, 15 Nov 2011 14:26:06 EST Received: by qyd20 with SMTP id 20so470717qyd.1 for ; Tue, 15 Nov 2011 11:26:05 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=beta; h=from:to:cc:subject:date:message-id:x-mailer:in-reply-to:references :in-reply-to:references:organization:x-system-of-record; bh=p3sLbWVEjRh0r1t54LIorOOE6uA5V+K4ZSszZ/scsXs=; b=kCt/6KPx43zfDHKbYJz2Ooi6NWkSFkr3h1yn4cy5rJEdDJuyrn4NNdw+GCcXMr7Kz8 9aJzbrgnqItKxY1mplFA== Received: by 10.100.75.7 with SMTP id x7mr5619131ana.53.1321385165727; Tue, 15 Nov 2011 11:26:05 -0800 (PST) Received: by 10.100.75.7 with SMTP id x7mr5619069ana.53.1321385165345; Tue, 15 Nov 2011 11:26:05 -0800 (PST) Received: from wpzn3.hot.corp.google.com (216-239-44-65.google.com [216.239.44.65]) by gmr-mx.google.com with ESMTPS id h1si1031198ybh.3.2011.11.15.11.26.04 (version=TLSv1/SSLv3 cipher=AES128-SHA); Tue, 15 Nov 2011 11:26:05 -0800 (PST) Received: from wpaz1.hot.corp.google.com (wpaz1.hot.corp.google.com [172.24.198.65]) by wpzn3.hot.corp.google.com (Postfix) with ESMTPS id BD5FF10004D; Tue, 15 Nov 2011 11:26:04 -0800 (PST) Received: from decotigny.mtv.corp.google.com (decotigny.mtv.corp.google.com [172.18.64.159]) by wpaz1.hot.corp.google.com with ESMTP id pAFJQ2pM010342; Tue, 15 Nov 2011 11:26:02 -0800 Received: by decotigny.mtv.corp.google.com (Postfix, from userid 128857) id 1CF22255CA; Tue, 15 Nov 2011 11:26:00 -0800 (PST) From: David Decotigny To: netdev@vger.kernel.org, linux-kernel@vger.kernel.org Cc: "David S. Miller" , Ian Campbell , Eric Dumazet , Jeff Kirsher , Ben Hutchings , Jiri Pirko , Joe Perches , Szymon Janc , Richard Jones , Ayaz Abdulla , David Decotigny Subject: [PATCH net-next v4 7/8] forcedeth: new ethtool stat counter for TX timeouts Date: Tue, 15 Nov 2011 11:25:40 -0800 Message-Id: <52bc9f8b3924e22f6921bbc41be4865030215747.1321384662.git.david.decotigny@google.com> X-Mailer: git-send-email 1.7.3.1 In-Reply-To: References: In-Reply-To: References: Organization: Google, Inc. X-System-Of-Record: true Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org This change publishes a new ethtool stats: tx_timeout that counts the number of times the tx_timeout callback was triggered. Signed-off-by: David Decotigny --- drivers/net/ethernet/nvidia/forcedeth.c | 9 +++++++++ 1 files changed, 9 insertions(+), 0 deletions(-) diff --git a/drivers/net/ethernet/nvidia/forcedeth.c b/drivers/net/ethernet/nvidia/forcedeth.c index a50c839..7284f40 100644 --- a/drivers/net/ethernet/nvidia/forcedeth.c +++ b/drivers/net/ethernet/nvidia/forcedeth.c @@ -634,6 +634,7 @@ static const struct nv_ethtool_str nv_estats_str[] = { { "rx_packets" }, { "rx_errors_total" }, { "tx_errors_total" }, + { "tx_timeout" }, /* version 2 stats */ { "tx_deferral" }, @@ -674,6 +675,7 @@ struct nv_ethtool_stats { u64 rx_packets; /* should be ifconfig->rx_packets */ u64 rx_errors_total; u64 tx_errors_total; + u64 tx_timeout; /* version 2 stats */ u64 tx_deferral; @@ -848,6 +850,9 @@ struct fe_priv { u64 stat_tx_bytes; u64 stat_tx_dropped; + /* TX software stats exported by ethtool */ + atomic_t stat_tx_timeout; /* TX timeouts since last nv_update_stats */ + /* msi/msi-x fields */ u32 msi_flags; struct msix_entry msi_x_entry[NV_MSI_X_MAX_VECTORS]; @@ -1731,6 +1736,8 @@ static void nv_update_stats(struct net_device *dev) np->estats.tx_multicast += readl(base + NvRegTxMulticast); np->estats.tx_broadcast += readl(base + NvRegTxBroadcast); } + + np->estats.tx_timeout += atomic_xchg(&np->stat_tx_timeout, 0); } /* @@ -2627,6 +2634,8 @@ static void nv_tx_timeout(struct net_device *dev) } } + atomic_inc(&np->stat_tx_timeout); + spin_lock_irq(&np->lock); /* 1) stop tx engine */