[PATCH v4 net-next] hv_netvsc: Add per-cpu ethtool stats for netvsc

2018-07-30 Thread Yidong Ren
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

RE: [PATCH v3] hv_netvsc: Add per-cpu ethtool stats for netvsc

2018-07-25 Thread Yidong Ren
> From: Vitaly Kuznetsov > While you do for_each_present_cpu() in netvsc_get_ethtool_stats(), > netvsc_get_pcpu_stats() does for_each_possible_cpu(). This looks > inconsistent. I made a mistake there. Thanks for catch me. > The allocation you're doing here is short-lived so I would suggest

RE: [PATCH v3] hv_netvsc: Add per-cpu ethtool stats for netvsc

2018-07-23 Thread Yidong Ren
> From: Yidong Ren > Sent: Monday, July 23, 2018 6:26 PM > + pcpu_sum = kvmalloc(sizeof(struct netvsc_ethtool_pcpu_stats) * > + num_present_cpus(), GFP_KERNEL); Since there is no plan for CPU hotplug in Hyper-V in short term, it is fine to use num_present_

[PATCH v3] hv_netvsc: Add per-cpu ethtool stats for netvsc

2018-07-23 Thread Yidong Ren
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. Signed-off-by: Yidong Ren

RE: [PATCH v2] hv_netvsc: Add per-cpu ethtool stats for netvsc

2018-06-13 Thread Yidong Ren
> From: devel On Behalf > Of Stephen Hemminger > > +/* statistics per queue (rx/tx packets/bytes) */ #define > > +NETVSC_PCPU_STATS_LEN (num_present_cpus() * > ARRAY_SIZE(pcpu_stats)) > > Even though Hyper-V/Azure does not support hot plug cpu's it might be > better to num_cpu_possible to avoid

RE: [PATCH v2] hv_netvsc: Add per-cpu ethtool stats for netvsc

2018-06-13 Thread Yidong Ren
> From: Eric Dumazet > You actually want to allocate memory local to this cpu, possibly in one chunk, > not spread all over the places. > > kvmalloc(nr_cpu_ids * sizeof(struct netvsc_ethtool_pcpu_stats)) should be > really better, since it would most of the time be satisfied by a single >

[PATCH v2] hv_netvsc: Add per-cpu ethtool stats for netvsc

2018-06-13 Thread Yidong Ren
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 exist in current code. Exposing these counters will help troubleshooting performance issues. Signed-off-by: Yidong Ren

[PATCH] hv_netvsc: Add per-cpu ethtool stats for netvsc

2018-06-06 Thread Yidong Ren
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 exist in current code. Exposing these counters will help troubleshooting performance issues. Signed-off-by: Yidong Ren

RE: [PATCH] hv_netvsc: add per-cpu ethtool stats for netvsc

2018-06-06 Thread Yidong Ren
Thank you, Greg. I'm sorry for didn't read the guidelines on kernel newbies. Please ignore this patch. Thanks, Yidong -Original Message- From: Greg KH Sent: Wednesday, June 6, 2018 1:34 AM To: Yidong Ren Cc: driverdev-devel@linuxdriverproject.org; Haiyang Zhang ; Stephen Hemminger

[PATCH] hv_netvsc: add per-cpu ethtool stats for netvsc

2018-06-05 Thread Yidong Ren
This patch implements following ethtool stats fields for netvsc: cpu_rx_packets cpu_tx_packets cpu_rx_bytes cpu_tx_bytes cpu_vf_rx_packets cpu_vf_tx_packets cpu_vf_rx_bytes cpu_vf_tx_bytes --- drivers/net/hyperv/hyperv_net.h | 11 + drivers/net/hyperv/netvsc_drv.c | 95