From patchwork Wed Apr 26 23:38:54 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Iyappan Subramanian X-Patchwork-Id: 9702207 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 054DB601D3 for ; Wed, 26 Apr 2017 23:38:33 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id E818B28399 for ; Wed, 26 Apr 2017 23:38:32 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id DC0D7284DB; Wed, 26 Apr 2017 23:38:32 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-1.9 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [65.50.211.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 5533028399 for ; Wed, 26 Apr 2017 23:38:32 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:MIME-Version:Cc:List-Subscribe: List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id:References: In-Reply-To:Message-Id:Date:Subject:To:From:Reply-To:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Owner; bh=Nd7jz4n04k8j46hGVBNU6cl4ONMdb2cnwLU+MQKR2ho=; b=RAruzUC5hdhGfgTUng8qI/mFLI h/hBYQPsrJrhqnd4hhtedkQGDtk1IVIauHLV1CNa8VxwYnoynZuXGjZKMLURYfNJurweDPh9oPJRd sffQLgFSZDLFf/yMVn0+O+bQJy8pNwMqxNnLu7XiH1HuxCgwA99RUGTe7k9RFVP80d4czHhmSZBgV qqUEV4daLuYuzhAI4OCThbIFW3YKUdIr5nLZAy6tB3I/XIxlcBNxcrwkpoJWVkfGDR43DYD/jPBfJ OaaTUPYeEluPHXHD4NYRD0G/403f0paCmgpIRzv3Ja5d4s4L9WWs4ztC8GDl/PJ00DWU0gnjhat2z tp91DY3A==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.87 #1 (Red Hat Linux)) id 1d3WVz-0005zV-54; Wed, 26 Apr 2017 23:38:31 +0000 Received: from mail-pf0-x231.google.com ([2607:f8b0:400e:c00::231]) by bombadil.infradead.org with esmtps (Exim 4.87 #1 (Red Hat Linux)) id 1d3WUb-0004Dp-DE for linux-arm-kernel@lists.infradead.org; Wed, 26 Apr 2017 23:37:08 +0000 Received: by mail-pf0-x231.google.com with SMTP id v14so8274749pfd.2 for ; Wed, 26 Apr 2017 16:36:42 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=apm.com; s=apm; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=FeGfh/R8tDFjVGavahiDiIGbiida6C4PPeAzDBIQHaQ=; b=UL1aNmdZm4U8jT67X6D1m9NdIoVsvXCUjO+W8peJGZyzphVgLWR//IDtRSPhaZWFpL Yr8Vkzh0kKNxv9QOQH7pZdbdF4JjpQi/A63BGMGoyz6mBWurEY4aqVNBaUZKCIFBFQks mjNfR9HM4eLQBcENDv/6BKWi2w/f3ExbqmaOQ= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=FeGfh/R8tDFjVGavahiDiIGbiida6C4PPeAzDBIQHaQ=; b=iwVU53xFrKdpVIkCFUzq1eh1KspIyg4nW5kraDIJS1KeRuLBsWxJEEocMzZgfB5Obs +rsd31yR6BQ3HuM9WSoXw+FEXdWPJqCI0QHdDTQ2SD1nBiphUuS21S8n6CgcCil9HMmB FX1OCUdr2SZFY3LGgb8O88dgScOEjMdsvPPUV3Gi1R2+18JBESfe+3iQJUxZeVeFxwmZ fpHWhXiyLPOsZl/j1sceztg7oWSNDigI1xYX2CAbRxILtyIIkSu0HaPehKpeuxyidpdI 1hk88V6Z7abXTvvTydwCHOGHIWSQd5pCds+VxJp2nE+P9oq4ZIBw1oCQwBsk5CvHCB63 0YDg== X-Gm-Message-State: AN3rC/4LMHJpJG1v6N14UeYDSj0ceWt0GBU9ePHneOaflz2ZxGTkNyrK IU+XoedvdRk8YeSG X-Received: by 10.99.218.69 with SMTP id l5mr2566956pgj.88.1493249802143; Wed, 26 Apr 2017 16:36:42 -0700 (PDT) Received: from isubrama-dev.amcc.com ([206.80.4.98]) by smtp.gmail.com with ESMTPSA id i30sm626700pgn.39.2017.04.26.16.36.41 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 26 Apr 2017 16:36:41 -0700 (PDT) From: Iyappan Subramanian To: davem@davemloft.net, netdev@vger.kernel.org Subject: [PATCH net-next 8/9] drivers: net: xgene: Add frame recovered statistics counter for errata 10GE_8/ENET_11 Date: Wed, 26 Apr 2017 16:38:54 -0700 Message-Id: <1493249935-30759-9-git-send-email-isubramanian@apm.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1493249935-30759-1-git-send-email-isubramanian@apm.com> References: <1493249935-30759-1-git-send-email-isubramanian@apm.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20170426_163705_570598_1DB547ED X-CRM114-Status: GOOD ( 12.27 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Quan Nguyen , patches@apm.com, linux-arm-kernel@lists.infradead.org, Iyappan Subramanian MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP From: Quan Nguyen This patch adds statistic counter for frames recovered from HW errata 10GE_8 and ENET_11: "HW reports Length error for valid 64 byte frames with len <46 bytes". Signed-off-by: Quan Nguyen Signed-off-by: Iyappan Subramanian --- drivers/net/ethernet/apm/xgene/xgene_enet_ethtool.c | 9 +++++++-- drivers/net/ethernet/apm/xgene/xgene_enet_main.c | 2 ++ drivers/net/ethernet/apm/xgene/xgene_enet_main.h | 1 + 3 files changed, 10 insertions(+), 2 deletions(-) diff --git a/drivers/net/ethernet/apm/xgene/xgene_enet_ethtool.c b/drivers/net/ethernet/apm/xgene/xgene_enet_ethtool.c index 369658b..5e8660e 100644 --- a/drivers/net/ethernet/apm/xgene/xgene_enet_ethtool.c +++ b/drivers/net/ethernet/apm/xgene/xgene_enet_ethtool.c @@ -64,6 +64,7 @@ struct xgene_gstrings_stats { XGENE_EXTD_STAT(rx_unk_opcode_cntr, RXUO, 16), XGENE_EXTD_STAT(rx_align_err_cntr, RALN, 16), XGENE_EXTD_STAT(rx_frame_len_err_cntr, RFLR, 16), + XGENE_EXTD_STAT(rx_frame_len_err_recov_cntr, DUMP, 0), XGENE_EXTD_STAT(rx_code_err_cntr, RCDE, 16), XGENE_EXTD_STAT(rx_carrier_sense_err_cntr, RCSE, 16), XGENE_EXTD_STAT(rx_undersize_pkt_cntr, RUND, 16), @@ -95,8 +96,9 @@ struct xgene_gstrings_stats { #define XGENE_STATS_LEN ARRAY_SIZE(gstrings_stats) #define XGENE_EXTD_STATS_LEN ARRAY_SIZE(gstrings_extd_stats) -#define RX_OVERRUN_IDX 22 -#define TX_UNDERRUN_IDX 41 +#define FALSE_RFLR_IDX 15 +#define RX_OVERRUN_IDX 23 +#define TX_UNDERRUN_IDX 42 static void xgene_get_drvinfo(struct net_device *ndev, struct ethtool_drvinfo *info) @@ -230,6 +232,9 @@ static void xgene_get_extd_stats(struct xgene_enet_pdata *pdata) pdata->mac_ops->get_drop_cnt(pdata, &rx_drop, &tx_drop); pdata->extd_stats[RX_OVERRUN_IDX] += rx_drop; pdata->extd_stats[TX_UNDERRUN_IDX] += tx_drop; + + /* Errata 10GE_8 - Update Frame recovered from Errata 10GE_8/ENET_11 */ + pdata->extd_stats[FALSE_RFLR_IDX] = pdata->false_rflr; } int xgene_extd_stats_init(struct xgene_enet_pdata *pdata) diff --git a/drivers/net/ethernet/apm/xgene/xgene_enet_main.c b/drivers/net/ethernet/apm/xgene/xgene_enet_main.c index bd2486e..c2d38da 100644 --- a/drivers/net/ethernet/apm/xgene/xgene_enet_main.c +++ b/drivers/net/ethernet/apm/xgene/xgene_enet_main.c @@ -712,6 +712,8 @@ static int xgene_enet_rx_frame(struct xgene_enet_desc_ring *rx_ring, xgene_enet_parse_error(rx_ring, status); rx_ring->rx_dropped++; goto out; + } else { + pdata->false_rflr++; } } diff --git a/drivers/net/ethernet/apm/xgene/xgene_enet_main.h b/drivers/net/ethernet/apm/xgene/xgene_enet_main.h index e4b7786..8afae57 100644 --- a/drivers/net/ethernet/apm/xgene/xgene_enet_main.h +++ b/drivers/net/ethernet/apm/xgene/xgene_enet_main.h @@ -225,6 +225,7 @@ struct xgene_enet_pdata { enum xgene_enet_rm rm; struct xgene_enet_cle cle; u64 *extd_stats; + u64 false_rflr; spinlock_t stats_lock; /* statistics lock */ const struct xgene_mac_ops *mac_ops; spinlock_t mac_lock; /* mac lock */