From patchwork Tue Nov 15 00:11:17 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: david decotigny X-Patchwork-Id: 125640 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 17B72B71F8 for ; Tue, 15 Nov 2011 11:12:28 +1100 (EST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756868Ab1KOALv (ORCPT ); Mon, 14 Nov 2011 19:11:51 -0500 Received: from mail-vx0-f202.google.com ([209.85.220.202]:42034 "EHLO mail-vx0-f202.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752631Ab1KOALs (ORCPT ); Mon, 14 Nov 2011 19:11:48 -0500 Received: by vcbfy13 with SMTP id fy13so557886vcb.1 for ; Mon, 14 Nov 2011 16:11:47 -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=7hCs9r6LdTQXN8CHIwiIvWapXv3313Zh8ra27zvh/iI=; b=MwMOUmCe43Ui6MjM9tClxwbtJupb6apGry4lJyU2kdEPLpZkksrgybB8dKz4nGxFjh jaT1UYqZgIqPX0BAlV7w== Received: by 10.101.119.16 with SMTP id w16mr3132394anm.24.1321315907313; Mon, 14 Nov 2011 16:11:47 -0800 (PST) Received: by 10.101.119.16 with SMTP id w16mr3132333anm.24.1321315906983; Mon, 14 Nov 2011 16:11:46 -0800 (PST) Received: from wpzn4.hot.corp.google.com (216-239-44-65.google.com [216.239.44.65]) by gmr-mx.google.com with ESMTPS id o24si2926142ybh.1.2011.11.14.16.11.46 (version=TLSv1/SSLv3 cipher=AES128-SHA); Mon, 14 Nov 2011 16:11:46 -0800 (PST) Received: from wpaz24.hot.corp.google.com (wpaz24.hot.corp.google.com [172.24.198.88]) by wpzn4.hot.corp.google.com (Postfix) with ESMTPS id DBF9B1E004D; Mon, 14 Nov 2011 16:11:46 -0800 (PST) Received: from decotigny.mtv.corp.google.com (decotigny.mtv.corp.google.com [172.18.64.159]) by wpaz24.hot.corp.google.com with ESMTP id pAF0BgkP013089; Mon, 14 Nov 2011 16:11:42 -0800 Received: by decotigny.mtv.corp.google.com (Postfix, from userid 128857) id 514DB2391D; Mon, 14 Nov 2011 16:11:40 -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 v3 7/9] forcedeth: new ethtool stat counter for TX timeouts Date: Mon, 14 Nov 2011 16:11:17 -0800 Message-Id: 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 | 6 ++++++ 1 files changed, 6 insertions(+), 0 deletions(-) diff --git a/drivers/net/ethernet/nvidia/forcedeth.c b/drivers/net/ethernet/nvidia/forcedeth.c index 84e8d17..dd24035 100644 --- a/drivers/net/ethernet/nvidia/forcedeth.c +++ b/drivers/net/ethernet/nvidia/forcedeth.c @@ -633,6 +633,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" }, @@ -673,6 +674,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; @@ -852,6 +854,7 @@ struct fe_priv { struct nv_driver_stat stat_tx_packets; /* not always available in HW */ struct nv_driver_stat stat_tx_bytes; struct nv_driver_stat stat_tx_dropped; + atomic_t stat_tx_timeout; /* TX timeouts since last nv_update_stats */ /* msi/msi-x fields */ u32 msi_flags; @@ -1746,6 +1749,7 @@ static void nv_update_stats(struct net_device *dev) NV_DRIVER_STAT_UPDATE_TOTAL(&np->stat_tx_packets); NV_DRIVER_STAT_UPDATE_TOTAL(&np->stat_tx_bytes); NV_DRIVER_STAT_UPDATE_TOTAL(&np->stat_tx_dropped); + np->estats.tx_timeout += atomic_xchg(&np->stat_tx_timeout, 0); } /* @@ -2639,6 +2643,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 */