Received: by 2002:a25:ab43:0:0:0:0:0 with SMTP id u61csp2973135ybi; Mon, 10 Jun 2019 01:56:06 -0700 (PDT) X-Google-Smtp-Source: APXvYqwtAI9Ap0AwfixmIJhAswqKsuOhp/nmJDSndZLdnexzQwpqeaEChlDHS+loqwFYxH/xcx4+ X-Received: by 2002:a17:902:549:: with SMTP id 67mr10337646plf.86.1560156966498; Mon, 10 Jun 2019 01:56:06 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1560156966; cv=none; d=google.com; s=arc-20160816; b=qXYl8EvDqm7yJtKjfUoGWuurfpEKhAFbVAuu1YRB5rby6towU1UxaD8SgxI4uED9ME 13bEBMkji30VWIUCMr6dsN5qvaBF94sc1v0Td+7eeBBeKA5y24vNL5eBbO6F16QWYXEy h1VhaRmyGB2PG8byHm+YjLOiUoOLlxBcGau/+DGscmo9YEFS52JjDi72hAE6L/Pio/dK Lt21IDvb7sZm4Xjs3T8Nao+dVXO1tB18pNxJu4jNWFBnTzlbtUk28yXnWazXIg2BEZDX I6vL93p3oCh8ENoxUZFFih8R2+2dAfOg3oQ8v1ds0WHswBAFEyXE5eglP9jy4V5EPRh8 C0ZA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from; bh=AskpH9kS3qNc4r20TxaxLHBvCWZuMNu1J0rsn+c0jI4=; b=Pnr4aKjXvAow5vwpTJB3d08KkL4yYRPZmG25wMfhpFt3GLghjfceh2nv1y0tzdOZFM SYNTsxAbtifBus/8PVOsYl1Dm/dBwJybs4LRWUc2drndDThT+jue3mOgiqQAMhx9Ux+U 0Cjbbz7nXCA4Pro+OSPXQJ8YLejpyCXgZAnZLVO624LW8esTI1ysv0qiwvkiJJVT+RwQ HnelYV27rGjU6b/eViU+FJ+2197PMgcduWQjrccqYE1lbfh9sc6escfLBXx7KMc2krwU JAxbkUgsIVnWNC1MHsHc/tBNIi17bXXaTdt/tOqmzzZeeHFHcvC1zXENa5Faw1ktv8Iu 1uAA== 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 q33si9277306pgm.287.2019.06.10.01.55.51; Mon, 10 Jun 2019 01:56:06 -0700 (PDT) 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 S2388746AbfFJIzk (ORCPT + 99 others); Mon, 10 Jun 2019 04:55:40 -0400 Received: from relay9-d.mail.gandi.net ([217.70.183.199]:41471 "EHLO relay9-d.mail.gandi.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2388727AbfFJIzi (ORCPT ); Mon, 10 Jun 2019 04:55:38 -0400 X-Originating-IP: 90.88.159.246 Received: from mc-bl-xps13.lan (aaubervilliers-681-1-40-246.w90-88.abo.wanadoo.fr [90.88.159.246]) (Authenticated sender: maxime.chevallier@bootlin.com) by relay9-d.mail.gandi.net (Postfix) with ESMTPSA id C7707FF810; Mon, 10 Jun 2019 08:55:35 +0000 (UTC) From: Maxime Chevallier To: davem@davemloft.net Cc: Maxime Chevallier , netdev@vger.kernel.org, linux-kernel@vger.kernel.org, Antoine Tenart , thomas.petazzoni@bootlin.com, gregory.clement@bootlin.com, miquel.raynal@bootlin.com, nadavh@marvell.com, stefanc@marvell.com, ymarkman@marvell.com, mw@semihalf.com Subject: [PATCH net-next 2/3] net: mvpp2: Rename mvpp2_ethtool_counters to mvpp2_ethtool_mib_counters Date: Mon, 10 Jun 2019 10:55:28 +0200 Message-Id: <20190610085529.16803-3-maxime.chevallier@bootlin.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190610085529.16803-1-maxime.chevallier@bootlin.com> References: <20190610085529.16803-1-maxime.chevallier@bootlin.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Since we'll be adding support for other kind of internal counters, make clear that the currently supported counters are the MIB counters. Signed-off-by: Maxime Chevallier --- .../net/ethernet/marvell/mvpp2/mvpp2_main.c | 21 ++++++++++--------- 1 file changed, 11 insertions(+), 10 deletions(-) diff --git a/drivers/net/ethernet/marvell/mvpp2/mvpp2_main.c b/drivers/net/ethernet/marvell/mvpp2/mvpp2_main.c index ee653125194e..01380ccb2139 100644 --- a/drivers/net/ethernet/marvell/mvpp2/mvpp2_main.c +++ b/drivers/net/ethernet/marvell/mvpp2/mvpp2_main.c @@ -1267,7 +1267,7 @@ static u64 mvpp2_read_count(struct mvpp2_port *port, * Hence, statistics gathered from userspace with ifconfig (software) and * ethtool (hardware) cannot be compared. */ -static const struct mvpp2_ethtool_counter mvpp2_ethtool_regs[] = { +static const struct mvpp2_ethtool_counter mvpp2_ethtool_mib_regs[] = { { MVPP2_MIB_GOOD_OCTETS_RCVD, "good_octets_received", true }, { MVPP2_MIB_BAD_OCTETS_RCVD, "bad_octets_received" }, { MVPP2_MIB_CRC_ERRORS_SENT, "crc_errors_sent" }, @@ -1303,9 +1303,10 @@ static void mvpp2_ethtool_get_strings(struct net_device *netdev, u32 sset, if (sset == ETH_SS_STATS) { int i; - for (i = 0; i < ARRAY_SIZE(mvpp2_ethtool_regs); i++) + for (i = 0; i < ARRAY_SIZE(mvpp2_ethtool_mib_regs); i++) strscpy(data + i * ETH_GSTRING_LEN, - mvpp2_ethtool_regs[i].string, ETH_GSTRING_LEN); + mvpp2_ethtool_mib_regs[i].string, + ETH_GSTRING_LEN); } } @@ -1320,8 +1321,8 @@ static void mvpp2_gather_hw_statistics(struct work_struct *work) mutex_lock(&port->gather_stats_lock); pstats = port->ethtool_stats; - for (i = 0; i < ARRAY_SIZE(mvpp2_ethtool_regs); i++) - *pstats++ += mvpp2_read_count(port, &mvpp2_ethtool_regs[i]); + for (i = 0; i < ARRAY_SIZE(mvpp2_ethtool_mib_regs); i++) + *pstats++ += mvpp2_read_count(port, &mvpp2_ethtool_mib_regs[i]); /* No need to read again the counters right after this function if it * was called asynchronously by the user (ie. use of ethtool). @@ -1345,14 +1346,14 @@ static void mvpp2_ethtool_get_stats(struct net_device *dev, mutex_lock(&port->gather_stats_lock); memcpy(data, port->ethtool_stats, - sizeof(u64) * ARRAY_SIZE(mvpp2_ethtool_regs)); + sizeof(u64) * ARRAY_SIZE(mvpp2_ethtool_mib_regs)); mutex_unlock(&port->gather_stats_lock); } static int mvpp2_ethtool_get_sset_count(struct net_device *dev, int sset) { if (sset == ETH_SS_STATS) - return ARRAY_SIZE(mvpp2_ethtool_regs); + return ARRAY_SIZE(mvpp2_ethtool_mib_regs); return -EOPNOTSUPP; } @@ -4368,8 +4369,8 @@ static int mvpp2_port_init(struct mvpp2_port *port) goto err_free_percpu; /* Read the GOP statistics to reset the hardware counters */ - for (i = 0; i < ARRAY_SIZE(mvpp2_ethtool_regs); i++) - mvpp2_read_count(port, &mvpp2_ethtool_regs[i]); + for (i = 0; i < ARRAY_SIZE(mvpp2_ethtool_mib_regs); i++) + mvpp2_read_count(port, &mvpp2_ethtool_mib_regs[i]); return 0; @@ -5052,7 +5053,7 @@ static int mvpp2_port_probe(struct platform_device *pdev, } port->ethtool_stats = devm_kcalloc(&pdev->dev, - ARRAY_SIZE(mvpp2_ethtool_regs), + ARRAY_SIZE(mvpp2_ethtool_mib_regs), sizeof(u64), GFP_KERNEL); if (!port->ethtool_stats) { err = -ENOMEM; -- 2.20.1