[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Minios-devel] [UNIKRAFT/CLICK PATCH 01/11] Initial public release: basic unikraft files



Hi Florian,

Thanks for the series! Regarding this patch:

* The license headers are missing
* The .md files are missing
* When configuring lwip, I noticed that if the option "Automatically attach 
netifs" is selected, the router fails to initialize ("Failed to configure 
device", from click.cc). Could you please unselect this by adding an option in 
Config.uk?

Thanks,

-- Felipe

On 02.06.19, 07:53, "Florian Schmidt" <Florian.Schmidt@xxxxxxxxx> wrote:

    Add Makefile, Makefile.uk, Config.uk, .gitignore
    
    Signed-off-by: Felipe Huici <felipe.huici@xxxxxxxxx>
    Signed-off-by: Florian Schmidt <florian.schmidt@xxxxxxxxx>
    ---
     .gitignore  |   4 ++
     Config.uk   |  85 +++++++++++++++++++++++++++++++
     Makefile    |   9 ++++
     Makefile.uk | 143 ++++++++++++++++++++++++++++++++++++++++++++++++++++
     4 files changed, 241 insertions(+)
     create mode 100644 .gitignore
     create mode 100644 Config.uk
     create mode 100644 Makefile
     create mode 100644 Makefile.uk
    
    diff --git a/.gitignore b/.gitignore
    new file mode 100644
    index 0000000..a9fb71b
    --- /dev/null
    +++ b/.gitignore
    @@ -0,0 +1,4 @@
    +.config
    +.config.old
    +..config.tmp
    +build/
    diff --git a/Config.uk b/Config.uk
    new file mode 100644
    index 0000000..20d9131
    --- /dev/null
    +++ b/Config.uk
    @@ -0,0 +1,85 @@
    +### Invisible option for dependencies
    +config APP_DEPENDENCIES
    +   bool
    +   default y
    +
    +menuconfig LIBCLICK
    +   bool "The Click modular router"
    +   # depends on (HAVE_LIBC)  # && HAVE_NW_STACK && ...
    +   default y
    +
    +if LIBCLICK
    +
    +config LIBCLICK_MAIN
    +   bool "Enable Click main function"
    +   default n
    +   help
    +     Define main function instead of click_main function
    +
    +config LIBCLICK_ELEMS_AQM
    +   bool "Enable AQM elements"
    +   default y
    +   help
    +     Build with IP elements
    +
    +config LIBCLICK_ELEMS_ETHERNET
    +   bool "Enable Ethernet elements"
    +   default y
    +   help
    +     Build with Ethernet elements
    +
    +config LIBCLICK_ELEMS_ETHERSWITCH
    +   bool "Enable Ethernet switch elements"
    +   default y
    +   help
    +     Build with Ethernet switch elements
    +
    +config LIBCLICK_ELEMS_ICMP
    +   bool "Enable ICMP elements"
    +   default y
    +   help
    +     Build with ICMP elements
    +
    +config LIBCLICK_ELEMS_IP
    +   bool "Enable IP elements"
    +   default y
    +   help
    +     Build with adaptive queue management elements
    +
    +config LIBCLICK_ELEMS_UNIKRAFT
    +   bool "Enable Unikraft networking"
    +   default y
    +   help
    +     Build with Unikraft FromDevice and ToDevice elements
    +
    +config LIBCLICK_ELEMS_LOCAL
    +   bool "Enable local elements"
    +   default y
    +   help
    +     Build with local elements
    +
    +config LIBCLICK_ELEMS_SIMPLE
    +   bool "Enable simple elements"
    +   default y
    +   help
    +     Build with simple elements
    +
    +config LIBCLICK_ELEMS_STANDARD
    +   bool "Enable standard elements"
    +   default y
    +   help
    +     Build with standard elements
    +
    +config LIBCLICK_ELEMS_TCPUDP
    +   bool "Enable TCP/UDP elements"
    +   default y
    +   help
    +     Build with TCP/UDP elements
    +
    +config LIBCLICK_ELEMS_THREADS
    +   bool "Enable multi-threading elements"
    +   default y
    +   help
    +     Build with multi-threading elements
    +
    +endif
    diff --git a/Makefile b/Makefile
    new file mode 100644
    index 0000000..8ecf80b
    --- /dev/null
    +++ b/Makefile
    @@ -0,0 +1,9 @@
    +UK_ROOT ?= $(PWD)/../unikraft
    +UK_LIBS ?= $(PWD)/..
    +LIBS := $(UK_LIBS)/newlib:$(UK_LIBS)/lwip
    +
    +all:
    +   @$(MAKE) -C $(UK_ROOT) A=$(PWD) L=$(LIBS)
    +
    +$(MAKECMDGOALS):
    +   @$(MAKE) -C $(UK_ROOT) A=$(PWD) L=$(LIBS) $(MAKECMDGOALS)
    diff --git a/Makefile.uk b/Makefile.uk
    new file mode 100644
    index 0000000..b27bb10
    --- /dev/null
    +++ b/Makefile.uk
    @@ -0,0 +1,143 @@
    
+################################################################################
    +# Register with unikraft
    
+################################################################################
    +$(eval $(call addlib,libclick))
    +
    
+################################################################################
    +# Sources
    
+################################################################################
    +LIBCLICK_COMMIT_HASH=a5384835a6cac10f8d44da4eeea8eaa8f8e6a0c2
    
+LIBCLICK_URL=https://codeload.github.com/kohler/click/zip/$(LIBCLICK_COMMIT_HASH)
    +$(eval $(call 
fetchas,libclick,$(LIBCLICK_URL),click-$(LIBCLICK_COMMIT_HASH).zip))
    +LIBCLICK_PATCHDIR=$(LIBCLICK_BASE)/patches
    +$(eval $(call 
patch,libclick,$(LIBCLICK_PATCHDIR),click-$(LIBCLICK_COMMIT_HASH)))
    +
    
+################################################################################
    +# Copy Unikraft from/to devices
    
+################################################################################
    +ifneq ($(CONFIG_LIBCLICK_ELEMS_UNIKRAFT),)
    +$(shell mkdir -p $(LIBCLICK_ORIGIN)/click-$(LIBCLICK_COMMIT_HASH)/elements)
    +$(shell cp -r $(LIBCLICK_BASE)/unikraft 
$(LIBCLICK_ORIGIN)/click-$(LIBCLICK_COMMIT_HASH)/elements/)
    +endif
    +
    
+################################################################################
    +# Helpers
    
+################################################################################
    +LIBCLICK_EXTRACTED=$(LIBCLICK_ORIGIN)/click-$(LIBCLICK_COMMIT_HASH)
    +LIBCLICK_ELEMENTS_DIR=$(LIBCLICK_EXTRACTED)/elements
    +LIBCLICK_BUILDTOOL=$(LIBCLICK_EXTRACTED)/bin/click-buildtool
    +LIBCLICK_ELEM_DIRS=aqm ethernet etherswitch icmp ip unikraft \
    +              local simple standard tcpudp threads
    +
    
+################################################################################
    +# Config Menu - Filter which element categories actually get built
    
+################################################################################
    +LIBCLICK_ELEM_DIRS_U=$(call uc,$(LIBCLICK_ELEM_DIRS))
    +LIBCLICK_FILTERED_ELEM_DIRS_U := $(foreach V, $(LIBCLICK_ELEM_DIRS_U), \
    +                                 $(if $(filter 
y,$(CONFIG_LIBCLICK_ELEMS_$V)),$V))
    +LIBCLICK_FILTERED_ELEM_DIRS=$(call lc,$(LIBCLICK_FILTERED_ELEM_DIRS_U))
    +
    
+################################################################################
    +# App-specific Targets
    
+################################################################################
    +
    +# Run Click's configure script
    +$(LIBCLICK_BUILD)/.configured: $(LIBCLICK_BUILD)/.origin
    +   $(call verbose_cmd,CONFIGURE,libapp: $@,\
    +          cd $(LIBCLICK_EXTRACTED) && ./configure --enable-minios 
--with-xen=$(LIBCLICK_BUILD) --with-minios=$(LIBCLICK_BUILD) 
--with-newlib=$(LIBCLICK_BUILD) --with-lwip=$(LIBCLICK_BUILD) && \
    +          $(TOUCH) $@)
    +
    +# Generate element build rules using click-buildtool
    +$(LIBCLICK_BUILD)/.elementsmk: $(LIBCLICK_BUILD)/.configured 
$(UK_CONFIG_OUT)
    +   $(call verbose_cmd,ELEMMK,libapp: $@,\
    +          cd $(LIBCLICK_ELEMENTS_DIR) && echo 
"$(LIBCLICK_FILTERED_ELEM_DIRS)" | $(LIBCLICK_BUILDTOOL) findelem -r unikraft 
-X $(LIBCLICK_BUILD)/elements.exclude | grep -E "^[^#]" | awk '{print 
"LIBCLICK_SRCS-y += $$(LIBCLICK_EXTRACTED)/elements/" $$1}' > $@)
    +
    +# Generate elements.cc and add it to the build list
    +$(LIBCLICK_BUILD)/elements.cc: $(LIBCLICK_BUILD)/.elementsmk
    +   $(call verbose_cmd,ELEMCC,libapp: $@,\
    +          echo "$(LIBCLICK_FILTERED_ELEM_DIRS)" | $(LIBCLICK_BUILDTOOL) 
findelem -r unikraft -p $(LIBCLICK_ELEMENTS_DIR) -X 
$(LIBCLICK_BUILD)/elements.exclude > $(LIBCLICK_BUILD)/.elementsconf && \
    +          $(LIBCLICK_BUILDTOOL) elem2export < 
$(LIBCLICK_BUILD)/.elementsconf > $(LIBCLICK_BUILD)/elements.cc)
    +
    +$(LIBCLICK_BUILD)/.prepared: $(LIBCLICK_BUILD)/elements.cc
    +
    +UK_PREPARE += $(LIBCLICK_BUILD)/.prepared
    +
    
+################################################################################
    +# App includes, compile flags
    
+################################################################################
    +LIBCLICK_CINCLUDES   += -I$(LIBCLICK_BASE)/include        \
    +                   -I$(LIBCLICK_EXTRACTED)      \
    +                   -I$(LIBCLICK_EXTRACTED)/include \
    +                   -I$(LIBLWIP_LWIP_SRCS)/include/posix
    +LIBCLICK_CXXINCLUDES += -I$(LIBCLICK_BASE)/include        \
    +                   -I$(LIBCLICK_EXTRACTED)           \
    +                   -I$(LIBCLICK_EXTRACTED)/include \
    +                   -I$(LIBLWIP_LWIP_SRCS)/include/posix
    +
    
+################################################################################
    +# Global flags
    
+################################################################################
    +LIBCLICK_CFLAGS-y       += -DLWIP_TIMEVAL_PRIVATE=0 -DCLICK_USERLEVEL
    +LIBCLICK_CXXFLAGS-y     += -DLWIP_TIMEVAL_PRIVATE=0 -DCLICK_USERLEVEL 
-DHAVE_IP6
    +LIBCLICK_CXXFLAGS       += -fno-exceptions -fno-rtti -std=c++11
    +
    +# Suppress some warnings to make the build process look neater
    +LIBCLICK_SUPPRESS_FLAGS := -Wno-strict-aliasing
    +LIBCLICK_CFLAGS-y += $(LIBCLICK_SUPPRESS_FLAGS)
    +LIBCLICK_CXXFLAGS-y += $(LIBCLICK_SUPPRESS_FLAGS)
    +
    
+################################################################################
    +# Unikraft <-> Click glue code
    
+################################################################################
    +LIBCLICK_SRCS-y += $(LIBCLICK_BASE)/click.cc
    +
    
+################################################################################
    +# Click sources
    
+################################################################################
    +LIBCLICK_SRCS-y += $(LIBCLICK_EXTRACTED)/lib/archive.cc
    +LIBCLICK_SRCS-y += $(LIBCLICK_EXTRACTED)/lib/args.cc
    +LIBCLICK_SRCS-y += $(LIBCLICK_EXTRACTED)/lib/atomic.cc
    +LIBCLICK_SRCS-y += $(LIBCLICK_EXTRACTED)/lib/bighashmap_arena.cc
    +LIBCLICK_SRCS-y += $(LIBCLICK_EXTRACTED)/lib/bitvector.cc
    +LIBCLICK_SRCS-y += $(LIBCLICK_EXTRACTED)/lib/confparse.cc
    +LIBCLICK_SRCS-y += $(LIBCLICK_EXTRACTED)/lib/crc32.c
    +LIBCLICK_SRCS-y += $(LIBCLICK_EXTRACTED)/lib/driver.cc
    +LIBCLICK_SRCS-y += $(LIBCLICK_EXTRACTED)/lib/element.cc
    +LIBCLICK_SRCS-y += $(LIBCLICK_EXTRACTED)/lib/elemfilter.cc
    +LIBCLICK_SRCS-y += $(LIBCLICK_EXTRACTED)/lib/error.cc
    +LIBCLICK_SRCS-y += $(LIBCLICK_EXTRACTED)/lib/etheraddress.cc
    +LIBCLICK_SRCS-y += $(LIBCLICK_EXTRACTED)/lib/gaprate.cc
    +LIBCLICK_SRCS-y += $(LIBCLICK_EXTRACTED)/lib/glue.cc
    +LIBCLICK_SRCS-y += $(LIBCLICK_EXTRACTED)/lib/handlercall.cc
    +LIBCLICK_SRCS-y += $(LIBCLICK_EXTRACTED)/lib/hashallocator.cc
    +LIBCLICK_SRCS-y += $(LIBCLICK_EXTRACTED)/lib/in_cksum.c
    +LIBCLICK_SRCS-y += $(LIBCLICK_EXTRACTED)/lib/integers.cc
    +LIBCLICK_SRCS-y += $(LIBCLICK_EXTRACTED)/lib/ipaddress.cc
    +LIBCLICK_SRCS-y += $(LIBCLICK_EXTRACTED)/lib/ipflowid.cc
    +LIBCLICK_SRCS-y += $(LIBCLICK_EXTRACTED)/lib/iptable.cc
    +LIBCLICK_SRCS-y += $(LIBCLICK_EXTRACTED)/lib/lexer.cc
    +LIBCLICK_SRCS-y += $(LIBCLICK_EXTRACTED)/lib/master.cc
    +LIBCLICK_SRCS-y += $(LIBCLICK_EXTRACTED)/lib/md5.cc
    +LIBCLICK_SRCS-y += $(LIBCLICK_EXTRACTED)/lib/nameinfo.cc
    +LIBCLICK_SRCS-y += $(LIBCLICK_EXTRACTED)/lib/notifier.cc
    +LIBCLICK_SRCS-y += $(LIBCLICK_EXTRACTED)/lib/packet.cc
    +LIBCLICK_SRCS-y += $(LIBCLICK_EXTRACTED)/lib/router.cc
    +LIBCLICK_SRCS-y += $(LIBCLICK_EXTRACTED)/lib/routerthread.cc
    +LIBCLICK_SRCS-y += $(LIBCLICK_EXTRACTED)/lib/routervisitor.cc
    +LIBCLICK_SRCS-y += $(LIBCLICK_EXTRACTED)/lib/straccum.cc
    +LIBCLICK_SRCS-y += $(LIBCLICK_EXTRACTED)/lib/string.cc
    +LIBCLICK_SRCS-y += $(LIBCLICK_EXTRACTED)/lib/task.cc
    +LIBCLICK_SRCS-y += $(LIBCLICK_EXTRACTED)/lib/timer.cc
    +LIBCLICK_SRCS-y += $(LIBCLICK_EXTRACTED)/lib/timerset.cc
    +LIBCLICK_SRCS-y += $(LIBCLICK_EXTRACTED)/lib/timestamp.cc
    +LIBCLICK_SRCS-y += $(LIBCLICK_EXTRACTED)/lib/variableenv.cc
    +LIBCLICK_SRCS-y += $(LIBCLICK_EXTRACTED)/lib/ip6table.cc
    +LIBCLICK_SRCS-y += $(LIBCLICK_EXTRACTED)/lib/ip6address.cc
    +LIBCLICK_SRCS-y += $(LIBCLICK_EXTRACTED)/lib/ip6flowid.cc
    +LIBCLICK_SRCS-y += $(LIBCLICK_EXTRACTED)/lib/selectset.cc
    +
    
+################################################################################
    +# Click elements
    
+################################################################################
    +LIBCLICK_SRCS-y += $(LIBCLICK_BUILD)/elements.cc
    +-include $(LIBCLICK_BUILD)/.elementsmk
    -- 
    2.21.0
    
    

_______________________________________________
Minios-devel mailing list
Minios-devel@xxxxxxxxxxxxxxxxxxxx
https://lists.xenproject.org/mailman/listinfo/minios-devel

 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.