Trivial: Clean up some typos.
[vpp.git] / src / plugins / dpdk / device / node.c
index daccf73..e28ad7f 100644 (file)
 
 #include <dpdk/device/dpdk_priv.h>
 
-#ifndef CLIB_MULTIARCH_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;
@@ -474,7 +454,7 @@ dpdk_device_input (vlib_main_t * vm, dpdk_main_t * dm, dpdk_device_t * xd,
   /* get up to DPDK_RX_BURST_SZ buffers from PMD */
   while (n_rx_packets < DPDK_RX_BURST_SZ)
     {
-      n = rte_eth_rx_burst (xd->device_index, queue_id,
+      n = rte_eth_rx_burst (xd->port_id, queue_id,
                            ptd->mbufs + n_rx_packets,
                            DPDK_RX_BURST_SZ - n_rx_packets);
       n_rx_packets += n;
@@ -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))))
@@ -636,8 +616,7 @@ dpdk_device_input (vlib_main_t * vm, dpdk_main_t * dm, dpdk_device_t * xd,
   return n_rx_packets;
 }
 
-uword CLIB_CPU_OPTIMIZED
-CLIB_MULTIARCH_FN (dpdk_input) (vlib_main_t * vm, vlib_node_runtime_t * node,
+VLIB_NODE_FN (dpdk_input_node) (vlib_main_t * vm, vlib_node_runtime_t * node,
                                vlib_frame_t * f)
 {
   dpdk_main_t *dm = &dpdk_main;
@@ -660,16 +639,11 @@ CLIB_MULTIARCH_FN (dpdk_input) (vlib_main_t * vm, vlib_node_runtime_t * node,
                                         dq->queue_id);
     }
   /* *INDENT-ON* */
-
-  poll_rate_limit (dm);
-
   return n_rx_packets;
 }
 
-#ifndef CLIB_MULTIARCH_VARIANT
 /* *INDENT-OFF* */
 VLIB_REGISTER_NODE (dpdk_input_node) = {
-  .function = dpdk_input,
   .type = VLIB_NODE_TYPE_INPUT,
   .name = "dpdk-input",
   .sibling_of = "device-input",
@@ -685,21 +659,6 @@ VLIB_REGISTER_NODE (dpdk_input_node) = {
 };
 /* *INDENT-ON* */
 
-vlib_node_function_t __clib_weak dpdk_input_avx512;
-vlib_node_function_t __clib_weak dpdk_input_avx2;
-
-#if __x86_64__
-static void __clib_constructor
-dpdk_input_multiarch_select (void)
-{
-  if (dpdk_input_avx512 && clib_cpu_supports_avx512f ())
-    dpdk_input_node.function = dpdk_input_avx512;
-  else if (dpdk_input_avx2 && clib_cpu_supports_avx2 ())
-    dpdk_input_node.function = dpdk_input_avx2;
-}
-#endif
-#endif
-
 /*
  * fd.io coding-style-patch-verification: ON
  *