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-24 Thread Vitaly Kuznetsov
Yidong Ren writes: >> 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

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_cpus for now.

[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