From bb7418cf9ba89edef031d7ca5114d22afce8b8c5 Mon Sep 17 00:00:00 2001 From: Fan Zhang Date: Tue, 25 May 2021 15:50:30 +0100 Subject: dpdk: fix missing symbol Type: fix This patch fixes the missing symbol of dpdk_plugin.so when creating symmetric key. The solution is to add dependency of libssl to dpdk cryptodev and disable cryptodev engine when libssl is not presented. Signed-off-by: Fan Zhang Change-Id: I30aa6e3e3af1faefa82883bad613e1d82235a2ec (cherry picked from commit 3f3da0d27dcf83808f2691205b891a42ac2b4679) --- src/plugins/dpdk/CMakeLists.txt | 19 ++++++++++++++----- src/plugins/dpdk/cryptodev/cryptodev.h | 3 +-- src/plugins/dpdk/device/init.c | 12 ++++++++---- 3 files changed, 23 insertions(+), 11 deletions(-) diff --git a/src/plugins/dpdk/CMakeLists.txt b/src/plugins/dpdk/CMakeLists.txt index 386515e8eef..5de75e76289 100644 --- a/src/plugins/dpdk/CMakeLists.txt +++ b/src/plugins/dpdk/CMakeLists.txt @@ -117,9 +117,15 @@ endif() # DPDK plugin ############################################################################## -if (${DPDK_VERSION} VERSION_GREATER_EQUAL "20.8.0") - set(DPDK_CRYPTODEV_RAW_SOURCE cryptodev/cryptodev_raw_data_path.c) -endif () +if(OPENSSL_FOUND) + include_directories(${OPENSSL_INCLUDE_DIR}) + + set(DPDK_CRYPTODEV_OP_SOURCE cryptodev/cryptodev_op_data_path.c) + set(DPDK_CRYPTODEV_SOURCE cryptodev/cryptodev.c) + if (${DPDK_VERSION} VERSION_GREATER_EQUAL "20.8.0") + set(DPDK_CRYPTODEV_RAW_SOURCE cryptodev/cryptodev_raw_data_path.c) + endif() +endif() add_vpp_plugin(dpdk SOURCES @@ -133,8 +139,8 @@ add_vpp_plugin(dpdk device/format.c device/init.c device/node.c - cryptodev/cryptodev_op_data_path.c - cryptodev/cryptodev.c + ${DPDK_CRYPTODEV_OP_SOURCE} + ${DPDK_CRYPTODEV_SOURCE} ${DPDK_CRYPTODEV_RAW_SOURCE} MULTIARCH_SOURCES @@ -151,6 +157,9 @@ add_vpp_plugin(dpdk LINK_LIBRARIES ${DPDK_LINK_LIBRARIES} + LINK_LIBRARIES + ${OPENSSL_LIBRARIES} + COMPONENT vpp-plugin-dpdk ) diff --git a/src/plugins/dpdk/cryptodev/cryptodev.h b/src/plugins/dpdk/cryptodev/cryptodev.h index 1c013be265c..3b47b43f538 100644 --- a/src/plugins/dpdk/cryptodev/cryptodev.h +++ b/src/plugins/dpdk/cryptodev/cryptodev.h @@ -200,7 +200,6 @@ clib_error_t *cryptodev_register_cop_hdl (vlib_main_t *vm, u32 eidx); clib_error_t *__clib_weak cryptodev_register_raw_hdl (vlib_main_t *vm, u32 eidx); -clib_error_t * -dpdk_cryptodev_init (vlib_main_t * vm); +clib_error_t *__clib_weak dpdk_cryptodev_init (vlib_main_t *vm); #endif diff --git a/src/plugins/dpdk/device/init.c b/src/plugins/dpdk/device/init.c index 59d46f086c1..8b07e00dd2d 100644 --- a/src/plugins/dpdk/device/init.c +++ b/src/plugins/dpdk/device/init.c @@ -1842,11 +1842,15 @@ dpdk_process (vlib_main_t * vm, vlib_node_runtime_t * rt, vlib_frame_t * f) if (error) clib_error_report (error); - error = dpdk_cryptodev_init (vm); - if (error) + if (dpdk_cryptodev_init) { - vlib_log_warn (dpdk_main.log_cryptodev, "%U", format_clib_error, error); - clib_error_free (error); + error = dpdk_cryptodev_init (vm); + if (error) + { + vlib_log_warn (dpdk_main.log_cryptodev, "%U", format_clib_error, + error); + clib_error_free (error); + } } tm->worker_thread_release = 1; -- cgit 1.2.3-korg