Received: by 2002:a25:f815:0:0:0:0:0 with SMTP id u21csp2893936ybd; Mon, 24 Jun 2019 14:53:05 -0700 (PDT) X-Google-Smtp-Source: APXvYqy2QS9kP7hN81zL+xloiux2B3KDCk5y6WXRORN9N7pBS81Qp/tqgi6fyj9kHwHV4/oe2oWe X-Received: by 2002:a63:1d2:: with SMTP id 201mr29559914pgb.232.1561413185687; Mon, 24 Jun 2019 14:53:05 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1561413185; cv=none; d=google.com; s=arc-20160816; b=P590X3KU8Jdb3DI5Ctv7WgiQCEu91A2sr8nOvTctCQvSQFeqvZC+TLaeN1WBZGgE4R mEXmNkBl5SKbTTV7KUytqn9FzPABx7veVoaIT2gp5MI5+marlwYimpvqaICdiBWs6hAA W/ehc00BC/+wrsGTQMbW2xV4lyyQWSfNGMfla/lVTh3I45bFggk77V67HAD4knuxySw1 jhrj9BX9cxZpTM1hvl6wA+k/dmKJHqEiHyqG+N3OUtohpfLFcXHBkR7x6d9qib3Nkm08 3qhJX3EeiDKF8ZEG5G2+SBWizxOvC4FN5LToL+y6QPXe0SyBRWP7/9Yy/iQt8tZaWdsc 7fww== 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 :organization:references:in-reply-to:message-id:subject:cc:to:from :date:dkim-signature; bh=AyuRS8Lwp7vEBwCUi0j+D6xyHz2b0vyBNyOhbTtwtYU=; b=UVdKeCwNxm2ZZ4FgkXa/VabWoTQ/cgVgbzd+uCx2h954J0DJ7HcYe9W4LJR0T1LWJ+ 5l5rX8+Zx5Yexb8g6oe8V/YzZapClnuK2e7yG0Jn98a2Bez5RMN5lStlQR/zWvmMzGow EfjbNseBbLLYsJTB5+ZEa2F5YFzxOmfwAEJAe2dgW07tD6IohUfu2JLlKFLvE5q9ySWk csIwfoNEIKEblTEjks226p0IZFI/LUj66nscaotbIJbQ0DvTQhuJRpHL5c1R4fVdZoOO +kbkthUfPLOtWWuGTC53DjsB0QMmPK4d0AEz/aN44VWMzcLGMRArcu0U5KmoEk4r9i9k ScWw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@netronome-com.20150623.gappssmtp.com header.s=20150623 header.b=Z88sjk6O; 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 t13si11289547pgu.142.2019.06.24.14.52.50; Mon, 24 Jun 2019 14:53:05 -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; dkim=pass header.i=@netronome-com.20150623.gappssmtp.com header.s=20150623 header.b=Z88sjk6O; 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 S1729994AbfFXTFZ (ORCPT + 99 others); Mon, 24 Jun 2019 15:05:25 -0400 Received: from mail-qt1-f196.google.com ([209.85.160.196]:45565 "EHLO mail-qt1-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729865AbfFXTFZ (ORCPT ); Mon, 24 Jun 2019 15:05:25 -0400 Received: by mail-qt1-f196.google.com with SMTP id j19so15648562qtr.12 for ; Mon, 24 Jun 2019 12:05:24 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=netronome-com.20150623.gappssmtp.com; s=20150623; h=date:from:to:cc:subject:message-id:in-reply-to:references :organization:mime-version:content-transfer-encoding; bh=AyuRS8Lwp7vEBwCUi0j+D6xyHz2b0vyBNyOhbTtwtYU=; b=Z88sjk6Oy1WaO3+yCDQDFOSbz8ukF6kaN/e53K7UPw19c9G4PMe0KXNDQ/dKqFnmAd shxS/mq9FNfhBZyQ1N7StT8XRemQpqA+DWEpZRLx8HYuRDM1LcZF3ad4u3N+MEEUbbVs L89mZKHlHmWYcVoWMxIwO9TQn0z35be2TPvWCxBIFvfZEymZv+U7erpPcW1rrjKdgg/G JUD5T+rmZ9+Oln1tBy8vI8dH1gwVHQO/w2jApOPAtPrzi1U49hfyDC5ANRj1HFzo8/XP yqlbRBXHrgcii9xwRgeGGfWEdxKtgadBpMBv6xmtpcXRmRxv2mWl15B2K5XXGJayEIGD xX8Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:in-reply-to :references:organization:mime-version:content-transfer-encoding; bh=AyuRS8Lwp7vEBwCUi0j+D6xyHz2b0vyBNyOhbTtwtYU=; b=qKJrYcaGZFp2LSIErJ8xyOJmGGFOlw9foQqVvvKLNrEXMkQm0Q6rd5wv49ALVQVjEv 6K+/BGYlwmtrDZbsrp+1aTu/urdfhuuqkaXsHwAaxbqJSvXWUCoPFMz/f1x2pa81mnTR 74Mo3csS78M9QFzBk4HdS3jSF8IaJNS7VvKRaVDv0XpqARYMHElxa9X8Wd+r9Hua2oi7 Lzx4nq/nwPJrqAINJEKgiulMJmTzA4FKgMIu6GgynK/ntca0IzZ0Qci/Y9RjDL5T1Nv1 bPXn6Lt1WVmLoUgfjlTmaeOP/IraDnLHTQV4jDQzoyU3iGUxEVWJEVuKV9Bc6n24kGhC 0ovA== X-Gm-Message-State: APjAAAX9jSjIvXTLfyRP33CgJc0aJHmFGxIhjtptz7pHeCmGlle4b/qu wvqA+e/KYI0lSNILgPQJKL/Rqw== X-Received: by 2002:ac8:685:: with SMTP id f5mr57301924qth.9.1561403124388; Mon, 24 Jun 2019 12:05:24 -0700 (PDT) Received: from cakuba.netronome.com ([66.60.152.14]) by smtp.gmail.com with ESMTPSA id e4sm7095824qtc.3.2019.06.24.12.05.22 (version=TLS1_3 cipher=AEAD-AES256-GCM-SHA384 bits=256/256); Mon, 24 Jun 2019 12:05:24 -0700 (PDT) Date: Mon, 24 Jun 2019 12:05:19 -0700 From: Jakub Kicinski To: Xue Chaojing , Cc: , , , , , , Stephen Hemminger Subject: Re: [PATCH net-next v2] hinic: implement the statistical interface of ethtool Message-ID: <20190624120519.4ec22e19@cakuba.netronome.com> In-Reply-To: <20190624035012.7221-1-xuechaojing@huawei.com> References: <20190624035012.7221-1-xuechaojing@huawei.com> Organization: Netronome Systems, Ltd. MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, 24 Jun 2019 03:50:12 +0000, Xue Chaojing wrote: > diff --git a/drivers/net/ethernet/huawei/hinic/hinic_ethtool.c b/drivers/net/ethernet/huawei/hinic/hinic_ethtool.c > index be28a9a7f033..8d98f37c88a8 100644 > --- a/drivers/net/ethernet/huawei/hinic/hinic_ethtool.c > +++ b/drivers/net/ethernet/huawei/hinic/hinic_ethtool.c > @@ -438,6 +438,344 @@ static u32 hinic_get_rxfh_indir_size(struct net_device *netdev) > return HINIC_RSS_INDIR_SIZE; > } > > +#define ARRAY_LEN(arr) ((int)((int)sizeof(arr) / (int)sizeof(arr[0]))) > + > +#define HINIC_NETDEV_STAT(_stat_item) { \ > + .name = #_stat_item, \ > + .size = FIELD_SIZEOF(struct rtnl_link_stats64, _stat_item), \ > + .offset = offsetof(struct rtnl_link_stats64, _stat_item) \ > +} > + > +static struct hinic_stats hinic_netdev_stats[] = { > + HINIC_NETDEV_STAT(rx_packets), > + HINIC_NETDEV_STAT(tx_packets), > + HINIC_NETDEV_STAT(rx_bytes), > + HINIC_NETDEV_STAT(tx_bytes), > + HINIC_NETDEV_STAT(rx_errors), > + HINIC_NETDEV_STAT(tx_errors), > + HINIC_NETDEV_STAT(rx_dropped), > + HINIC_NETDEV_STAT(tx_dropped), > + HINIC_NETDEV_STAT(multicast), > + HINIC_NETDEV_STAT(collisions), > + HINIC_NETDEV_STAT(rx_length_errors), > + HINIC_NETDEV_STAT(rx_over_errors), > + HINIC_NETDEV_STAT(rx_crc_errors), > + HINIC_NETDEV_STAT(rx_frame_errors), > + HINIC_NETDEV_STAT(rx_fifo_errors), > + HINIC_NETDEV_STAT(rx_missed_errors), > + HINIC_NETDEV_STAT(tx_aborted_errors), > + HINIC_NETDEV_STAT(tx_carrier_errors), > + HINIC_NETDEV_STAT(tx_fifo_errors), > + HINIC_NETDEV_STAT(tx_heartbeat_errors), > +}; I think we wanted to stop duplicating standard netdev stats in ethtool -S. Chaojing please post a patch to remove this part, the other stats are good.