Received: by 10.223.185.116 with SMTP id b49csp1068266wrg; Fri, 23 Feb 2018 11:20:04 -0800 (PST) X-Google-Smtp-Source: AH8x225ghVDx/AgXEeWI+GdfYEPDRQWYuFw75aZUoaXC/LjrSUM9wOxVhV0k7+Y57NG55KRDBuR5 X-Received: by 2002:a17:902:6184:: with SMTP id u4-v6mr2602247plj.390.1519413604516; Fri, 23 Feb 2018 11:20:04 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1519413604; cv=none; d=google.com; s=arc-20160816; b=cHl9GlRDXK8O8edO56KsWABamYuE+Ofx1Da4BS4D4Uw2vg3hoODdWnEYmw6PhhKnPV Z7RhcZQfAiIcvcgwA7HeKMMABo66DSWeiQ0SNkjDeclSiuRsG24c/am7gNeOWUbWKMCt 1PsWtyBve3pXSnTpncr1Gs8hL+jWkKcYMISKKsiOh2xnn2qAGx5Wd4iEBbK8BDCRKk+u VEaGQyvT9n0rJGiWrKDw0Hgv8Y1NayHra6A2nyt6tRApo6z9dY4k2EcHJV13RVBinPpS n+6dVpHEB43TJZ9FJLq7qiV5KcDxYu75Y7/n18wG3dalgeQiQWkSHgyBRnlbFpXriTG9 1Lpg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:user-agent:references :in-reply-to:message-id:date:subject:cc:to:from :arc-authentication-results; bh=/7K7Endd31mV6UcQSa1/FjwQiSgsihx5eGoHxfeBvQQ=; b=G3BBWyT6K8pVqjTKOno+AAMwm2GvZWkW/TaKtC68+NVCI8ZD7wOe37MvHvmzPGQ8gW OOwwZ9JvrxTNI6yOescjsNKw1grn563TdXs1uOemGqyN4598IPzq9PahVwQzdxnYFdKV OkwobeL3s7+BYiLUCQg+rErK0Q4EB6NdwaTizPmM/ER6eXmk/cn9d2sFunfGi4eKCgeK f+KKKLzZiMIR9tb5e/7rfnz3ERLBjrBexCOcwIJJqBj1Wob7vkaxuXzp+IRp6tjrJMEo 2Sx403///IwUYXJaWpRvqxN8sLgiewV5AHBht2XkNiHpKnRttIU+zk89AMMfbhR/iHrr krGg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id v22si1850977pgc.724.2018.02.23.11.19.49; Fri, 23 Feb 2018 11:20:04 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S964959AbeBWSyY (ORCPT + 99 others); Fri, 23 Feb 2018 13:54:24 -0500 Received: from mail.linuxfoundation.org ([140.211.169.12]:47728 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S964920AbeBWSyV (ORCPT ); Fri, 23 Feb 2018 13:54:21 -0500 Received: from localhost (LFbn-1-12258-90.w90-92.abo.wanadoo.fr [90.92.71.90]) by mail.linuxfoundation.org (Postfix) with ESMTPSA id 4E2EF11E9; Fri, 23 Feb 2018 18:54:20 +0000 (UTC) From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Pieter Jansen van Vuuren , Simon Horman , Jakub Kicinski , "David S. Miller" , Sasha Levin Subject: [PATCH 4.14 110/159] nfp: fix port stats for mac representors Date: Fri, 23 Feb 2018 19:26:58 +0100 Message-Id: <20180223170756.686403723@linuxfoundation.org> X-Mailer: git-send-email 2.16.2 In-Reply-To: <20180223170743.086611315@linuxfoundation.org> References: <20180223170743.086611315@linuxfoundation.org> User-Agent: quilt/0.65 X-stable: review MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 4.14-stable review patch. If anyone has any objections, please let me know. ------------------ From: Pieter Jansen van Vuuren [ Upstream commit 42d779ffc186f6dd26271fc60a7417cb51aca93e ] Previously we swapped the tx_packets, tx_bytes and tx_dropped counters with rx_packets, rx_bytes and rx_dropped counters, respectively. This behaviour is correct and expected for VF representors but it should not be swapped for physical port mac representors. Fixes: eadfa4c3be99 ("nfp: add stats and xmit helpers for representors") Signed-off-by: Pieter Jansen van Vuuren Reviewed-by: Simon Horman Reviewed-by: Jakub Kicinski Signed-off-by: David S. Miller Signed-off-by: Sasha Levin Signed-off-by: Greg Kroah-Hartman --- drivers/net/ethernet/netronome/nfp/nfp_net_repr.c | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) --- a/drivers/net/ethernet/netronome/nfp/nfp_net_repr.c +++ b/drivers/net/ethernet/netronome/nfp/nfp_net_repr.c @@ -84,16 +84,13 @@ nfp_repr_phy_port_get_stats64(struct nfp { u8 __iomem *mem = port->eth_stats; - /* TX and RX stats are flipped as we are returning the stats as seen - * at the switch port corresponding to the phys port. - */ - stats->tx_packets = readq(mem + NFP_MAC_STATS_RX_FRAMES_RECEIVED_OK); - stats->tx_bytes = readq(mem + NFP_MAC_STATS_RX_IN_OCTETS); - stats->tx_dropped = readq(mem + NFP_MAC_STATS_RX_IN_ERRORS); + stats->tx_packets = readq(mem + NFP_MAC_STATS_TX_FRAMES_TRANSMITTED_OK); + stats->tx_bytes = readq(mem + NFP_MAC_STATS_TX_OUT_OCTETS); + stats->tx_dropped = readq(mem + NFP_MAC_STATS_TX_OUT_ERRORS); - stats->rx_packets = readq(mem + NFP_MAC_STATS_TX_FRAMES_TRANSMITTED_OK); - stats->rx_bytes = readq(mem + NFP_MAC_STATS_TX_OUT_OCTETS); - stats->rx_dropped = readq(mem + NFP_MAC_STATS_TX_OUT_ERRORS); + stats->rx_packets = readq(mem + NFP_MAC_STATS_RX_FRAMES_RECEIVED_OK); + stats->rx_bytes = readq(mem + NFP_MAC_STATS_RX_IN_OCTETS); + stats->rx_dropped = readq(mem + NFP_MAC_STATS_RX_IN_ERRORS); } static void