From patchwork Mon Feb 8 12:07:47 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sunil Kovvuri X-Patchwork-Id: 8249131 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 330B5BEEE5 for ; Mon, 8 Feb 2016 12:07:13 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 51CFA202FF for ; Mon, 8 Feb 2016 12:07:12 +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 31D38202EC for ; Mon, 8 Feb 2016 12:07:04 +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 1aSkZS-0007vh-9X; Mon, 08 Feb 2016 12:05:34 +0000 Received: from mail-pa0-x243.google.com ([2607:f8b0:400e:c03::243]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1aSkZ9-0006NO-Ir for linux-arm-kernel@lists.infradead.org; Mon, 08 Feb 2016 12:05:18 +0000 Received: by mail-pa0-x243.google.com with SMTP id sv5so2510468pab.3 for ; Mon, 08 Feb 2016 04:04:55 -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=0Mpta2b3+o2ptaVOAbO52i98+P5t65ECh990TY/V8zjUAe2uXVegA8YPOC5GVdwRrl oQ8CCqxAyYpAOgFY1JcLYJSi4ZrS4i4AvbE1I+yIokXF/YQtGM+nE1go+iI0cRHaAO5H aY1YNrXgLbCpBk8fKCt783gbM9VlNUjMc9hY3jYoJEzhHht8w7geYzFiPWHVHMCMnh0o uf2Gd14fCnZFjFRDB7WVo6jTQFJXBFDHX5vd7oAjdp/hqI6TMZaPWAM091AoprACuVoQ vCct1nbUSofjl57Ird4k4pCuEb6mYN5ewDvSxb+RmPn2gTg8sL/yjfMOEAJiMk4bgwVT Sszg== 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=L/8rM6BKGEWMHsIIeDwTSPiHUiBBILhnhrGJIiAbKtnx6qs+Jr5NfJ9y+aPRJ0yi8p VY8fqXwVtDndFlVwnW8Vm7/Jw382b99t0s+USFChKU4gnZaJ1ENrIzMbh5uKmh/Cpu3n zfGiKxxY/oX4KcKxK0Tz4syrc4zF6k8HKk0jvDI0CAiVE1KPAZqvp6ZSR24FE1BrvtNb IKd12X/z69qHVOVaFIp9YK0x7OG+MgvX5myjhgl4b1Dgc91KmNxXzQImj6VSJSye3yL3 /r+/FrgXbFLRa8HroL18GyoHCr78yNmc5v3UVxlxSC5h7xtVR+XrweewJ0rqv76BNOmu QWgA== X-Gm-Message-State: AG10YORx1620Sw71xMG2IMSy7MhczSkUZS+1G414jpiakwGWXvEJkgXY2fAn/S1Cox13hg== X-Received: by 10.66.164.196 with SMTP id ys4mr41472068pab.119.1454933094689; Mon, 08 Feb 2016 04:04:54 -0800 (PST) Received: from localhost.localdomain ([14.140.2.178]) by smtp.googlemail.com with ESMTPSA id 17sm43082945pfq.51.2016.02.08.04.04.51 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 08 Feb 2016 04:04:53 -0800 (PST) From: sunil.kovvuri@gmail.com To: netdev@vger.kernel.org Subject: [PATCH 1/6] net, thunderx: Add TX timeout and RX buffer alloc failure stats. Date: Mon, 8 Feb 2016 17:37:47 +0530 Message-Id: <1454933272-45005-2-git-send-email-sunil.kovvuri@gmail.com> X-Mailer: git-send-email 1.7.1 In-Reply-To: <1454933272-45005-1-git-send-email-sunil.kovvuri@gmail.com> References: <1454933272-45005-1-git-send-email-sunil.kovvuri@gmail.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20160208_040515_892776_9CDEB76E X-CRM114-Status: GOOD ( 15.69 ) X-Spam-Score: -2.7 (--) 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=-4.4 required=5.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, 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;