summaryrefslogtreecommitdiffstats
path: root/vnet
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 /vnet
parentbfdedbd5a3ba7e6fdc036d212253aa55c9062211 (diff)
aarch64 CPU arch / ThunderX platform initial support
Change-Id: Ia2edd3cee2c25c26c7c47a9023744b97226434c7 Signed-off-by: Dave Barach <dave@barachs.net>
Diffstat (limited to 'vnet')
-rw-r--r--vnet/Makefile.am12
-rw-r--r--vnet/configure.ac24
-rw-r--r--vnet/vnet/classify/vnet_classify.h21
-rw-r--r--vnet/vnet/devices/dpdk/dpdk.h1
-rw-r--r--vnet/vnet/devices/dpdk/init.c17
-rw-r--r--vnet/vnet/devices/dpdk/node.c12
-rw-r--r--vnet/vnet/map/map.c2
-rw-r--r--vnet/vnet/plugin/p1.c12
8 files changed, 95 insertions, 6 deletions
diff --git a/vnet/Makefile.am b/vnet/Makefile.am
index a0c20e9eb37..81cc012f046 100644
--- a/vnet/Makefile.am
+++ b/vnet/Makefile.am
@@ -13,7 +13,7 @@
AUTOMAKE_OPTIONS = foreign subdir-objects
-AM_CFLAGS = -Wall @DPDK@ @VIRL@
+AM_CFLAGS = -Wall @DPDK@ @VIRL@ @IPSEC@ @VCGN@ @IPV6SR@
libvnet_la_SOURCES =
libvnetplugin_la_SOURCES =
@@ -278,7 +278,7 @@ nobase_include_HEADERS += \
########################################
# Layer 3 protocol: IPSec
########################################
-if WITH_DPDK
+if WITH_IPSEC
libvnet_la_SOURCES += \
vnet/ipsec/ipsec.c \
vnet/ipsec/ipsec_cli.c \
@@ -295,13 +295,13 @@ libvnet_la_SOURCES += \
vnet/ipsec/ikev2_cli.c \
vnet/ipsec/ikev2_payload.c \
vnet/ipsec/ikev2_format.c
+endif
nobase_include_HEADERS += \
vnet/ipsec/ipsec.h \
vnet/ipsec/esp.h \
vnet/ipsec/ikev2.h \
vnet/ipsec/ikev2_priv.h
-endif
########################################
# Layer 3 protocol: osi
@@ -441,8 +441,11 @@ nobase_include_HEADERS += \
########################################
# ipv6 segment routing
########################################
+
+if WITH_IPV6SR
libvnet_la_SOURCES += \
vnet/sr/sr.c
+endif
nobase_include_HEADERS += \
vnet/sr/sr_packet.h \
@@ -452,6 +455,8 @@ nobase_include_HEADERS += \
########################################
# CGN
#########################################
+
+if WITH_VCGN
libvnet_la_SOURCES += \
vnet/vcgn/cnat_bulk_port.c \
vnet/vcgn/cnat_config.c \
@@ -480,6 +485,7 @@ libvnet_la_SOURCES += \
vnet/vcgn/index_list.c \
vnet/vcgn/spp_platform_trace_log.c \
vnet/vcgn/vcgn_classify.c
+endif
########################################
# DHCPv6 proxy
diff --git a/vnet/configure.ac b/vnet/configure.ac
index a570389e3fb..cc55dc3b4c1 100644
--- a/vnet/configure.ac
+++ b/vnet/configure.ac
@@ -17,10 +17,34 @@ AC_ARG_WITH(virl,
[with_virl=1],
[with_virl=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(DPDK,[-DDPDK=${with_dpdk}])
AM_CONDITIONAL(WITH_VIRL, test "$with_virl" = "1")
AC_SUBST(VIRL,[-DVIRL=${with_virl}])
+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/vnet/vnet/classify/vnet_classify.h b/vnet/vnet/classify/vnet_classify.h
index 03271ad2e06..3e93ba34229 100644
--- a/vnet/vnet/classify/vnet_classify.h
+++ b/vnet/vnet/classify/vnet_classify.h
@@ -294,7 +294,9 @@ vnet_classify_find_entry_inline (vnet_classify_table_t * t,
u32x4 result __attribute__((aligned(sizeof(u32x4))));
vnet_classify_bucket_t * b;
u32 value_index;
+#ifndef __aarch64__
u32 result_mask;
+#endif
u32 bucket_index;
int i;
@@ -357,6 +359,7 @@ vnet_classify_find_entry_inline (vnet_classify_table_t * t,
abort();
}
+#ifndef __aarch64__
result_mask = u32x4_zero_byte_mask (result);
if (result_mask == 0xffff)
{
@@ -367,6 +370,24 @@ vnet_classify_find_entry_inline (vnet_classify_table_t * t,
}
return (v);
}
+#else
+ {
+ typedef union {u32x4 as_u32x4; u64 as_u64[2];} u64u_t;
+ u64u_t u;
+ u.as_u32x4 = result;
+
+ if (u.as_u64[0] == 0 && u.as_u64[1] == 0)
+ {
+ if (PREDICT_TRUE(now))
+ {
+ v->hits++;
+ v->last_heard = now;
+ }
+ return (v);
+ }
+ }
+#endif
+
v = vnet_classify_entry_at_index (t, v, 1);
}
return 0;
diff --git a/vnet/vnet/devices/dpdk/dpdk.h b/vnet/vnet/devices/dpdk/dpdk.h
index fd984e4d4df..bb3ef4ffba8 100644
--- a/vnet/vnet/devices/dpdk/dpdk.h
+++ b/vnet/vnet/devices/dpdk/dpdk.h
@@ -75,6 +75,7 @@ typedef enum {
} dpdk_device_type_t;
#define foreach_dpdk_pmd \
+ _ ("rte_nicvf_pmd", THUNDERX) \
_ ("rte_em_pmd", E1000EM) \
_ ("rte_igb_pmd", IGB) \
_ ("rte_igbvf_pmd", IGBVF) \
diff --git a/vnet/vnet/devices/dpdk/init.c b/vnet/vnet/devices/dpdk/init.c
index a4b0f01475f..a8e84949a52 100644
--- a/vnet/vnet/devices/dpdk/init.c
+++ b/vnet/vnet/devices/dpdk/init.c
@@ -341,6 +341,7 @@ dpdk_lib_init (dpdk_main_t * dm)
/* 10G adapters */
case VNET_DPDK_PMD_IXGBE:
case VNET_DPDK_PMD_IXGBEVF:
+ case VNET_DPDK_PMD_THUNDERX:
xd->port_type = VNET_DPDK_PORT_TYPE_ETH_10G;
xd->nb_rx_desc = DPDK_NB_RX_DESC_10GE;
xd->nb_tx_desc = DPDK_NB_TX_DESC_10GE;
@@ -1686,6 +1687,22 @@ do { \
#undef _
+/*
+ * At the moment, the ThunderX NIC driver doesn't have
+ * an entry point named "devinitfn_rte_xxx_driver"
+ */
+#define _(d) \
+do { \
+ void d(void); \
+ __attribute__((unused)) void (* volatile pf)(void); \
+ pf = d; \
+} while(0);
+
+#ifdef RTE_LIBRTE_THUNDERVNIC_PMD
+_(rte_nicvf_pmd_init)
+#endif
+#undef _
+
dm->vlib_main = vm;
dm->vnet_main = vnet_get_main();
diff --git a/vnet/vnet/devices/dpdk/node.c b/vnet/vnet/devices/dpdk/node.c
index f05c37fed52..770af2a04ac 100644
--- a/vnet/vnet/devices/dpdk/node.c
+++ b/vnet/vnet/devices/dpdk/node.c
@@ -541,6 +541,7 @@ static inline u32 dpdk_device_input ( dpdk_main_t * dm,
u32 n_trace, trace_cnt __attribute__((unused));
vlib_buffer_free_list_t * fl;
u8 efd_discard_burst = 0;
+ u16 ip_align_offset = 0;
if (xd->admin_up == 0)
return 0;
@@ -559,6 +560,9 @@ static inline u32 dpdk_device_input ( dpdk_main_t * dm,
return 0;
}
+ if (xd->pmd == VNET_DPDK_PMD_THUNDERX)
+ ip_align_offset = 6;
+
vec_reset_length (xd->d_trace_buffers);
trace_cnt = n_trace = vlib_get_trace_count (vm, node);
@@ -706,6 +710,14 @@ static inline u32 dpdk_device_input ( dpdk_main_t * dm,
b0->current_data = l3_offset0;
b0->current_length = mb->data_len - l3_offset0;
+
+ if (PREDICT_FALSE (ip_align_offset != 0))
+ {
+ if (next0 == DPDK_RX_NEXT_IP4_INPUT ||
+ next0 == DPDK_RX_NEXT_IP6_INPUT)
+ b0->current_data += ip_align_offset;
+ }
+
b0->flags = VLIB_BUFFER_TOTAL_LENGTH_VALID;
if (VMWARE_LENGTH_BUG_WORKAROUND)
diff --git a/vnet/vnet/map/map.c b/vnet/vnet/map/map.c
index 3cf5e692489..b55c4c2e519 100644
--- a/vnet/vnet/map/map.c
+++ b/vnet/vnet/map/map.c
@@ -17,7 +17,7 @@
#include "map.h"
-#ifdef __powerpc64__
+#if defined(__powerpc64__) || defined(__aarch64__)
#include <vppinfra/xxhash.h>
static inline u32
diff --git a/vnet/vnet/plugin/p1.c b/vnet/vnet/plugin/p1.c
index 6ede7938ee9..9029f130dc5 100644
--- a/vnet/vnet/plugin/p1.c
+++ b/vnet/vnet/plugin/p1.c
@@ -51,8 +51,6 @@ _(format_ip6_address_and_length) \
_(udp_register_dst_port) \
_(ethernet_register_input_type) \
_(ethernet_set_flags) \
-_(vnet_register_sr_app_callback) \
-_(format_ip6_sr_header) \
_(format_ip6_address) \
_(unformat_ip6_address) \
_(ip6_main) \
@@ -101,9 +99,18 @@ _(efd_config)
#define foreach_dpdk_plugin_reference
#endif
+#if IPV6SR > 0
+#define foreach_ip6_sr_plugin_reference \
+_(vnet_register_sr_app_callback) \
+_(format_ip6_sr_header)
+#else
+#define foreach_ip6_sr_plugin_reference
+#endif
+
#define _(a) void a (void);
foreach_plugin_reference
foreach_dpdk_plugin_reference
+foreach_ip6_sr_plugin_reference
#undef _
void *vnet_library_plugin_references[] =
@@ -111,6 +118,7 @@ void *vnet_library_plugin_references[] =
#define _(a) &a,
foreach_plugin_reference
foreach_dpdk_plugin_reference
+ foreach_ip6_sr_plugin_reference
#undef _
};