dpdk: Only use vmbus on Linux
[vpp.git] / src / plugins / dpdk / device / init.c
index 2da0258..07e5225 100644 (file)
@@ -187,9 +187,11 @@ dpdk_find_startup_config (struct rte_eth_dev_info *di)
 {
   dpdk_main_t *dm = &dpdk_main;
   struct rte_pci_device *pci_dev;
-  struct rte_vmbus_device *vmbus_dev;
   vlib_pci_addr_t pci_addr;
+#ifdef __linux__
+  struct rte_vmbus_device *vmbus_dev;
   vlib_vmbus_addr_t vmbus_addr;
+#endif /* __linux__ */
   uword *p = 0;
 
   if ((pci_dev = dpdk_get_pci_device (di)))
@@ -202,6 +204,7 @@ dpdk_find_startup_config (struct rte_eth_dev_info *di)
        hash_get (dm->conf->device_config_index_by_pci_addr, pci_addr.as_u32);
     }
 
+#ifdef __linux__
   if ((vmbus_dev = dpdk_get_vmbus_device (di)))
     {
       unformat_input_t input_vmbus;
@@ -216,6 +219,7 @@ dpdk_find_startup_config (struct rte_eth_dev_info *di)
                       &vmbus_addr);
       unformat_free (&input_vmbus);
     }
+#endif /* __linux__ */
 
   if (p)
     return pool_elt_at_index (dm->conf->dev_confs, p[0]);
@@ -548,7 +552,6 @@ dpdk_bind_devices_to_uio (dpdk_config_main_t * conf)
   int i;
 
   addrs = vlib_pci_get_all_dev_addrs ();
-  /* *INDENT-OFF* */
   vec_foreach (addr, addrs)
     {
     dpdk_device_config_t * devconf = 0;
@@ -734,7 +737,6 @@ dpdk_bind_devices_to_uio (dpdk_config_main_t * conf)
        clib_error_report (error);
       }
   }
-  /* *INDENT-ON* */
   vec_free (pci_addr);
   vlib_pci_free_device_info (d);
 }
@@ -749,7 +751,6 @@ dpdk_bind_vmbus_devices_to_uio (dpdk_config_main_t * conf)
 
   addrs = vlib_vmbus_get_all_dev_addrs ();
 
-  /* *INDENT-OFF* */
   vec_foreach (addr, addrs)
     {
       dpdk_device_config_t *devconf = 0;
@@ -814,7 +815,6 @@ dpdk_bind_vmbus_devices_to_uio (dpdk_config_main_t * conf)
          clib_error_report (error);
        }
     }
-  /* *INDENT-ON* */
 }
 
 uword
@@ -1254,7 +1254,6 @@ dpdk_config (vlib_main_t * vm, unformat_input_t * input)
 
       default_hugepage_sz = clib_mem_get_default_hugepage_size ();
 
-      /* *INDENT-OFF* */
       clib_bitmap_foreach (x, tm->cpu_socket_bitmap)
        {
          clib_error_t *e;
@@ -1267,7 +1266,6 @@ dpdk_config (vlib_main_t * vm, unformat_input_t * input)
          if ((e = clib_sysfs_prealloc_hugepages(x, 0, n_pages)))
            clib_error_report (e);
         }
-      /* *INDENT-ON* */
     }
 
   /* on/off dpdk's telemetry thread */
@@ -1569,14 +1567,12 @@ dpdk_process (vlib_main_t * vm, vlib_node_runtime_t * rt, vlib_frame_t * f)
   return 0;
 }
 
-/* *INDENT-OFF* */
 VLIB_REGISTER_NODE (dpdk_process_node,static) = {
     .function = dpdk_process,
     .type = VLIB_NODE_TYPE_PROCESS,
     .name = "dpdk-process",
     .process_log2_n_stack_bytes = 17,
 };
-/* *INDENT-ON* */
 
 static clib_error_t *
 dpdk_init (vlib_main_t * vm)