From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id E5996A056A for ; Fri, 6 Mar 2020 15:27:55 +0100 (CET) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id BAA6E1BFD2; Fri, 6 Mar 2020 15:27:55 +0100 (CET) Received: from mail-pg1-f196.google.com (mail-pg1-f196.google.com [209.85.215.196]) by dpdk.org (Postfix) with ESMTP id 9082B23D; Fri, 6 Mar 2020 15:27:52 +0100 (CET) Received: by mail-pg1-f196.google.com with SMTP id t3so1170755pgn.1; Fri, 06 Mar 2020 06:27:52 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=fBuZB/+x6mLl/orvSN/EPmS1PAdYnw5+Sja+TcdtDHE=; b=J83ZuhRkw5tjPBigegSfrG5kKvVw67zanFIFIR22XvZXjA5yp9eQtV+eqTKk1Yiw0Z WsDpdKWKdjIRAH7H6xXfE/itFm7Zo4iT2Rh41OwwWRQqtzNwYHgBxqyUOkgBL+ApFgEC y0zpGrZY7B4+TS8U1rm4k2OKNNjj/TEu6yOIiN+5cIw+HNAFgyGUKkpWc3A7f18+Kpyh 3VS0ZGCaVIsQkzo+WKMFsDjkBi3ONg4+GmqtXFc4D84NkEolaVpoXviAdUItMfWJo0UY W8x2rdw3rUTZ5RS0wY3JLDNjx9s+ezqniZ79SVfYmeVtbYRJhMOeqjKQPqJgl0hCUeQn ujlQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=fBuZB/+x6mLl/orvSN/EPmS1PAdYnw5+Sja+TcdtDHE=; b=ASHy6lueCgI5QshM79Qdl+7vs9EgtqjYh3/GZnyAVCWKI40HmeRCRwNXiWMHv4bLrh +lzipt/k2S1aQzYEiGazVDBOsgnNnfktt/F9xIvalyDyQZatWLM9STaC4uEc0HiP1iYA G1ou4cmLol6h/tRKoy1OevLgZcviORkdBsysWjIl5JCzu+tzh/Dy5yksfNcr/kziQ9py UYEwQkt5m4uPjGP6T46EEcu2nd5T5qwOdglYqu5OysQZZ0rMjZ/YnhqGyvL4282G88id jJfgphEztOGABAcUSkaz3Jo+Wh/+IaZJgv1GxjrNuFL8nis/byoCv3Ut0Inyt3AT/O3+ a+cw== X-Gm-Message-State: ANhLgQ00pIxmE7r3OP7qgrjBGRb8m7rvFKKxBreFmysBu4uBgiRuWy97 aHFUfGE830LImE5orJoCPXc= X-Google-Smtp-Source: ADFU+vsnBEOJN78Wx/k9kjveoQcQuDiuQF9f/QwimS4sxDvcV9rtMKLnHuNKfzyUCbHHtxQYKUoggA== X-Received: by 2002:aa7:86c3:: with SMTP id h3mr3880710pfo.243.1583504871528; Fri, 06 Mar 2020 06:27:51 -0800 (PST) Received: from local.opencloud.tech.localdomain ([219.143.129.147]) by smtp.gmail.com with ESMTPSA id 69sm17512440pfz.97.2020.03.06.06.27.44 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 06 Mar 2020 06:27:51 -0800 (PST) From: xiangxia.m.yue@gmail.com To: matan@mellanox.com, alialnu@mellanox.com Cc: dev@dpdk.org, Tonghao Zhang , stable@dpdk.org Date: Fri, 6 Mar 2020 22:27:19 +0800 Message-Id: <1583504839-11329-1-git-send-email-xiangxia.m.yue@gmail.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1583146517-7079-1-git-send-email-xiangxia.m.yue@gmail.com> References: <1583146517-7079-1-git-send-email-xiangxia.m.yue@gmail.com> Subject: [dpdk-stable] [PATCH dpdk-dev v3] common/mlx5: fix dynamic loading reference X-BeenThere: stable@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches for DPDK stable branches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: stable-bounces@dpdk.org Sender: "stable" From: Tonghao Zhang When setting the CONFIG_RTE_BUILD_SHARED_LIB to y, and build the mlx5 pmd, there is a building error. To fix it, add RTE_IBVERBS_LINK_DLOPEN to include relative codes. mlx5_common.o: In function `mlx5_glue_init': drivers/common/mlx5/mlx5_common.c:324: undefined reference to `dlclose' Fixes: 7b4f1e6bd367 ("common/mlx5: introduce common library") Cc: stable@dpdk.org Signed-off-by: Tonghao Zhang Tested-by: Ali Alnubani --- v3: * rename the patch title * mv the dlfcn.h to define area * tested: https://travis-ci.com/ovn-open-virtual-networks/dpdk-next-net/builds/151882661 v2: * change the patch title --- drivers/common/mlx5/mlx5_common.c | 10 +++++++--- drivers/net/mlx4/mlx4.c | 4 +++- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/drivers/common/mlx5/mlx5_common.c b/drivers/common/mlx5/mlx5_common.c index 610fb48..9ea56f2 100644 --- a/drivers/common/mlx5/mlx5_common.c +++ b/drivers/common/mlx5/mlx5_common.c @@ -2,10 +2,12 @@ * Copyright 2019 Mellanox Technologies, Ltd */ -#include #include #include #include +#ifdef RTE_IBVERBS_LINK_DLOPEN +#include +#endif #include @@ -209,8 +211,6 @@ enum mlx5_class */ RTE_INIT_PRIO(mlx5_glue_init, CLASS) { - void *handle = NULL; - /* Initialize common log type. */ mlx5_common_logtype = rte_log_register("pmd.common.mlx5"); if (mlx5_common_logtype >= 0) @@ -233,6 +233,8 @@ enum mlx5_class /* The glue initialization was done earlier by mlx5 common library. */ #ifdef RTE_IBVERBS_LINK_DLOPEN char glue_path[sizeof(RTE_EAL_PMD_PATH) - 1 + sizeof("-glue")]; + void *handle = NULL; + const char *path[] = { /* * A basic security check is necessary before trusting @@ -320,8 +322,10 @@ enum mlx5_class mlx5_glue->fork_init(); return; glue_error: +#ifdef RTE_IBVERBS_LINK_DLOPEN if (handle) dlclose(handle); +#endif DRV_LOG(WARNING, "Cannot initialize MLX5 common due to missing" " run-time dependency on rdma-core libraries (libibverbs," " libmlx5)"); diff --git a/drivers/net/mlx4/mlx4.c b/drivers/net/mlx4/mlx4.c index a1dd658..8e29878 100644 --- a/drivers/net/mlx4/mlx4.c +++ b/drivers/net/mlx4/mlx4.c @@ -8,7 +8,6 @@ * mlx4 driver initialization. */ -#include #include #include #include @@ -18,6 +17,9 @@ #include #include #include +#ifdef RTE_IBVERBS_LINK_DLOPEN +#include +#endif /* Verbs headers do not support -pedantic. */ #ifdef PEDANTIC -- 1.8.3.1