From patchwork Fri May 1 13:21:04 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg KH X-Patchwork-Id: 226506 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=-6.8 required=3.0 tests=DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI, SIGNED_OFF_BY, SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=unavailable 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 7A0A4C47253 for ; Fri, 1 May 2020 13:57:10 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 565392054F for ; Fri, 1 May 2020 13:57:10 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1588341430; bh=TIDW1O+XunI+ndei1fj20NuEKsENS1mU14MYLt4g7J8=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=ZiyuK4QKj9acu0tkqjKVvzqYYzI5S74TLZ05drg+OTaiCrj+5B2eaYZcQVCdRoHU4 RVZ2rtlyOXzB/pHjnP1PzyocvEi7mdkIDoVRLgj3BKOxZ7VX3xrU4gQyCOo5g0HH/P 8pAvqM5XRReLCEHc/JeX+lvxkV8HnWw5IMyufEXc= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730285AbgEAN5G (ORCPT ); Fri, 1 May 2020 09:57:06 -0400 Received: from mail.kernel.org ([198.145.29.99]:56520 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730159AbgEANbs (ORCPT ); Fri, 1 May 2020 09:31:48 -0400 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (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 17937208C3; Fri, 1 May 2020 13:31:47 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1588339908; bh=TIDW1O+XunI+ndei1fj20NuEKsENS1mU14MYLt4g7J8=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=0exOwOCv2vxJNjaMK6ReGi1VJod/9HhbJWsLqWF3K0JdiDTlsfdjlZcYitmKvCPpS p/nmp3N1D9AEa4ufwPfd+vgzCJlm0ekkqt6WjYep+DYOHxGnA465AJbQOF+hYvVAYO wN1oa+LRom5s3Y3Gtx4s24AabMFHEoBibfU+tbjk= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Doug Berger , Florian Fainelli , "David S. Miller" Subject: [PATCH 4.14 028/117] net: bcmgenet: correct per TX/RX ring statistics Date: Fri, 1 May 2020 15:21:04 +0200 Message-Id: <20200501131548.233610904@linuxfoundation.org> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20200501131544.291247695@linuxfoundation.org> References: <20200501131544.291247695@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Sender: stable-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org From: Doug Berger [ Upstream commit a6d0b83f25073bdf08b8547aeff961a62c6ab229 ] The change to track net_device_stats per ring to better support SMP missed updating the rx_dropped member. The ndo_get_stats method is also needed to combine the results for ethtool statistics (-S) before filling in the ethtool structure. Fixes: 37a30b435b92 ("net: bcmgenet: Track per TX/RX rings statistics") Signed-off-by: Doug Berger Acked-by: Florian Fainelli Signed-off-by: David S. Miller Signed-off-by: Greg Kroah-Hartman --- drivers/net/ethernet/broadcom/genet/bcmgenet.c | 3 +++ 1 file changed, 3 insertions(+) --- a/drivers/net/ethernet/broadcom/genet/bcmgenet.c +++ b/drivers/net/ethernet/broadcom/genet/bcmgenet.c @@ -973,6 +973,8 @@ static void bcmgenet_get_ethtool_stats(s if (netif_running(dev)) bcmgenet_update_mib_counters(priv); + dev->netdev_ops->ndo_get_stats(dev); + for (i = 0; i < BCMGENET_STATS_LEN; i++) { const struct bcmgenet_stats *s; char *p; @@ -3215,6 +3217,7 @@ static struct net_device_stats *bcmgenet dev->stats.rx_packets = rx_packets; dev->stats.rx_errors = rx_errors; dev->stats.rx_missed_errors = rx_errors; + dev->stats.rx_dropped = rx_dropped; return &dev->stats; }