summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChristophe Fontaine <christophe.fontaine@enea.com>2017-04-05 11:49:07 +0200
committerDamjan Marion <dmarion.lists@gmail.com>2017-05-15 16:46:28 +0000
commitf195a5693450083c7c6840c5aab02bfe5088cb40 (patch)
tree60435ef8c7adf995f439f52e90efb0856b384b06
parent259fca789a9f02c5bf60fd0734ba97045d4595bc (diff)
[plugins/dpdk] Support for CLIB_HAVE_64 (aarch64)
For platforms which do not support u8x32, such as aarch64, add an alternative implementation of 'dpdk_buffer_init_from_template'. Change-Id: Ia7e8d0a5985fa5925e063ed6e890208c73e39933 Signed-off-by: Christophe Fontaine <christophe.fontaine@enea.com>
-rw-r--r--src/plugins/dpdk/device/node.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/src/plugins/dpdk/device/node.c b/src/plugins/dpdk/device/node.c
index 0562b48a..69acc529 100644
--- a/src/plugins/dpdk/device/node.c
+++ b/src/plugins/dpdk/device/node.c
@@ -267,6 +267,7 @@ static_always_inline void
dpdk_buffer_init_from_template (void *d0, void *d1, void *d2, void *d3,
void *s)
{
+#if defined(CLIB_HAVE_VEC128)
int i;
for (i = 0; i < 2; i++)
{
@@ -275,6 +276,18 @@ dpdk_buffer_init_from_template (void *d0, void *d1, void *d2, void *d3,
*(u8x32 *) (((u8 *) d2) + i * 32) =
*(u8x32 *) (((u8 *) d3) + i * 32) = *(u8x32 *) (((u8 *) s) + i * 32);
}
+#elif defined(CLIB_HAVE_VEC64)
+ int i;
+ for (i = 0; i < 4; i++)
+ {
+ *(u8x16 *) (((u8 *) d0) + i * 16) =
+ *(u8x16 *) (((u8 *) d1) + i * 16) =
+ *(u8x16 *) (((u8 *) d2) + i * 16) =
+ *(u8x16 *) (((u8 *) d3) + i * 16) = *(u8x16 *) (((u8 *) s) + i * 16);
+ }
+#else
+#error "Either CLIB_HAVE_VEC128 or CLIB_HAVE_VEC64 has to be defined"
+#endif
}
/*