On Wed, Sep 21, 2016 at 6:43 AM, Jeff Kirsher <jeffrey.t.kirs...@intel.com> wrote: > From: Sridhar Samudrala <sridhar.samudr...@intel.com> > > Sample script that shows ethtool stats on VF representor netdev > PF: enp5s0f0, VF0: enp5s2 VF_REP0: enp5s0f0-vf0 > > # echo 2 > /sys/class/net/enp5s0f0/device/sriov_numvfs > # ip link set enp5s2 up > # ethtool -S enp5s0f0-vf0 > NIC statistics: > tx_bytes: 0 > tx_unicast: 0 > tx_multicast: 0 > tx_broadcast: 0 > tx_discards: 0 > tx_errors: 0 > rx_bytes: 140 > rx_unicast: 0 > rx_multicast: 2 > rx_broadcast: 0 > rx_discards: 0 > rx_unknown_protocol: 0
Now, when the SW stats are finally upstream for 4.9 in net-next, the correct approach for the VF reps counters is to follow the architecture presented there [1] -- and this is for the netlink based standard counters. Once you do that, there's no need to expose the VF HW counters through ethtool of the VF rep. Or. [1] offloaded stats commits a5ea31f Merge branch 'net-offloaded-stats' fc1bbb0 mlxsw: spectrum: Implement offload stats ndo and expose HW stats by default 69ae6ad net: core: Add offload stats to if_stats_msg 2c9d85d netdevice: Add offload statistics ndo