X-Git-Url: https://gerrit.fd.io/r/gitweb?a=blobdiff_plain;f=src%2Fplugins%2Fdpdk%2Fdevice%2Fdpdk_priv.h;h=e5db674ca6ddaac33cd5054264befb4134c3fea1;hb=6ca6ac6c887eb38797027169f5a2f84e45b3436d;hp=a95d03cfba4aa6cf7019028522742845958d63c1;hpb=149ba779cff4ffc48d87ca67a2a8d4afd49b05f5;p=vpp.git diff --git a/src/plugins/dpdk/device/dpdk_priv.h b/src/plugins/dpdk/device/dpdk_priv.h index a95d03cfba4..e5db674ca6d 100644 --- a/src/plugins/dpdk/device/dpdk_priv.h +++ b/src/plugins/dpdk/device/dpdk_priv.h @@ -44,12 +44,13 @@ _(blacklist, b) \ _(mem-alloc-request, m) \ _(force-ranks, r) -/* These args are preceeded by "--" and followed by a single string */ +/* These args are preceded by "--" and followed by a single string */ #define foreach_eal_double_hyphen_arg \ _(huge-dir) \ _(proc-type) \ _(file-prefix) \ -_(vdev) +_(vdev) \ +_(log-level) typedef struct { @@ -62,15 +63,16 @@ typedef struct static inline void dpdk_get_xstats (dpdk_device_t * xd) { + if (!(xd->flags & DPDK_DEVICE_FLAG_ADMIN_UP)) + return; int len; - if ((len = rte_eth_xstats_get (xd->device_index, NULL, 0)) > 0) + if ((len = rte_eth_xstats_get (xd->port_id, NULL, 0)) > 0) { vec_validate (xd->xstats, len - 1); vec_validate (xd->last_cleared_xstats, len - 1); len = - rte_eth_xstats_get (xd->device_index, xd->xstats, - vec_len (xd->xstats)); + rte_eth_xstats_get (xd->port_id, xd->xstats, vec_len (xd->xstats)); ASSERT (vec_len (xd->xstats) == len); ASSERT (vec_len (xd->last_cleared_xstats) == len); @@ -96,7 +98,7 @@ dpdk_update_counters (dpdk_device_t * xd, f64 now) xd->time_last_stats_update = now ? now : xd->time_last_stats_update; clib_memcpy (&xd->last_stats, &xd->stats, sizeof (xd->last_stats)); - rte_eth_stats_get (xd->device_index, &xd->stats); + rte_eth_stats_get (xd->port_id, &xd->stats); /* maybe bump interface rx no buffer counter */ if (PREDICT_FALSE (xd->stats.rx_nombuf != xd->last_stats.rx_nombuf)) @@ -104,7 +106,7 @@ dpdk_update_counters (dpdk_device_t * xd, f64 now) cm = vec_elt_at_index (vnm->interface_main.sw_if_counters, VNET_INTERFACE_COUNTER_RX_NO_BUF); - vlib_increment_simple_counter (cm, thread_index, xd->vlib_sw_if_index, + vlib_increment_simple_counter (cm, thread_index, xd->sw_if_index, xd->stats.rx_nombuf - xd->last_stats.rx_nombuf); } @@ -115,7 +117,7 @@ dpdk_update_counters (dpdk_device_t * xd, f64 now) cm = vec_elt_at_index (vnm->interface_main.sw_if_counters, VNET_INTERFACE_COUNTER_RX_MISS); - vlib_increment_simple_counter (cm, thread_index, xd->vlib_sw_if_index, + vlib_increment_simple_counter (cm, thread_index, xd->sw_if_index, xd->stats.imissed - xd->last_stats.imissed); } @@ -127,7 +129,7 @@ dpdk_update_counters (dpdk_device_t * xd, f64 now) cm = vec_elt_at_index (vnm->interface_main.sw_if_counters, VNET_INTERFACE_COUNTER_RX_ERROR); - vlib_increment_simple_counter (cm, thread_index, xd->vlib_sw_if_index, + vlib_increment_simple_counter (cm, thread_index, xd->sw_if_index, rxerrors - last_rxerrors); }