summaryrefslogtreecommitdiffstats
path: root/vpp
diff options
context:
space:
mode:
authorDave Barach <dave@barachs.net>2016-01-22 08:23:09 -0500
committerDave Barach <dave@barachs.net>2016-01-22 08:23:27 -0500
commit61efa140b1f44e0c568697fbc31cf3f430131ab2 (patch)
tree780880f2fce0882840b204eb26bd7465ed7c7e09 /vpp
parentbfdedbd5a3ba7e6fdc036d212253aa55c9062211 (diff)
aarch64 CPU arch / ThunderX platform initial support
Change-Id: Ia2edd3cee2c25c26c7c47a9023744b97226434c7 Signed-off-by: Dave Barach <dave@barachs.net>
Diffstat (limited to 'vpp')
-rw-r--r--vpp/Makefile.am8
-rw-r--r--vpp/api/api.c21
-rw-r--r--vpp/api/test_client.c1
-rw-r--r--vpp/configure.ac39
-rw-r--r--vpp/vnet/main.c41
5 files changed, 85 insertions, 25 deletions
diff --git a/vpp/Makefile.am b/vpp/Makefile.am
index 5103646c..73e01b79 100644
--- a/vpp/Makefile.am
+++ b/vpp/Makefile.am
@@ -13,7 +13,7 @@
AUTOMAKE_OPTIONS = foreign subdir-objects
-AM_CFLAGS = -Wall @Q_PLATFORM_DEFINE@ @Q_PLATFORM_PLUGPATH@ @DPDK@
+AM_CFLAGS = -Wall @DPDK@ @IPSEC@ @VCGN@ @IPV6SR@
noinst_PROGRAMS =
BUILT_SOURCES =
@@ -75,9 +75,11 @@ if WITH_DPDK
vpp_LDADD += -l:libdpdk.a
endif
-# These go last
+vpp_LDADD += -lvppinfra -lm -lpthread -ldl
-vpp_LDADD += -lvppinfra -lm -lpthread -lcrypto -ldl
+if WITH_IPV6SR
+ vpp_LDADD += -lcrypto
+endif
SUFFIXES = .api.h .api
diff --git a/vpp/api/api.c b/vpp/api/api.c
index fe926791..9f3da214 100644
--- a/vpp/api/api.c
+++ b/vpp/api/api.c
@@ -52,7 +52,9 @@
#include <vnet/mpls-gre/mpls.h>
#include <vnet/dhcp/proxy.h>
#include <vnet/dhcp/client.h>
+#if IPV6SR > 0
#include <vnet/sr/sr.h>
+#endif
#include <vnet/dhcpv6/proxy.h>
#include <vlib/vlib.h>
#include <vlib/unix/unix.h>
@@ -73,7 +75,9 @@
#include <vnet/l2/l2_fib.h>
#if DPDK > 0
+#if IPSEC > 0
#include <vnet/ipsec/ipsec.h>
+#endif /* IPSEC */
#include <vnet/devices/virtio/vhost-user.h>
#endif
@@ -3276,6 +3280,9 @@ static void vl_api_set_arp_neighbor_limit_t_handler (vl_api_set_arp_neighbor_lim
static void vl_api_sr_tunnel_add_del_t_handler
(vl_api_sr_tunnel_add_del_t *mp)
{
+#if IPV6SR == 0
+ clib_warning ("unimplemented");
+#else
ip6_sr_add_del_tunnel_args_t _a, *a=&_a;
int rv = 0;
vl_api_sr_tunnel_add_del_reply_t * rmp;
@@ -3319,6 +3326,7 @@ static void vl_api_sr_tunnel_add_del_t_handler
out:
REPLY_MACRO(VL_API_SR_TUNNEL_ADD_DEL_REPLY);
+#endif
}
#define foreach_classify_add_del_table_field \
@@ -4509,6 +4517,10 @@ static void vl_api_input_acl_set_interface_t_handler
static void vl_api_ipsec_spd_add_del_t_handler
(vl_api_ipsec_spd_add_del_t * mp)
{
+#if IPSEC == 0
+ clib_warning ("unimplemented");
+#else
+
vlib_main_t *vm __attribute__((unused)) = vlib_get_main();
vl_api_ipsec_spd_add_del_reply_t * rmp;
int rv;
@@ -4520,6 +4532,7 @@ static void vl_api_ipsec_spd_add_del_t_handler
#endif
REPLY_MACRO(VL_API_IPSEC_SPD_ADD_DEL_REPLY);
+#endif
}
static void vl_api_ipsec_interface_add_del_spd_t_handler
@@ -4536,7 +4549,7 @@ static void vl_api_ipsec_interface_add_del_spd_t_handler
VALIDATE_SW_IF_INDEX(mp);
-#if DPDK > 0
+#if IPSEC > 0
rv = ipsec_set_interface_spd(vm, sw_if_index, spd_id, mp->is_add);
#else
rv = VNET_API_ERROR_UNIMPLEMENTED;
@@ -4554,7 +4567,7 @@ static void vl_api_ipsec_spd_add_del_entry_t_handler
vl_api_ipsec_spd_add_del_entry_reply_t * rmp;
int rv;
-#if DPDK > 0
+#if IPSEC > 0
ipsec_policy_t p;
p.id = ntohl(mp->spd_id);
@@ -4604,7 +4617,7 @@ static void vl_api_ipsec_sad_add_del_entry_t_handler
vlib_main_t *vm __attribute__((unused)) = vlib_get_main();
vl_api_ipsec_sad_add_del_entry_reply_t * rmp;
int rv;
-#if DPDK > 0
+#if IPSEC > 0
ipsec_sa_t sa;
sa.id = ntohl(mp->sad_id);
@@ -4830,7 +4843,7 @@ static void vl_api_ipsec_sa_set_key_t_handler
vlib_main_t *vm __attribute__((unused)) = vlib_get_main();
vl_api_ipsec_sa_set_key_reply_t *rmp;
int rv;
-#if DPDK > 0
+#if IPSEC > 0
ipsec_sa_t sa;
sa.id = ntohl(mp->sa_id);
sa.crypto_key_len = mp->crypto_key_length;
diff --git a/vpp/api/test_client.c b/vpp/api/test_client.c
index b635f04f..cfb133c7 100644
--- a/vpp/api/test_client.c
+++ b/vpp/api/test_client.c
@@ -42,7 +42,6 @@
#include <vppinfra/error.h>
#include <vnet/vnet.h>
-#include <vnet/sr/sr.h>
#include <vlib/vlib.h>
#include <vlib/unix/unix.h>
#include <vlibapi/api.h>
diff --git a/vpp/configure.ac b/vpp/configure.ac
index 8c7beb4d..f2756a30 100644
--- a/vpp/configure.ac
+++ b/vpp/configure.ac
@@ -7,27 +7,36 @@ AM_PROG_AS
AC_PROG_CC
AM_PROG_CC_C_O
-AC_ARG_WITH(q-plugin-prefix,
- AC_HELP_STRING([--with-q-plugin-prefix],[vlib plugin prefix]),
- [case $with_q_plugin_prefix in
- *) ;;
- esac])
-
-AC_ARG_WITH(q-platform,
- AC_HELP_STRING([--with-q-platform],[Build version for given platform (qnative)]),
- [case $with_q_platform in
- qnative) ;;
- *) with_q_platform=qnative;;
- esac])
-
AC_ARG_WITH(dpdk,
AC_HELP_STRING([--with-dpdk],[Use the Intel dpdk]),
[with_dpdk=1],
[with_dpdk=0])
+AC_ARG_WITH(ipsec,
+ AC_HELP_STRING([--without-ipsec],[Disable ipsec]),
+ [with_ipsec=0],
+ [with_ipsec=1])
+
+AC_ARG_WITH(vcgn,
+ AC_HELP_STRING([--without-vcgn],[Disable vcgn]),
+ [with_vcgn=0],
+ [with_vcgn=1])
+
+AC_ARG_WITH(ipv6sr,
+ AC_HELP_STRING([--without-ipv6sr],[Disable ipv6sr]),
+ [with_ipv6sr=0],
+ [with_ipv6sr=1])
+
AM_CONDITIONAL(WITH_DPDK, test "$with_dpdk" = "1")
-AC_SUBST(Q_PLATFORM_DEFINE,[-DQ_PLATFORM_${with_q_platform}])
-AC_SUBST(Q_PLATFORM_PLUGPATH,[-DQ_PLUGIN_PREFIX=${with_q_plugin_prefix}])
AC_SUBST(DPDK,[-DDPDK=${with_dpdk}])
+AM_CONDITIONAL(WITH_IPSEC, test "$with_ipsec" = "1")
+AC_SUBST(IPSEC,[-DIPSEC=${with_ipsec}])
+
+AM_CONDITIONAL(WITH_VCGN, test "$with_vcgn" = "1")
+AC_SUBST(VCGN,[-DVCGN=${with_vcgn}])
+
+AM_CONDITIONAL(WITH_IPV6SR, test "$with_ipv6sr" = "1")
+AC_SUBST(IPV6SR,[-DIPV6SR=${with_ipv6sr}])
+
AC_OUTPUT([Makefile])
diff --git a/vpp/vnet/main.c b/vpp/vnet/main.c
index d60b489e..1dffa7c2 100644
--- a/vpp/vnet/main.c
+++ b/vpp/vnet/main.c
@@ -52,8 +52,6 @@ vpe_main_init (vlib_main_t * vm)
return error;
if ((error = vlib_call_init_function (vm, ethernet_arp_init)))
return error;
- if ((error = vlib_call_init_function (vm, sr_init)))
- return error;
if ((error = vlib_call_init_function (vm, map_init)))
return error;
if ((error = vlib_call_init_function (vm, sixrd_init)))
@@ -72,8 +70,10 @@ vpe_main_init (vlib_main_t * vm)
return error;
if ((error = vlib_call_init_function (vm, vhost_user_init)))
return error;
+#if IPSEC > 0
if ((error = vlib_call_init_function (vm, ipsec_init)))
return error;
+#endif /* IPSEC */
#endif
if ((error = vlib_call_init_function (vm, vlibmemory_init)))
return error;
@@ -102,16 +102,20 @@ vpe_main_init (vlib_main_t * vm)
return error;
if ((error = vlib_call_init_function (vm, tuntap_init)))
return error;
+#if IPV6SR > 0
if ((error = vlib_call_init_function (vm, sr_init)))
return error;
+#endif
if ((error = vlib_call_init_function (vm, l2_classify_init)))
return error;
if ((error = vlib_call_init_function (vm, policer_init)))
return error;
if ((error = vlib_call_init_function (vm, vxlan_init)))
return error;
+#if VCGN > 0
if ((error = vlib_call_init_function (vm, vcgn_init)))
return error;
+#endif
if ((error = vlib_call_init_function (vm, li_init)))
return error;
@@ -339,6 +343,39 @@ u32 vlib_app_num_thread_stacks_needed (void)
return 1;
}
+/*
+ * Depending on the configuration selected above,
+ * it may be necessary to generate stub graph nodes.
+ * It is never OK to ignore "node 'x' refers to unknown node 'y'
+ * messages!
+ */
+
+#if IPV6SR == 0
+#define foreach_ipv6_sr_stub_node \
+_(ipsec-output, ipsec_output)
+#else
+#define foreach_ipv6_sr_stub_node
+#endif
+
+#define _(n,m) \
+static uword \
+m##_node_fn (vlib_main_t *vm, \
+ vlib_node_runtime_t *node, \
+ vlib_frame_t *frame) \
+{ \
+ clib_warning("unimplemented, leaking buffers..."); \
+ return 0; \
+} \
+ \
+VLIB_REGISTER_NODE(m##_node) = { \
+ .function = m##_node_fn, \
+ .name = #n, \
+ .vector_size = sizeof(u32), \
+ .type = VLIB_NODE_TYPE_INTERNAL, \
+};
+foreach_ipv6_sr_stub_node;
+#undef _
+
#if CLIB_DEBUG > 0
static clib_error_t *