Retire vpp_lite 91/5691/8
authorDamjan Marion <damarion@cisco.com>
Thu, 9 Mar 2017 19:38:15 +0000 (20:38 +0100)
committerDave Barach <openvpp@barachs.net>
Fri, 10 Mar 2017 19:35:49 +0000 (19:35 +0000)
vpp_lite platform is not needed anymore as same efect can be
achieved with following startup.conf config:

plugins {
plugin dpdk_plugin.so { disable }
}

Change-Id: I690ea8ceb1c6e1fe32e01e7da54e9958019a93bf
Signed-off-by: Damjan Marion <damarion@cisco.com>
18 files changed:
Makefile
build-data/platforms/vpp.mk
build-data/platforms/vpp_lite.mk [deleted file]
src/configure.ac
src/plugins/Makefile.am
src/plugins/ixge.am [new file with mode: 0644]
src/plugins/ixge/ixge.c [moved from src/vnet/devices/nic/ixge.c with 99% similarity]
src/plugins/ixge/ixge.h [moved from src/vnet/devices/nic/ixge.h with 99% similarity]
src/vlib/buffer.c
src/vnet.am
src/vnet/ethernet/sfp.c [moved from src/vnet/devices/nic/sfp.c with 98% similarity]
src/vnet/ethernet/sfp.h [moved from src/vnet/devices/nic/sfp.h with 100% similarity]
src/vpp-api/lua/bench.lua
src/vpp-api/lua/examples/cli/lua-cli.lua
src/vpp-api/lua/examples/example-classifier.lua
src/vpp-api/lua/examples/example-cli.lua
src/vpp/vnet/main.c
test/framework.py

index f0173cc..1527d60 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -230,18 +230,18 @@ define test
 endef
 
 test: bootstrap
-       $(call test,vpp_lite,vpp_lite,test)
+       $(call test,vpp,vpp,test)
 
 test-debug: bootstrap
-       $(call test,vpp_lite,vpp_lite_debug,test)
+       $(call test,vpp,vpp_debug,test)
 
 test-all: bootstrap
        $(eval EXTENDED_TESTS=yes)
-       $(call test,vpp_lite,vpp_lite,test)
+       $(call test,vpp,vpp,test)
 
 test-all-debug: bootstrap
        $(eval EXTENDED_TESTS=yes)
-       $(call test,vpp_lite,vpp_lite_debug,test)
+       $(call test,vpp,vpp_debug,test)
 
 test-help:
        @make -C test help
@@ -262,7 +262,7 @@ test-wipe-doc:
        @make -C test wipe-doc
 
 test-cov: bootstrap
-       $(call test,vpp_lite,vpp_lite_gcov,cov)
+       $(call test,vpp,vpp_gcov,cov)
 
 test-wipe-cov:
        @make -C test wipe-cov
@@ -271,10 +271,10 @@ test-checkstyle:
        @make -C test checkstyle
 
 retest:
-       $(call test,vpp_lite,vpp_lite,retest)
+       $(call test,vpp,vpp,retest)
 
 retest-debug:
-       $(call test,vpp_lite,vpp_lite_debug,retest)
+       $(call test,vpp,vpp_debug,retest)
 
 STARTUP_DIR ?= $(PWD)
 ifeq ("$(wildcard $(STARTUP_CONF))","")
@@ -376,8 +376,6 @@ endef
 verify: install-dep $(BR)/.bootstrap.ok dpdk-install-dev
        $(call banner,"Building for PLATFORM=vpp using gcc")
        @make -C build-root PLATFORM=vpp TAG=vpp wipe-all install-packages
-       $(call banner,"Building for PLATFORM=vpp_lite using gcc")
-       @make -C build-root PLATFORM=vpp_lite TAG=vpp_lite wipe-all install-packages
 ifeq ($(OS_ID)-$(OS_VERSION_ID),ubuntu-16.04)
        $(call banner,"Installing dependencies")
        @sudo -E apt-get update
index 401a383..c61375d 100644 (file)
@@ -35,11 +35,6 @@ vpp_uses_dpdk = yes
 
 vpp_root_packages = vpp gmod
 
-vpp_configure_args_vpp = --with-dpdk
-
-# Set these parameters carefully. The vlib_buffer_t is 128 bytes, i.e.
-vlib_configure_args_vpp = --with-pre-data=128
-
 # DPDK configuration parameters
 # vpp_uses_dpdk_cryptodev_sw = yes
 # vpp_uses_dpdk_mlx5_pmd = yes
diff --git a/build-data/platforms/vpp_lite.mk b/build-data/platforms/vpp_lite.mk
deleted file mode 100644 (file)
index a556b48..0000000
+++ /dev/null
@@ -1,50 +0,0 @@
-# Copyright (c) 2016 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_lite_arch = native
-ifeq ($(shell uname -m),x86_64)
-vpp_lite_march = corei7                                # Nehalem Instruction set
-vpp_lite_mtune = corei7-avx                    # Optimize for Sandy Bridge
-else
-vpp_lite_march = native
-vpp_lite_mtune = generic
-endif
-vpp_lite_native_tools = vppapigen
-
-vpp_lite_uses_dpdk = no
-
-# Uncoment to enable building unit tests
-#vpp_lite_enable_tests = yes
-
-vpp_lite_root_packages = vpp gmod
-
-vlib_configure_args_vpp_lite = --with-pre-data=128
-
-vnet_configure_args_vpp_lite =
-vpp_configure_args_vpp_lite =
-
-vpp_lite_debug_TAG_CFLAGS = -g -O0 -DCLIB_DEBUG -DFORTIFY_SOURCE=2 -march=$(MARCH) \
-       -fstack-protector-all -fPIC -Werror
-vpp_lite_debug_TAG_LDFLAGS = -g -O0 -DCLIB_DEBUG -DFORTIFY_SOURCE=2 -march=$(MARCH) \
-       -fstack-protector-all -fPIC -Werror
-
-vpp_lite_TAG_CFLAGS = -g -O2 -DFORTIFY_SOURCE=2 -march=$(MARCH) -mtune=$(MTUNE) \
-       -fstack-protector -fPIC -Werror
-vpp_lite_TAG_LDFLAGS = -g -O2 -DFORTIFY_SOURCE=2 -march=$(MARCH) -mtune=$(MTUNE) \
-       -fstack-protector -fPIC -Werror
-
-vpp_lite_gcov_TAG_CFLAGS = -g -O0 -DCLIB_DEBUG -march=$(MARCH) \
-       -fPIC -Werror -fprofile-arcs -ftest-coverage
-vpp_lite_gcov_TAG_LDFLAGS = -g -O0 -DCLIB_DEBUG -march=$(MARCH) \
-       -fPIC -Werror -coverage
index c22d152..d90740d 100644 (file)
@@ -97,7 +97,6 @@ DISABLE_ARG(papi,     [Disable Python API bindings])
 DISABLE_ARG(japi,      [Disable Java API bindings])
 
 # --with-X
-WITH_ARG(dpdk,         [Use use DPDK])
 WITH_ARG(dpdk_crypto_sw,[Use DPDK cryptodev SW PMDs])
 WITH_ARG(dpdk_mlx5_pmd,        [Use DPDK with mlx5 PMD])
 
@@ -130,7 +129,6 @@ AC_ARG_WITH(pre-data,
 AC_SUBST(PRE_DATA_SIZE,                [$with_pre_data])
 AC_SUBST(APICLI,               [-DVPP_API_TEST_BUILTIN=${n_with_apicli}])
 
-AC_DEFINE_UNQUOTED(DPDK,               [${n_with_dpdk}])
 AC_DEFINE_UNQUOTED(DPDK_SHARED_LIB,    [${n_enable_dpdk_shared}])
 AC_DEFINE_UNQUOTED(DPDK_CRYPTO_SW,     [${n_with_dpdk_crypto_sw}])
 AC_DEFINE_UNQUOTED(WITH_LIBSSL,                [${n_with_libssl}])
@@ -147,9 +145,11 @@ AC_SUBST(AR_FLAGS)
 
 # Please keep alphabetical order
 PLUGIN_ENABLED(acl)
+PLUGIN_ENABLED(dpdk)
 PLUGIN_ENABLED(flowperpkt)
 PLUGIN_ENABLED(ila)
 PLUGIN_ENABLED(ioam)
+PLUGIN_ENABLED(ixge)
 PLUGIN_ENABLED(lb)
 PLUGIN_ENABLED(sixrd)
 PLUGIN_ENABLED(snat)
index 7b36049..255e644 100644 (file)
@@ -33,7 +33,7 @@ if ENABLE_ACL_PLUGIN
 include acl.am
 endif
 
-if WITH_DPDK
+if ENABLE_DPDK_PLUGIN
 include dpdk.am
 endif
 
@@ -49,6 +49,10 @@ if ENABLE_IOAM_PLUGIN
 include ioam.am
 endif
 
+if ENABLE_IXGE_PLUGIN
+include ixge.am
+endif
+
 if ENABLE_LB_PLUGIN
 include lb.am
 endif
diff --git a/src/plugins/ixge.am b/src/plugins/ixge.am
new file mode 100644 (file)
index 0000000..7e61344
--- /dev/null
@@ -0,0 +1,20 @@
+# Copyright (c) 2016 Cisco Systems, Inc.
+# 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.
+
+vppplugins_LTLIBRARIES += ixge_plugin.la
+
+ixge_plugin_la_SOURCES = ixge/ixge.c
+
+noinst_HEADERS += ixge/ixge.h
+
+# vi:syntax=automake
similarity index 99%
rename from src/vnet/devices/nic/ixge.c
rename to src/plugins/ixge/ixge.c
index d4c4c6b..4eebc45 100644 (file)
@@ -32,8 +32,10 @@ typedef unsigned long long u32x4;
 #include <vlib/unix/unix.h>
 #include <vlib/pci/pci.h>
 #include <vnet/vnet.h>
-#include <vnet/devices/nic/ixge.h>
+#include <ixge/ixge.h>
 #include <vnet/ethernet/ethernet.h>
+#include <vnet/plugin/plugin.h>
+#include <vpp/app/version.h>
 
 #define IXGE_ALWAYS_POLL 0
 
@@ -2929,6 +2931,13 @@ ixge_set_next_node (ixge_rx_next_t next, char *name)
 }
 #endif
 
+/* *INDENT-OFF* */
+VLIB_PLUGIN_REGISTER () = {
+    .version = VPP_BUILD_VER,
+    .default_disabled = 1,
+};
+
+/* *INDENT-ON* */
 /*
  * fd.io coding-style-patch-verification: ON
  *
similarity index 99%
rename from src/vnet/devices/nic/ixge.h
rename to src/plugins/ixge/ixge.h
index a8e652d..779603b 100644 (file)
@@ -19,7 +19,7 @@
 #include <vnet/vnet.h>
 #include <vlib/pci/pci.h>
 #include <vlib/i2c.h>
-#include <vnet/devices/nic/sfp.h>
+#include <vnet/ethernet/sfp.h>
 #include <vnet/ip/ip4_packet.h>
 #include <vnet/ip/ip6_packet.h>
 
index 6ba8258..a517a59 100644 (file)
@@ -44,6 +44,7 @@
  */
 
 #include <vlib/vlib.h>
+#include <vlib/unix/unix.h>
 
 uword
 vlib_buffer_length_in_chain_slow_path (vlib_main_t * vm,
@@ -583,6 +584,11 @@ alloc_from_free_list (vlib_main_t * vm,
 
   dst = alloc_buffers;
 
+  /* wait with buffer memory allocation as long as possible
+     in case external buffer manager takes over */
+  if (PREDICT_FALSE (vm->os_physmem_alloc_aligned == 0))
+    unix_physmem_init (vm, 0 /* fail_if_physical_memory_not_present */ );
+
   n_filled = fill_free_list (vm, free_list, n_alloc_buffers);
   if (n_filled == 0)
     return 0;
index ca24c9c..bc9655c 100644 (file)
@@ -114,14 +114,16 @@ libvnet_la_SOURCES +=                             \
  vnet/ethernet/init.c                          \
  vnet/ethernet/interface.c                     \
  vnet/ethernet/node.c                          \
- vnet/ethernet/pg.c
+ vnet/ethernet/pg.c                            \
+ vnet/ethernet/sfp.c
 
 nobase_include_HEADERS +=                      \
  vnet/ethernet/arp_packet.h                    \
  vnet/ethernet/error.def                       \
  vnet/ethernet/ethernet.h                      \
  vnet/ethernet/packet.h                                \
- vnet/ethernet/types.def
+ vnet/ethernet/types.def                       \
+ vnet/ethernet/sfp.h
 
 ########################################
 # Layer 2 protocol: Ethernet bridging
@@ -792,14 +794,6 @@ nobase_include_HEADERS +=                  \
   vnet/pg/pg.h                                 \
   vnet/pg/edit.h
 
-if !WITH_DPDK
-libvnet_la_SOURCES +=                          \
-  vnet/devices/nic/ixge.c                       \
-  vnet/devices/nic/ixge.h                       \
-  vnet/devices/nic/sfp.c                        \
-  vnet/devices/nic/sfp.h
-endif
-
 ########################################
 # virtio
 ########################################
similarity index 98%
rename from src/vnet/devices/nic/sfp.c
rename to src/vnet/ethernet/sfp.c
index 9e9c008..624740e 100644 (file)
@@ -13,7 +13,7 @@
  * limitations under the License.
  */
 
-#include <vnet/devices/nic/sfp.h>
+#include <vnet/ethernet/sfp.h>
 
 static u8 *
 format_space_terminated (u8 * s, va_list * args)
index 8e5a0b4..c7231b9 100644 (file)
@@ -53,9 +53,9 @@ function do_bench()
 end
 
 root_dir = "/home/ubuntu/vpp"
-pneum_path = root_dir .. "/build-root/install-vpp_lite_debug-native/vpp-api/lib64/libpneum.so"
+pneum_path = root_dir .. "/build-root/install-vpp_debug-native/vpp-api/lib64/libpneum.so"
 vpp:init({ pneum_path = pneum_path })
-vpp:json_api(root_dir .. "/build-root/install-vpp_lite_debug-native/vpp/vpp-api/vpe.api.json")
+vpp:json_api(root_dir .. "/build-root/install-vpp_debug-native/vpp/vpp-api/vpe.api.json")
 
 vpp:connect("lua-bench")
 local n_tests = 10
index b3a24d7..4a27af5 100644 (file)
@@ -557,12 +557,12 @@ end
 
 function init_vpp(vpp)
   local root_dir = "/home/ubuntu/vpp"
-  local pneum_path = root_dir .. "/build-root/install-vpp_lite_debug-native/vpp-api/lib64/libpneum.so"
+  local pneum_path = root_dir .. "/build-root/install-vpp_debug-native/vpp-api/lib64/libpneum.so"
 
   vpp:init({ pneum_path = pneum_path })
 
   vpp:init({ pneum_path = pneum_path })
-  vpp:json_api(root_dir .. "/build-root/install-vpp_lite_debug-native/vpp/vpp-api/vpe.api.json")
+  vpp:json_api(root_dir .. "/build-root/install-vpp_debug-native/vpp/vpp-api/vpe.api.json")
 
 
 
index ec9c3d3..b127075 100644 (file)
@@ -20,12 +20,12 @@ local vpp = require "vpp-lapi"
 local bit = require("bit")
 
 root_dir = "/home/ubuntu/vpp"
-pneum_path = root_dir .. "/build-root/install-vpp_lite_debug-native/vpp-api/lib64/libpneum.so"
+pneum_path = root_dir .. "/build-root/install-vpp_debug-native/vpp-api/lib64/libpneum.so"
 
 
 vpp:init({ pneum_path = pneum_path })
 
-vpp:json_api(root_dir .. "/build-root/install-vpp_lite_debug-native/vpp/vpp-api/vpe.api.json")
+vpp:json_api(root_dir .. "/build-root/install-vpp_debug-native/vpp/vpp-api/vpe.api.json")
 
 vpp:connect("aytest")
 
index 8b84989..85425ca 100644 (file)
 vpp = require "vpp-lapi"
 
 root_dir = "/home/ubuntu/vpp"
-pneum_path = root_dir .. "/build-root/install-vpp_lite_debug-native/vpp-api/lib64/libpneum.so"
+pneum_path = root_dir .. "/build-root/install-vpp_debug-native/vpp-api/lib64/libpneum.so"
 
 vpp:init({ pneum_path = pneum_path })
 
-vpp:json_api(root_dir .. "/build-root/install-vpp_lite_debug-native/vpp/vpp-api/vpe.api.json")
+vpp:json_api(root_dir .. "/build-root/install-vpp_debug-native/vpp/vpp-api/vpe.api.json")
 
 vpp:connect("aytest")
 
index a566d95..d6a1232 100644 (file)
@@ -199,9 +199,6 @@ defaulted:
     {
       vm->init_functions_called = hash_create (0, /* value bytes */ 0);
       vpe_main_init (vm);
-#if DPDK == 0
-      unix_physmem_init (vm, 0 /* fail_if_physical_memory_not_present */ );
-#endif
       return vlib_unix_main (argc, argv);
     }
   else
index 6b1799a..a0284e3 100644 (file)
@@ -157,7 +157,9 @@ class VppTestCase(unittest.TestCase):
         cls.vpp_cmdline = [cls.vpp_bin, "unix",
                            "{", "nodaemon", debug_cli, coredump_size, "}",
                            "api-trace", "{", "on", "}",
-                           "api-segment", "{", "prefix", cls.shm_prefix, "}"]
+                           "api-segment", "{", "prefix", cls.shm_prefix, "}",
+                           "plugins", "{", "plugin", "dpdk_plugin.so", "{",
+                           "disable", "}", "}"]
         if cls.plugin_path is not None:
             cls.vpp_cmdline.extend(["plugin_path", cls.plugin_path])
         cls.logger.info("vpp_cmdline: %s" % cls.vpp_cmdline)