smadaminov / ovs-dpdk-meson-issues

VMware Summer 2021
BSD 3-Clause "New" or "Revised" License
1 stars 1 forks source link

windows meson: virtio device #39

Open williamtu opened 3 years ago

williamtu commented 3 years ago

maybe we need to disable virtio in OVS, because windows DPDK hasn't supported yet.

[2/43] Compiling C object lib/libopenvswitch.a.p/netdev-dpdk.c.obj
FAILED: lib/libopenvswitch.a.p/netdev-dpdk.c.obj
"clang" "-Ilib\libopenvswitch.a.p" "-Ilib" "-I..\lib" "-I." "-I.." "-I..\include\windows" "-Iinclude" "-I..\include" "-I..\datapath-windows\i
nclude" "-IC:\PTHREADS-BUILT\include" "-IC:\temp\dpdk\include" "-IC:\dpdk\lib\eal\windows\include" "-Xclang" "-fcolor-diagnostics" "-pipe" "-
D_FILE_OFFSET_BITS=64" "-Wall" "-Winvalid-pch" "-g" "-Wthread-safety" "-Wno-microsoft-enum-forward-reference" "-Wno-unused-function" "-Wno-so
metimes-uninitialized" "-Wno-format" "-Wno-pointer-sign" "-Wno-incompatible-pointer-types" "-dM" "-U_MSC_VER" "-D_TIMESPEC_DEFINED" "-D_CRT_N
ONSTDC_NO_DEPRECATE -D_CRT_SECURE_NO_WARNINGS" "-D_CRT_SECURE_NO_DEPRECATE" -MD -MQ lib/libopenvswitch.a.p/netdev-dpdk.c.obj -MF "lib\libopen
vswitch.a.p\netdev-dpdk.c.obj.d" -o lib/libopenvswitch.a.p/netdev-dpdk.c.obj "-c" ../lib/netdev-dpdk.c
../lib/netdev-dpdk.c:25:10: fatal error: 'linux/virtio_net.h' file not found
         ^~~~~~~~~~~~~~~~~~~~
1 error generated.
williamtu commented 3 years ago

The windows DPDK today doesn't support vhost library yet, compile it and found many missing headers....

[2/149] Compiling C object lib/librte_vhost.a.p/vhost_virtio_net.c.obj
FAILED: lib/librte_vhost.a.p/vhost_virtio_net.c.obj
"clang" "-Ilib\librte_vhost.a.p" "-Ilib" "-I..\lib" "-Ilib\vhost" "-I..\lib\vhost" "-I." "-I.." "-Iconfig" "-I..\config" "-Ilib\eal\include"
"-I..\lib\eal\include" "-Ilib\eal\windows\include" "-I..\lib\eal\windows\include" "-Ilib\eal\x86\include" "-I..\lib\eal\x86\include" "-Ilib\e
al\common" "-I..\lib\eal\common" "-Ilib\eal" "-I..\lib\eal" "-Ilib\kvargs" "-I..\lib\kvargs" "-Ilib\ethdev" "-I..\lib\ethdev" "-Ilib\net" "-I
..\lib\net" "-Ilib\mbuf" "-I..\lib\mbuf" "-Ilib\mempool" "-I..\lib\mempool" "-Ilib\ring" "-I..\lib\ring" "-Ilib\meter" "-I..\lib\meter" "-Ili
b\metrics" "-I..\lib\metrics" "-Ilib\telemetry" "-I..\lib\telemetry" "-Ilib\hash" "-I..\lib\hash" "-Ilib\rcu" "-I..\lib\rcu" "-Ilib\pci" "-I.
.\lib\pci" "-Xclang" "-fcolor-diagnostics" "-pipe" "-D_FILE_OFFSET_BITS=64" "-Wall" "-Winvalid-pch" "-O3" "-include" "rte_config.h" "-Wextra"
 "-Wcast-qual" "-Wdeprecated" "-Wformat" "-Wformat-nonliteral" "-Wformat-security" "-Wmissing-declarations" "-Wmissing-prototypes" "-Wnested-
externs" "-Wold-style-definition" "-Wpointer-arith" "-Wsign-compare" "-Wstrict-prototypes" "-Wundef" "-Wwrite-strings" "-Wno-address-of-packe
d-member" "-Wno-missing-field-initializers" "-D_GNU_SOURCE" "-D_WIN32_WINNT=0x0A00" "-D_CRT_SECURE_NO_WARNINGS" "-march=native" "-DALLOW_EXPE
RIMENTAL_API" "-DALLOW_INTERNAL_API" "-DVHOST_CLANG_UNROLL_PRAGMA" "-fno-strict-aliasing" "-DRTE_LOG_DEFAULT_LOGTYPE=lib.vhost" -MD -MQ lib/l
ibrte_vhost.a.p/vhost_virtio_net.c.obj -MF "lib\librte_vhost.a.p\vhost_virtio_net.c.obj.d" -o lib/librte_vhost.a.p/vhost_virtio_net.c.obj "-c
" ../lib/vhost/virtio_net.c
../lib/vhost/virtio_net.c:7:10: fatal error: 'linux/virtio_net.h' file not found
#include <linux/virtio_net.h>
         ^~~~~~~~~~~~~~~~~~~~
1 error generated.
[3/149] Linking target lib/rte_pdump-21.dll
   Creating library lib\rte_pdump.lib and object lib\rte_pdump.exp
[4/149] Compiling C object lib/librte_vhost.a.p/vhost_fd_man.c.obj
FAILED: lib/librte_vhost.a.p/vhost_fd_man.c.obj
"clang" "-Ilib\librte_vhost.a.p" "-Ilib" "-I..\lib" "-Ilib\vhost" "-I..\lib\vhost" "-I." "-I.." "-Iconfig" "-I..\config" "-Ilib\eal\include"
"-I..\lib\eal\include" "-Ilib\eal\windows\include" "-I..\lib\eal\windows\include" "-Ilib\eal\x86\include" "-I..\lib\eal\x86\include" "-Ilib\e
al\common" "-I..\lib\eal\common" "-Ilib\eal" "-I..\lib\eal" "-Ilib\kvargs" "-I..\lib\kvargs" "-Ilib\ethdev" "-I..\lib\ethdev" "-Ilib\net" "-I
..\lib\net" "-Ilib\mbuf" "-I..\lib\mbuf" "-Ilib\mempool" "-I..\lib\mempool" "-Ilib\ring" "-I..\lib\ring" "-Ilib\meter" "-I..\lib\meter" "-Ili
b\metrics" "-I..\lib\metrics" "-Ilib\telemetry" "-I..\lib\telemetry" "-Ilib\hash" "-I..\lib\hash" "-Ilib\rcu" "-I..\lib\rcu" "-Ilib\pci" "-I.
.\lib\pci" "-Xclang" "-fcolor-diagnostics" "-pipe" "-D_FILE_OFFSET_BITS=64" "-Wall" "-Winvalid-pch" "-O3" "-include" "rte_config.h" "-Wextra"
 "-Wcast-qual" "-Wdeprecated" "-Wformat" "-Wformat-nonliteral" "-Wformat-security" "-Wmissing-declarations" "-Wmissing-prototypes" "-Wnested-
externs" "-Wold-style-definition" "-Wpointer-arith" "-Wsign-compare" "-Wstrict-prototypes" "-Wundef" "-Wwrite-strings" "-Wno-address-of-packe
d-member" "-Wno-missing-field-initializers" "-D_GNU_SOURCE" "-D_WIN32_WINNT=0x0A00" "-D_CRT_SECURE_NO_WARNINGS" "-march=native" "-DALLOW_EXPE
RIMENTAL_API" "-DALLOW_INTERNAL_API" "-DVHOST_CLANG_UNROLL_PRAGMA" "-fno-strict-aliasing" "-DRTE_LOG_DEFAULT_LOGTYPE=lib.vhost" -MD -MQ lib/l
ibrte_vhost.a.p/vhost_fd_man.c.obj -MF "lib\librte_vhost.a.p\vhost_fd_man.c.obj.d" -o lib/librte_vhost.a.p/vhost_fd_man.c.obj "-c" ../lib/vho
st/fd_man.c
../lib/vhost/fd_man.c:8:10: fatal error: 'sys/socket.h' file not found
#include <sys/socket.h>

how to enable vhost

diff --git a/lib/meson.build b/lib/meson.build
index 1673ca4323..d630ab3182 100644
--- a/lib/meson.build
+++ b/lib/meson.build
@@ -85,6 +85,7 @@ if is_windows
             'gso',
             'latencystats',
             'pdump',
+           'vhost',
     ] # only supported libraries for windows
 endif

diff --git a/lib/vhost/meson.build b/lib/vhost/meson.build
index 2d8fe0239f..2ae4826a50 100644
--- a/lib/vhost/meson.build
+++ b/lib/vhost/meson.build
@@ -1,10 +1,10 @@
 # SPDX-License-Identifier: BSD-3-Clause
 # Copyright(c) 2017-2018 Intel Corporation

-if not is_linux
-    build = false
-    reason = 'only supported on Linux'
-endif
+#if not is_linux
+#    build = false
+#    reason = 'only supported on Linux'
+#endif
 if has_libnuma == 1
     dpdk_conf.set10('RTE_LIBRTE_VHOST_NUMA', true)
 endif
@@ -21,9 +21,9 @@ sources = files(
         'fd_man.c',
         'iotlb.c',
         'socket.c',
-        'vdpa.c',
+#        'vdpa.c',
         'vhost.c',
-        'vhost_crypto.c',
+#        'vhost_crypto.c',
         'vhost_user.c',