+static clib_error_t *
+avf_interface_rx_mode_change (vnet_main_t * vnm, u32 hw_if_index, u32 qid,
+ vnet_hw_interface_rx_mode mode)
+{
+ vnet_hw_interface_t *hw = vnet_get_hw_interface (vnm, hw_if_index);
+ avf_device_t *ad = avf_get_device (hw->dev_instance);
+ avf_rxq_t *rxq = vec_elt_at_index (ad->rxqs, qid);
+
+ if (mode == VNET_HW_INTERFACE_RX_MODE_POLLING)
+ {
+ if (rxq->int_mode == 0)
+ return 0;
+ if (ad->feature_bitmap & VIRTCHNL_VF_OFFLOAD_WB_ON_ITR)
+ avf_irq_n_set_state (ad, qid, AVF_IRQ_STATE_WB_ON_ITR);
+ else
+ avf_irq_n_set_state (ad, qid, AVF_IRQ_STATE_ENABLED);
+ rxq->int_mode = 0;
+ }
+ else
+ {
+ if (rxq->int_mode == 1)
+ return 0;
+ if (ad->n_rx_irqs != ad->n_rx_queues)
+ return clib_error_return (0, "not enough interrupt lines");
+ rxq->int_mode = 1;
+ avf_irq_n_set_state (ad, qid, AVF_IRQ_STATE_ENABLED);
+ }
+
+ return 0;
+}
+
+static void
+avf_set_interface_next_node (vnet_main_t * vnm, u32 hw_if_index,
+ u32 node_index)
+{
+ vnet_hw_interface_t *hw = vnet_get_hw_interface (vnm, hw_if_index);
+ avf_device_t *ad = avf_get_device (hw->dev_instance);
+
+ /* Shut off redirection */
+ if (node_index == ~0)
+ {
+ ad->per_interface_next_index = node_index;
+ return;
+ }
+
+ ad->per_interface_next_index =
+ vlib_node_add_next (vlib_get_main (), avf_input_node.index, node_index);
+}
+
+static char *avf_tx_func_error_strings[] = {
+#define _(n,s) s,
+ foreach_avf_tx_func_error
+#undef _
+};
+
+static void
+avf_clear_hw_interface_counters (u32 instance)
+{
+ avf_device_t *ad = avf_get_device (instance);
+ clib_memcpy_fast (&ad->last_cleared_eth_stats,
+ &ad->eth_stats, sizeof (ad->eth_stats));
+}
+