From patchwork Thu Feb 11 16:20:21 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sunil Kovvuri X-Patchwork-Id: 8282331 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id C8C4FBEEE5 for ; Thu, 11 Feb 2016 16:19:47 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id CB4622020F for ; Thu, 11 Feb 2016 16:19:46 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.9]) (using TLSv1.2 with cipher AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id D7DBF203B6 for ; Thu, 11 Feb 2016 16:19:44 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1aTtwT-0000FK-14; Thu, 11 Feb 2016 16:18:05 +0000 Received: from mail-pa0-x241.google.com ([2607:f8b0:400e:c03::241]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1aTtwL-0008Ux-Gj for linux-arm-kernel@lists.infradead.org; Thu, 11 Feb 2016 16:17:59 +0000 Received: by mail-pa0-x241.google.com with SMTP id yy13so2624413pab.1 for ; Thu, 11 Feb 2016 08:17:37 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=dScBFwbALpEQnLeyML/fMyrptfmva9duU74qCIOHZOQ=; b=Gyi2xTXE/vbpOxfqklNJ3mXEE83NnTqFx9vpkCEJBLNx64kY852KoZd0EL4LGXPu7I +Tar3j7BjkKlEiB5awpYOLxlIeFKTB5UY1tjv0sDUgC2lo6O/X9VnE9SwFgUAAu9zqd7 thKUgXThHMFL3EGXZNkN/eQkJ6PtnHRRVsejx6qsALvuHrUyQY+PQdx2yFx+816FCFoc RGPaAfPHANtBjxsMHoDFZfWa2A98NIlsR1wxoTIRCbCndrs/tcK33IgWhtkk2uYsQ95z rsurV0w39eZ59BqSduXvWGveV45g7yEw4BV/82GCOhOHwAteNZ4ySpTwDghE34PuEi4q VauA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=dScBFwbALpEQnLeyML/fMyrptfmva9duU74qCIOHZOQ=; b=H6dlbZiY/ej4hl86EbJKvYzpW/Fd8cMh/3hvuqGqP1r4pJQ/i6+2Jtz3xyaVlq7bHi Zw9wl/aIK1VUguh1AobDy8mxYUVrO/clJIi3O9fVXER/FVsx5YJ36sBWBJtHMwXsNPSO x7ucJtHFm7II41qNxFWLW9ipx8EWodys+sgoVSuebeLZoGm1Zl3C1w1K5HFGZhSu2OX8 kYM5998+AVF/rODoswMTNIxrl/GnjX8I40KTCwXOdn9C8or4sU7jYTWweK8ti4iEAUoB tmt9Y1ybT2cFDad0pwEAwKuFwqaYDwm5BYrNzdD/IrvByBjuTSR3OPH0ahwo3z5U+vpv grsw== X-Gm-Message-State: AG10YOQteD55fkB8figaoSfaAoMWO7LiXAbYJkZH0YWd9n/tJX8blcKHgXZDUXSs48eBQw== X-Received: by 10.66.232.132 with SMTP id to4mr67623537pac.95.1455207456790; Thu, 11 Feb 2016 08:17:36 -0800 (PST) Received: from localhost.localdomain ([14.140.2.178]) by smtp.googlemail.com with ESMTPSA id s90sm13355894pfa.49.2016.02.11.08.17.33 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 11 Feb 2016 08:17:35 -0800 (PST) From: sunil.kovvuri@gmail.com To: netdev@vger.kernel.org Subject: [PATCH v2 1/6] net, thunderx: Add TX timeout and RX buffer alloc failure stats. Date: Thu, 11 Feb 2016 21:50:21 +0530 Message-Id: <1455207626-35488-2-git-send-email-sunil.kovvuri@gmail.com> X-Mailer: git-send-email 1.7.1 In-Reply-To: <1455207626-35488-1-git-send-email-sunil.kovvuri@gmail.com> References: <1455207626-35488-1-git-send-email-sunil.kovvuri@gmail.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20160211_081757_775644_A0C0E1A4 X-CRM114-Status: GOOD ( 15.28 ) X-Spam-Score: -1.4 (-) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Thanneeru Srinivasulu , sgoutham@cavium.com, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, robert.richter@caviumnetworks.com MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Spam-Status: No, score=-3.0 required=5.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED,FREEMAIL_FROM,RCVD_IN_BL_SPAMCOP_NET,RCVD_IN_DNSWL_MED, RP_MATCHES_RCVD, T_DKIM_INVALID, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Thanneeru Srinivasulu When system is low on atomic memory, too many error messages are logged. Since this is not a total failure but a simple switch to non-atomic allocation better to have a stat. Also add a stat for reset, kicked due to transmit watchdog timeout. Signed-off-by: Thanneeru Srinivasulu Signed-off-by: Sunil Goutham --- drivers/net/ethernet/cavium/thunder/nic.h | 3 +++ .../net/ethernet/cavium/thunder/nicvf_ethtool.c | 2 ++ drivers/net/ethernet/cavium/thunder/nicvf_main.c | 1 + drivers/net/ethernet/cavium/thunder/nicvf_queues.c | 3 +-- 4 files changed, 7 insertions(+), 2 deletions(-) diff --git a/drivers/net/ethernet/cavium/thunder/nic.h b/drivers/net/ethernet/cavium/thunder/nic.h index 6888288..8af363a 100644 --- a/drivers/net/ethernet/cavium/thunder/nic.h +++ b/drivers/net/ethernet/cavium/thunder/nic.h @@ -248,10 +248,13 @@ struct nicvf_drv_stats { u64 rx_frames_jumbo; u64 rx_drops; + u64 rcv_buffer_alloc_failures; + /* Tx */ u64 tx_frames_ok; u64 tx_drops; u64 tx_tso; + u64 tx_timeout; u64 txq_stop; u64 txq_wake; }; diff --git a/drivers/net/ethernet/cavium/thunder/nicvf_ethtool.c b/drivers/net/ethernet/cavium/thunder/nicvf_ethtool.c index a12b2e3..d2d8ef2 100644 --- a/drivers/net/ethernet/cavium/thunder/nicvf_ethtool.c +++ b/drivers/net/ethernet/cavium/thunder/nicvf_ethtool.c @@ -89,9 +89,11 @@ static const struct nicvf_stat nicvf_drv_stats[] = { NICVF_DRV_STAT(rx_frames_1518), NICVF_DRV_STAT(rx_frames_jumbo), NICVF_DRV_STAT(rx_drops), + NICVF_DRV_STAT(rcv_buffer_alloc_failures), NICVF_DRV_STAT(tx_frames_ok), NICVF_DRV_STAT(tx_tso), NICVF_DRV_STAT(tx_drops), + NICVF_DRV_STAT(tx_timeout), NICVF_DRV_STAT(txq_stop), NICVF_DRV_STAT(txq_wake), }; diff --git a/drivers/net/ethernet/cavium/thunder/nicvf_main.c b/drivers/net/ethernet/cavium/thunder/nicvf_main.c index c24cb2a..95db6b7 100644 --- a/drivers/net/ethernet/cavium/thunder/nicvf_main.c +++ b/drivers/net/ethernet/cavium/thunder/nicvf_main.c @@ -1394,6 +1394,7 @@ static void nicvf_tx_timeout(struct net_device *dev) netdev_warn(dev, "%s: Transmit timed out, resetting\n", dev->name); + nic->drv_stats.tx_timeout++; schedule_work(&nic->reset_task); } diff --git a/drivers/net/ethernet/cavium/thunder/nicvf_queues.c b/drivers/net/ethernet/cavium/thunder/nicvf_queues.c index d0d1b54..50ab6f4 100644 --- a/drivers/net/ethernet/cavium/thunder/nicvf_queues.c +++ b/drivers/net/ethernet/cavium/thunder/nicvf_queues.c @@ -96,8 +96,7 @@ static inline int nicvf_alloc_rcv_buffer(struct nicvf *nic, gfp_t gfp, nic->rb_page = alloc_pages(gfp | __GFP_COMP | __GFP_NOWARN, order); if (!nic->rb_page) { - netdev_err(nic->netdev, - "Failed to allocate new rcv buffer\n"); + nic->drv_stats.rcv_buffer_alloc_failures++; return -ENOMEM; } nic->rb_page_offset = 0;