Skip to contentSkip to conversation

add OSv support

RFC PATCH Superseded Takuya ASADA 4 participants 28 messages Mar 12, 2015 – Apr 6, 2015 8 messages not in the archive Kbuild

v1 of 3 Superseded Latest is v3 →

lore
Share & tools
lore
#0 lore raw

cover add OSv support

Hi DPDK developers,

I'd like to contribute a new EAL to support our open-sourced operating system called "OSv".
It is a new operating system build from scratch for cloud computing, to run application faster with lower footprint on IaaS.
Unlike general propose OS, it is a library OS designed to run single application per one instance, everything run in kernel mode, single memory space. It's not using Linux kernel but has compatibility with Linux application, not perfect but we already supported various applications such as Cassandra, memcached, Redis, etc.

In DPDK case, PMDs can access devices directly, without kernel driver help.
At this point I haven't enough optimized performance of the EAL yet, but it has potential to get better performance than Linux with fewer resources.

OSv web site: http://osv.io
USENIX ATC'14 paper: https://www.usenix.org/conference/atc14/technical-sessions/presentation/kivity

Takuya ASADA (7):
mk: support compiling C++ code
eal: Add extern C on eal_hugepages.h
eal: Add extern C on eal_thread.h
eal: Add extern C on eal_private.h
add OSv support
virtio: enable MSI-X on OSv
app/test: support OSv

 app/test/test_eal_flags.c                          |  34 +--
 app/test/test_timer_perf.c                         |   2 +-
 config/{common_linuxapp => common_osvapp}          |  20 +-
 ...xapp-gcc => defconfig_x86_64-native-osvapp-gcc} |   2 +-
 lib/librte_eal/Makefile                            |   2 +
 lib/librte_eal/common/eal_hugepages.h              |   8 +
 lib/librte_eal/common/eal_private.h                |   8 +
 lib/librte_eal/common/eal_thread.h                 |   8 +
 Makefile => lib/librte_eal/osvapp/Makefile         |   5 +-
 lib/librte_eal/osvapp/eal/Makefile                 | 115 ++++++++
 lib/librte_eal/{linuxapp => osvapp}/eal/eal.c      | 123 +-------
 .../{linuxapp => osvapp}/eal/eal_alarm.c           |   0
 .../{linuxapp => osvapp}/eal/eal_debug.c           |   0
 lib/librte_eal/osvapp/eal/eal_hugepage_info.cc     |  63 +++++
 .../{bsdapp => osvapp}/eal/eal_interrupts.c        |   0
 .../eal/eal_lcore.c => osvapp/eal/eal_lcore.cc}    |  53 ++--
 lib/librte_eal/{bsdapp => osvapp}/eal/eal_log.c    |   0
 lib/librte_eal/osvapp/eal/eal_memory.cc            | 148 ++++++++++
 lib/librte_eal/osvapp/eal/eal_pci.cc               | 311 +++++++++++++++++++++
 .../{linuxapp => osvapp}/eal/eal_thread.c          |   0
 lib/librte_eal/osvapp/eal/eal_timer.c              | 121 ++++++++
 .../eal/include/exec-env/rte_interrupts.h          |   0
 lib/librte_pmd_virtio/virtio_ethdev.c              |  15 +-
 mk/exec-env/{linuxapp => osvapp}/rte.app.mk        |   0
 mk/exec-env/{linuxapp => osvapp}/rte.vars.mk       |   6 +-
 mk/internal/rte.compile-pre.mk                     |  41 ++-
 mk/target/generic/rte.vars.mk                      |   4 +
 mk/toolchain/gcc/rte.vars.mk                       |   5 +-
 28 files changed, 907 insertions(+), 187 deletions(-)
 copy config/{common_linuxapp => common_osvapp} (97%)
 copy config/{defconfig_x86_64-native-linuxapp-gcc => defconfig_x86_64-native-osvapp-gcc} (98%)
 copy Makefile => lib/librte_eal/osvapp/Makefile (93%)
 create mode 100644 lib/librte_eal/osvapp/eal/Makefile
 copy lib/librte_eal/{linuxapp => osvapp}/eal/eal.c (87%)
 copy lib/librte_eal/{linuxapp => osvapp}/eal/eal_alarm.c (100%)
 copy lib/librte_eal/{linuxapp => osvapp}/eal/eal_debug.c (100%)
 create mode 100644 lib/librte_eal/osvapp/eal/eal_hugepage_info.cc
 copy lib/librte_eal/{bsdapp => osvapp}/eal/eal_interrupts.c (100%)
 copy lib/librte_eal/{bsdapp/eal/eal_lcore.c => osvapp/eal/eal_lcore.cc} (80%)
 copy lib/librte_eal/{bsdapp => osvapp}/eal/eal_log.c (100%)
 create mode 100644 lib/librte_eal/osvapp/eal/eal_memory.cc
 create mode 100644 lib/librte_eal/osvapp/eal/eal_pci.cc
 copy lib/librte_eal/{linuxapp => osvapp}/eal/eal_thread.c (100%)
 create mode 100644 lib/librte_eal/osvapp/eal/eal_timer.c
 copy lib/librte_eal/{bsdapp => osvapp}/eal/include/exec-env/rte_interrupts.h (100%)
 copy mk/exec-env/{linuxapp => osvapp}/rte.app.mk (100%)
 copy mk/exec-env/{linuxapp => osvapp}/rte.vars.mk (95%)
Signature · 1 line
2.1.0

A message that is not in the archive (sent off-list or not yet received): 1426194348-4406-1-git-send-email-syuu-RmZWMc9puTNJc61us3aD9laTQe2KTcn/@public.gmane.org

#2 lore raw

RFC PATCH 1/7 mk: support compiling C++ code

Since OSv is written in C++, we need to write OSv EAL in C++. To do so, we need to compile .cc files by $(CXX).

This patch does not contain diff for clang and icc, but OSv EAL does not supported these toolchain, this is enough for now.

---
 mk/internal/rte.compile-pre.mk | 41 ++++++++++++++++++++++++++++++++++++++---
 mk/target/generic/rte.vars.mk  |  4 ++++
 mk/toolchain/gcc/rte.vars.mk   |  5 ++++-
 3 files changed, 46 insertions(+), 4 deletions(-)
mk/internal/rte.compile-pre.mk +38 -3
index b9bff4a..142f996 100644
@@ -37,7 +37,7 @@ SRCS-all := $(SRCS-y) $(SRCS-n) $(SRCS-)
 
 # convert source to obj file
 src2obj = $(strip $(patsubst %.c,%.o,\
-	$(patsubst %.S,%_s.o,$(1))))
+	$(patsubst %.S,%_s.o,$(patsubst %.cc,%.o,$(1)))))
 
 # add a dot in front of the file name
 dotfile = $(strip $(foreach f,$(1),\
@@ -46,12 +46,12 @@ dotfile = $(strip $(foreach f,$(1),\
 # convert source/obj files into dot-dep filename (does not
 # include .S files)
 src2dep = $(strip $(call dotfile,$(patsubst %.c,%.o.d, \
-		$(patsubst %.S,,$(1)))))
+		$(patsubst %.S,,$(patsubst %.cc,%.o.d,$(1))))))
 obj2dep = $(strip $(call dotfile,$(patsubst %.o,%.o.d,$(1))))
 
 # convert source/obj files into dot-cmd filename
 src2cmd = $(strip $(call dotfile,$(patsubst %.c,%.o.cmd, \
-		$(patsubst %.S,%_s.o.cmd,$(1)))))
+		$(patsubst %.S,%_s.o.cmd,$(patsubst %.cc,%.o.cmd,$(1))))))
 obj2cmd = $(strip $(call dotfile,$(patsubst %.o,%.o.cmd,$(1))))
 
 OBJS-y := $(call src2obj,$(SRCS-y))
@@ -78,11 +78,19 @@ C_TO_O = $(HOSTCC) -Wp,-MD,$(call obj2dep,$(@)).tmp $(HOST_CFLAGS) \
 	$(CFLAGS_$(@)) $(HOST_EXTRA_CFLAGS) -o $@ -c $<
 C_TO_O_STR = $(subst ','\'',$(C_TO_O)) #'# fix syntax highlight
 C_TO_O_DISP = $(if $(V),"$(C_TO_O_STR)","  HOSTCC $(@)")
+CXX_TO_O = $(HOSTCXX) -Wp,-MD,$(call obj2dep,$(@)).tmp $(HOST_CXXFLAGS) \
+	$(CXXFLAGS_$(@)) $(HOST_EXTRA_CXXFLAGS) -o $@ -c $<
+CXX_TO_O_STR = $(subst ','\'',$(CXX_TO_O)) #'# fix syntax highlight
+CXX_TO_O_DISP = $(if $(V),"$(CXX_TO_O_STR)","  HOSTCXX $(@)")
 else
 C_TO_O = $(CC) -Wp,-MD,$(call obj2dep,$(@)).tmp $(CFLAGS) \
 	$(CFLAGS_$(@)) $(EXTRA_CFLAGS) -o $@ -c $<
 C_TO_O_STR = $(subst ','\'',$(C_TO_O)) #'# fix syntax highlight
 C_TO_O_DISP = $(if $(V),"$(C_TO_O_STR)","  CC $(@)")
+CXX_TO_O = $(CXX) -Wp,-MD,$(call obj2dep,$(@)).tmp $(CXXFLAGS) \
+	$(CXXFLAGS_$(@)) $(EXTRA_CXXFLAGS) -o $@ -c $<
+CXX_TO_O_STR = $(subst ','\'',$(CXX_TO_O)) #'# fix syntax highlight
+CXX_TO_O_DISP = $(if $(V),"$(CXX_TO_O_STR)","  CXX $(@)")
 endif
 C_TO_O_CMD = 'cmd_$@ = $(C_TO_O_STR)'
 C_TO_O_DO = @set -e; \
@@ -91,6 +99,13 @@ C_TO_O_DO = @set -e; \
 	echo $(C_TO_O_CMD) > $(call obj2cmd,$(@)) && \
 	sed 's,'$@':,dep_'$@' =,' $(call obj2dep,$(@)).tmp > $(call obj2dep,$(@)) && \
 	rm -f $(call obj2dep,$(@)).tmp
+CXX_TO_O_CMD = 'cmd_$@ = $(CXX_TO_O_STR)'
+CXX_TO_O_DO = @set -e; \
+	echo $(CXX_TO_O_DISP); \
+	$(CXX_TO_O) && \
+	echo $(CXX_TO_O_CMD) > $(call obj2cmd,$(@)) && \
+	sed 's,'$@':,dep_'$@' =,' $(call obj2dep,$(@)).tmp > $(call obj2dep,$(@)) && \
+	rm -f $(call obj2dep,$(@)).tmp
 
 # return an empty string if string are equal
 compare = $(strip $(subst $(1),,$(2)) $(subst $(2),,$(1)))
@@ -136,6 +151,26 @@ boolean = $(if $1,1,0)
 		$(depfile_missing),\
 		$(depfile_newer)),\
 		$(C_TO_O_DO))
+#
+# Compile .cc file if needed
+# Note: dep_$$@ is from the .d file and DEP_$$@ can be specified by
+# user (by default it is empty)
+#
+.SECONDEXPANSION:
+%.o: %.cc $$(wildcard $$(dep_$$@)) $$(DEP_$$(@)) FORCE
+	@[ -d $(dir $@) ] || mkdir -p $(dir $@)
+	$(if $(D),\
+		@echo -n "$< -> $@ " ; \
+		echo -n "file_missing=$(call boolean,$(file_missing)) " ; \
+		echo -n "cmdline_changed=$(call boolean,$(call cmdline_changed,$(CXX_TO_O))) " ; \
+		echo -n "depfile_missing=$(call boolean,$(depfile_missing)) " ; \
+		echo "depfile_newer=$(call boolean,$(depfile_newer))")
+	$(if $(or \
+		$(file_missing),\
+		$(call cmdline_changed,$(CXX_TO_O)),\
+		$(depfile_missing),\
+		$(depfile_newer)),\
+		$(CXX_TO_O_DO))
 
 # command to assemble a .S file to generate an object
 ifeq ($(USE_HOST),1)
mk/target/generic/rte.vars.mk +4 -0
index 53650c3..47d845b 100644
@@ -146,7 +146,11 @@ endif
 LDFLAGS += -L$(RTE_SDK_BIN)/lib
 endif
 
+# copy CFLAGS to CXXFLAGS
+CXXFLAGS := $(CFLAGS)
+
 export CFLAGS
 export LDFLAGS
+export CXXFLAGS
 
 endif
mk/toolchain/gcc/rte.vars.mk +4 -1
index 88f235c..4bdf2eb 100644
@@ -39,6 +39,7 @@
 #
 
 CC        = $(CROSS)gcc
+CXX       = $(CROSS)g++
 KERNELCC  = $(CROSS)gcc
 CPP       = $(CROSS)cpp
 # for now, we don't use as but nasm.
@@ -54,8 +55,10 @@ GCOV      = $(CROSS)gcov
 
 ifeq ("$(origin CC)", "command line")
 HOSTCC    = $(CC)
+HOSTCXX   = $(CXX)
 else
 HOSTCC    = gcc
+HOSTCXX   = gxx
 endif
 HOSTAS    = as
 
@@ -80,5 +83,5 @@ WERROR_FLAGS += -Wundef -Wwrite-strings
 # process cpu flags
 include $(RTE_SDK)/mk/toolchain/$(RTE_TOOLCHAIN)/rte.toolchain-compat.mk
 
-export CC AS AR LD OBJCOPY OBJDUMP STRIP READELF
+export CC CXX AS AR LD OBJCOPY OBJDUMP STRIP READELF
 export TOOLCHAIN_CFLAGS TOOLCHAIN_LDFLAGS TOOLCHAIN_ASFLAGS
Signature · 1 line
2.1.0
#3 lore raw

RFC PATCH 2/7 eal: Add extern C on eal_hugepages.h

In reply to a message not in the archive

This is required to link with OSv EAL.

---
 lib/librte_eal/common/eal_hugepages.h | 8 ++++++++
 1 file changed, 8 insertions(+)
lib/librte_eal/common/eal_hugepages.h +8 -0
index 38edac0..b722aee 100644
@@ -34,6 +34,10 @@
 #ifndef EAL_HUGEPAGES_H
 #define EAL_HUGEPAGES_H
 
+#ifdef __cplusplus
+extern "C" {
+#endif
+
 #include <stddef.h>
 #include <stdint.h>
 #include <limits.h>
@@ -64,4 +68,8 @@ struct hugepage_file {
  */
 int eal_hugepage_info_init(void);
 
+#ifdef __cplusplus
+}
+#endif
+
 #endif /* EAL_HUGEPAGES_H */
Signature · 1 line
2.1.0
#4 lore raw

RFC PATCH 3/7 eal: Add extern C on eal_thread.h

In reply to a message not in the archive

This is required to link with OSv EAL.

---
 lib/librte_eal/common/eal_thread.h | 8 ++++++++
 1 file changed, 8 insertions(+)
lib/librte_eal/common/eal_thread.h +8 -0
index e4e76b9..794137f 100644
@@ -34,6 +34,10 @@
 #ifndef EAL_THREAD_H
 #define EAL_THREAD_H
 
+#ifdef __cplusplus
+extern "C" {
+#endif
+
 #include <rte_lcore.h>
 
 /**
@@ -97,4 +101,8 @@ int eal_cpuset_socket_id(rte_cpuset_t *cpusetp);
 int
 eal_thread_dump_affinity(char *str, unsigned size);
 
+#ifdef __cplusplus
+}
+#endif
+
 #endif /* EAL_THREAD_H */
Signature · 1 line
2.1.0
#5 lore raw

RFC PATCH 4/7 eal: Add extern C on eal_private.h

In reply to a message not in the archive

This is required to link with OSv EAL.

---
 lib/librte_eal/common/eal_private.h | 8 ++++++++
 1 file changed, 8 insertions(+)
lib/librte_eal/common/eal_private.h +8 -0
index 4acf5a0..80b3d44 100644
@@ -34,6 +34,10 @@
 #ifndef _EAL_PRIVATE_H_
 #define _EAL_PRIVATE_H_
 
+#ifdef __cplusplus
+extern "C" {
+#endif
+
 #include <stdio.h>
 
 /**
@@ -232,4 +236,8 @@ int rte_eal_dev_init(void);
  */
 int rte_eal_check_module(const char *module_name);
 
+#ifdef __cplusplus
+}
+#endif
+
 #endif /* _EAL_PRIVATE_H_ */
Signature · 1 line
2.1.0
#6 lore raw

RFC PATCH 5/7 add OSv support

In reply to a message not in the archive

Adding OSv support.
Based on Linux/FreeBSD EAL, but calling OSv kernel APIs to access devices, allocate contiguous memory, etc.

---
 config/{common_linuxapp => common_osvapp}          |  20 +-
 ...xapp-gcc => defconfig_x86_64-native-osvapp-gcc} |   2 +-
 lib/librte_eal/Makefile                            |   2 +
 Makefile => lib/librte_eal/osvapp/Makefile         |   5 +-
 lib/librte_eal/osvapp/eal/Makefile                 | 115 ++++++++
 lib/librte_eal/{linuxapp => osvapp}/eal/eal.c      | 123 +-------
 .../{linuxapp => osvapp}/eal/eal_alarm.c           |   0
 .../{linuxapp => osvapp}/eal/eal_debug.c           |   0
 lib/librte_eal/osvapp/eal/eal_hugepage_info.cc     |  63 +++++
 .../{bsdapp => osvapp}/eal/eal_interrupts.c        |   0
 .../eal/eal_lcore.c => osvapp/eal/eal_lcore.cc}    |  53 ++--
 lib/librte_eal/{bsdapp => osvapp}/eal/eal_log.c    |   0
 lib/librte_eal/osvapp/eal/eal_memory.cc            | 148 ++++++++++
 lib/librte_eal/osvapp/eal/eal_pci.cc               | 311 +++++++++++++++++++++
 .../{linuxapp => osvapp}/eal/eal_thread.c          |   0
 lib/librte_eal/osvapp/eal/eal_timer.c              | 121 ++++++++
 .../eal/include/exec-env/rte_interrupts.h          |   0
 mk/exec-env/{linuxapp => osvapp}/rte.app.mk        |   0
 mk/exec-env/{linuxapp => osvapp}/rte.vars.mk       |   6 +-
 19 files changed, 805 insertions(+), 164 deletions(-)
 copy config/{common_linuxapp => common_osvapp} (97%)
 copy config/{defconfig_x86_64-native-linuxapp-gcc => defconfig_x86_64-native-osvapp-gcc} (98%)
 copy Makefile => lib/librte_eal/osvapp/Makefile (93%)
 create mode 100644 lib/librte_eal/osvapp/eal/Makefile
 copy lib/librte_eal/{linuxapp => osvapp}/eal/eal.c (87%)
 copy lib/librte_eal/{linuxapp => osvapp}/eal/eal_alarm.c (100%)
 copy lib/librte_eal/{linuxapp => osvapp}/eal/eal_debug.c (100%)
 create mode 100644 lib/librte_eal/osvapp/eal/eal_hugepage_info.cc
 copy lib/librte_eal/{bsdapp => osvapp}/eal/eal_interrupts.c (100%)
 copy lib/librte_eal/{bsdapp/eal/eal_lcore.c => osvapp/eal/eal_lcore.cc} (80%)
 copy lib/librte_eal/{bsdapp => osvapp}/eal/eal_log.c (100%)
 create mode 100644 lib/librte_eal/osvapp/eal/eal_memory.cc
 create mode 100644 lib/librte_eal/osvapp/eal/eal_pci.cc
 copy lib/librte_eal/{linuxapp => osvapp}/eal/eal_thread.c (100%)
 create mode 100644 lib/librte_eal/osvapp/eal/eal_timer.c
 copy lib/librte_eal/{bsdapp => osvapp}/eal/include/exec-env/rte_interrupts.h (100%)
 copy mk/exec-env/{linuxapp => osvapp}/rte.app.mk (100%)
 copy mk/exec-env/{linuxapp => osvapp}/rte.vars.mk (95%)
config/common_osvapp renamed from config/common_linuxapp +13 -7
similarity index 97%
copy from config/common_linuxapp
copy to config/common_osvapp
index 97f1c9e..ce973fe 100644
@@ -35,8 +35,8 @@
 #
 # CONFIG_RTE_EXEC_ENV can be linuxapp, bsdapp
 #
-CONFIG_RTE_EXEC_ENV="linuxapp"
-CONFIG_RTE_EXEC_ENV_LINUXAPP=y
+CONFIG_RTE_EXEC_ENV="osvapp"
+CONFIG_RTE_EXEC_ENV_OSVAPP=y
 
 ##
 ## machine can define specific variables or action for a specific board
@@ -89,7 +89,7 @@ CONFIG_RTE_LIBNAME="intel_dpdk"
 #
 CONFIG_RTE_LIBRTE_EAL=y
 CONFIG_RTE_MAX_LCORE=128
-CONFIG_RTE_MAX_NUMA_NODES=8
+CONFIG_RTE_MAX_NUMA_NODES=1
 CONFIG_RTE_MAX_MEMSEG=256
 CONFIG_RTE_MAX_MEMZONE=2560
 CONFIG_RTE_MAX_TAILQ=32
@@ -98,8 +98,8 @@ CONFIG_RTE_LOG_HISTORY=256
 CONFIG_RTE_LIBEAL_USE_HPET=n
 CONFIG_RTE_EAL_ALLOW_INV_SOCKET_ID=n
 CONFIG_RTE_EAL_ALWAYS_PANIC_ON_ERROR=n
-CONFIG_RTE_EAL_IGB_UIO=y
-CONFIG_RTE_EAL_VFIO=y
+CONFIG_RTE_EAL_IGB_UIO=n
+CONFIG_RTE_EAL_VFIO=n
 
 #
 # Special configurations in PCI Config Space for high performance
@@ -111,7 +111,13 @@ CONFIG_RTE_PCI_MAX_READ_REQUEST_SIZE=0
 #
 # Compile Environment Abstraction Layer for linux
 #
-CONFIG_RTE_LIBRTE_EAL_LINUXAPP=y
+CONFIG_RTE_LIBRTE_EAL_OSVAPP=y
+
+#
+# Compile OSv specific parameters
+#
+CONFIG_RTE_CONTIGUOUS_CHUNK_SIZE=32M
+CONFIG_RTE_DEFAULT_NUM_CHUNKS=4
 
 #
 # Compile Environment Abstraction Layer to support hotplug
@@ -403,7 +409,7 @@ CONFIG_RTE_LIBRTE_PIPELINE=y
 #
 # Compile librte_kni
 #
-CONFIG_RTE_LIBRTE_KNI=y
+CONFIG_RTE_LIBRTE_KNI=n
 CONFIG_RTE_KNI_PREEMPT_DEFAULT=y
 CONFIG_RTE_KNI_KO_DEBUG=n
 CONFIG_RTE_KNI_VHOST=n
config/defconfig_x86_64-native-osvapp-gcc renamed from config/defconfig_x86_64-native-linuxapp-gcc +1 -1
similarity index 98%
copy from config/defconfig_x86_64-native-linuxapp-gcc
copy to config/defconfig_x86_64-native-osvapp-gcc
index 60baf5b..2134270 100644
@@ -30,7 +30,7 @@
 #   OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 #
 
-#include "common_linuxapp"
+#include "common_osvapp"
 
 CONFIG_RTE_MACHINE="native"
 
lib/librte_eal/Makefile +2 -0
index 69003cf..c555587 100644
@@ -35,5 +35,7 @@ DIRS-$(CONFIG_RTE_LIBRTE_EAL_LINUXAPP) += common
 DIRS-$(CONFIG_RTE_LIBRTE_EAL_LINUXAPP) += linuxapp
 DIRS-$(CONFIG_RTE_LIBRTE_EAL_BSDAPP) += common
 DIRS-$(CONFIG_RTE_LIBRTE_EAL_BSDAPP) += bsdapp
+DIRS-$(CONFIG_RTE_LIBRTE_EAL_OSVAPP) += common
+DIRS-$(CONFIG_RTE_LIBRTE_EAL_OSVAPP) += osvapp
 
 include $(RTE_SDK)/mk/rte.subdir.mk
lib/librte_eal/osvapp/Makefile renamed from Makefile +4 -1
similarity index 93%
copy from Makefile
copy to lib/librte_eal/osvapp/Makefile
index f4b807e..15badb3 100644
@@ -29,5 +29,8 @@
 #   (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
 #   OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 
-.error Error please compile using GNU Make (gmake)
+include $(RTE_SDK)/mk/rte.vars.mk
 
+DIRS-$(CONFIG_RTE_LIBRTE_EAL_OSVAPP) += eal
+
+include $(RTE_SDK)/mk/rte.subdir.mk
lib/librte_eal/osvapp/eal/Makefile new file +115 -0

115 lines not on this page · raw message

lib/librte_eal/osvapp/eal/eal.c renamed from lib/librte_eal/linuxapp/eal/eal.c +3 -120

196 lines not on this page · raw message

lib/librte_eal/osvapp/eal/eal_alarm.c renamed from lib/librte_eal/linuxapp/eal/eal_alarm.c +0 -0
similarity index 100%
copy from lib/librte_eal/linuxapp/eal/eal_alarm.c
copy to lib/librte_eal/osvapp/eal/eal_alarm.c
lib/librte_eal/osvapp/eal/eal_debug.c renamed from lib/librte_eal/linuxapp/eal/eal_debug.c +0 -0
similarity index 100%
copy from lib/librte_eal/linuxapp/eal/eal_debug.c
copy to lib/librte_eal/osvapp/eal/eal_debug.c
lib/librte_eal/osvapp/eal/eal_hugepage_info.cc new file +63 -0

63 lines not on this page · raw message

lib/librte_eal/osvapp/eal/eal_interrupts.c renamed from lib/librte_eal/bsdapp/eal/eal_interrupts.c +0 -0
similarity index 100%
copy from lib/librte_eal/bsdapp/eal/eal_interrupts.c
copy to lib/librte_eal/osvapp/eal/eal_interrupts.c
lib/librte_eal/osvapp/eal/eal_lcore.cc renamed from lib/librte_eal/bsdapp/eal/eal_lcore.c +23 -30

100 lines not on this page · raw message

lib/librte_eal/osvapp/eal/eal_log.c renamed from lib/librte_eal/bsdapp/eal/eal_log.c +0 -0
similarity index 100%
copy from lib/librte_eal/bsdapp/eal/eal_log.c
copy to lib/librte_eal/osvapp/eal/eal_log.c
lib/librte_eal/osvapp/eal/eal_memory.cc new file +148 -0

148 lines not on this page · raw message

lib/librte_eal/osvapp/eal/eal_pci.cc new file +311 -0

311 lines not on this page · raw message

lib/librte_eal/osvapp/eal/eal_thread.c renamed from lib/librte_eal/linuxapp/eal/eal_thread.c +0 -0
similarity index 100%
copy from lib/librte_eal/linuxapp/eal/eal_thread.c
copy to lib/librte_eal/osvapp/eal/eal_thread.c
lib/librte_eal/osvapp/eal/eal_timer.c new file +121 -0

121 lines not on this page · raw message

lib/librte_eal/osvapp/eal/include/exec-env/rte_interrupts.h renamed from lib/librte_eal/bsdapp/eal/include/exec-env/rte_interrupts.h +0 -0
similarity index 100%
copy from lib/librte_eal/bsdapp/eal/include/exec-env/rte_interrupts.h
copy to lib/librte_eal/osvapp/eal/include/exec-env/rte_interrupts.h
mk/exec-env/osvapp/rte.app.mk renamed from mk/exec-env/linuxapp/rte.app.mk +0 -0
similarity index 100%
copy from mk/exec-env/linuxapp/rte.app.mk
copy to mk/exec-env/osvapp/rte.app.mk
mk/exec-env/osvapp/rte.vars.mk renamed from mk/exec-env/linuxapp/rte.vars.mk +1 -5
similarity index 95%
copy from mk/exec-env/linuxapp/rte.vars.mk
copy to mk/exec-env/osvapp/rte.vars.mk
index e5af318..db0f115 100644
@@ -39,11 +39,7 @@
 #
 # examples for RTE_EXEC_ENV: linuxapp, bsdapp
 #
-ifeq ($(RTE_BUILD_SHARED_LIB),y)
-EXECENV_CFLAGS  = -pthread -fPIC
-else
-EXECENV_CFLAGS  = -pthread
-endif
+EXECENV_CFLAGS  = -pthread -fPIC -shared
 
 # Workaround lack of DT_NEEDED entry
 EXECENV_LDFLAGS = --no-as-needed
Signature · 1 line
2.1.0

A message that is not in the archive (sent off-list or not yet received): 1426194348-4406-6-git-send-email-syuu-RmZWMc9puTNJc61us3aD9laTQe2KTcn/@public.gmane.org

#8 lore raw

lib/librte_eal/osvapp/eal/Makefile line 37

Quoted 10 lines · Takuya ASADA

Adding OSv support.
Based on Linux/FreeBSD EAL, but calling OSv kernel APIs to access devices, allocate contiguous memory, etc. <snip>

lib/librte_eal/osvapp/eal/Makefile new file +7 -0
+
+include $(RTE_SDK)/mk/rte.vars.mk
+
+LIB = librte_eal.a
+
+EXPORT_MAP := rte_eal_version.map
+

You never coppied over the version map. How does this build for shared libraries?

A message that is not in the archive (sent off-list or not yet received): 20150315120122.GA6662-0o1r3XBGOEbbgkc5XkKeNuvMHUBZFtU3YPYVAmT7z5s@public.gmane.org

#10 lore raw
Quoted 13 lines · On Sun, 15 Mar 2015 08:01:22 -0400 Neil Horman…

lib/librte_eal/osvapp/eal/Makefile line 37

Quoted 10 lines · Takuya ASADA

Adding OSv support.
Based on Linux/FreeBSD EAL, but calling OSv kernel APIs to access devices, allocate contiguous memory, etc. <snip>

lib/librte_eal/osvapp/eal/Makefile new file +7 -0
+
+include $(RTE_SDK)/mk/rte.vars.mk
+
+LIB = librte_eal.a
+
+EXPORT_MAP := rte_eal_version.map
+  

You never coppied over the version map. How does this build for shared libraries?

OSv probably doesn't do shared libraries.

#11 lore raw
Quoted 17 lines · Stephen Hemminger
Quoted 13 lines · On Sun, 15 Mar 2015 08:01:22 -0400 Neil Horman…

lib/librte_eal/osvapp/eal/Makefile line 37

Quoted 10 lines · Takuya ASADA

Adding OSv support.
Based on Linux/FreeBSD EAL, but calling OSv kernel APIs to access devices, allocate contiguous memory, etc. <snip>

lib/librte_eal/osvapp/eal/Makefile new file +7 -0
+
+include $(RTE_SDK)/mk/rte.vars.mk
+
+LIB = librte_eal.a
+
+EXPORT_MAP := rte_eal_version.map
+  

You never coppied over the version map. How does this build for shared libraries?

Quoted 2 lines

OSv probably doesn't do shared libraries.

Ah, then do we need to add a check to prevent trying to configure shared libraries then?

Neil

A message that is not in the archive (sent off-list or not yet received): 20150316224259.GA28909-0o1r3XBGOEbbgkc5XkKeNuvMHUBZFtU3YPYVAmT7z5s@public.gmane.org

#13 lore raw

I forgot to copied rte_eal_version.map, added on new patchset. OSv supports shared libraries, but I found that DPDK shared libraries causes an error on OSv:
https://github.com/cloudius-systems/osv/issues/599
I'll fix it shortly.

Quoted 27 lines · Neil Horman
Quoted 6 lines · Stephen Hemminger
Quoted 3 lines · On Sun, 15 Mar 2015 08:01:22 -0400 Neil Horman…
Quoted 2 lines · Takuya ASADA

Adding OSv support.
Based on Linux/FreeBSD EAL, but calling OSv kernel APIs to access

devices, allocate contiguous memory, etc.

Quoted 11 lines
Quoted 10 lines

Review

Quoted 8 lines

<snip>

(quoted diff) +7 -0
+
+include $(RTE_SDK)/mk/rte.vars.mk
+
+LIB = librte_eal.a
+
+EXPORT_MAP := rte_eal_version.map
+

You never coppied over the version map. How does this build for shared libraries?

Quoted 2 lines

OSv probably doesn't do shared libraries.

Ah, then do we need to add a check to prevent trying to configure shared libraries then?

Neil

#14 lore raw

RFC PATCH 6/7 virtio: enable MSI-X on OSv

In reply to a message not in the archive

Add support OSv EAL.

---
 lib/librte_pmd_virtio/virtio_ethdev.c | 15 ++++++++++++++-
 1 file changed, 14 insertions(+), 1 deletion(-)
lib/librte_pmd_virtio/virtio_ethdev.c +14 -1
index 603be2d..fed65f3 100644
@@ -1055,7 +1055,20 @@ static int virtio_resource_init(struct rte_pci_device *pci_dev)
 		return virtio_resource_init_by_ioports(pci_dev);
 }
 
-#else
+#elif defined(RTE_EXEC_ENV_OSVAPP)
+static int
+virtio_has_msix(const struct rte_pci_addr *loc __rte_unused)
+{
+	/* TODO: ask to OSv this NIC has MSI-X */
+	return 1;
+}
+
+static int virtio_resource_init(struct rte_pci_device *pci_dev __rte_unused)
+{
+	/* no setup required */
+	return 0;
+}
+#else /* BSD */
 static int
 virtio_has_msix(const struct rte_pci_addr *loc __rte_unused)
 {
Signature · 1 line
2.1.0
#15 lore raw

RFC PATCH 7/7 app/test: support OSv

In reply to a message not in the archive

Add support OSv EAL.

---
 app/test/test_eal_flags.c  | 34 +++++++++++++++++-----------------
 app/test/test_timer_perf.c |  2 +-
 2 files changed, 18 insertions(+), 18 deletions(-)
app/test/test_eal_flags.c +17 -17
index 0352f87..40a5c7e 100644
@@ -287,7 +287,7 @@ static int
 test_whitelist_flag(void)
 {
 	unsigned i;
-#ifdef RTE_EXEC_ENV_BSDAPP
+#if defined(RTE_EXEC_ENV_BSDAPP) || defined(RTE_EXEC_ENV_OSVAPP)
 	/* BSD target doesn't support prefixes at this point */
 	const char * prefix = "";
 #else
@@ -353,7 +353,7 @@ test_whitelist_flag(void)
 static int
 test_invalid_b_flag(void)
 {
-#ifdef RTE_EXEC_ENV_BSDAPP
+#if defined(RTE_EXEC_ENV_BSDAPP) || defined(RTE_EXEC_ENV_OSVAPP)
 	/* BSD target doesn't support prefixes at this point */
 	const char * prefix = "";
 #else
@@ -400,7 +400,7 @@ test_invalid_b_flag(void)
 static int
 test_invalid_vdev_flag(void)
 {
-#ifdef RTE_EXEC_ENV_BSDAPP
+#if defined(RTE_EXEC_ENV_BSDAPP) || defined(RTE_EXEC_ENV_OSVAPP)
 	/* BSD target doesn't support prefixes at this point, and we also need to
 	 * run another primary process here */
 	const char * prefix = no_shconf;
@@ -454,7 +454,7 @@ test_invalid_vdev_flag(void)
 static int
 test_invalid_r_flag(void)
 {
-#ifdef RTE_EXEC_ENV_BSDAPP
+#if defined(RTE_EXEC_ENV_BSDAPP) || defined(RTE_EXEC_ENV_OSVAPP)
 	/* BSD target doesn't support prefixes at this point */
 	const char * prefix = "";
 #else
@@ -498,7 +498,7 @@ test_invalid_r_flag(void)
 static int
 test_missing_c_flag(void)
 {
-#ifdef RTE_EXEC_ENV_BSDAPP
+#if defined(RTE_EXEC_ENV_BSDAPP) || defined(RTE_EXEC_ENV_OSVAPP)
 	/* BSD target doesn't support prefixes at this point */
 	const char * prefix = "";
 #else
@@ -629,7 +629,7 @@ test_missing_c_flag(void)
 static int
 test_master_lcore_flag(void)
 {
-#ifdef RTE_EXEC_ENV_BSDAPP
+#if defined(RTE_EXEC_ENV_BSDAPP) || defined(RTE_EXEC_ENV_OSVAPP)
 	/* BSD target doesn't support prefixes at this point */
 	const char *prefix = "";
 #else
@@ -677,7 +677,7 @@ test_master_lcore_flag(void)
 static int
 test_missing_n_flag(void)
 {
-#ifdef RTE_EXEC_ENV_BSDAPP
+#if defined(RTE_EXEC_ENV_BSDAPP) || defined(RTE_EXEC_ENV_OSVAPP)
 	/* BSD target doesn't support prefixes at this point */
 	const char * prefix = "";
 #else
@@ -722,7 +722,7 @@ test_no_hpet_flag(void)
 {
 	char prefix[PATH_MAX], tmp[PATH_MAX];
 
-#ifdef RTE_EXEC_ENV_BSDAPP
+#if defined(RTE_EXEC_ENV_BSDAPP) || defined(RTE_EXEC_ENV_OSVAPP)
 	return 0;
 #endif
 	if (get_current_prefix(tmp, sizeof(tmp)) == NULL) {
@@ -754,7 +754,7 @@ test_no_hpet_flag(void)
 static int
 test_no_huge_flag(void)
 {
-#ifdef RTE_EXEC_ENV_BSDAPP
+#if defined(RTE_EXEC_ENV_BSDAPP) || defined(RTE_EXEC_ENV_OSVAPP)
 	/* BSD target doesn't support prefixes at this point, and we also need to
 	 * run another primary process here */
 	const char * prefix = no_shconf;
@@ -782,7 +782,7 @@ test_no_huge_flag(void)
 		printf("Error - process run ok with --no-huge and -m flags\n");
 		return -1;
 	}
-#ifdef RTE_EXEC_ENV_BSDAPP
+#if defined(RTE_EXEC_ENV_BSDAPP) || defined(RTE_EXEC_ENV_OSVAPP)
 	/* BSD target does not support NUMA, hence no --socket-mem tests */
 	return 0;
 #endif
@@ -870,7 +870,7 @@ static int
 test_misc_flags(void)
 {
 	char hugepath[PATH_MAX] = {0};
-#ifdef RTE_EXEC_ENV_BSDAPP
+#if defined(RTE_EXEC_ENV_BSDAPP) || defined(RTE_EXEC_ENV_OSVAPP)
 	/* BSD target doesn't support prefixes at this point */
 	const char * prefix = "";
 	const char * nosh_prefix = "";
@@ -942,7 +942,7 @@ test_misc_flags(void)
 	const char *argv6[] = {prgname, "-c", "1", "-n", "2", "-m", DEFAULT_MEM_SIZE,
 			no_shconf, nosh_prefix };
 
-#ifdef RTE_EXEC_ENV_BSDAPP
+#if defined(RTE_EXEC_ENV_BSDAPP) || defined(RTE_EXEC_ENV_OSVAPP)
 	return 0;
 #endif
 	/* With --huge-dir */
@@ -1007,7 +1007,7 @@ test_misc_flags(void)
 		printf("Error - process did not run ok with --no-shconf flag\n");
 		return -1;
 	}
-#ifdef RTE_EXEC_ENV_BSDAPP
+#if defined(RTE_EXEC_ENV_BSDAPP) || defined(RTE_EXEC_ENV_OSVAPP)
 	return 0;
 #endif
 	if (launch_proc(argv7) != 0) {
@@ -1068,7 +1068,7 @@ test_file_prefix(void)
 	 * 7. check that only memtest2 hugefiles are present in the hugedir
 	 */
 
-#ifdef RTE_EXEC_ENV_BSDAPP
+#if defined(RTE_EXEC_ENV_BSDAPP) || defined(RTE_EXEC_ENV_OSVAPP)
 	return 0;
 #endif
 
@@ -1175,7 +1175,7 @@ test_file_prefix(void)
 static int
 test_memory_flags(void)
 {
-#ifdef RTE_EXEC_ENV_BSDAPP
+#if defined(RTE_EXEC_ENV_BSDAPP) || defined(RTE_EXEC_ENV_OSVAPP)
 	/* BSD target doesn't support prefixes at this point */
 	const char * prefix = "";
 #else
@@ -1228,7 +1228,7 @@ test_memory_flags(void)
 	char invalid_socket_mem[SOCKET_MEM_STRLEN];
 	char buf[SOCKET_MEM_STRLEN];	/* to avoid copying string onto itself */
 
-#ifdef RTE_EXEC_ENV_BSDAPP
+#if defined(RTE_EXEC_ENV_BSDAPP) || defined(RTE_EXEC_ENV_OSVAPP)
 	int i, num_sockets = 1;
 #else
 	int i, num_sockets = get_number_of_sockets();
@@ -1281,7 +1281,7 @@ test_memory_flags(void)
 		return -1;
 	}
 
-#ifdef RTE_EXEC_ENV_BSDAPP
+#if defined(RTE_EXEC_ENV_BSDAPP) || defined(RTE_EXEC_ENV_OSVAPP)
 	/* no other tests are applicable to BSD */
 	return 0;
 #endif
app/test/test_timer_perf.c +1 -1
index 3f7ddd3..1edffa8 100644
@@ -55,7 +55,7 @@ timer_cb(struct rte_timer *t __rte_unused, void *param __rte_unused)
 
 #define DELAY_SECONDS 1
 
-#ifdef RTE_EXEC_ENV_LINUXAPP
+#if defined(RTE_EXEC_ENV_LINUXAPP) || defined(RTE_EXEC_ENV_OSVAPP)
 #define do_delay() usleep(10)
 #else
 #define do_delay() rte_pause()
Signature · 1 line
2.1.0
#16 lore raw
In reply to a message not in the archive
Quoted 7 lines · Takuya ASADA

Hi DPDK developers,

I'd like to contribute a new EAL to support our open-sourced operating system called "OSv".
It is a new operating system build from scratch for cloud computing, to run application faster with lower footprint on IaaS.
Unlike general propose OS, it is a library OS designed to run single application per one instance, everything run in kernel mode, single memory space. It's not using Linux kernel but has compatibility with Linux application, not perfect but we already supported various applications such as Cassandra, memcached, Redis, etc.

Quoted 5 lines

In DPDK case, PMDs can access devices directly, without kernel driver help.
At this point I haven't enough optimized performance of the EAL yet, but it has potential to get better performance than Linux with fewer resources.

OSv web site: http://osv.io
USENIX ATC'14 paper: https://www.usenix.org/conference/atc14/technical-sessions/presentation/kivity

This sounds really interesting. Any chance of adding in a "Getting Started Guide" with your patchset to make it easy for us to try out DPDK on OSv?

Quoted 61 lines

Takuya ASADA (7):
mk: support compiling C++ code
eal: Add extern C on eal_hugepages.h
eal: Add extern C on eal_thread.h
eal: Add extern C on eal_private.h
add OSv support
virtio: enable MSI-X on OSv
app/test: support OSv

 app/test/test_eal_flags.c                          |  34 +--
 app/test/test_timer_perf.c                         |   2 +-
 config/{common_linuxapp => common_osvapp}          |  20 +-
 ...xapp-gcc => defconfig_x86_64-native-osvapp-gcc} |   2 +-
 lib/librte_eal/Makefile                            |   2 +
 lib/librte_eal/common/eal_hugepages.h              |   8 +
 lib/librte_eal/common/eal_private.h                |   8 +
 lib/librte_eal/common/eal_thread.h                 |   8 +
 Makefile => lib/librte_eal/osvapp/Makefile         |   5 +-
 lib/librte_eal/osvapp/eal/Makefile                 | 115 ++++++++
 lib/librte_eal/{linuxapp => osvapp}/eal/eal.c      | 123 +-------
 .../{linuxapp => osvapp}/eal/eal_alarm.c           |   0
 .../{linuxapp => osvapp}/eal/eal_debug.c           |   0
 lib/librte_eal/osvapp/eal/eal_hugepage_info.cc     |  63 +++++
 .../{bsdapp => osvapp}/eal/eal_interrupts.c        |   0
 .../eal/eal_lcore.c => osvapp/eal/eal_lcore.cc}    |  53 ++--
 lib/librte_eal/{bsdapp => osvapp}/eal/eal_log.c    |   0
 lib/librte_eal/osvapp/eal/eal_memory.cc            | 148 ++++++++++
 lib/librte_eal/osvapp/eal/eal_pci.cc               | 311 +++++++++++++++++++++
 .../{linuxapp => osvapp}/eal/eal_thread.c          |   0
 lib/librte_eal/osvapp/eal/eal_timer.c              | 121 ++++++++
 .../eal/include/exec-env/rte_interrupts.h          |   0
 lib/librte_pmd_virtio/virtio_ethdev.c              |  15 +-
 mk/exec-env/{linuxapp => osvapp}/rte.app.mk        |   0
 mk/exec-env/{linuxapp => osvapp}/rte.vars.mk       |   6 +-
 mk/internal/rte.compile-pre.mk                     |  41 ++-
 mk/target/generic/rte.vars.mk                      |   4 +
 mk/toolchain/gcc/rte.vars.mk                       |   5 +-
 28 files changed, 907 insertions(+), 187 deletions(-)
 copy config/{common_linuxapp => common_osvapp} (97%)
 copy config/{defconfig_x86_64-native-linuxapp-gcc => defconfig_x86_64-native-osvapp-gcc} (98%)
 copy Makefile => lib/librte_eal/osvapp/Makefile (93%)
 create mode 100644 lib/librte_eal/osvapp/eal/Makefile
 copy lib/librte_eal/{linuxapp => osvapp}/eal/eal.c (87%)
 copy lib/librte_eal/{linuxapp => osvapp}/eal/eal_alarm.c (100%)
 copy lib/librte_eal/{linuxapp => osvapp}/eal/eal_debug.c (100%)
 create mode 100644 lib/librte_eal/osvapp/eal/eal_hugepage_info.cc
 copy lib/librte_eal/{bsdapp => osvapp}/eal/eal_interrupts.c (100%)
 copy lib/librte_eal/{bsdapp/eal/eal_lcore.c => osvapp/eal/eal_lcore.cc} (80%)
 copy lib/librte_eal/{bsdapp => osvapp}/eal/eal_log.c (100%)
 create mode 100644 lib/librte_eal/osvapp/eal/eal_memory.cc
 create mode 100644 lib/librte_eal/osvapp/eal/eal_pci.cc
 copy lib/librte_eal/{linuxapp => osvapp}/eal/eal_thread.c (100%)
 create mode 100644 lib/librte_eal/osvapp/eal/eal_timer.c
 copy lib/librte_eal/{bsdapp => osvapp}/eal/include/exec-env/rte_interrupts.h (100%)
 copy mk/exec-env/{linuxapp => osvapp}/rte.app.mk (100%)
 copy mk/exec-env/{linuxapp => osvapp}/rte.vars.mk (95%)
Signature · 1 line
2.1.0
#17 lore raw
Quoted 19 lines · Bruce Richardson
Quoted 3 lines · Takuya ASADA

Hi DPDK developers,

I'd like to contribute a new EAL to support our open-sourced operating

system called "OSv".

Quoted 1 line

It is a new operating system build from scratch for cloud computing, to

run application faster with lower footprint on IaaS.

Quoted 1 line

Unlike general propose OS, it is a library OS designed to run single

application per one instance, everything run in kernel mode, single memory space.

Quoted 1 line

It's not using Linux kernel but has compatibility with Linux

application, not perfect but we already supported various applications such as Cassandra, memcached, Redis, etc.

Quoted 2 lines

In DPDK case, PMDs can access devices directly, without kernel driver

help.

Quoted 1 line

At this point I haven't enough optimized performance of the EAL yet, but

it has potential to get better performance than Linux with fewer resources.

Quoted 1 line
Quoted 8 lines
Quoted 2 lines

OSv web site: http://osv.io
USENIX ATC'14 paper:

https://www.usenix.org/conference/atc14/technical-sessions/presentation/kivity

This sounds really interesting. Any chance of adding in a "Getting Started Guide"
with your patchset to make it easy for us to try out DPDK on OSv?

We have an application repository for OSv, I'll add DPDK to deploy it easier:
https://github.com/cloudius-systems/osv-apps
And we will add DPDK building instructions on OSv wiki:
https://github.com/cloudius-systems/osv/wiki

Since Linux and FreeBSD has "Getting Started Guide", probably I need to add OSv version too?

Quoted 66 lines
Quoted 21 lines

Takuya ASADA (7):
mk: support compiling C++ code
eal: Add extern C on eal_hugepages.h
eal: Add extern C on eal_thread.h
eal: Add extern C on eal_private.h
add OSv support
virtio: enable MSI-X on OSv
app/test: support OSv

 app/test/test_eal_flags.c                          |  34 +--
 app/test/test_timer_perf.c                         |   2 +-
 config/{common_linuxapp => common_osvapp}          |  20 +-
 ...xapp-gcc => defconfig_x86_64-native-osvapp-gcc} |   2 +-
 lib/librte_eal/Makefile                            |   2 +
 lib/librte_eal/common/eal_hugepages.h              |   8 +
 lib/librte_eal/common/eal_private.h                |   8 +
 lib/librte_eal/common/eal_thread.h                 |   8 +
 Makefile => lib/librte_eal/osvapp/Makefile         |   5 +-
 lib/librte_eal/osvapp/eal/Makefile                 | 115 ++++++++
 lib/librte_eal/{linuxapp => osvapp}/eal/eal.c      | 123 +-------
Quoted 8 lines
 .../{linuxapp => osvapp}/eal/eal_alarm.c           |   0
 .../{linuxapp => osvapp}/eal/eal_debug.c           |   0
 lib/librte_eal/osvapp/eal/eal_hugepage_info.cc     |  63 +++++
 .../{bsdapp => osvapp}/eal/eal_interrupts.c        |   0
 .../eal/eal_lcore.c => osvapp/eal/eal_lcore.cc}    |  53 ++--
 lib/librte_eal/{bsdapp => osvapp}/eal/eal_log.c    |   0
 lib/librte_eal/osvapp/eal/eal_memory.cc            | 148 ++++++++++
 lib/librte_eal/osvapp/eal/eal_pci.cc               | 311

+++++++++++++++++++++

Quoted 4 lines
 .../{linuxapp => osvapp}/eal/eal_thread.c          |   0
 lib/librte_eal/osvapp/eal/eal_timer.c              | 121 ++++++++
 .../eal/include/exec-env/rte_interrupts.h          |   0
 lib/librte_pmd_virtio/virtio_ethdev.c              |  15 +-
Quoted 8 lines
 mk/exec-env/{linuxapp => osvapp}/rte.app.mk        |   0
 mk/exec-env/{linuxapp => osvapp}/rte.vars.mk       |   6 +-
 mk/internal/rte.compile-pre.mk                     |  41 ++-
 mk/target/generic/rte.vars.mk                      |   4 +
 mk/toolchain/gcc/rte.vars.mk                       |   5 +-
 28 files changed, 907 insertions(+), 187 deletions(-)
 copy config/{common_linuxapp => common_osvapp} (97%)
 copy config/{defconfig_x86_64-native-linuxapp-gcc =>

defconfig_x86_64-native-osvapp-gcc} (98%)

Quoted 8 lines
 copy Makefile => lib/librte_eal/osvapp/Makefile (93%)
 create mode 100644 lib/librte_eal/osvapp/eal/Makefile
 copy lib/librte_eal/{linuxapp => osvapp}/eal/eal.c (87%)
 copy lib/librte_eal/{linuxapp => osvapp}/eal/eal_alarm.c (100%)
 copy lib/librte_eal/{linuxapp => osvapp}/eal/eal_debug.c (100%)
 create mode 100644 lib/librte_eal/osvapp/eal/eal_hugepage_info.cc
 copy lib/librte_eal/{bsdapp => osvapp}/eal/eal_interrupts.c (100%)
 copy lib/librte_eal/{bsdapp/eal/eal_lcore.c => osvapp/eal/eal_lcore.cc}

(80%)

Quoted 6 lines
 copy lib/librte_eal/{bsdapp => osvapp}/eal/eal_log.c (100%)
 create mode 100644 lib/librte_eal/osvapp/eal/eal_memory.cc
 create mode 100644 lib/librte_eal/osvapp/eal/eal_pci.cc
 copy lib/librte_eal/{linuxapp => osvapp}/eal/eal_thread.c (100%)
 create mode 100644 lib/librte_eal/osvapp/eal/eal_timer.c
 copy lib/librte_eal/{bsdapp =>

osvapp}/eal/include/exec-env/rte_interrupts.h (100%)

Quoted 6 lines
 copy mk/exec-env/{linuxapp => osvapp}/rte.app.mk (100%)
 copy mk/exec-env/{linuxapp => osvapp}/rte.vars.mk (95%)

--
2.1.0

#18 lore raw
In reply to Bruce Richardson
Quoted 19 lines · Bruce Richardson
Quoted 3 lines · Takuya ASADA

Hi DPDK developers,

I'd like to contribute a new EAL to support our open-sourced operating

system called "OSv".

Quoted 1 line

It is a new operating system build from scratch for cloud computing, to

run application faster with lower footprint on IaaS.

Quoted 1 line

Unlike general propose OS, it is a library OS designed to run single

application per one instance, everything run in kernel mode, single memory space.

Quoted 1 line

It's not using Linux kernel but has compatibility with Linux

application, not perfect but we already supported various applications such as Cassandra, memcached, Redis, etc.

Quoted 2 lines

In DPDK case, PMDs can access devices directly, without kernel driver

help.

Quoted 1 line

At this point I haven't enough optimized performance of the EAL yet, but

it has potential to get better performance than Linux with fewer resources.

Quoted 1 line
Quoted 8 lines
Quoted 2 lines

OSv web site: http://osv.io
USENIX ATC'14 paper:

https://www.usenix.org/conference/atc14/technical-sessions/presentation/kivity

This sounds really interesting. Any chance of adding in a "Getting Started Guide"
with your patchset to make it easy for us to try out DPDK on OSv?

Just send new patchset with Getting Started Guide, please check it.

Quoted 67 lines
Quoted 22 lines

Takuya ASADA (7):
mk: support compiling C++ code
eal: Add extern C on eal_hugepages.h
eal: Add extern C on eal_thread.h
eal: Add extern C on eal_private.h
add OSv support
virtio: enable MSI-X on OSv
app/test: support OSv

 app/test/test_eal_flags.c                          |  34 +--
 app/test/test_timer_perf.c                         |   2 +-
 config/{common_linuxapp => common_osvapp}          |  20 +-
 ...xapp-gcc => defconfig_x86_64-native-osvapp-gcc} |   2 +-
 lib/librte_eal/Makefile                            |   2 +
 lib/librte_eal/common/eal_hugepages.h              |   8 +
 lib/librte_eal/common/eal_private.h                |   8 +
 lib/librte_eal/common/eal_thread.h                 |   8 +
 Makefile => lib/librte_eal/osvapp/Makefile         |   5 +-
 lib/librte_eal/osvapp/eal/Makefile                 | 115 ++++++++
 lib/librte_eal/{linuxapp => osvapp}/eal/eal.c      | 123 +-------
Quoted 8 lines
 .../{linuxapp => osvapp}/eal/eal_alarm.c           |   0
 .../{linuxapp => osvapp}/eal/eal_debug.c           |   0
 lib/librte_eal/osvapp/eal/eal_hugepage_info.cc     |  63 +++++
 .../{bsdapp => osvapp}/eal/eal_interrupts.c        |   0
 .../eal/eal_lcore.c => osvapp/eal/eal_lcore.cc}    |  53 ++--
 lib/librte_eal/{bsdapp => osvapp}/eal/eal_log.c    |   0
 lib/librte_eal/osvapp/eal/eal_memory.cc            | 148 ++++++++++
 lib/librte_eal/osvapp/eal/eal_pci.cc               | 311

+++++++++++++++++++++

Quoted 4 lines
 .../{linuxapp => osvapp}/eal/eal_thread.c          |   0
 lib/librte_eal/osvapp/eal/eal_timer.c              | 121 ++++++++
 .../eal/include/exec-env/rte_interrupts.h          |   0
 lib/librte_pmd_virtio/virtio_ethdev.c              |  15 +-
Quoted 8 lines
 mk/exec-env/{linuxapp => osvapp}/rte.app.mk        |   0
 mk/exec-env/{linuxapp => osvapp}/rte.vars.mk       |   6 +-
 mk/internal/rte.compile-pre.mk                     |  41 ++-
 mk/target/generic/rte.vars.mk                      |   4 +
 mk/toolchain/gcc/rte.vars.mk                       |   5 +-
 28 files changed, 907 insertions(+), 187 deletions(-)
 copy config/{common_linuxapp => common_osvapp} (97%)
 copy config/{defconfig_x86_64-native-linuxapp-gcc =>

defconfig_x86_64-native-osvapp-gcc} (98%)

Quoted 8 lines
 copy Makefile => lib/librte_eal/osvapp/Makefile (93%)
 create mode 100644 lib/librte_eal/osvapp/eal/Makefile
 copy lib/librte_eal/{linuxapp => osvapp}/eal/eal.c (87%)
 copy lib/librte_eal/{linuxapp => osvapp}/eal/eal_alarm.c (100%)
 copy lib/librte_eal/{linuxapp => osvapp}/eal/eal_debug.c (100%)
 create mode 100644 lib/librte_eal/osvapp/eal/eal_hugepage_info.cc
 copy lib/librte_eal/{bsdapp => osvapp}/eal/eal_interrupts.c (100%)
 copy lib/librte_eal/{bsdapp/eal/eal_lcore.c => osvapp/eal/eal_lcore.cc}

(80%)

Quoted 6 lines
 copy lib/librte_eal/{bsdapp => osvapp}/eal/eal_log.c (100%)
 create mode 100644 lib/librte_eal/osvapp/eal/eal_memory.cc
 create mode 100644 lib/librte_eal/osvapp/eal/eal_pci.cc
 copy lib/librte_eal/{linuxapp => osvapp}/eal/eal_thread.c (100%)
 create mode 100644 lib/librte_eal/osvapp/eal/eal_timer.c
 copy lib/librte_eal/{bsdapp =>

osvapp}/eal/include/exec-env/rte_interrupts.h (100%)

Quoted 6 lines
 copy mk/exec-env/{linuxapp => osvapp}/rte.app.mk (100%)
 copy mk/exec-env/{linuxapp => osvapp}/rte.vars.mk (95%)

--
2.1.0

#19 lore raw
In reply to a message not in the archive
Quoted 61 lines · Takuya ASADA

Hi DPDK developers,

I'd like to contribute a new EAL to support our open-sourced operating system called "OSv".
It is a new operating system build from scratch for cloud computing, to run application faster with lower footprint on IaaS.
Unlike general propose OS, it is a library OS designed to run single application per one instance, everything run in kernel mode, single memory space. It's not using Linux kernel but has compatibility with Linux application, not perfect but we already supported various applications such as Cassandra, memcached, Redis, etc.

In DPDK case, PMDs can access devices directly, without kernel driver help.
At this point I haven't enough optimized performance of the EAL yet, but it has potential to get better performance than Linux with fewer resources.

OSv web site: http://osv.io
USENIX ATC'14 paper: https://www.usenix.org/conference/atc14/technical-sessions/presentation/kivity

Takuya ASADA (7):
mk: support compiling C++ code
eal: Add extern C on eal_hugepages.h
eal: Add extern C on eal_thread.h
eal: Add extern C on eal_private.h
add OSv support
virtio: enable MSI-X on OSv
app/test: support OSv

 app/test/test_eal_flags.c                          |  34 +--
 app/test/test_timer_perf.c                         |   2 +-
 config/{common_linuxapp => common_osvapp}          |  20 +-
 ...xapp-gcc => defconfig_x86_64-native-osvapp-gcc} |   2 +-
 lib/librte_eal/Makefile                            |   2 +
 lib/librte_eal/common/eal_hugepages.h              |   8 +
 lib/librte_eal/common/eal_private.h                |   8 +
 lib/librte_eal/common/eal_thread.h                 |   8 +
 Makefile => lib/librte_eal/osvapp/Makefile         |   5 +-
 lib/librte_eal/osvapp/eal/Makefile                 | 115 ++++++++
 lib/librte_eal/{linuxapp => osvapp}/eal/eal.c      | 123 +-------
 .../{linuxapp => osvapp}/eal/eal_alarm.c           |   0
 .../{linuxapp => osvapp}/eal/eal_debug.c           |   0
 lib/librte_eal/osvapp/eal/eal_hugepage_info.cc     |  63 +++++
 .../{bsdapp => osvapp}/eal/eal_interrupts.c        |   0
 .../eal/eal_lcore.c => osvapp/eal/eal_lcore.cc}    |  53 ++--
 lib/librte_eal/{bsdapp => osvapp}/eal/eal_log.c    |   0
 lib/librte_eal/osvapp/eal/eal_memory.cc            | 148 ++++++++++
 lib/librte_eal/osvapp/eal/eal_pci.cc               | 311 +++++++++++++++++++++
 .../{linuxapp => osvapp}/eal/eal_thread.c          |   0
 lib/librte_eal/osvapp/eal/eal_timer.c              | 121 ++++++++
 .../eal/include/exec-env/rte_interrupts.h          |   0
 lib/librte_pmd_virtio/virtio_ethdev.c              |  15 +-
 mk/exec-env/{linuxapp => osvapp}/rte.app.mk        |   0
 mk/exec-env/{linuxapp => osvapp}/rte.vars.mk       |   6 +-
 mk/internal/rte.compile-pre.mk                     |  41 ++-
 mk/target/generic/rte.vars.mk                      |   4 +
 mk/toolchain/gcc/rte.vars.mk                       |   5 +-
 28 files changed, 907 insertions(+), 187 deletions(-)
 copy config/{common_linuxapp => common_osvapp} (97%)
 copy config/{defconfig_x86_64-native-linuxapp-gcc => defconfig_x86_64-native-osvapp-gcc} (98%)
 copy Makefile => lib/librte_eal/osvapp/Makefile (93%)
 create mode 100644 lib/librte_eal/osvapp/eal/Makefile
 copy lib/librte_eal/{linuxapp => osvapp}/eal/eal.c (87%)
 copy lib/librte_eal/{linuxapp => osvapp}/eal/eal_alarm.c (100%)
 copy lib/librte_eal/{linuxapp => osvapp}/eal/eal_debug.c (100%)
 create mode 100644 lib/librte_eal/osvapp/eal/eal_hugepage_info.cc
 copy lib/librte_eal/{bsdapp => osvapp}/eal/eal_interrupts.c (100%)
 copy lib/librte_eal/{bsdapp/eal/eal_lcore.c => osvapp/eal/eal_lcore.cc} (80%)
Quoted 13 lines
 copy lib/librte_eal/{bsdapp => osvapp}/eal/eal_log.c (100%)
 create mode 100644 lib/librte_eal/osvapp/eal/eal_memory.cc
 create mode 100644 lib/librte_eal/osvapp/eal/eal_pci.cc
 copy lib/librte_eal/{linuxapp => osvapp}/eal/eal_thread.c (100%)
 create mode 100644 lib/librte_eal/osvapp/eal/eal_timer.c
 copy lib/librte_eal/{bsdapp => osvapp}/eal/include/exec-env/rte_interrupts.h (100%)
 copy mk/exec-env/{linuxapp => osvapp}/rte.app.mk (100%)
 copy mk/exec-env/{linuxapp => osvapp}/rte.vars.mk (95%)
Signature · 1 line
2.1.0

I presume you intend for this to get merged during the 2.1 release?

Neil

A message that is not in the archive (sent off-list or not yet received): 20150313134244.GB28191-B26myB8xz7F8NnZeBjwnZQMhkBWG/[email protected]

#21 lore raw
Quoted 84 lines · Neil Horman
Quoted 3 lines · Takuya ASADA

Hi DPDK developers,

I'd like to contribute a new EAL to support our open-sourced operating

system called "OSv".

Quoted 1 line

It is a new operating system build from scratch for cloud computing, to

run application faster with lower footprint on IaaS.

Quoted 1 line

Unlike general propose OS, it is a library OS designed to run single

application per one instance, everything run in kernel mode, single memory space.

Quoted 1 line

It's not using Linux kernel but has compatibility with Linux

application, not perfect but we already supported various applications such as Cassandra, memcached, Redis, etc.

Quoted 2 lines

In DPDK case, PMDs can access devices directly, without kernel driver

help.

Quoted 1 line

At this point I haven't enough optimized performance of the EAL yet, but

it has potential to get better performance than Linux with fewer resources.

Quoted 3 lines

OSv web site: http://osv.io
USENIX ATC'14 paper:

https://www.usenix.org/conference/atc14/technical-sessions/presentation/kivity

Quoted 21 lines

Takuya ASADA (7):
mk: support compiling C++ code
eal: Add extern C on eal_hugepages.h
eal: Add extern C on eal_thread.h
eal: Add extern C on eal_private.h
add OSv support
virtio: enable MSI-X on OSv
app/test: support OSv

 app/test/test_eal_flags.c                          |  34 +--
 app/test/test_timer_perf.c                         |   2 +-
 config/{common_linuxapp => common_osvapp}          |  20 +-
 ...xapp-gcc => defconfig_x86_64-native-osvapp-gcc} |   2 +-
 lib/librte_eal/Makefile                            |   2 +
 lib/librte_eal/common/eal_hugepages.h              |   8 +
 lib/librte_eal/common/eal_private.h                |   8 +
 lib/librte_eal/common/eal_thread.h                 |   8 +
 Makefile => lib/librte_eal/osvapp/Makefile         |   5 +-
 lib/librte_eal/osvapp/eal/Makefile                 | 115 ++++++++
 lib/librte_eal/{linuxapp => osvapp}/eal/eal.c      | 123 +-------
Quoted 8 lines
 .../{linuxapp => osvapp}/eal/eal_alarm.c           |   0
 .../{linuxapp => osvapp}/eal/eal_debug.c           |   0
 lib/librte_eal/osvapp/eal/eal_hugepage_info.cc     |  63 +++++
 .../{bsdapp => osvapp}/eal/eal_interrupts.c        |   0
 .../eal/eal_lcore.c => osvapp/eal/eal_lcore.cc}    |  53 ++--
 lib/librte_eal/{bsdapp => osvapp}/eal/eal_log.c    |   0
 lib/librte_eal/osvapp/eal/eal_memory.cc            | 148 ++++++++++
 lib/librte_eal/osvapp/eal/eal_pci.cc               | 311

+++++++++++++++++++++

Quoted 4 lines
 .../{linuxapp => osvapp}/eal/eal_thread.c          |   0
 lib/librte_eal/osvapp/eal/eal_timer.c              | 121 ++++++++
 .../eal/include/exec-env/rte_interrupts.h          |   0
 lib/librte_pmd_virtio/virtio_ethdev.c              |  15 +-
Quoted 8 lines
 mk/exec-env/{linuxapp => osvapp}/rte.app.mk        |   0
 mk/exec-env/{linuxapp => osvapp}/rte.vars.mk       |   6 +-
 mk/internal/rte.compile-pre.mk                     |  41 ++-
 mk/target/generic/rte.vars.mk                      |   4 +
 mk/toolchain/gcc/rte.vars.mk                       |   5 +-
 28 files changed, 907 insertions(+), 187 deletions(-)
 copy config/{common_linuxapp => common_osvapp} (97%)
 copy config/{defconfig_x86_64-native-linuxapp-gcc =>

defconfig_x86_64-native-osvapp-gcc} (98%)

Quoted 8 lines
 copy Makefile => lib/librte_eal/osvapp/Makefile (93%)
 create mode 100644 lib/librte_eal/osvapp/eal/Makefile
 copy lib/librte_eal/{linuxapp => osvapp}/eal/eal.c (87%)
 copy lib/librte_eal/{linuxapp => osvapp}/eal/eal_alarm.c (100%)
 copy lib/librte_eal/{linuxapp => osvapp}/eal/eal_debug.c (100%)
 create mode 100644 lib/librte_eal/osvapp/eal/eal_hugepage_info.cc
 copy lib/librte_eal/{bsdapp => osvapp}/eal/eal_interrupts.c (100%)
 copy lib/librte_eal/{bsdapp/eal/eal_lcore.c => osvapp/eal/eal_lcore.cc}

(80%)

Quoted 6 lines
 copy lib/librte_eal/{bsdapp => osvapp}/eal/eal_log.c (100%)
 create mode 100644 lib/librte_eal/osvapp/eal/eal_memory.cc
 create mode 100644 lib/librte_eal/osvapp/eal/eal_pci.cc
 copy lib/librte_eal/{linuxapp => osvapp}/eal/eal_thread.c (100%)
 create mode 100644 lib/librte_eal/osvapp/eal/eal_timer.c
 copy lib/librte_eal/{bsdapp =>

osvapp}/eal/include/exec-env/rte_interrupts.h (100%)

Quoted 3 lines
 copy mk/exec-env/{linuxapp => osvapp}/rte.app.mk (100%)
 copy mk/exec-env/{linuxapp => osvapp}/rte.vars.mk (95%)
Quoted 10 lines
Quoted 4 lines

--
2.1.0

I presume you intend for this to get merged during the 2.1 release?

Neil

Yes, I think it would be nice if it can merge for v2.1.

#22 lore raw

v2 cover add OSv support

In reply to a message not in the archive

This is 2nd version of OSv support patchset.

Changelist:
- Added "Capstan" build script for OSv
- Added Getting Started Guide for OSv
- Added rte_delay_us() on osvapp
- Added rte_eal_version.map

Takuya ASADA (8):
mk: support compiling C++ code
eal: Add extern C on eal_hugepages.h
eal: Add extern C on eal_thread.h
eal: Add extern C on eal_private.h
add OSv support
virtio: enable MSI-X on OSv
app/test: support OSv
doc: Add Getting Started Guide for OSv

 app/test/test_eal_flags.c                          |  34 +--
 app/test/test_timer_perf.c                         |   2 +-
 config/{common_linuxapp => common_osvapp}          |  24 +-
 ...xapp-gcc => defconfig_x86_64-native-osvapp-gcc} |   2 +-
 doc/guides/index.rst                               |   1 +
 doc/guides/osv_gsg/build_dpdk.rst                  | 276 ++++++++++++++++++
 doc/guides/osv_gsg/build_sample_apps.rst           | 123 ++++++++
 doc/guides/{freebsd_gsg => osv_gsg}/index.rst      |   3 +-
 doc/guides/{freebsd_gsg => osv_gsg}/intro.rst      |  15 +-
 lib/librte_eal/Makefile                            |   2 +
 lib/librte_eal/common/eal_hugepages.h              |   8 +
 lib/librte_eal/common/eal_private.h                |   8 +
 lib/librte_eal/common/eal_thread.h                 |   8 +
 Makefile => lib/librte_eal/osvapp/Makefile         |   5 +-
 lib/librte_eal/osvapp/capstan/Capstanfile          |   5 +
 lib/librte_eal/osvapp/capstan/GET                  |  22 ++
 lib/librte_eal/osvapp/eal/Makefile                 | 115 ++++++++
 lib/librte_eal/{linuxapp => osvapp}/eal/eal.c      | 123 +-------
 .../{linuxapp => osvapp}/eal/eal_alarm.c           |   0
 .../{linuxapp => osvapp}/eal/eal_debug.c           |   0
 lib/librte_eal/osvapp/eal/eal_hugepage_info.cc     |  63 +++++
 .../{bsdapp => osvapp}/eal/eal_interrupts.c        |   0
 .../eal/eal_lcore.c => osvapp/eal/eal_lcore.cc}    |  53 ++--
 lib/librte_eal/{bsdapp => osvapp}/eal/eal_log.c    |   0
 lib/librte_eal/osvapp/eal/eal_memory.cc            | 148 ++++++++++
 lib/librte_eal/osvapp/eal/eal_pci.cc               | 311 +++++++++++++++++++++
 .../{linuxapp => osvapp}/eal/eal_thread.c          |   0
 lib/librte_eal/osvapp/eal/eal_timer.c              | 130 +++++++++
 .../eal/include/exec-env/rte_interrupts.h          |   0
 .../{bsdapp => osvapp}/eal/rte_eal_version.map     |  11 +-
 lib/librte_pmd_virtio/virtio_ethdev.c              |  15 +-
 mk/exec-env/{linuxapp => osvapp}/rte.app.mk        |   0
 mk/exec-env/{linuxapp => osvapp}/rte.vars.mk       |   6 +-
 mk/internal/rte.compile-pre.mk                     |  41 ++-
 mk/target/generic/rte.vars.mk                      |   4 +
 mk/toolchain/gcc/rte.vars.mk                       |   5 +-
 36 files changed, 1353 insertions(+), 210 deletions(-)
 copy config/{common_linuxapp => common_osvapp} (96%)
 copy config/{defconfig_x86_64-native-linuxapp-gcc => defconfig_x86_64-native-osvapp-gcc} (98%)
 create mode 100644 doc/guides/osv_gsg/build_dpdk.rst
 create mode 100644 doc/guides/osv_gsg/build_sample_apps.rst
 copy doc/guides/{freebsd_gsg => osv_gsg}/index.rst (96%)
 copy doc/guides/{freebsd_gsg => osv_gsg}/intro.rst (84%)
 copy Makefile => lib/librte_eal/osvapp/Makefile (93%)
 create mode 100644 lib/librte_eal/osvapp/capstan/Capstanfile
 create mode 100755 lib/librte_eal/osvapp/capstan/GET
 create mode 100644 lib/librte_eal/osvapp/eal/Makefile
 copy lib/librte_eal/{linuxapp => osvapp}/eal/eal.c (87%)
 copy lib/librte_eal/{linuxapp => osvapp}/eal/eal_alarm.c (100%)
 copy lib/librte_eal/{linuxapp => osvapp}/eal/eal_debug.c (100%)
 create mode 100644 lib/librte_eal/osvapp/eal/eal_hugepage_info.cc
 copy lib/librte_eal/{bsdapp => osvapp}/eal/eal_interrupts.c (100%)
 copy lib/librte_eal/{bsdapp/eal/eal_lcore.c => osvapp/eal/eal_lcore.cc} (80%)
 copy lib/librte_eal/{bsdapp => osvapp}/eal/eal_log.c (100%)
 create mode 100644 lib/librte_eal/osvapp/eal/eal_memory.cc
 create mode 100644 lib/librte_eal/osvapp/eal/eal_pci.cc
 copy lib/librte_eal/{linuxapp => osvapp}/eal/eal_thread.c (100%)
 create mode 100644 lib/librte_eal/osvapp/eal/eal_timer.c
 copy lib/librte_eal/{bsdapp => osvapp}/eal/include/exec-env/rte_interrupts.h (100%)
 copy lib/librte_eal/{bsdapp => osvapp}/eal/rte_eal_version.map (92%)
 copy mk/exec-env/{linuxapp => osvapp}/rte.app.mk (100%)
 copy mk/exec-env/{linuxapp => osvapp}/rte.vars.mk (95%)
Signature · 1 line
2.1.0

A message that is not in the archive (sent off-list or not yet received): 1426908185-27940-1-git-send-email-syuu-RmZWMc9puTNJc61us3aD9laTQe2KTcn/@public.gmane.org

#24 lore raw

RFC PATCH v2 1/8 mk: support compiling C++ code

Since OSv is written in C++, we need to write OSv EAL in C++. To do so, we need to compile .cc files by $(CXX).

This patch does not contain diff for clang and icc, but OSv EAL does not supported these toolchain, this is enough for now.

---
 mk/internal/rte.compile-pre.mk | 41 ++++++++++++++++++++++++++++++++++++++---
 mk/target/generic/rte.vars.mk  |  4 ++++
 mk/toolchain/gcc/rte.vars.mk   |  5 ++++-
 3 files changed, 46 insertions(+), 4 deletions(-)
mk/internal/rte.compile-pre.mk +38 -3
index b9bff4a..142f996 100644
@@ -37,7 +37,7 @@ SRCS-all := $(SRCS-y) $(SRCS-n) $(SRCS-)
 
 # convert source to obj file
 src2obj = $(strip $(patsubst %.c,%.o,\
-	$(patsubst %.S,%_s.o,$(1))))
+	$(patsubst %.S,%_s.o,$(patsubst %.cc,%.o,$(1)))))
 
 # add a dot in front of the file name
 dotfile = $(strip $(foreach f,$(1),\
@@ -46,12 +46,12 @@ dotfile = $(strip $(foreach f,$(1),\
 # convert source/obj files into dot-dep filename (does not
 # include .S files)
 src2dep = $(strip $(call dotfile,$(patsubst %.c,%.o.d, \
-		$(patsubst %.S,,$(1)))))
+		$(patsubst %.S,,$(patsubst %.cc,%.o.d,$(1))))))
 obj2dep = $(strip $(call dotfile,$(patsubst %.o,%.o.d,$(1))))
 
 # convert source/obj files into dot-cmd filename
 src2cmd = $(strip $(call dotfile,$(patsubst %.c,%.o.cmd, \
-		$(patsubst %.S,%_s.o.cmd,$(1)))))
+		$(patsubst %.S,%_s.o.cmd,$(patsubst %.cc,%.o.cmd,$(1))))))
 obj2cmd = $(strip $(call dotfile,$(patsubst %.o,%.o.cmd,$(1))))
 
 OBJS-y := $(call src2obj,$(SRCS-y))
@@ -78,11 +78,19 @@ C_TO_O = $(HOSTCC) -Wp,-MD,$(call obj2dep,$(@)).tmp $(HOST_CFLAGS) \
 	$(CFLAGS_$(@)) $(HOST_EXTRA_CFLAGS) -o $@ -c $<
 C_TO_O_STR = $(subst ','\'',$(C_TO_O)) #'# fix syntax highlight
 C_TO_O_DISP = $(if $(V),"$(C_TO_O_STR)","  HOSTCC $(@)")
+CXX_TO_O = $(HOSTCXX) -Wp,-MD,$(call obj2dep,$(@)).tmp $(HOST_CXXFLAGS) \
+	$(CXXFLAGS_$(@)) $(HOST_EXTRA_CXXFLAGS) -o $@ -c $<
+CXX_TO_O_STR = $(subst ','\'',$(CXX_TO_O)) #'# fix syntax highlight
+CXX_TO_O_DISP = $(if $(V),"$(CXX_TO_O_STR)","  HOSTCXX $(@)")
 else
 C_TO_O = $(CC) -Wp,-MD,$(call obj2dep,$(@)).tmp $(CFLAGS) \
 	$(CFLAGS_$(@)) $(EXTRA_CFLAGS) -o $@ -c $<
 C_TO_O_STR = $(subst ','\'',$(C_TO_O)) #'# fix syntax highlight
 C_TO_O_DISP = $(if $(V),"$(C_TO_O_STR)","  CC $(@)")
+CXX_TO_O = $(CXX) -Wp,-MD,$(call obj2dep,$(@)).tmp $(CXXFLAGS) \
+	$(CXXFLAGS_$(@)) $(EXTRA_CXXFLAGS) -o $@ -c $<
+CXX_TO_O_STR = $(subst ','\'',$(CXX_TO_O)) #'# fix syntax highlight
+CXX_TO_O_DISP = $(if $(V),"$(CXX_TO_O_STR)","  CXX $(@)")
 endif
 C_TO_O_CMD = 'cmd_$@ = $(C_TO_O_STR)'
 C_TO_O_DO = @set -e; \
@@ -91,6 +99,13 @@ C_TO_O_DO = @set -e; \
 	echo $(C_TO_O_CMD) > $(call obj2cmd,$(@)) && \
 	sed 's,'$@':,dep_'$@' =,' $(call obj2dep,$(@)).tmp > $(call obj2dep,$(@)) && \
 	rm -f $(call obj2dep,$(@)).tmp
+CXX_TO_O_CMD = 'cmd_$@ = $(CXX_TO_O_STR)'
+CXX_TO_O_DO = @set -e; \
+	echo $(CXX_TO_O_DISP); \
+	$(CXX_TO_O) && \
+	echo $(CXX_TO_O_CMD) > $(call obj2cmd,$(@)) && \
+	sed 's,'$@':,dep_'$@' =,' $(call obj2dep,$(@)).tmp > $(call obj2dep,$(@)) && \
+	rm -f $(call obj2dep,$(@)).tmp
 
 # return an empty string if string are equal
 compare = $(strip $(subst $(1),,$(2)) $(subst $(2),,$(1)))
@@ -136,6 +151,26 @@ boolean = $(if $1,1,0)
 		$(depfile_missing),\
 		$(depfile_newer)),\
 		$(C_TO_O_DO))
+#
+# Compile .cc file if needed
+# Note: dep_$$@ is from the .d file and DEP_$$@ can be specified by
+# user (by default it is empty)
+#
+.SECONDEXPANSION:
+%.o: %.cc $$(wildcard $$(dep_$$@)) $$(DEP_$$(@)) FORCE
+	@[ -d $(dir $@) ] || mkdir -p $(dir $@)
+	$(if $(D),\
+		@echo -n "$< -> $@ " ; \
+		echo -n "file_missing=$(call boolean,$(file_missing)) " ; \
+		echo -n "cmdline_changed=$(call boolean,$(call cmdline_changed,$(CXX_TO_O))) " ; \
+		echo -n "depfile_missing=$(call boolean,$(depfile_missing)) " ; \
+		echo "depfile_newer=$(call boolean,$(depfile_newer))")
+	$(if $(or \
+		$(file_missing),\
+		$(call cmdline_changed,$(CXX_TO_O)),\
+		$(depfile_missing),\
+		$(depfile_newer)),\
+		$(CXX_TO_O_DO))
 
 # command to assemble a .S file to generate an object
 ifeq ($(USE_HOST),1)
mk/target/generic/rte.vars.mk +4 -0
index 53650c3..47d845b 100644
@@ -146,7 +146,11 @@ endif
 LDFLAGS += -L$(RTE_SDK_BIN)/lib
 endif
 
+# copy CFLAGS to CXXFLAGS
+CXXFLAGS := $(CFLAGS)
+
 export CFLAGS
 export LDFLAGS
+export CXXFLAGS
 
 endif
mk/toolchain/gcc/rte.vars.mk +4 -1
index 88f235c..4bdf2eb 100644
@@ -39,6 +39,7 @@
 #
 
 CC        = $(CROSS)gcc
+CXX       = $(CROSS)g++
 KERNELCC  = $(CROSS)gcc
 CPP       = $(CROSS)cpp
 # for now, we don't use as but nasm.
@@ -54,8 +55,10 @@ GCOV      = $(CROSS)gcov
 
 ifeq ("$(origin CC)", "command line")
 HOSTCC    = $(CC)
+HOSTCXX   = $(CXX)
 else
 HOSTCC    = gcc
+HOSTCXX   = gxx
 endif
 HOSTAS    = as
 
@@ -80,5 +83,5 @@ WERROR_FLAGS += -Wundef -Wwrite-strings
 # process cpu flags
 include $(RTE_SDK)/mk/toolchain/$(RTE_TOOLCHAIN)/rte.toolchain-compat.mk
 
-export CC AS AR LD OBJCOPY OBJDUMP STRIP READELF
+export CC CXX AS AR LD OBJCOPY OBJDUMP STRIP READELF
 export TOOLCHAIN_CFLAGS TOOLCHAIN_LDFLAGS TOOLCHAIN_ASFLAGS
Signature · 1 line
2.1.0
#25 lore raw

RFC PATCH v2 2/8 eal: Add extern C on eal_hugepages.h

In reply to a message not in the archive

This is required to link with OSv EAL.

---
 lib/librte_eal/common/eal_hugepages.h | 8 ++++++++
 1 file changed, 8 insertions(+)
lib/librte_eal/common/eal_hugepages.h +8 -0
index 38edac0..b722aee 100644
@@ -34,6 +34,10 @@
 #ifndef EAL_HUGEPAGES_H
 #define EAL_HUGEPAGES_H
 
+#ifdef __cplusplus
+extern "C" {
+#endif
+
 #include <stddef.h>
 #include <stdint.h>
 #include <limits.h>
@@ -64,4 +68,8 @@ struct hugepage_file {
  */
 int eal_hugepage_info_init(void);
 
+#ifdef __cplusplus
+}
+#endif
+
 #endif /* EAL_HUGEPAGES_H */
Signature · 1 line
2.1.0
#26 lore raw

RFC PATCH v2 3/8 eal: Add extern C on eal_thread.h

In reply to a message not in the archive

This is required to link with OSv EAL.

---
 lib/librte_eal/common/eal_thread.h | 8 ++++++++
 1 file changed, 8 insertions(+)
lib/librte_eal/common/eal_thread.h +8 -0
index e4e76b9..794137f 100644
@@ -34,6 +34,10 @@
 #ifndef EAL_THREAD_H
 #define EAL_THREAD_H
 
+#ifdef __cplusplus
+extern "C" {
+#endif
+
 #include <rte_lcore.h>
 
 /**
@@ -97,4 +101,8 @@ int eal_cpuset_socket_id(rte_cpuset_t *cpusetp);
 int
 eal_thread_dump_affinity(char *str, unsigned size);
 
+#ifdef __cplusplus
+}
+#endif
+
 #endif /* EAL_THREAD_H */
Signature · 1 line
2.1.0
#27 lore raw

RFC PATCH v2 4/8 eal: Add extern C on eal_private.h

In reply to a message not in the archive

This is required to link with OSv EAL.

---
 lib/librte_eal/common/eal_private.h | 8 ++++++++
 1 file changed, 8 insertions(+)
lib/librte_eal/common/eal_private.h +8 -0
index 4acf5a0..80b3d44 100644
@@ -34,6 +34,10 @@
 #ifndef _EAL_PRIVATE_H_
 #define _EAL_PRIVATE_H_
 
+#ifdef __cplusplus
+extern "C" {
+#endif
+
 #include <stdio.h>
 
 /**
@@ -232,4 +236,8 @@ int rte_eal_dev_init(void);
  */
 int rte_eal_check_module(const char *module_name);
 
+#ifdef __cplusplus
+}
+#endif
+
 #endif /* _EAL_PRIVATE_H_ */
Signature · 1 line
2.1.0
#28 lore raw

RFC PATCH v2 5/8 add OSv support

In reply to a message not in the archive

Adding OSv support.
Based on Linux/FreeBSD EAL, but calling OSv kernel APIs to access devices, allocate contiguous memory, etc.

---
 config/{common_linuxapp => common_osvapp}          |  24 +-
 ...xapp-gcc => defconfig_x86_64-native-osvapp-gcc} |   2 +-
 lib/librte_eal/Makefile                            |   2 +
 Makefile => lib/librte_eal/osvapp/Makefile         |   5 +-
 lib/librte_eal/osvapp/capstan/Capstanfile          |   5 +
 lib/librte_eal/osvapp/capstan/GET                  |  22 ++
 lib/librte_eal/osvapp/eal/Makefile                 | 115 ++++++++
 lib/librte_eal/{linuxapp => osvapp}/eal/eal.c      | 123 +-------
 .../{linuxapp => osvapp}/eal/eal_alarm.c           |   0
 .../{linuxapp => osvapp}/eal/eal_debug.c           |   0
 lib/librte_eal/osvapp/eal/eal_hugepage_info.cc     |  63 +++++
 .../{bsdapp => osvapp}/eal/eal_interrupts.c        |   0
 .../eal/eal_lcore.c => osvapp/eal/eal_lcore.cc}    |  53 ++--
 lib/librte_eal/{bsdapp => osvapp}/eal/eal_log.c    |   0
 lib/librte_eal/osvapp/eal/eal_memory.cc            | 148 ++++++++++
 lib/librte_eal/osvapp/eal/eal_pci.cc               | 311 +++++++++++++++++++++
 .../{linuxapp => osvapp}/eal/eal_thread.c          |   0
 lib/librte_eal/osvapp/eal/eal_timer.c              | 130 +++++++++
 .../eal/include/exec-env/rte_interrupts.h          |   0
 .../{bsdapp => osvapp}/eal/rte_eal_version.map     |  11 +-
 mk/exec-env/{linuxapp => osvapp}/rte.app.mk        |   0
 mk/exec-env/{linuxapp => osvapp}/rte.vars.mk       |   6 +-
 22 files changed, 847 insertions(+), 173 deletions(-)
 copy config/{common_linuxapp => common_osvapp} (96%)
 copy config/{defconfig_x86_64-native-linuxapp-gcc => defconfig_x86_64-native-osvapp-gcc} (98%)
 copy Makefile => lib/librte_eal/osvapp/Makefile (93%)
 create mode 100644 lib/librte_eal/osvapp/capstan/Capstanfile
 create mode 100755 lib/librte_eal/osvapp/capstan/GET
 create mode 100644 lib/librte_eal/osvapp/eal/Makefile
 copy lib/librte_eal/{linuxapp => osvapp}/eal/eal.c (87%)
 copy lib/librte_eal/{linuxapp => osvapp}/eal/eal_alarm.c (100%)
 copy lib/librte_eal/{linuxapp => osvapp}/eal/eal_debug.c (100%)
 create mode 100644 lib/librte_eal/osvapp/eal/eal_hugepage_info.cc
 copy lib/librte_eal/{bsdapp => osvapp}/eal/eal_interrupts.c (100%)
 copy lib/librte_eal/{bsdapp/eal/eal_lcore.c => osvapp/eal/eal_lcore.cc} (80%)
 copy lib/librte_eal/{bsdapp => osvapp}/eal/eal_log.c (100%)
 create mode 100644 lib/librte_eal/osvapp/eal/eal_memory.cc
 create mode 100644 lib/librte_eal/osvapp/eal/eal_pci.cc
 copy lib/librte_eal/{linuxapp => osvapp}/eal/eal_thread.c (100%)
 create mode 100644 lib/librte_eal/osvapp/eal/eal_timer.c
 copy lib/librte_eal/{bsdapp => osvapp}/eal/include/exec-env/rte_interrupts.h (100%)
 copy lib/librte_eal/{bsdapp => osvapp}/eal/rte_eal_version.map (92%)
 copy mk/exec-env/{linuxapp => osvapp}/rte.app.mk (100%)
 copy mk/exec-env/{linuxapp => osvapp}/rte.vars.mk (95%)
config/common_osvapp renamed from config/common_linuxapp +14 -10
similarity index 96%
copy from config/common_linuxapp
copy to config/common_osvapp
index 09a58ac..ce973fe 100644
@@ -35,8 +35,8 @@
 #
 # CONFIG_RTE_EXEC_ENV can be linuxapp, bsdapp
 #
-CONFIG_RTE_EXEC_ENV="linuxapp"
-CONFIG_RTE_EXEC_ENV_LINUXAPP=y
+CONFIG_RTE_EXEC_ENV="osvapp"
+CONFIG_RTE_EXEC_ENV_OSVAPP=y
 
 ##
 ## machine can define specific variables or action for a specific board
@@ -89,7 +89,7 @@ CONFIG_RTE_LIBNAME="intel_dpdk"
 #
 CONFIG_RTE_LIBRTE_EAL=y
 CONFIG_RTE_MAX_LCORE=128
-CONFIG_RTE_MAX_NUMA_NODES=8
+CONFIG_RTE_MAX_NUMA_NODES=1
 CONFIG_RTE_MAX_MEMSEG=256
 CONFIG_RTE_MAX_MEMZONE=2560
 CONFIG_RTE_MAX_TAILQ=32
@@ -98,8 +98,8 @@ CONFIG_RTE_LOG_HISTORY=256
 CONFIG_RTE_LIBEAL_USE_HPET=n
 CONFIG_RTE_EAL_ALLOW_INV_SOCKET_ID=n
 CONFIG_RTE_EAL_ALWAYS_PANIC_ON_ERROR=n
-CONFIG_RTE_EAL_IGB_UIO=y
-CONFIG_RTE_EAL_VFIO=y
+CONFIG_RTE_EAL_IGB_UIO=n
+CONFIG_RTE_EAL_VFIO=n
 
 #
 # Special configurations in PCI Config Space for high performance
@@ -111,7 +111,13 @@ CONFIG_RTE_PCI_MAX_READ_REQUEST_SIZE=0
 #
 # Compile Environment Abstraction Layer for linux
 #
-CONFIG_RTE_LIBRTE_EAL_LINUXAPP=y
+CONFIG_RTE_LIBRTE_EAL_OSVAPP=y
+
+#
+# Compile OSv specific parameters
+#
+CONFIG_RTE_CONTIGUOUS_CHUNK_SIZE=32M
+CONFIG_RTE_DEFAULT_NUM_CHUNKS=4
 
 #
 # Compile Environment Abstraction Layer to support hotplug
@@ -403,7 +409,7 @@ CONFIG_RTE_LIBRTE_PIPELINE=y
 #
 # Compile librte_kni
 #
-CONFIG_RTE_LIBRTE_KNI=y
+CONFIG_RTE_LIBRTE_KNI=n
 CONFIG_RTE_KNI_PREEMPT_DEFAULT=y
 CONFIG_RTE_KNI_KO_DEBUG=n
 CONFIG_RTE_KNI_VHOST=n
@@ -414,12 +420,10 @@ CONFIG_RTE_KNI_VHOST_DEBUG_TX=n
 
 #
 # Compile vhost library
-# fuse-devel is needed to run vhost-cuse.
+# fuse-devel is needed to run vhost.
 # fuse-devel enables user space char driver development
-# vhost-user is turned on by default.
 #
 CONFIG_RTE_LIBRTE_VHOST=n
-CONFIG_RTE_LIBRTE_VHOST_USER=y
 CONFIG_RTE_LIBRTE_VHOST_DEBUG=n
 
 #
config/defconfig_x86_64-native-osvapp-gcc renamed from config/defconfig_x86_64-native-linuxapp-gcc +1 -1
similarity index 98%
copy from config/defconfig_x86_64-native-linuxapp-gcc
copy to config/defconfig_x86_64-native-osvapp-gcc
index 60baf5b..2134270 100644
@@ -30,7 +30,7 @@
 #   OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 #
 
-#include "common_linuxapp"
+#include "common_osvapp"
 
 CONFIG_RTE_MACHINE="native"
 
lib/librte_eal/Makefile +2 -0
index 69003cf..c555587 100644
@@ -35,5 +35,7 @@ DIRS-$(CONFIG_RTE_LIBRTE_EAL_LINUXAPP) += common
 DIRS-$(CONFIG_RTE_LIBRTE_EAL_LINUXAPP) += linuxapp
 DIRS-$(CONFIG_RTE_LIBRTE_EAL_BSDAPP) += common
 DIRS-$(CONFIG_RTE_LIBRTE_EAL_BSDAPP) += bsdapp
+DIRS-$(CONFIG_RTE_LIBRTE_EAL_OSVAPP) += common
+DIRS-$(CONFIG_RTE_LIBRTE_EAL_OSVAPP) += osvapp
 
 include $(RTE_SDK)/mk/rte.subdir.mk
lib/librte_eal/osvapp/Makefile renamed from Makefile +4 -1
similarity index 93%
copy from Makefile
copy to lib/librte_eal/osvapp/Makefile
index f4b807e..15badb3 100644
@@ -29,5 +29,8 @@
 #   (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
 #   OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 
-.error Error please compile using GNU Make (gmake)
+include $(RTE_SDK)/mk/rte.vars.mk
 
+DIRS-$(CONFIG_RTE_LIBRTE_EAL_OSVAPP) += eal
+
+include $(RTE_SDK)/mk/rte.subdir.mk
lib/librte_eal/osvapp/capstan/Capstanfile new file +5 -0
new file mode 100644
index 0000000..c03480d
@@ -0,0 +1,5 @@
+base: cloudius/osv-base
+
+cmdline: /test -c 1 -n 1 --no-shconf
+
+build: ./GET
lib/librte_eal/osvapp/capstan/GET new file +22 -0
new file mode 100755
index 0000000..891fab6
@@ -0,0 +1,22 @@
+#!/bin/sh -e
+
+export RTE_SDK=`readlink -f ../../../..`
+export RTE_TARGET=x86_64-native-osvapp-gcc
+OSV_SDK=`readlink -f osv`
+OSV_VER=v0.18
+
+if [ ! -e $OSV_SDK ]; then
+    git clone -b $OSV_VER --depth 1 https://github.com/cloudius-systems/osv
+fi
+cd $RTE_SDK 
+make install T=$RTE_TARGET OSV_SDK=$OSV_SDK
+(cd examples/cmdline; make)
+(cd examples/helloworld; make)
+(cd examples/ip_fragmentation; make)
+(cd examples/l2fwd; make)
+(cd examples/l3fwd; make)
+cd -
+mkdir -p ROOTFS
+find $RTE_SDK/x86_64-native-osvapp-gcc/app/ -executable -readable -type f -exec cp -v {} ROOTFS/ \;
+find $RTE_SDK/examples/*/build/app -executable -readable -type f -exec cp -v {} ROOTFS/ \;
+find $RTE_SDK/x86_64-native-osvapp-gcc/lib/ -name "*.so*" -exec cp -av {} ROOTFS/ \;
lib/librte_eal/osvapp/eal/Makefile new file +115 -0

115 lines not on this page · raw message

lib/librte_eal/osvapp/eal/eal.c renamed from lib/librte_eal/linuxapp/eal/eal.c +3 -120

196 lines not on this page · raw message

lib/librte_eal/osvapp/eal/eal_alarm.c renamed from lib/librte_eal/linuxapp/eal/eal_alarm.c +0 -0
similarity index 100%
copy from lib/librte_eal/linuxapp/eal/eal_alarm.c
copy to lib/librte_eal/osvapp/eal/eal_alarm.c
lib/librte_eal/osvapp/eal/eal_debug.c renamed from lib/librte_eal/linuxapp/eal/eal_debug.c +0 -0
similarity index 100%
copy from lib/librte_eal/linuxapp/eal/eal_debug.c
copy to lib/librte_eal/osvapp/eal/eal_debug.c
lib/librte_eal/osvapp/eal/eal_hugepage_info.cc new file +63 -0

63 lines not on this page · raw message

lib/librte_eal/osvapp/eal/eal_interrupts.c renamed from lib/librte_eal/bsdapp/eal/eal_interrupts.c +0 -0
similarity index 100%
copy from lib/librte_eal/bsdapp/eal/eal_interrupts.c
copy to lib/librte_eal/osvapp/eal/eal_interrupts.c
lib/librte_eal/osvapp/eal/eal_lcore.cc renamed from lib/librte_eal/bsdapp/eal/eal_lcore.c +23 -30

100 lines not on this page · raw message

lib/librte_eal/osvapp/eal/eal_log.c renamed from lib/librte_eal/bsdapp/eal/eal_log.c +0 -0
similarity index 100%
copy from lib/librte_eal/bsdapp/eal/eal_log.c
copy to lib/librte_eal/osvapp/eal/eal_log.c
lib/librte_eal/osvapp/eal/eal_memory.cc new file +148 -0

148 lines not on this page · raw message

lib/librte_eal/osvapp/eal/eal_pci.cc new file +311 -0

311 lines not on this page · raw message

lib/librte_eal/osvapp/eal/eal_thread.c renamed from lib/librte_eal/linuxapp/eal/eal_thread.c +0 -0
similarity index 100%
copy from lib/librte_eal/linuxapp/eal/eal_thread.c
copy to lib/librte_eal/osvapp/eal/eal_thread.c
lib/librte_eal/osvapp/eal/eal_timer.c new file +130 -0

130 lines not on this page · raw message

lib/librte_eal/osvapp/eal/include/exec-env/rte_interrupts.h renamed from lib/librte_eal/bsdapp/eal/include/exec-env/rte_interrupts.h +0 -0
similarity index 100%
copy from lib/librte_eal/bsdapp/eal/include/exec-env/rte_interrupts.h
copy to lib/librte_eal/osvapp/eal/include/exec-env/rte_interrupts.h
lib/librte_eal/osvapp/eal/rte_eal_version.map renamed from lib/librte_eal/bsdapp/eal/rte_eal_version.map +5 -6
similarity index 92%
copy from lib/librte_eal/bsdapp/eal/rte_eal_version.map
copy to lib/librte_eal/osvapp/eal/rte_eal_version.map
index 67b6a6c..ebb584a 100644
@@ -31,24 +31,26 @@ DPDK_2.0 {
 	rte_eal_get_physmem_layout;
 	rte_eal_get_physmem_size;
 	rte_eal_has_hugepages;
-	rte_eal_hpet_init;
 	rte_eal_init;
 	rte_eal_iopl_init;
 	rte_eal_lcore_role;
 	rte_eal_mp_remote_launch;
 	rte_eal_mp_wait_lcore;
+	rte_eal_parse_devargs_str;
+	rte_eal_pci_close_one;
 	rte_eal_pci_dump;
 	rte_eal_pci_probe;
+	rte_eal_pci_probe_one;
 	rte_eal_pci_register;
 	rte_eal_pci_unregister;
 	rte_eal_process_type;
 	rte_eal_remote_launch;
 	rte_eal_tailq_lookup;
 	rte_eal_tailq_register;
+	rte_eal_vdev_init;
+	rte_eal_vdev_uninit;
 	rte_eal_wait_lcore;
 	rte_exit;
-	rte_get_hpet_cycles;
-	rte_get_hpet_hz;
 	rte_get_tsc_hz;
 	rte_hexdump;
 	rte_intr_callback_register;
@@ -86,9 +88,6 @@ DPDK_2.0 {
 	rte_thread_get_affinity;
 	rte_thread_set_affinity;
 	rte_vlog;
-	rte_xen_dom0_memory_attach;
-	rte_xen_dom0_memory_init;
-	test_mp_secondary;
 
 	local: *;
 };
mk/exec-env/osvapp/rte.app.mk renamed from mk/exec-env/linuxapp/rte.app.mk +0 -0
similarity index 100%
copy from mk/exec-env/linuxapp/rte.app.mk
copy to mk/exec-env/osvapp/rte.app.mk
mk/exec-env/osvapp/rte.vars.mk renamed from mk/exec-env/linuxapp/rte.vars.mk +1 -5
similarity index 95%
copy from mk/exec-env/linuxapp/rte.vars.mk
copy to mk/exec-env/osvapp/rte.vars.mk
index e5af318..db0f115 100644
@@ -39,11 +39,7 @@
 #
 # examples for RTE_EXEC_ENV: linuxapp, bsdapp
 #
-ifeq ($(RTE_BUILD_SHARED_LIB),y)
-EXECENV_CFLAGS  = -pthread -fPIC
-else
-EXECENV_CFLAGS  = -pthread
-endif
+EXECENV_CFLAGS  = -pthread -fPIC -shared
 
 # Workaround lack of DT_NEEDED entry
 EXECENV_LDFLAGS = --no-as-needed
Signature · 1 line
2.1.0

A message that is not in the archive (sent off-list or not yet received): 1426908185-27940-6-git-send-email-syuu-RmZWMc9puTNJc61us3aD9laTQe2KTcn/@public.gmane.org

#30 lore raw
Quoted 47 lines · Takuya ASADA

Adding OSv support.
Based on Linux/FreeBSD EAL, but calling OSv kernel APIs to access devices, allocate contiguous memory, etc.

---

lib/librte_eal/osvapp/eal/include/exec-env/rte_interrupts.h renamed from lib/librte_eal/bsdapp/eal/include/exec-env/rte_interrupts.h +0 -0
similarity index 100%
copy from lib/librte_eal/bsdapp/eal/include/exec-env/rte_interrupts.h
copy to lib/librte_eal/osvapp/eal/include/exec-env/rte_interrupts.h
lib/librte_eal/osvapp/eal/rte_eal_version.map renamed from lib/librte_eal/bsdapp/eal/rte_eal_version.map +5 -3
similarity index 92%
copy from lib/librte_eal/bsdapp/eal/rte_eal_version.map
copy to lib/librte_eal/osvapp/eal/rte_eal_version.map
index 67b6a6c..ebb584a 100644
@@ -31,24 +31,26 @@ DPDK_2.0 {
 	rte_eal_get_physmem_layout;
 	rte_eal_get_physmem_size;
 	rte_eal_has_hugepages;
-	rte_eal_hpet_init;
 	rte_eal_init;
 	rte_eal_iopl_init;
 	rte_eal_lcore_role;
 	rte_eal_mp_remote_launch;
 	rte_eal_mp_wait_lcore;
+	rte_eal_parse_devargs_str;
+	rte_eal_pci_close_one;
 	rte_eal_pci_dump;
 	rte_eal_pci_probe;
+	rte_eal_pci_probe_one;
 	rte_eal_pci_register;
 	rte_eal_pci_unregister;
 	rte_eal_process_type;
 	rte_eal_remote_launch;
 	rte_eal_tailq_lookup;
 	rte_eal_tailq_register;
+	rte_eal_vdev_init;
+	rte_eal_vdev_uninit;
 	rte_eal_wait_lcore;
 	rte_exit;
-	rte_get_hpet_cycles;
-	rte_get_hpet_hz;
 	rte_get_tsc_hz;
 	rte_hexdump;
 	rte_intr_callback_register;

lib/librte_eal/osvapp/eal/rte_eal_version.map DPDK_2.0 { · line 91

Quoted 7 lines
lib/librte_eal/osvapp/eal/rte_eal_version.map renamed from lib/librte_eal/bsdapp/eal/rte_eal_version.map +0 -3
@@ -86,9 +88,6 @@ DPDK_2.0 {
 	rte_thread_get_affinity;
 	rte_thread_set_affinity;
 	rte_vlog;
-	rte_xen_dom0_memory_attach;
-	rte_xen_dom0_memory_init;
-	test_mp_secondary;
 

I understand removing symbols that you don't support, but why are you adding the vdev, pci and parsing symbols? I don't see you using them anywhere in your code...

Neil

A message that is not in the archive (sent off-list or not yet received): 20150324135252.GA11053-B26myB8xz7F8NnZeBjwnZQMhkBWG/[email protected]

#32 lore raw
Quoted 54 lines · Neil Horman
Quoted 2 lines · Takuya ASADA

Adding OSv support.
Based on Linux/FreeBSD EAL, but calling OSv kernel APIs to access

devices, allocate contiguous memory, etc.

Review

Quoted 4 lines

---

(quoted diff) +0 -0

b/lib/librte_eal/osvapp/eal/include/exec-env/rte_interrupts.h

Review

Quoted 4 lines

similarity index 100%
copy from lib/librte_eal/bsdapp/eal/include/exec-env/rte_interrupts.h copy to lib/librte_eal/osvapp/eal/include/exec-env/rte_interrupts.h

(quoted diff) +0 -0

b/lib/librte_eal/osvapp/eal/rte_eal_version.map

Quoted 40 lines

similarity index 92%
copy from lib/librte_eal/bsdapp/eal/rte_eal_version.map copy to lib/librte_eal/osvapp/eal/rte_eal_version.map index 67b6a6c..ebb584a 100644

lib/librte_eal/osvapp/eal/rte_eal_version.map renamed from lib/librte_eal/bsdapp/eal/rte_eal_version.map +5 -3
@@ -31,24 +31,26 @@ DPDK_2.0 {
      rte_eal_get_physmem_layout;
      rte_eal_get_physmem_size;
      rte_eal_has_hugepages;
-     rte_eal_hpet_init;
      rte_eal_init;
      rte_eal_iopl_init;
      rte_eal_lcore_role;
      rte_eal_mp_remote_launch;
      rte_eal_mp_wait_lcore;
+     rte_eal_parse_devargs_str;
+     rte_eal_pci_close_one;
      rte_eal_pci_dump;
      rte_eal_pci_probe;
+     rte_eal_pci_probe_one;
      rte_eal_pci_register;
      rte_eal_pci_unregister;
      rte_eal_process_type;
      rte_eal_remote_launch;
      rte_eal_tailq_lookup;
      rte_eal_tailq_register;
+     rte_eal_vdev_init;
+     rte_eal_vdev_uninit;
      rte_eal_wait_lcore;
      rte_exit;
-     rte_get_hpet_cycles;
-     rte_get_hpet_hz;
      rte_get_tsc_hz;
      rte_hexdump;
      rte_intr_callback_register;
@@ -86,9 +88,6 @@ DPDK_2.0 {
      rte_thread_get_affinity;
      rte_thread_set_affinity;
      rte_vlog;
Quoted 9 lines

lib/librte_eal/osvapp/eal/rte_eal_version.map DPDK_2.0 { · line 91

Quoted 4 lines
lib/librte_eal/osvapp/eal/rte_eal_version.map renamed from lib/librte_eal/bsdapp/eal/rte_eal_version.map +0 -3
-     rte_xen_dom0_memory_attach;
-     rte_xen_dom0_memory_init;
-     test_mp_secondary;
 

I understand removing symbols that you don't support, but why are you adding the
vdev, pci and parsing symbols? I don't see you using them anywhere in your code...

This was because I copied rte_eal_version.map from linuxapp, but git format-patch generated diff from bsdapp.
But osvapp don't have these symbols, so I dropped these lines. Please check v3 patchset which I just posted.

Quoted 3 lines

Neil

#33 lore raw

RFC PATCH v2 6/8 virtio: enable MSI-X on OSv

In reply to a message not in the archive

Add support OSv EAL.

---
 lib/librte_pmd_virtio/virtio_ethdev.c | 15 ++++++++++++++-
 1 file changed, 14 insertions(+), 1 deletion(-)
lib/librte_pmd_virtio/virtio_ethdev.c +14 -1
index 603be2d..fed65f3 100644
@@ -1055,7 +1055,20 @@ static int virtio_resource_init(struct rte_pci_device *pci_dev)
 		return virtio_resource_init_by_ioports(pci_dev);
 }
 
-#else
+#elif defined(RTE_EXEC_ENV_OSVAPP)
+static int
+virtio_has_msix(const struct rte_pci_addr *loc __rte_unused)
+{
+	/* TODO: ask to OSv this NIC has MSI-X */
+	return 1;
+}
+
+static int virtio_resource_init(struct rte_pci_device *pci_dev __rte_unused)
+{
+	/* no setup required */
+	return 0;
+}
+#else /* BSD */
 static int
 virtio_has_msix(const struct rte_pci_addr *loc __rte_unused)
 {
Signature · 1 line
2.1.0
#34 lore raw

RFC PATCH v2 7/8 app/test: support OSv

In reply to a message not in the archive

Add support OSv EAL.

---
 app/test/test_eal_flags.c  | 34 +++++++++++++++++-----------------
 app/test/test_timer_perf.c |  2 +-
 2 files changed, 18 insertions(+), 18 deletions(-)
app/test/test_eal_flags.c +17 -17
index 0352f87..40a5c7e 100644
@@ -287,7 +287,7 @@ static int
 test_whitelist_flag(void)
 {
 	unsigned i;
-#ifdef RTE_EXEC_ENV_BSDAPP
+#if defined(RTE_EXEC_ENV_BSDAPP) || defined(RTE_EXEC_ENV_OSVAPP)
 	/* BSD target doesn't support prefixes at this point */
 	const char * prefix = "";
 #else
@@ -353,7 +353,7 @@ test_whitelist_flag(void)
 static int
 test_invalid_b_flag(void)
 {
-#ifdef RTE_EXEC_ENV_BSDAPP
+#if defined(RTE_EXEC_ENV_BSDAPP) || defined(RTE_EXEC_ENV_OSVAPP)
 	/* BSD target doesn't support prefixes at this point */
 	const char * prefix = "";
 #else
@@ -400,7 +400,7 @@ test_invalid_b_flag(void)
 static int
 test_invalid_vdev_flag(void)
 {
-#ifdef RTE_EXEC_ENV_BSDAPP
+#if defined(RTE_EXEC_ENV_BSDAPP) || defined(RTE_EXEC_ENV_OSVAPP)
 	/* BSD target doesn't support prefixes at this point, and we also need to
 	 * run another primary process here */
 	const char * prefix = no_shconf;
@@ -454,7 +454,7 @@ test_invalid_vdev_flag(void)
 static int
 test_invalid_r_flag(void)
 {
-#ifdef RTE_EXEC_ENV_BSDAPP
+#if defined(RTE_EXEC_ENV_BSDAPP) || defined(RTE_EXEC_ENV_OSVAPP)
 	/* BSD target doesn't support prefixes at this point */
 	const char * prefix = "";
 #else
@@ -498,7 +498,7 @@ test_invalid_r_flag(void)
 static int
 test_missing_c_flag(void)
 {
-#ifdef RTE_EXEC_ENV_BSDAPP
+#if defined(RTE_EXEC_ENV_BSDAPP) || defined(RTE_EXEC_ENV_OSVAPP)
 	/* BSD target doesn't support prefixes at this point */
 	const char * prefix = "";
 #else
@@ -629,7 +629,7 @@ test_missing_c_flag(void)
 static int
 test_master_lcore_flag(void)
 {
-#ifdef RTE_EXEC_ENV_BSDAPP
+#if defined(RTE_EXEC_ENV_BSDAPP) || defined(RTE_EXEC_ENV_OSVAPP)
 	/* BSD target doesn't support prefixes at this point */
 	const char *prefix = "";
 #else
@@ -677,7 +677,7 @@ test_master_lcore_flag(void)
 static int
 test_missing_n_flag(void)
 {
-#ifdef RTE_EXEC_ENV_BSDAPP
+#if defined(RTE_EXEC_ENV_BSDAPP) || defined(RTE_EXEC_ENV_OSVAPP)
 	/* BSD target doesn't support prefixes at this point */
 	const char * prefix = "";
 #else
@@ -722,7 +722,7 @@ test_no_hpet_flag(void)
 {
 	char prefix[PATH_MAX], tmp[PATH_MAX];
 
-#ifdef RTE_EXEC_ENV_BSDAPP
+#if defined(RTE_EXEC_ENV_BSDAPP) || defined(RTE_EXEC_ENV_OSVAPP)
 	return 0;
 #endif
 	if (get_current_prefix(tmp, sizeof(tmp)) == NULL) {
@@ -754,7 +754,7 @@ test_no_hpet_flag(void)
 static int
 test_no_huge_flag(void)
 {
-#ifdef RTE_EXEC_ENV_BSDAPP
+#if defined(RTE_EXEC_ENV_BSDAPP) || defined(RTE_EXEC_ENV_OSVAPP)
 	/* BSD target doesn't support prefixes at this point, and we also need to
 	 * run another primary process here */
 	const char * prefix = no_shconf;
@@ -782,7 +782,7 @@ test_no_huge_flag(void)
 		printf("Error - process run ok with --no-huge and -m flags\n");
 		return -1;
 	}
-#ifdef RTE_EXEC_ENV_BSDAPP
+#if defined(RTE_EXEC_ENV_BSDAPP) || defined(RTE_EXEC_ENV_OSVAPP)
 	/* BSD target does not support NUMA, hence no --socket-mem tests */
 	return 0;
 #endif
@@ -870,7 +870,7 @@ static int
 test_misc_flags(void)
 {
 	char hugepath[PATH_MAX] = {0};
-#ifdef RTE_EXEC_ENV_BSDAPP
+#if defined(RTE_EXEC_ENV_BSDAPP) || defined(RTE_EXEC_ENV_OSVAPP)
 	/* BSD target doesn't support prefixes at this point */
 	const char * prefix = "";
 	const char * nosh_prefix = "";
@@ -942,7 +942,7 @@ test_misc_flags(void)
 	const char *argv6[] = {prgname, "-c", "1", "-n", "2", "-m", DEFAULT_MEM_SIZE,
 			no_shconf, nosh_prefix };
 
-#ifdef RTE_EXEC_ENV_BSDAPP
+#if defined(RTE_EXEC_ENV_BSDAPP) || defined(RTE_EXEC_ENV_OSVAPP)
 	return 0;
 #endif
 	/* With --huge-dir */
@@ -1007,7 +1007,7 @@ test_misc_flags(void)
 		printf("Error - process did not run ok with --no-shconf flag\n");
 		return -1;
 	}
-#ifdef RTE_EXEC_ENV_BSDAPP
+#if defined(RTE_EXEC_ENV_BSDAPP) || defined(RTE_EXEC_ENV_OSVAPP)
 	return 0;
 #endif
 	if (launch_proc(argv7) != 0) {
@@ -1068,7 +1068,7 @@ test_file_prefix(void)
 	 * 7. check that only memtest2 hugefiles are present in the hugedir
 	 */
 
-#ifdef RTE_EXEC_ENV_BSDAPP
+#if defined(RTE_EXEC_ENV_BSDAPP) || defined(RTE_EXEC_ENV_OSVAPP)
 	return 0;
 #endif
 
@@ -1175,7 +1175,7 @@ test_file_prefix(void)
 static int
 test_memory_flags(void)
 {
-#ifdef RTE_EXEC_ENV_BSDAPP
+#if defined(RTE_EXEC_ENV_BSDAPP) || defined(RTE_EXEC_ENV_OSVAPP)
 	/* BSD target doesn't support prefixes at this point */
 	const char * prefix = "";
 #else
@@ -1228,7 +1228,7 @@ test_memory_flags(void)
 	char invalid_socket_mem[SOCKET_MEM_STRLEN];
 	char buf[SOCKET_MEM_STRLEN];	/* to avoid copying string onto itself */
 
-#ifdef RTE_EXEC_ENV_BSDAPP
+#if defined(RTE_EXEC_ENV_BSDAPP) || defined(RTE_EXEC_ENV_OSVAPP)
 	int i, num_sockets = 1;
 #else
 	int i, num_sockets = get_number_of_sockets();
@@ -1281,7 +1281,7 @@ test_memory_flags(void)
 		return -1;
 	}
 
-#ifdef RTE_EXEC_ENV_BSDAPP
+#if defined(RTE_EXEC_ENV_BSDAPP) || defined(RTE_EXEC_ENV_OSVAPP)
 	/* no other tests are applicable to BSD */
 	return 0;
 #endif
app/test/test_timer_perf.c +1 -1
index 3f7ddd3..1edffa8 100644
@@ -55,7 +55,7 @@ timer_cb(struct rte_timer *t __rte_unused, void *param __rte_unused)
 
 #define DELAY_SECONDS 1
 
-#ifdef RTE_EXEC_ENV_LINUXAPP
+#if defined(RTE_EXEC_ENV_LINUXAPP) || defined(RTE_EXEC_ENV_OSVAPP)
 #define do_delay() usleep(10)
 #else
 #define do_delay() rte_pause()
Signature · 1 line
2.1.0
#35 lore raw

RFC PATCH v2 8/8 doc: Add Getting Started Guide for OSv

In reply to a message not in the archive

Described how to build DPDK for OSv, using "Capstan".

---
 doc/guides/index.rst                          |   1 +
 doc/guides/osv_gsg/build_dpdk.rst             | 276 ++++++++++++++++++++++++++
 doc/guides/osv_gsg/build_sample_apps.rst      | 123 ++++++++++++
 doc/guides/{freebsd_gsg => osv_gsg}/index.rst |   3 +-
 doc/guides/{freebsd_gsg => osv_gsg}/intro.rst |  15 +-
 5 files changed, 404 insertions(+), 14 deletions(-)
 create mode 100644 doc/guides/osv_gsg/build_dpdk.rst
 create mode 100644 doc/guides/osv_gsg/build_sample_apps.rst
 copy doc/guides/{freebsd_gsg => osv_gsg}/index.rst (96%)
 copy doc/guides/{freebsd_gsg => osv_gsg}/intro.rst (84%)
doc/guides/index.rst +1 -0
index c589a30..66a44f9 100644
@@ -39,6 +39,7 @@ Contents:
 
    linux_gsg/index
    freebsd_gsg/index
+   osv_gsg/index
    prog_guide/index
    sample_app_ug/index
    testpmd_app_ug/index
doc/guides/osv_gsg/build_dpdk.rst new file +276 -0

276 lines not on this page · raw message

doc/guides/osv_gsg/build_sample_apps.rst new file +123 -0

123 lines not on this page · raw message

doc/guides/osv_gsg/index.rst renamed from doc/guides/freebsd_gsg/index.rst +1 -2
similarity index 96%
copy from doc/guides/freebsd_gsg/index.rst
copy to doc/guides/osv_gsg/index.rst
index 1b4cd3b..46ffb3e 100644
@@ -28,7 +28,7 @@
     (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
     OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 
-Getting Started Guide for FreeBSD
+Getting Started Guide for OSv 
 =================================
 
 |today|
@@ -40,6 +40,5 @@ Getting Started Guide for FreeBSD
     :numbered:
 
     intro
-    install_from_ports
     build_dpdk
     build_sample_apps
doc/guides/osv_gsg/intro.rst renamed from doc/guides/freebsd_gsg/intro.rst +3 -12
similarity index 84%
copy from doc/guides/freebsd_gsg/intro.rst
copy to doc/guides/osv_gsg/intro.rst
index 176358a..bc7c3ba 100644
@@ -34,20 +34,11 @@ Introduction
 This document contains instructions for installing and configuring the
 Data Plane Development Kit (DPDK) software. It is designed to get customers
 up and running quickly and describes how to compile and run a
-DPDK application in a FreeBSD* application (bsdapp) environment, without going
+DPDK application in a OSv* application (osvapp) environment, without going
 deeply into detail.
 
-For a comprehensive guide to installing and using FreeBSD*, the following
-handbook is available from the FreeBSD* Documentation Project:
-
-`http://www.freebsd.org/doc/en_US.ISO8859-1/books/handbook/index.html <http://www.freebsd.org/doc/en_US.ISO8859-1/books/handbook/index.html>`_
-
-.. note::
-
-	The DPDK is now available as part of the FreeBSD ports collection.
-	Installing via the ports collection infrastructure is now the recommended
-	way to install the DPDK on FreeBSD, and is documented in the
-	next chapter, :ref:`install_from_ports`.
+For a comprehensive guide to installing and using OSv*, the following
+handbook is available from the OSv* Documentation Project:
 
 Documentation Roadmap
 ---------------------
Signature · 1 line
2.1.0