buffers: add compile-time option to set buffer alignment

Type: improvement
Change-Id: I88c4c45bed0bdd8686e17e4f77a7d32a08c995aa
Signed-off-by: Damjan Marion <damarion@cisco.com>
diff --git a/src/vlib/CMakeLists.txt b/src/vlib/CMakeLists.txt
index 76de4ed..9c41216 100644
--- a/src/vlib/CMakeLists.txt
+++ b/src/vlib/CMakeLists.txt
@@ -22,6 +22,12 @@
   set(BUFFER_ALLOC_FAULT_INJECTOR 0 CACHE STRING "fault injector off")
 endif()
 
+if(VPP_PLATFORM_BUFFER_ALIGN)
+  set(VLIB_BUFFER_ALIGN ${VPP_PLATFORM_BUFFER_ALIGN})
+else()
+  set(VLIB_BUFFER_ALIGN ${VPP_CACHE_LINE_SIZE})
+endif()
+
 set(PRE_DATA_SIZE 128 CACHE STRING "Buffer headroom size.")
 
 if (CMAKE_BUILD_TYPE_UC STREQUAL "DEBUG")