From mboxrd@z Thu Jan 1 00:00:00 1970 From: David Miller Subject: Re: [PATCH v4 net-next] hv_netvsc: Add per-cpu ethtool stats for netvsc Date: Mon, 30 Jul 2018 12:34:53 -0700 (PDT) Message-ID: <20180730.123453.209203416033226519.davem@davemloft.net> References: <20180724012622.26873-1-yidren@linuxonhyperv.com> <20180730170945.20517-1-yidren@linuxonhyperv.com> Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit Cc: kys@microsoft.com, haiyangz@microsoft.com, sthemmin@microsoft.com, devel@linuxdriverproject.org, netdev@vger.kernel.org, linux-kernel@vger.kernel.org, madhans@microsoft.com To: yidren@microsoft.com, yidren@linuxonhyperv.com Return-path: In-Reply-To: <20180730170945.20517-1-yidren@linuxonhyperv.com> Sender: linux-kernel-owner@vger.kernel.org List-Id: netdev.vger.kernel.org From: Yidong Ren Date: Mon, 30 Jul 2018 17:09:45 +0000 > From: Yidong Ren > > This patch implements following ethtool stats fields for netvsc: > cpu_tx/rx_packets/bytes > cpu_vf_tx/rx_packets/bytes > > Corresponding per-cpu counters already exist in current code. Exposing > these counters will help troubleshooting performance issues. > > for_each_present_cpu() was used instead of for_each_possible_cpu(). > for_each_possible_cpu() would create very long and useless output. > It is still being used for internal buffer, but not for ethtool > output. > > There could be an overflow if cpu was added between ethtool > call netvsc_get_sset_count() and netvsc_get_ethtool_stats() and > netvsc_get_strings(). (still safe if cpu was removed) > ethtool makes these three function calls separately. > As long as we use ethtool, I can't see any clean solution. > > Currently and in foreseeable short term, Hyper-V doesn't support > cpu hot-plug. Plus, ethtool is for admin use. Unlikely the admin > would perform such combo operations. > > Signed-off-by: Yidong Ren Applied, thank you.