From patchwork Fri Sep 11 23:28:51 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jakub Kicinski X-Patchwork-Id: 261014 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-13.1 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, INCLUDES_PATCH, MAILING_LIST_MULTI, SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 2EF04C433E2 for ; Fri, 11 Sep 2020 23:29:42 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id E6E2A21D40 for ; Fri, 11 Sep 2020 23:29:41 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1599866982; bh=XmAPZSSO7hhjf6JXOXMXTzLgowJRHK3/5FdNsuGUIaM=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=tUKQG55A6lWq0kWva3DVhWhZHrt3aXvOmKUX+i523fxgG0zX7c723cBV28QZ/Ceou ecOYzy3ZH/BuGjU2fjRgEwwskYJ62+lBZ74DzxwS8OVJl/lLCqVlOunuqgdqqvsZI/ 7xJAUGbeyX0r/yn1dMphqlX3f2hWChqlQwetZW4c= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1725935AbgIKX3j (ORCPT ); Fri, 11 Sep 2020 19:29:39 -0400 Received: from mail.kernel.org ([198.145.29.99]:47708 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725893AbgIKX3C (ORCPT ); Fri, 11 Sep 2020 19:29:02 -0400 Received: from kicinski-fedora-PC1C0HJN.thefacebook.com (unknown [163.114.132.4]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 91F2A2220F; Fri, 11 Sep 2020 23:29:01 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1599866941; bh=XmAPZSSO7hhjf6JXOXMXTzLgowJRHK3/5FdNsuGUIaM=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=H8uW61w8cmGa4JDo0DEyR0gbQVfJ/KMJ3P9QZNxbViGNjUD5zlg1SNpowiyqasO/o LALa6oK1BOaaiD7xKWo4J6qvKlM7Vt5aw76Izk8O8PMuJVM5dslftUIXTqU7IknmFt pU7acKPXZWH4i4tzobhcLnroFXv5+OJMrSQszn7E= From: Jakub Kicinski To: davem@davemloft.net Cc: netdev@vger.kernel.org, mkubecek@suse.cz, michael.chan@broadcom.com, tariqt@nvidia.com, saeedm@nvidia.com, alexander.duyck@gmail.com, andrew@lunn.ch, Jakub Kicinski , Alexander Duyck Subject: [PATCH net-next v2 6/8] ixgbe: add pause frame stats Date: Fri, 11 Sep 2020 16:28:51 -0700 Message-Id: <20200911232853.1072362-7-kuba@kernel.org> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20200911232853.1072362-1-kuba@kernel.org> References: <20200911232853.1072362-1-kuba@kernel.org> MIME-Version: 1.0 Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org Report standard pause frame stats. They are already aggregated in struct ixgbe_hw_stats. The combination of the registers is suggested as equivalent to PAUSEMACCtrlFramesTransmitted / PAUSEMACCtrlFramesReceived by the Intel 82576EB datasheet, I could not find any information in the HW actually supported by ixgbe. Signed-off-by: Jakub Kicinski Reviewed-by: Alexander Duyck --- drivers/net/ethernet/intel/ixgbe/ixgbe_ethtool.c | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/drivers/net/ethernet/intel/ixgbe/ixgbe_ethtool.c b/drivers/net/ethernet/intel/ixgbe/ixgbe_ethtool.c index 71ec908266a6..a280aa34ca1d 100644 --- a/drivers/net/ethernet/intel/ixgbe/ixgbe_ethtool.c +++ b/drivers/net/ethernet/intel/ixgbe/ixgbe_ethtool.c @@ -531,6 +531,16 @@ static int ixgbe_set_link_ksettings(struct net_device *netdev, return err; } +static void ixgbe_get_pause_stats(struct net_device *netdev, + struct ethtool_pause_stats *stats) +{ + struct ixgbe_adapter *adapter = netdev_priv(netdev); + struct ixgbe_hw_stats *hwstats = &adapter->stats; + + stats->tx_pause_frames = hwstats->lxontxc + hwstats->lxofftxc; + stats->rx_pause_frames = hwstats->lxonrxc + hwstats->lxoffrxc; +} + static void ixgbe_get_pauseparam(struct net_device *netdev, struct ethtool_pauseparam *pause) { @@ -3546,6 +3556,7 @@ static const struct ethtool_ops ixgbe_ethtool_ops = { .set_eeprom = ixgbe_set_eeprom, .get_ringparam = ixgbe_get_ringparam, .set_ringparam = ixgbe_set_ringparam, + .get_pause_stats = ixgbe_get_pause_stats, .get_pauseparam = ixgbe_get_pauseparam, .set_pauseparam = ixgbe_set_pauseparam, .get_msglevel = ixgbe_get_msglevel,