dpdk: remove support for dpdk 16.04
[vpp.git] / vnet / vnet / devices / dpdk / dpdk_priv.h
index 4ecb1b8..eb13df2 100644 (file)
 #define DPDK_NB_TX_DESC_40GE    1024
 #define DPDK_NB_RX_DESC_ENIC    1024
 
-#if RTE_VERSION >= RTE_VERSION_NUM(16, 7, 0, 0)
 #define I40E_DEV_ID_SFP_XL710           0x1572
 #define I40E_DEV_ID_QSFP_A              0x1583
 #define I40E_DEV_ID_QSFP_B              0x1584
 #define I40E_DEV_ID_QSFP_C              0x1585
 #define I40E_DEV_ID_10G_BASE_T          0x1586
 #define I40E_DEV_ID_VF                  0x154C
-#endif
 
 /* These args appear by themselves */
 #define foreach_eal_double_hyphen_predicate_arg \
 _(no-shconf)                                    \
 _(no-hpet)                                      \
 _(no-huge)                                      \
-_(vmware-tsc-map)                               \
-_(virtio-vhost)
+_(vmware-tsc-map)
 
 #define foreach_eal_single_hyphen_mandatory_arg \
 _(coremask, c)                                  \
@@ -88,53 +85,44 @@ dpdk_update_counters (dpdk_device_t * xd, f64 now)
   u64 rxerrors, last_rxerrors;
 
   /* only update counters for PMD interfaces */
-  if (xd->dev_type != VNET_DPDK_DEV_ETH)
+  if ((xd->flags & DPDK_DEVICE_FLAG_PMD) == 0)
     return;
 
-  /*
-   * DAW-FIXME: VMXNET3 device stop/start doesn't work,
-   * therefore fake the stop in the dpdk driver by
-   * silently dropping all of the incoming pkts instead of
-   * stopping the driver / hardware.
-   */
-  if (xd->admin_up != 0xff)
+  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);
+
+  /* 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))
     {
-      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);
-
-      /* 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);
-       }
-      rxerrors = xd->stats.ierrors;
-      last_rxerrors = xd->last_stats.ierrors;
-
-      if (PREDICT_FALSE (rxerrors != last_rxerrors))
-       {
-         cm = vec_elt_at_index (vnm->interface_main.sw_if_counters,
-                                VNET_INTERFACE_COUNTER_RX_ERROR);
-
-         vlib_increment_simple_counter (cm, my_cpu, xd->vlib_sw_if_index,
-                                        rxerrors - last_rxerrors);
-       }
+      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);
+    }
+  rxerrors = xd->stats.ierrors;
+  last_rxerrors = xd->last_stats.ierrors;
+
+  if (PREDICT_FALSE (rxerrors != last_rxerrors))
+    {
+      cm = vec_elt_at_index (vnm->interface_main.sw_if_counters,
+                            VNET_INTERFACE_COUNTER_RX_ERROR);
+
+      vlib_increment_simple_counter (cm, my_cpu, xd->vlib_sw_if_index,
+                                    rxerrors - last_rxerrors);
     }
 
   dpdk_get_xstats (xd);