aboutsummaryrefslogtreecommitdiffstats
path: root/src/plugins/avf/device.c
diff options
context:
space:
mode:
authorFilip Tehlar <ftehlar@cisco.com>2019-06-20 23:53:43 +0000
committerNeale Ranns <nranns@cisco.com>2019-06-25 09:40:46 +0000
commitc036c93bdf240541ec436877f8614c82c5b49b8b (patch)
treeabc145a51bab39682be3a65a4356136a95ad64a3 /src/plugins/avf/device.c
parentece2ae0fa27a11d25fff6ea27263d5c5ba5c9dbc (diff)
avf: fix clear hw stats
AVF plugin is missing a handler for clearing stats. This patch will implement it. Ticket: VPP-1701 Type: fix Change-Id: If4b4354da442065896bb001deda23f64ddc18fb4 Signed-off-by: Filip Tehlar <ftehlar@cisco.com>
Diffstat (limited to 'src/plugins/avf/device.c')
-rw-r--r--src/plugins/avf/device.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/plugins/avf/device.c b/src/plugins/avf/device.c
index aab81642ac9..d595da281b7 100644
--- a/src/plugins/avf/device.c
+++ b/src/plugins/avf/device.c
@@ -1516,10 +1516,20 @@ static char *avf_tx_func_error_strings[] = {
#undef _
};
+static void
+avf_clear_hw_interface_counters (u32 instance)
+{
+ avf_main_t *am = &avf_main;
+ avf_device_t *ad = vec_elt_at_index (am->devices, instance);
+ clib_memcpy_fast (&ad->last_cleared_eth_stats,
+ &ad->eth_stats, sizeof (ad->eth_stats));
+}
+
/* *INDENT-OFF* */
VNET_DEVICE_CLASS (avf_device_class,) =
{
.name = "Adaptive Virtual Function (AVF) interface",
+ .clear_counters = avf_clear_hw_interface_counters,
.format_device = format_avf_device,
.format_device_name = format_avf_device_name,
.admin_up_down_function = avf_interface_admin_up_down,