Initial commit of vpp code.
Change-Id: Ib246f1fbfce93274020ee93ce461e3d8bd8b9f17 Signed-off-by: Ed Warnicke <eaw@cisco.com>
This commit is contained in:
15
.gitignore
vendored
Normal file
15
.gitignore
vendored
Normal file
@ -0,0 +1,15 @@
|
|||||||
|
*~
|
||||||
|
autom4te.cache/
|
||||||
|
/build-root/.ccache
|
||||||
|
/build-root/build-*/
|
||||||
|
/build-root/install-*/
|
||||||
|
/build-root/tools
|
||||||
|
/build-root/packages-vpp/
|
||||||
|
/build-root/path_setup
|
||||||
|
/build-root/build-config.mk
|
||||||
|
/build-root/*.deb
|
||||||
|
/build-root/*.changes
|
||||||
|
/build-config.mk
|
||||||
|
/dpdk/*.tar.gz
|
||||||
|
/path_setup
|
||||||
|
/tools/
|
4
.gitreview
Normal file
4
.gitreview
Normal file
@ -0,0 +1,4 @@
|
|||||||
|
[gerrit]
|
||||||
|
host=gerrit.projectrotterdam.info
|
||||||
|
port=29418
|
||||||
|
project=vpp
|
24
build-data/packages/dpdk.mk
Normal file
24
build-data/packages/dpdk.mk
Normal file
@ -0,0 +1,24 @@
|
|||||||
|
|
||||||
|
DPDK_MARCH = $(strip $($(PLATFORM)_dpdk_arch))
|
||||||
|
ifeq ($(DPDK_MARCH),)
|
||||||
|
DPDK_MARCH="native"
|
||||||
|
endif
|
||||||
|
|
||||||
|
ifneq (,$(findstring debug,$(TAG)))
|
||||||
|
DPDK_DEBUG=y
|
||||||
|
else
|
||||||
|
DPDK_DEBUG=n
|
||||||
|
endif
|
||||||
|
|
||||||
|
DPDK_MAKE_ARGS = -C $(call find_source_fn,$(PACKAGE_SOURCE)) \
|
||||||
|
DPDK_BUILD_DIR=$(PACKAGE_BUILD_DIR) \
|
||||||
|
DPDK_INSTALL_DIR=$(PACKAGE_INSTALL_DIR) \
|
||||||
|
DPDK_MARCH=$(DPDK_MARCH) \
|
||||||
|
DPDK_DEBUG=$(DPDK_DEBUG)
|
||||||
|
|
||||||
|
|
||||||
|
dpdk_configure = echo
|
||||||
|
|
||||||
|
dpdk_make_args = $(DPDK_MAKE_ARGS) config
|
||||||
|
|
||||||
|
dpdk_install = make $(DPDK_MAKE_ARGS) build
|
41
build-data/packages/sample-plugin.mk
Normal file
41
build-data/packages/sample-plugin.mk
Normal file
@ -0,0 +1,41 @@
|
|||||||
|
sample-plugin_configure_depend = \
|
||||||
|
vppinfra-install \
|
||||||
|
dpdk-install \
|
||||||
|
svm-install \
|
||||||
|
vlib-api-install \
|
||||||
|
vlib-install \
|
||||||
|
vnet-install \
|
||||||
|
vpp-install \
|
||||||
|
vpp-api-test-install
|
||||||
|
|
||||||
|
#
|
||||||
|
sample-plugin_configure_args = --with-q-platform=$(PLATFORM) --with-dpdk
|
||||||
|
|
||||||
|
sample-plugin_CPPFLAGS = $(call installed_includes_fn, \
|
||||||
|
vppinfra \
|
||||||
|
dpdk \
|
||||||
|
openssl \
|
||||||
|
svm \
|
||||||
|
vlib \
|
||||||
|
vlib-api \
|
||||||
|
vnet \
|
||||||
|
vpp \
|
||||||
|
vpp-api-test)
|
||||||
|
|
||||||
|
sample-plugin_LDFLAGS = $(call installed_libs_fn, \
|
||||||
|
vppinfra \
|
||||||
|
dpdk \
|
||||||
|
openssl \
|
||||||
|
svm \
|
||||||
|
vlib \
|
||||||
|
vlib-api \
|
||||||
|
vnet \
|
||||||
|
vpp \
|
||||||
|
vpp-api-test)
|
||||||
|
|
||||||
|
sample-plugin_post_install = \
|
||||||
|
mkdir -p $(PACKAGE_INSTALL_DIR)/$(arch_lib_dir)/vlib_plugins ; \
|
||||||
|
cp $(PACKAGE_INSTALL_DIR)/$(arch_lib_dir)/*.so \
|
||||||
|
$(PACKAGE_INSTALL_DIR)/$(arch_lib_dir)/vlib_plugins
|
||||||
|
|
||||||
|
sample-plugin_image_include = echo $(arch_lib_dir)/vlib_plugins
|
5
build-data/packages/svm.mk
Normal file
5
build-data/packages/svm.mk
Normal file
@ -0,0 +1,5 @@
|
|||||||
|
svm_top_srcdir = $(call find_source_fn,svm)
|
||||||
|
svm_configure_depend = vppinfra-install
|
||||||
|
|
||||||
|
svm_CPPFLAGS = $(call installed_includes_fn, vppinfra)
|
||||||
|
svm_LDFLAGS = $(call installed_libs_fn, vppinfra)
|
6
build-data/packages/vlib-api.mk
Normal file
6
build-data/packages/vlib-api.mk
Normal file
@ -0,0 +1,6 @@
|
|||||||
|
vlib-api_configure_depend = vppinfra-install svm-install vlib-install
|
||||||
|
|
||||||
|
vlib-api_CPPFLAGS = $(call installed_includes_fn, vppinfra svm vlib)
|
||||||
|
vlib-api_LDFLAGS = $(call installed_libs_fn, vppinfra svm vlib)
|
||||||
|
|
||||||
|
vlib-api_top_srcdir = $(call find_source_fn,vlib-api)
|
6
build-data/packages/vlib.mk
Normal file
6
build-data/packages/vlib.mk
Normal file
@ -0,0 +1,6 @@
|
|||||||
|
vlib_configure_depend = vppinfra-install dpdk-install
|
||||||
|
|
||||||
|
vlib_configure_args += --with-dpdk
|
||||||
|
|
||||||
|
vlib_CPPFLAGS = $(call installed_includes_fn, vppinfra dpdk)
|
||||||
|
vlib_LDFLAGS = $(call installed_libs_fn, vppinfra dpdk)
|
26
build-data/packages/vnet.mk
Normal file
26
build-data/packages/vnet.mk
Normal file
@ -0,0 +1,26 @@
|
|||||||
|
vnet_configure_depend = \
|
||||||
|
vppinfra-install \
|
||||||
|
dpdk-install \
|
||||||
|
svm-install \
|
||||||
|
vlib-api-install \
|
||||||
|
vlib-install
|
||||||
|
|
||||||
|
vnet_CPPFLAGS = $(call installed_includes_fn, \
|
||||||
|
vppinfra \
|
||||||
|
dpdk \
|
||||||
|
openssl \
|
||||||
|
svm \
|
||||||
|
vlib \
|
||||||
|
vlib-api)
|
||||||
|
|
||||||
|
vnet_LDFLAGS = $(call installed_libs_fn, \
|
||||||
|
vppinfra \
|
||||||
|
dpdk \
|
||||||
|
openssl \
|
||||||
|
svm \
|
||||||
|
vlib \
|
||||||
|
vlib-api)
|
||||||
|
|
||||||
|
# Platform dependent configure flags
|
||||||
|
vnet_configure_args += $(vnet_configure_args_$(PLATFORM))
|
||||||
|
|
31
build-data/packages/vpp-api-test.mk
Normal file
31
build-data/packages/vpp-api-test.mk
Normal file
@ -0,0 +1,31 @@
|
|||||||
|
vpp-api-test_configure_depend = \
|
||||||
|
vppinfra-install \
|
||||||
|
dpdk-install \
|
||||||
|
svm-install \
|
||||||
|
vlib-api-install \
|
||||||
|
vlib-install \
|
||||||
|
vnet-install \
|
||||||
|
vpp-install
|
||||||
|
|
||||||
|
#
|
||||||
|
vpp-api-test_configure_args = --with-q-platform=$(PLATFORM) --with-dpdk \
|
||||||
|
--with-q-plugin-prefix=$(MU_BUILD_ROOT_DIR)/packages-$(PLATFORM)
|
||||||
|
|
||||||
|
vpp-api-test_CPPFLAGS = $(call installed_includes_fn, \
|
||||||
|
vppinfra \
|
||||||
|
dpdk \
|
||||||
|
svm \
|
||||||
|
vlib \
|
||||||
|
vlib-api \
|
||||||
|
vnet \
|
||||||
|
vpp)
|
||||||
|
|
||||||
|
vpp-api-test_LDFLAGS = $(call installed_libs_fn, \
|
||||||
|
vppinfra \
|
||||||
|
dpdk \
|
||||||
|
svm \
|
||||||
|
vlib \
|
||||||
|
vlib-api \
|
||||||
|
vnet \
|
||||||
|
vpp)
|
||||||
|
|
23
build-data/packages/vpp-japi.mk
Normal file
23
build-data/packages/vpp-japi.mk
Normal file
@ -0,0 +1,23 @@
|
|||||||
|
vpp-japi_configure_depend = \
|
||||||
|
vppinfra-install \
|
||||||
|
svm-install \
|
||||||
|
vlib-api-install \
|
||||||
|
vlib-install \
|
||||||
|
vnet-install \
|
||||||
|
vpp-install
|
||||||
|
|
||||||
|
vpp-japi_CPPFLAGS = $(call installed_includes_fn, \
|
||||||
|
vppinfra \
|
||||||
|
svm \
|
||||||
|
vlib \
|
||||||
|
vlib-api \
|
||||||
|
vnet \
|
||||||
|
vpp)
|
||||||
|
|
||||||
|
vpp-japi_LDFLAGS = $(call installed_libs_fn, \
|
||||||
|
vppinfra \
|
||||||
|
svm \
|
||||||
|
vlib \
|
||||||
|
vlib-api)
|
||||||
|
|
||||||
|
vpp-japi_CPPFLAGS += -I/usr/lib/jvm/java-7-openjdk-amd64/include
|
1
build-data/packages/vpp-platform-scripts.mk
Normal file
1
build-data/packages/vpp-platform-scripts.mk
Normal file
@ -0,0 +1 @@
|
|||||||
|
#
|
33
build-data/packages/vpp.mk
Normal file
33
build-data/packages/vpp.mk
Normal file
@ -0,0 +1,33 @@
|
|||||||
|
vpp_configure_depend = \
|
||||||
|
vppinfra-install \
|
||||||
|
dpdk-install \
|
||||||
|
svm-install \
|
||||||
|
vlib-api-install \
|
||||||
|
vlib-install \
|
||||||
|
vnet-install \
|
||||||
|
|
||||||
|
#
|
||||||
|
vpp_configure_args = --with-q-platform=$(PLATFORM) \
|
||||||
|
--with-q-plugin-prefix=$(MU_BUILD_ROOT_DIR)/packages-$(PLATFORM)
|
||||||
|
|
||||||
|
# Platform dependent configure flags
|
||||||
|
vpp_configure_args += $(vpp_configure_args_$(PLATFORM))
|
||||||
|
|
||||||
|
|
||||||
|
vpp_CPPFLAGS = $(call installed_includes_fn, \
|
||||||
|
vppinfra \
|
||||||
|
dpdk \
|
||||||
|
openssl \
|
||||||
|
svm \
|
||||||
|
vlib \
|
||||||
|
vlib-api \
|
||||||
|
vnet)
|
||||||
|
|
||||||
|
vpp_LDFLAGS = $(call installed_libs_fn, \
|
||||||
|
vppinfra \
|
||||||
|
dpdk \
|
||||||
|
openssl \
|
||||||
|
svm \
|
||||||
|
vlib \
|
||||||
|
vlib-api \
|
||||||
|
vnet)
|
2
build-data/packages/vppinfra.mk
Normal file
2
build-data/packages/vppinfra.mk
Normal file
@ -0,0 +1,2 @@
|
|||||||
|
# nothing
|
||||||
|
|
71
build-data/platforms.mk
Normal file
71
build-data/platforms.mk
Normal file
@ -0,0 +1,71 @@
|
|||||||
|
# Copyright (c) 2015 Cisco and/or its affiliates.
|
||||||
|
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
# you may not use this file except in compliance with the License.
|
||||||
|
# You may obtain a copy of the License at:
|
||||||
|
#
|
||||||
|
# http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
#
|
||||||
|
# Unless required by applicable law or agreed to in writing, software
|
||||||
|
# distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
# See the License for the specific language governing permissions and
|
||||||
|
# limitations under the License.
|
||||||
|
|
||||||
|
# Pick up per-platform makefile fragments
|
||||||
|
$(foreach d,$(SOURCE_PATH_BUILD_DATA_DIRS), \
|
||||||
|
$(eval -include $(d)/platforms/*.mk))
|
||||||
|
|
||||||
|
.PHONY: install-deb
|
||||||
|
install-deb: $(patsubst %,%-find-source,$(ROOT_PACKAGES))
|
||||||
|
@$(BUILD_ENV) ; \
|
||||||
|
set -eu$(BUILD_DEBUG) ; \
|
||||||
|
$(MAKE) -C $(MU_BUILD_ROOT_DIR) \
|
||||||
|
$(patsubst %,%-install, \
|
||||||
|
$(ROOT_PACKAGES)) || exit 1; \
|
||||||
|
\
|
||||||
|
: generate file manifests ; \
|
||||||
|
find $(INSTALL_PREFIX)$(ARCH)/*/bin -type f -print \
|
||||||
|
| sed -e 's:.*:../& /usr/bin:' \
|
||||||
|
> deb/debian/vpp.install ; \
|
||||||
|
find $(INSTALL_PREFIX)$(ARCH)/*/lib* -type f -print \
|
||||||
|
| egrep -e '*\.so\.*\.*\.*' \
|
||||||
|
| sed -e 's:.*:../& /usr/lib/x86_64-linux-gnu:' \
|
||||||
|
> deb/debian/vpp-lib.install ; \
|
||||||
|
\
|
||||||
|
: dev package ; \
|
||||||
|
./scripts/find-dev-contents $(INSTALL_PREFIX)$(ARCH) \
|
||||||
|
deb/debian/vpp-dev.install ; \
|
||||||
|
\
|
||||||
|
: bin package needs startup config ; \
|
||||||
|
echo ../../vpp/conf/startup.conf /etc/vpp \
|
||||||
|
>> deb/debian/vpp.install ; \
|
||||||
|
\
|
||||||
|
: and sysctl config ; \
|
||||||
|
echo ../../vpp/conf/80-vpp.conf /etc/sysctl.d \
|
||||||
|
>> deb/debian/vpp.install ; \
|
||||||
|
\
|
||||||
|
: dev package needs a couple of additions ; \
|
||||||
|
echo ../build-tool-native/vppapigen/vppapigen /usr/bin \
|
||||||
|
>> deb/debian/vpp-dev.install ; \
|
||||||
|
\
|
||||||
|
: generate changelog; \
|
||||||
|
./scripts/generate-deb-changelog \
|
||||||
|
\
|
||||||
|
: Go fabricate the actual Debian packages ; \
|
||||||
|
( \
|
||||||
|
cd deb && \
|
||||||
|
dpkg-buildpackage -us -uc -b \
|
||||||
|
)
|
||||||
|
|
||||||
|
.PHONY: install-rpm
|
||||||
|
install-rpm: $(patsubst %,%-find-source,$(ROOT_PACKAGES))
|
||||||
|
@$(BUILD_ENV) ; \
|
||||||
|
set -eu$(BUILD_DEBUG) ; \
|
||||||
|
$(MAKE) -C $(MU_BUILD_ROOT_DIR) \
|
||||||
|
$(patsubst %,%-install, \
|
||||||
|
$(ROOT_PACKAGES)) || exit 1; \
|
||||||
|
\
|
||||||
|
cd rpm ; \
|
||||||
|
rpmbuild -bb --define "_topdir $$PWD" vpp.spec ; \
|
||||||
|
mv $$(find RPMS -name \*.rpm -type f) ..
|
||||||
|
|
42
build-data/platforms/virl.mk
Normal file
42
build-data/platforms/virl.mk
Normal file
@ -0,0 +1,42 @@
|
|||||||
|
# Copyright (c) 2015 Cisco and/or its affiliates.
|
||||||
|
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
# you may not use this file except in compliance with the License.
|
||||||
|
# You may obtain a copy of the License at:
|
||||||
|
#
|
||||||
|
# http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
#
|
||||||
|
# Unless required by applicable law or agreed to in writing, software
|
||||||
|
# distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
# See the License for the specific language governing permissions and
|
||||||
|
# limitations under the License.
|
||||||
|
|
||||||
|
# vector packet processor
|
||||||
|
virl_arch = native
|
||||||
|
virl_native_tools = vppapigen vppversion
|
||||||
|
|
||||||
|
virl_root_packages = vpp vlib vlib-api vnet svm dpdk vpp-api-test \
|
||||||
|
vpp-japi
|
||||||
|
|
||||||
|
vpp_configure_args_virl = --with-dpdk
|
||||||
|
vnet_configure_args_virl = --with-dpdk --with-virl
|
||||||
|
|
||||||
|
# Set these parameters carefully. The vlib_buffer_t is 128 bytes, i.e.
|
||||||
|
# dpdk_headroom = uiotarball_headroom = vlib_pre_data + 128
|
||||||
|
dpdk_configure_args_virl = --with-headroom=256
|
||||||
|
vlib_configure_args_virl = --with-pre-data=128
|
||||||
|
|
||||||
|
# Override default -march and CONFIG_RTE_MACHINE settings
|
||||||
|
# Otherwise, illgal instructions will result
|
||||||
|
virl_march=corei7
|
||||||
|
virl_dpdk_arch=corei7
|
||||||
|
|
||||||
|
virl_debug_TAG_CFLAGS = -g -O0 -DCLIB_DEBUG -DFORTIFY_SOURCE=2 -march=$(MARCH) \
|
||||||
|
-fstack-protector-all -fPIC
|
||||||
|
virl_debug_TAG_LDFLAGS = -g -O0 -DCLIB_DEBUG -DFORTIFY_SOURCE=2 -march=$(MARCH) \
|
||||||
|
-fstack-protector-all -fPIC
|
||||||
|
|
||||||
|
virl_TAG_CFLAGS = -g -O2 -DFORTIFY_SOURCE=2 -march=$(MARCH) \
|
||||||
|
-fstack-protector -fPIC
|
||||||
|
virl_TAG_LDFLAGS = -g -O2 -DFORTIFY_SOURCE=2 -march=$(MARCH) \
|
||||||
|
-fstack-protector -fPIC
|
38
build-data/platforms/vpp.mk
Normal file
38
build-data/platforms/vpp.mk
Normal file
@ -0,0 +1,38 @@
|
|||||||
|
# Copyright (c) 2015 Cisco and/or its affiliates.
|
||||||
|
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
# you may not use this file except in compliance with the License.
|
||||||
|
# You may obtain a copy of the License at:
|
||||||
|
#
|
||||||
|
# http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
#
|
||||||
|
# Unless required by applicable law or agreed to in writing, software
|
||||||
|
# distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
# See the License for the specific language governing permissions and
|
||||||
|
# limitations under the License.
|
||||||
|
|
||||||
|
# vector packet processor
|
||||||
|
vpp_arch = native
|
||||||
|
vpp_native_tools = vppapigen vppversion
|
||||||
|
|
||||||
|
vpp_root_packages = vpp vlib vlib-api vnet svm dpdk vpp-api-test \
|
||||||
|
vpp-japi
|
||||||
|
|
||||||
|
vpp_configure_args_vpp = --with-dpdk
|
||||||
|
vnet_configure_args_vpp = --with-dpdk
|
||||||
|
|
||||||
|
# Set these parameters carefully. The vlib_buffer_t is 128 bytes, i.e.
|
||||||
|
# dpdk_headroom = uiotarball_headroom = vlib_pre_data + 128
|
||||||
|
dpdk_configure_args_vpp = --with-headroom=256
|
||||||
|
vlib_configure_args_vpp = --with-pre-data=128
|
||||||
|
|
||||||
|
|
||||||
|
vpp_debug_TAG_CFLAGS = -g -O0 -DCLIB_DEBUG -DFORTIFY_SOURCE=2 -march=$(MARCH) \
|
||||||
|
-fstack-protector-all -fPIC
|
||||||
|
vpp_debug_TAG_LDFLAGS = -g -O0 -DCLIB_DEBUG -DFORTIFY_SOURCE=2 -march=$(MARCH) \
|
||||||
|
-fstack-protector-all -fPIC
|
||||||
|
|
||||||
|
vpp_TAG_CFLAGS = -g -O2 -DFORTIFY_SOURCE=2 -march=$(MARCH) \
|
||||||
|
-fstack-protector -fPIC
|
||||||
|
vpp_TAG_LDFLAGS = -g -O2 -DFORTIFY_SOURCE=2 -march=$(MARCH) \
|
||||||
|
-fstack-protector -fPIC
|
1168
build-root/Makefile
Normal file
1168
build-root/Makefile
Normal file
File diff suppressed because it is too large
Load Diff
308
build-root/autowank
Executable file
308
build-root/autowank
Executable file
File diff suppressed because it is too large
Load Diff
59
build-root/bootstrap.sh
Executable file
59
build-root/bootstrap.sh
Executable file
@ -0,0 +1,59 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
build_root=`pwd`
|
||||||
|
cd ../
|
||||||
|
wsroot=`pwd`
|
||||||
|
|
||||||
|
# PATH
|
||||||
|
CCACHE_DIR="$build_root/.ccache"
|
||||||
|
ADD_TO_PATH="$build_root/tools/ccache-bin:$build_root/tools/bin"
|
||||||
|
|
||||||
|
# Construct build-config.mk
|
||||||
|
cd $build_root
|
||||||
|
echo SOURCE_PATH = $wsroot > build-config.mk
|
||||||
|
echo
|
||||||
|
echo Saving PATH settings in `pwd`/path_setup
|
||||||
|
echo Source this file later, as needed
|
||||||
|
cat >path_setup <<EOF
|
||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
export PATH=$ADD_TO_PATH:$PATH
|
||||||
|
export CCACHE_DIR=$CCACHE_DIR
|
||||||
|
EOF
|
||||||
|
|
||||||
|
# regenerate tools/ccache-bin
|
||||||
|
rm -rf tools/ccache-bin
|
||||||
|
mkdir -p tools/ccache-bin
|
||||||
|
|
||||||
|
if [ ! -f /usr/bin/ccache ] ; then
|
||||||
|
echo Please install ccache AYEC and re-run this script
|
||||||
|
fi
|
||||||
|
|
||||||
|
cd tools/ccache-bin
|
||||||
|
for c in gcc g++
|
||||||
|
do
|
||||||
|
if [ -f /usr/bin/ccache ] ; then
|
||||||
|
ln -s /usr/bin/ccache $c
|
||||||
|
else
|
||||||
|
ln -s /usr/bin/gcc
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
|
||||||
|
cd $wsroot
|
||||||
|
|
||||||
|
for dir in vppapigen vppinfra sample-plugin vppversion svm vlib vlib-api vnet \
|
||||||
|
vpp vpp-api-test vpp-japi
|
||||||
|
do
|
||||||
|
cd $dir
|
||||||
|
echo "Autowank in $dir"
|
||||||
|
../build-root/autowank --touch
|
||||||
|
cd $wsroot
|
||||||
|
done
|
||||||
|
|
||||||
|
cd $build_root
|
||||||
|
echo Compile native tools
|
||||||
|
for tool in vppapigen vppversion
|
||||||
|
do
|
||||||
|
make V=0 is_build_tool=yes $tool-install
|
||||||
|
done
|
||||||
|
|
3
build-root/build-config.mk.README
Normal file
3
build-root/build-config.mk.README
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
# To specify directories to find sources, build/packages/*.mk
|
||||||
|
# and build/platforms.mk
|
||||||
|
# SOURCE_PATH = PATH1 PATH2 ...
|
105
build-root/config.site
Normal file
105
build-root/config.site
Normal file
@ -0,0 +1,105 @@
|
|||||||
|
######################################################################
|
||||||
|
# glibc
|
||||||
|
######################################################################
|
||||||
|
|
||||||
|
# glibc needs this for cross compiling
|
||||||
|
libc_cv_forced_unwind=yes
|
||||||
|
libc_cv_c_cleanup=yes
|
||||||
|
libc_cv_ssp=no
|
||||||
|
# fixes gentoo build; not sure why?
|
||||||
|
libc_cv_uname_release=""
|
||||||
|
libc_cv_uname_version=""
|
||||||
|
ac_cv_header_cpuid_h=yes
|
||||||
|
######################################################################
|
||||||
|
# bash
|
||||||
|
######################################################################
|
||||||
|
|
||||||
|
# Bash configure.in uses this to work around an autoconf 2.53 bug
|
||||||
|
ac_cv_func_setvbuf_reversed=no
|
||||||
|
ac_cv_rl_version=5.1
|
||||||
|
bash_cv_termcap_lib=libncurses
|
||||||
|
|
||||||
|
# These mostly come from debian bash-2.05b changes
|
||||||
|
# They are needed to make a functioning bash. Without these
|
||||||
|
# settings gdbserver exiting would cause the invoking bash to
|
||||||
|
# exit also.
|
||||||
|
bash_cv_have_mbstate_t=yes
|
||||||
|
bash_cv_dup2_broken=no
|
||||||
|
bash_cv_pgrp_pipe=no
|
||||||
|
bash_cv_sys_siglist=yes
|
||||||
|
bash_cv_under_sys_siglist=yes
|
||||||
|
bash_cv_opendir_not_robust=no
|
||||||
|
bash_cv_printf_declared=yes
|
||||||
|
bash_cv_ulimit_maxfds=yes
|
||||||
|
bash_cv_getenv_redef=yes
|
||||||
|
bash_cv_getcwd_calls_popen=no
|
||||||
|
bash_cv_func_strcoll_broken=no
|
||||||
|
bash_cv_must_reinstall_sighandlers=no
|
||||||
|
bash_cv_type_quad_t=yes
|
||||||
|
bash_cv_func_sigsetjmp=present
|
||||||
|
bash_cv_job_control_missing=present
|
||||||
|
bash_cv_sys_named_pipes=present
|
||||||
|
bash_cv_type_rlimit=long
|
||||||
|
bash_cv_printf_a_format=yes
|
||||||
|
bash_cv_unusable_rtsigs=no
|
||||||
|
|
||||||
|
######################################################################
|
||||||
|
# Apache
|
||||||
|
######################################################################
|
||||||
|
ac_cv_func_setpgrp_void=yes
|
||||||
|
apr_cv_process_shared_works=yes
|
||||||
|
apr_cv_tcp_nodelay_with_cork=yes
|
||||||
|
ap_void_ptr_lt_long=no
|
||||||
|
|
||||||
|
case ${host_cpu} in
|
||||||
|
x86_64 | alpha)
|
||||||
|
ac_cv_sizeof_ssize_t=8
|
||||||
|
ac_cv_sizeof_size_t=8
|
||||||
|
ac_cv_sizeof_pid_t=4
|
||||||
|
;;
|
||||||
|
*)
|
||||||
|
ac_cv_sizeof_ssize_t=4
|
||||||
|
ac_cv_sizeof_size_t=4
|
||||||
|
ac_cv_sizeof_pid_t=4
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
|
||||||
|
######################################################################
|
||||||
|
# gdb
|
||||||
|
######################################################################
|
||||||
|
gdb_cv_func_ptrace_args=int,int,long,long
|
||||||
|
|
||||||
|
######################################################################
|
||||||
|
# dpkg
|
||||||
|
######################################################################
|
||||||
|
dpkg_cv_va_copy=yes
|
||||||
|
|
||||||
|
######################################################################
|
||||||
|
# coreutils
|
||||||
|
######################################################################
|
||||||
|
ac_cv_search_clock_gettime=no
|
||||||
|
gl_cv_fs_space=yes
|
||||||
|
|
||||||
|
######################################################################
|
||||||
|
# valgrind
|
||||||
|
######################################################################
|
||||||
|
ac_cv_file__proc_self_fd=yes
|
||||||
|
ac_cv_file__proc_self_exe=yes
|
||||||
|
ac_cv_file__proc_self_maps=yes
|
||||||
|
|
||||||
|
######################################################################
|
||||||
|
# tcpdump
|
||||||
|
######################################################################
|
||||||
|
ac_cv_linux_vers=2
|
||||||
|
ac_cv_func_pcap_findalldevs=no
|
||||||
|
|
||||||
|
######################################################################
|
||||||
|
# flex
|
||||||
|
######################################################################
|
||||||
|
ac_cv_func_malloc_0_nonnull=yes
|
||||||
|
ac_cv_func_realloc_0_nonnull=yes
|
||||||
|
|
||||||
|
######################################################################
|
||||||
|
# tar
|
||||||
|
######################################################################
|
||||||
|
tar_gl_cv_func_mknod_works=yes
|
83
build-root/copyimg
Executable file
83
build-root/copyimg
Executable file
@ -0,0 +1,83 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
|
||||||
|
if [ $# -lt 2 ]; then
|
||||||
|
cat - <<EOF
|
||||||
|
$0 FROM-DIR TO-DIR ENVIRONMENT
|
||||||
|
|
||||||
|
Copies files from one directory to another with possible
|
||||||
|
transformations.
|
||||||
|
|
||||||
|
Files named FILE.spp will be transformed via the spp preprocessor
|
||||||
|
subject to environment definitions. Source FILE.copyimgspp results in
|
||||||
|
destination file FILE in the corresponding destination directory.
|
||||||
|
|
||||||
|
Files named FILE.copyimgsh are run as shell scripts in (i.e. via chdir)
|
||||||
|
the corresponding destination directory (and not copied).
|
||||||
|
|
||||||
|
First regular files are copied. Then transformations are preformed.
|
||||||
|
Finally, shell scripts are run.
|
||||||
|
EOF
|
||||||
|
exit 1;
|
||||||
|
fi
|
||||||
|
|
||||||
|
FROM_DIR=$1
|
||||||
|
TO_DIR=$2
|
||||||
|
|
||||||
|
FILTER=" -and -not -name '*~'";
|
||||||
|
FILTER="${FILTER} -and -not -name '.*~'";
|
||||||
|
FILTER="$FILTER -and -not -path '*/.git*'";
|
||||||
|
FILTER="$FILTER -and -not -path '*/.svn*'";
|
||||||
|
FILTER="$FILTER -and -not -path '*/.CVS*'";
|
||||||
|
|
||||||
|
FROM_FILES=`(cd $FROM_DIR; eval "find . -not -type d $FILTER")`;
|
||||||
|
FROM_DIRS=`(cd $FROM_DIR; eval "find . -type d $FILTER")`;
|
||||||
|
|
||||||
|
COPY_FILES=
|
||||||
|
SPP_FILES=
|
||||||
|
SH_FILES=
|
||||||
|
for f in $FROM_FILES; do
|
||||||
|
case $f in
|
||||||
|
*.copyimgspp) SPP_FILES="$SPP_FILES $f" ;;
|
||||||
|
*.copyimgsh) SH_FILES="$SH_FILES $f" ;;
|
||||||
|
*) COPY_FILES="$COPY_FILES $f";;
|
||||||
|
esac
|
||||||
|
done
|
||||||
|
|
||||||
|
# Make destination directories.
|
||||||
|
mkdir -p $TO_DIR;
|
||||||
|
if [ "$FROM_DIRS" != "" ]; then
|
||||||
|
for d in $FROM_DIRS; do
|
||||||
|
mkdir -p $TO_DIR/$d;
|
||||||
|
done
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Copy files
|
||||||
|
if [ "$COPY_FILES" != "" ]; then
|
||||||
|
tar -cf - -C $FROM_DIR $COPY_FILES | tar --preserve-permissions -xf - -C $TO_DIR;
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Use spp to transform any spp files
|
||||||
|
if [ "$SPP_FILES" != "" ]; then
|
||||||
|
for f in $SPP_FILES; do
|
||||||
|
d=`dirname $f`;
|
||||||
|
b=`basename $f .copyimgspp`;
|
||||||
|
mkdir -p $TO_DIR/$d;
|
||||||
|
t=$TO_DIR/$d/$b;
|
||||||
|
spp -o $TO_DIR/$d/$b $FROM_DIR/$f || exit 1;
|
||||||
|
done;
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Now that all files have been copied/created we run any shell scripts
|
||||||
|
ABS_FROM_DIR=`(cd $FROM_DIR; pwd)`;
|
||||||
|
if [ "$SH_FILES" != "" ]; then
|
||||||
|
# Allow directory to define some functions
|
||||||
|
if [ -f $FROM_DIR/copyimgsh-functions.sh ]; then
|
||||||
|
. $FROM_DIR/copyimgsh-functions.sh ;
|
||||||
|
fi ;
|
||||||
|
for f in $SH_FILES; do
|
||||||
|
d=`dirname $f`;
|
||||||
|
b=`basename $f`;
|
||||||
|
mkdir -p $TO_DIR/$d;
|
||||||
|
(cd $TO_DIR/$d; . $ABS_FROM_DIR/$d/$b) || exit 1;
|
||||||
|
done;
|
||||||
|
fi;
|
10
build-root/deb/debian/.gitignore
vendored
Normal file
10
build-root/deb/debian/.gitignore
vendored
Normal file
@ -0,0 +1,10 @@
|
|||||||
|
changelog
|
||||||
|
files
|
||||||
|
*debhelper*
|
||||||
|
*.substvars
|
||||||
|
*.install
|
||||||
|
vpp-dpdk-dkms*
|
||||||
|
vpp/
|
||||||
|
vpp-dev/
|
||||||
|
vpp-lib/
|
||||||
|
vpp-dpdk-dkms/
|
56
build-root/deb/debian/README.vpp
Executable file
56
build-root/deb/debian/README.vpp
Executable file
@ -0,0 +1,56 @@
|
|||||||
|
Building DEB packages
|
||||||
|
=====================
|
||||||
|
|
||||||
|
REQUIREMENTS:
|
||||||
|
You will need a working Internet connection to execute the build, because
|
||||||
|
the build procedure for the included "dpdk" project attempts to contact the
|
||||||
|
Internet host "dpdk.org".
|
||||||
|
|
||||||
|
There are three main parts to the process:
|
||||||
|
a) Stage the source tree so that dpkg-source will recognize its organization
|
||||||
|
and create a valid DSC source package for you;
|
||||||
|
b) Ensure that the tools required for building DEB packages are installed;
|
||||||
|
and
|
||||||
|
c) Launch the build.
|
||||||
|
|
||||||
|
1) Create, or have on hand, a local clone of the git repository, with no
|
||||||
|
untracked files or local modifications pending, up-to-date with the branch or
|
||||||
|
commit reference from which you wish to construct the source release.
|
||||||
|
|
||||||
|
The branch and repository origins will differ based on local conditions.
|
||||||
|
|
||||||
|
Example:
|
||||||
|
$ git clone -b master ssh://git@example.com:7999/~username/open-vpp
|
||||||
|
|
||||||
|
("-b master" can be omitted since master is the default branch)
|
||||||
|
|
||||||
|
2) Rename the checkout with a version number embedded in its name as is
|
||||||
|
conventional for code releases. Again, your version number may vary.
|
||||||
|
|
||||||
|
Example:
|
||||||
|
$ mv open-vpp open-vpp-0.0.0
|
||||||
|
|
||||||
|
3) Ensure that the dpkg-buildpackage program is installed.
|
||||||
|
|
||||||
|
E.g.,
|
||||||
|
|
||||||
|
# apt-get install dpkg-dev
|
||||||
|
|
||||||
|
4) From the PARENT directory of the debian/ directory, run:
|
||||||
|
|
||||||
|
$ cd open-vpp-0.0.0
|
||||||
|
$ dpkg-buildpackage -I .git -us -uc
|
||||||
|
|
||||||
|
(The -us and -uc flags omit GPG signatures from the .dsc and .changes files,
|
||||||
|
respectively. You can add them later, or if you are preparing a signed release
|
||||||
|
and have the signing key on hand, leave off the flags.)
|
||||||
|
|
||||||
|
5) Get rid of the source directory; you now either have a source package with
|
||||||
|
which you can re-create it at any time, or there were problems with the build,
|
||||||
|
and you should go back to your git checkout to fix them.
|
||||||
|
|
||||||
|
$ rm -r open-vpp-0.0.0
|
||||||
|
|
||||||
|
END
|
||||||
|
|
||||||
|
vim:set ai et sw=4 ts=4 tw=80:
|
1
build-root/deb/debian/compat
Executable file
1
build-root/deb/debian/compat
Executable file
@ -0,0 +1 @@
|
|||||||
|
9
|
54
build-root/deb/debian/control
Normal file
54
build-root/deb/debian/control
Normal file
@ -0,0 +1,54 @@
|
|||||||
|
Source: vpp
|
||||||
|
Section: net
|
||||||
|
Priority: extra
|
||||||
|
Maintainer: Cisco OpenVPP Packaging Team <bogus.address@cisco.com>
|
||||||
|
Build-Depends: debhelper (>= 9), dkms
|
||||||
|
Standards-Version: 3.9.4
|
||||||
|
|
||||||
|
Package: vpp
|
||||||
|
Architecture: any
|
||||||
|
Depends: ${shlibs:Depends}, ${misc:Depends}
|
||||||
|
Description: Vector Packet Processing--executables
|
||||||
|
This package provides VPP executables: vpe, vpe_api_test, vpe_json_test
|
||||||
|
vpe - the vector packet engine
|
||||||
|
vpe_api_test - vector packet engine API test tool
|
||||||
|
vpe_json_test - vector packet engine JSON test tool
|
||||||
|
|
||||||
|
Package: vpp-dbg
|
||||||
|
Architecture: any
|
||||||
|
Depends: ${shlibs:Depends}, ${misc:Depends}
|
||||||
|
Description: Vector Packet Processing--debug symbols
|
||||||
|
|
||||||
|
Package: vpp-dev
|
||||||
|
Architecture: any
|
||||||
|
Depends: ${shlibs:Depends}, ${misc:Depends}
|
||||||
|
Description: Vector Packet Processing--development support
|
||||||
|
This package contains development support files for the VPP libraries, including:
|
||||||
|
.
|
||||||
|
Do we need to list those header files or just leave it blank ?
|
||||||
|
dynamic vectors (vec.c), dynamic bitmaps (bitmap.h), allocation heap of
|
||||||
|
objects (heap.c), allocation pool(pool.h), dynamic hash tables (hash.c), memory
|
||||||
|
allocator (mheap.c), extendable printf-like interface built on top of vectors
|
||||||
|
(format.c), formats for data structures (std-formats.c), and support for clock
|
||||||
|
time-based function calls (timer.c).
|
||||||
|
.
|
||||||
|
TODO: reference and describe only the .h files
|
||||||
|
|
||||||
|
Package: vpp-lib
|
||||||
|
Architecture: any
|
||||||
|
Depends: ${shlibs:Depends}, ${misc:Depends}
|
||||||
|
Description: Vector Packet Processing--runtime libraries
|
||||||
|
This package contains the VPP shared libraries, including:
|
||||||
|
.
|
||||||
|
vppinfra - foundation library supporting vectors, hashes, bitmaps, pools, and string formatting.
|
||||||
|
dpdk - Intel DPDK library
|
||||||
|
svm - vm library
|
||||||
|
vlib - vector processing library
|
||||||
|
vlib-api - binary API library
|
||||||
|
vnet - network stack library
|
||||||
|
|
||||||
|
Package: vpp-dpdk-dkms
|
||||||
|
Architecture: any
|
||||||
|
Depends: ${shlibs:Depends}, ${misc:Depends}
|
||||||
|
Description: DPDK 2.1 igb_uio_driver
|
||||||
|
This package contains Linux kernel modules distributed with DPDK.
|
9
build-root/deb/debian/copyright
Normal file
9
build-root/deb/debian/copyright
Normal file
@ -0,0 +1,9 @@
|
|||||||
|
Format: http://www.debian.org/doc/packaging-manuals/copyright-format/1.0/
|
||||||
|
Upstream-Name: optional.
|
||||||
|
Upstream-Contact: optional.
|
||||||
|
Source: optional.
|
||||||
|
Disclaimer: optional.
|
||||||
|
Comment: optional.
|
||||||
|
License: Apache-2.0
|
||||||
|
Copyright: 2015 Cisco and/or its affiliates and others.
|
||||||
|
|
30
build-root/deb/debian/rules
Executable file
30
build-root/deb/debian/rules
Executable file
@ -0,0 +1,30 @@
|
|||||||
|
#!/usr/bin/make -f
|
||||||
|
# See debhelper(7) (uncomment to enable)
|
||||||
|
# output every command that modifies files on the build system.
|
||||||
|
DH_VERBOSE = 1
|
||||||
|
|
||||||
|
# see EXAMPLES in dpkg-buildflags(1) and read /usr/share/dpkg/*
|
||||||
|
DPKG_EXPORT_BUILDFLAGS = 1
|
||||||
|
include /usr/share/dpkg/default.mk
|
||||||
|
|
||||||
|
# see FEATURE AREAS in dpkg-buildflags(1)
|
||||||
|
#export DEB_BUILD_MAINT_OPTIONS = hardening=+all
|
||||||
|
|
||||||
|
# see ENVIRONMENT in dpkg-buildflags(1)
|
||||||
|
# package maintainers to append CFLAGS
|
||||||
|
#export DEB_CFLAGS_MAINT_APPEND = -Wall -pedantic
|
||||||
|
# package maintainers to append LDFLAGS
|
||||||
|
#export DEB_LDFLAGS_MAINT_APPEND = -Wl,--as-needed
|
||||||
|
|
||||||
|
# main packaging script based on dh7 syntax
|
||||||
|
%:
|
||||||
|
dh $@ --with dkms
|
||||||
|
|
||||||
|
override_dh_install:
|
||||||
|
dh_install --exclude .git
|
||||||
|
|
||||||
|
override_dh_strip:
|
||||||
|
dh_strip --dbg-package=vpp-dbg
|
||||||
|
|
||||||
|
override_dh_dkms:
|
||||||
|
dh_dkms -pvpp-dpdk-dkms
|
1
build-root/deb/debian/source/format
Executable file
1
build-root/deb/debian/source/format
Executable file
@ -0,0 +1 @@
|
|||||||
|
3.0 (native)
|
53
build-root/deb/debian/vpp-bin.README.Debian
Normal file
53
build-root/deb/debian/vpp-bin.README.Debian
Normal file
@ -0,0 +1,53 @@
|
|||||||
|
To run vpp with the debug shell:
|
||||||
|
|
||||||
|
sudo vpe unix interactive
|
||||||
|
|
||||||
|
which will result in a prompt that looks like:
|
||||||
|
|
||||||
|
DBGvpd#
|
||||||
|
|
||||||
|
To give it a spin, we can create a tap interface and try a simple ping
|
||||||
|
(with trace).
|
||||||
|
|
||||||
|
To create the tap:
|
||||||
|
|
||||||
|
DBGvpd# tap connect foobar
|
||||||
|
Created tap-0 for Linux tap 'foobar'
|
||||||
|
DBGvpd# show int
|
||||||
|
|
||||||
|
To assign it an ip address (and 'up' the interface):
|
||||||
|
|
||||||
|
DBGvpd# set int ip address tap-0 192.168.1.1/24
|
||||||
|
DBGvpd# set int state tap-0 up
|
||||||
|
|
||||||
|
To turn on packet tracing for the tap interface:
|
||||||
|
DBGvpd# trace add tapcli-rx 10
|
||||||
|
|
||||||
|
Now, to set up and try the other end from the unix prompt:
|
||||||
|
vagrant@vagrant-ubuntu-trusty-64:~$ sudo ip addr add 192.168.1.2/24 dev foobar
|
||||||
|
vagrant@vagrant-ubuntu-trusty-64:~$ ping -c 3 192.168.1.1
|
||||||
|
|
||||||
|
To look at the trace, back in the vpp CLI:
|
||||||
|
DBGvpd# show trace
|
||||||
|
|
||||||
|
And to stop tracing:
|
||||||
|
|
||||||
|
DBGvpd# clear trace
|
||||||
|
|
||||||
|
Other fun things to look at:
|
||||||
|
|
||||||
|
The vlib packet processing graph:
|
||||||
|
DBGvpd# show vlib graph
|
||||||
|
|
||||||
|
which will produce output like:
|
||||||
|
|
||||||
|
Name Next Previous
|
||||||
|
ip4-icmp-input error-punt [0] ip4-local
|
||||||
|
ip4-icmp-echo-request [1]
|
||||||
|
vpe-icmp4-oam [2]
|
||||||
|
|
||||||
|
To read this, the first column (Name) is the name of the node.
|
||||||
|
The second column (Next) is the name of the children of that node.
|
||||||
|
The third column (Previous) is the name of the parents of this node.
|
||||||
|
|
||||||
|
END
|
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user