Trivial: Clean up some typos.
[vpp.git] / src / plugins / dpdk / device / node.c
index b4fadf0..e28ad7f 100644 (file)
 
 #include <dpdk/device/dpdk_priv.h>
 
-#ifndef CLIB_MARCH_VARIANT
 static char *dpdk_error_strings[] = {
 #define _(n,s) s,
   foreach_dpdk_error
 #undef _
 };
-#endif
 
 STATIC_ASSERT (VNET_DEVICE_INPUT_NEXT_IP4_INPUT - 1 ==
               VNET_DEVICE_INPUT_NEXT_IP4_NCS_INPUT,
@@ -48,8 +46,8 @@ enum
 };
 
 /* currently we are just copying bit positions from DPDK, but that
-   might change in future, in case we strart to be interested in something
-   stored in upper bytes. Curently we store only lower byte for perf reasons */
+   might change in future, in case we start to be interested in something
+   stored in upper bytes. Currently we store only lower byte for perf reasons */
 STATIC_ASSERT (1 << DPDK_RX_F_CKSUM_GOOD == PKT_RX_IP_CKSUM_GOOD, "");
 STATIC_ASSERT (1 << DPDK_RX_F_CKSUM_BAD == PKT_RX_IP_CKSUM_BAD, "");
 STATIC_ASSERT (1 << DPDK_RX_F_FDIR == PKT_RX_FDIR, "");
@@ -156,24 +154,6 @@ dpdk_prefetch_buffer_data_x4 (struct rte_mbuf *mb[])
   CLIB_PREFETCH (b->data, CLIB_CACHE_LINE_BYTES, LOAD);
 }
 
-static inline void
-poll_rate_limit (dpdk_main_t * dm)
-{
-  /* Limit the poll rate by sleeping for N msec between polls */
-  if (PREDICT_FALSE (dm->poll_sleep_usec != 0))
-    {
-      struct timespec ts, tsrem;
-
-      ts.tv_sec = 0;
-      ts.tv_nsec = 1000 * dm->poll_sleep_usec;
-
-      while (nanosleep (&ts, &tsrem) < 0)
-       {
-         ts = tsrem;
-       }
-    }
-}
-
 /** \brief Main DPDK input node
     @node dpdk-input
 
@@ -429,8 +409,8 @@ dpdk_process_flow_offload (dpdk_device_t * xd, dpdk_per_thread_data_t * ptd,
       if ((ptd->flags[n] & (1 << DPDK_RX_F_FDIR)) == 0)
        continue;
 
-      fle = vec_elt_at_index (xd->flow_lookup_entries,
-                             ptd->mbufs[n]->hash.fdir.hi);
+      fle = pool_elt_at_index (xd->flow_lookup_entries,
+                              ptd->mbufs[n]->hash.fdir.hi);
 
       if (fle->next_index != (u16) ~ 0)
        ptd->next[n] = fle->next_index;
@@ -500,7 +480,7 @@ dpdk_device_input (vlib_main_t * vm, dpdk_main_t * dm, dpdk_device_t * xd,
       next_index = xd->per_interface_next_index;
     }
 
-  /* as all packets belong to thr same interface feature arc lookup
+  /* as all packets belong to the same interface feature arc lookup
      can be don once and result stored in the buffer template */
   if (PREDICT_FALSE (vnet_device_input_have_features (xd->sw_if_index)))
     {
@@ -524,7 +504,7 @@ dpdk_device_input (vlib_main_t * vm, dpdk_main_t * dm, dpdk_device_t * xd,
   else
     dpdk_set_next_from_etype (vm, node, ptd, n_rx_packets);
 
-  /* flow offload - process if rx flow offlaod enabled and at least one packet
+  /* flow offload - process if rx flow offload enabled and at least one packet
      is marked */
   if (PREDICT_FALSE ((xd->flags & DPDK_DEVICE_FLAG_RX_FLOW_OFFLOAD) &&
                     (or_flags & (1 << DPDK_RX_F_FDIR))))
@@ -659,13 +639,9 @@ VLIB_NODE_FN (dpdk_input_node) (vlib_main_t * vm, vlib_node_runtime_t * node,
                                         dq->queue_id);
     }
   /* *INDENT-ON* */
-
-  poll_rate_limit (dm);
-
   return n_rx_packets;
 }
 
-#ifndef CLIB_MARCH_VARIANT
 /* *INDENT-OFF* */
 VLIB_REGISTER_NODE (dpdk_input_node) = {
   .type = VLIB_NODE_TYPE_INPUT,
@@ -682,7 +658,6 @@ VLIB_REGISTER_NODE (dpdk_input_node) = {
   .error_strings = dpdk_error_strings,
 };
 /* *INDENT-ON* */
-#endif
 
 /*
  * fd.io coding-style-patch-verification: ON