net/vmxnet3: support stats reset
authorYogev Chaimovich <yogev@cgstowernetworks.com>
Thu, 20 Sep 2018 06:37:05 +0000 (06:37 +0000)
committerFerruh Yigit <ferruh.yigit@intel.com>
Thu, 27 Sep 2018 23:41:02 +0000 (01:41 +0200)
commit30f77abecd38e97748b84b607aa68491b64c824e
tree9ef045cabd665eb71e151785a8ea2f9923e0fa46
parentae0207d4b5048a6af9bc30e0956d30461b813148
net/vmxnet3: support stats reset

'stats_reset()' callback was missing because the device backend doesn't
support it.

This commit adds a workaround to this and implements the callback by
taking a snapshot of the stats (SNAPSHOT) each time 'stats_reset()'
is called.  When getting stats with 'stats_get()', hw stats which
always increase reduce SNAPSHOT stats.
That's how we get the "real" stats since the last 'stats_reset()'.

Signed-off-by: Yogev Chaimovich <yogev@cgstowernetworks.com>
Acked-by: Yong Wang <yongwang@vmware.com>
drivers/net/vmxnet3/vmxnet3_ethdev.c
drivers/net/vmxnet3/vmxnet3_ethdev.h