Commit 9e7217ab authored by Krzysztof Karas's avatar Krzysztof Karas Committed by Tomasz Zawadzki
Browse files

env_dpdk: initialize OpenSSL library



Call OpenSSL library initialization explicitly.

Change-Id: I9c283bcd59cb0c1ebacaca0ac43db6024276acb5
Signed-off-by: default avatarKrzysztof Karas <krzysztof.karas@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/20665


Reviewed-by: default avatarJim Harris <jim.harris@samsung.com>
Tested-by: default avatarSPDK CI Jenkins <sys_sgci@intel.com>
Community-CI: Mellanox Build Bot
Reviewed-by: default avatarAleksey Marchuk <alexeymar@nvidia.com>
parent af9313b4
Loading
Loading
Loading
Loading
+21 −0
Original line number Diff line number Diff line
@@ -10,6 +10,10 @@
#include "spdk/version.h"
#include "spdk/env_dpdk.h"
#include "spdk/log.h"
#include "spdk/config.h"

#include <openssl/ssl.h>
#include <openssl/err.h>

#include <rte_config.h>
#include <rte_eal.h>
@@ -579,6 +583,7 @@ spdk_env_init(const struct spdk_env_opts *opts)
{
	char **dpdk_args = NULL;
	char *args_print = NULL, *args_tmp = NULL;
	OPENSSL_INIT_SETTINGS *settings;
	int i, rc;
	int orig_optind;
	bool legacy_mem;
@@ -603,6 +608,22 @@ spdk_env_init(const struct spdk_env_opts *opts)
		return -EINVAL;
	}

	settings = OPENSSL_INIT_new();
	if (!settings) {
		fprintf(stderr, "Failed to create openssl settings object\n");
		ERR_print_errors_fp(stderr);
		return -ENOMEM;
	}

	OPENSSL_INIT_set_config_file_flags(settings, 0);
	rc = OPENSSL_init_ssl(OPENSSL_INIT_LOAD_CONFIG, settings);
	if (rc != 1) {
		fprintf(stderr, "Failed to initialize OpenSSL\n");
		ERR_print_errors_fp(stderr);
		return -EINVAL;
	}
	OPENSSL_INIT_free(settings);

	rc = build_eal_cmdline(opts);
	if (rc < 0) {
		SPDK_ERRLOG("Invalid arguments to initialize DPDK\n");
+1 −1
Original line number Diff line number Diff line
@@ -12,7 +12,7 @@ shared:
	$(CC) $(COMMON_CFLAGS) -c -fPIC nvme.c -o nvme.o
	$(CC) $(COMMON_CFLAGS) -shared nvme.o -o libnvme_external.so
	$(CC) $(COMMON_CFLAGS) identify.c -o identify -L. -lnvme_external \
		-Wl,-rpath=$(SPDK_LIB_DIR) $(DEPLIBS)
		-Wl,-rpath=$(SPDK_LIB_DIR) $(DEPLIBS) $(SYS_LIB)

static:
	$(CC) $(COMMON_CFLAGS) nvme.c identify.c -o identify -Wl,--whole-archive \