- xd->time_last_stats_update = now ? now : xd->time_last_stats_update;
- memcpy (&xd->last_stats, &xd->stats, sizeof (xd->last_stats));
- rte_eth_stats_get (xd->device_index, &xd->stats);
-
- /* maybe bump interface rx no buffer counter */
- if (PREDICT_FALSE (xd->stats.rx_nombuf != xd->last_stats.rx_nombuf))
- {
- cm = vec_elt_at_index (vnm->interface_main.sw_if_counters,
- VNET_INTERFACE_COUNTER_RX_NO_BUF);
-
- vlib_increment_simple_counter (cm, my_cpu, xd->vlib_sw_if_index,
- xd->stats.rx_nombuf -
- xd->last_stats.rx_nombuf);
- }
-
- /* missed pkt counter */
- if (PREDICT_FALSE (xd->stats.imissed != xd->last_stats.imissed))
- {
- cm = vec_elt_at_index (vnm->interface_main.sw_if_counters,
- VNET_INTERFACE_COUNTER_RX_MISS);
-
- vlib_increment_simple_counter (cm, my_cpu, xd->vlib_sw_if_index,
- xd->stats.imissed -
- xd->last_stats.imissed);
- }
-#if RTE_VERSION >= RTE_VERSION_NUM(2, 2, 0, 0)
- rxerrors = xd->stats.ierrors;
- last_rxerrors = xd->last_stats.ierrors;
-#else
- rxerrors = xd->stats.ibadcrc
- + xd->stats.ibadlen + xd->stats.ierrors;
- last_rxerrors = xd->last_stats.ibadcrc
- + xd->last_stats.ibadlen + xd->last_stats.ierrors;
-#endif