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 69C7EA0573; Wed, 4 Mar 2020 16:14:23 +0100 (CET) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 6FCC82C16; Wed, 4 Mar 2020 16:14:22 +0100 (CET) Received: from mail-qv1-f68.google.com (mail-qv1-f68.google.com [209.85.219.68]) by dpdk.org (Postfix) with ESMTP id F41962BB8; Wed, 4 Mar 2020 16:14:20 +0100 (CET) Received: by mail-qv1-f68.google.com with SMTP id s15so918862qvn.8; Wed, 04 Mar 2020 07:14:20 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=ZEXXKtzeuJCHfJ4+l/cA05mH5V7UqbQ172ORVBRlge0=; b=jWMvVq/jHeZ64dzwKS5ZjLls0fcRoJjChee1iFep/VqqxBCyoD8s3C3ifAgRf1ErOs IOS1S0kilcWWFwrMAGyJ6MIr+lUfl+PA6/ofm1cfOS7YqaP1X4K/chhlzU2bcwRBl/NJ ZPdWOL8N4uToAPwNAzA6yS4fpHIBn3E26Km0TitwOPfMGKdehgRJ/h8N/W2obpK00IXH 3RcyjBGHzLB7DG/+yGZWyvkmCF0uRcEVvvVCs0pJx2ZQr6XJoTo3YxkdlR7D6wI1oI94 NfqzkrzioWmcdvPCi/vDq5jHPw5oMOoB9xv4uHrvcmoXx4HiHdemUSDdLqDwmRquuIzZ jjzg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=ZEXXKtzeuJCHfJ4+l/cA05mH5V7UqbQ172ORVBRlge0=; b=s30qbHcyNrHZPtxB8EAC5AJZh1Kg62r61HZrd911VzwNPdLr1yEg2mON53qdUH3DOI PtXq3kvpDV6RtMniYZjtQrrJ1Ksy6M9PlaKubm8jIh7UQg7klSTCELBxgsgmzrUp9Kbu 8p9k2M+hQMhHhyMqwZpGQVC6KcJw+tQza0aJLgZU7cHIZyy5bnQRuchvrxFYyRSVrUgZ w62WZPB6RSYT1ArsrV5DvXQ2NWkc2kG0ytL2nV8jxoYYlWOWGeGw2aejF0BuX0W/deMN 8wwmswW7amspu4qVMqVUz3UtTyaNr2uU/l7vHn38gqPIVzgBkzmL45Tmqb+J1f3F19IH GEBg== X-Gm-Message-State: ANhLgQ0rtPSlw11kJLWp3hrapC9N2QwJ7TR/awJ6E5vo8FbCmTlQN9gS GTiIZJMjZs8F5P4CHLknbUMTD/E/5X3xaKBNAOY= X-Google-Smtp-Source: ADFU+vs8wId0jY8sDsgD1Ym4FdnjEMOFsS23CFzUWWRxgaotvQ4GozKuh2ptRPKsr1Kb2MEPH1Y3PBFeDdkhDlfuNmQ= X-Received: by 2002:a0c:e7c7:: with SMTP id c7mr2469380qvo.188.1583334860217; Wed, 04 Mar 2020 07:14:20 -0800 (PST) MIME-Version: 1.0 References: <1583146517-7079-1-git-send-email-xiangxia.m.yue@gmail.com> In-Reply-To: From: Tonghao Zhang Date: Wed, 4 Mar 2020 23:13:42 +0800 Message-ID: To: Matan Azrad Cc: Raslan Darawsheh , Ali Alnubani , "dev@dpdk.org" , "stable@dpdk.org" Content-Type: text/plain; charset="UTF-8" Subject: Re: [dpdk-dev] [PATCH dpdk-dev v2] common/mlx5: fix possible building error X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" On Wed, Mar 4, 2020 at 10:25 PM Matan Azrad wrote: > > > > From: Tonghao Zhang > > On Tue, Mar 3, 2020 at 3:15 PM Matan Azrad wrote: > > > > > > > > > Hi > > > > > > From: xiangxia.m.yue@gmail.com > > > > 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 > > > > > > The title should point to the root cause - not to the results. > > > > > > Something like: > > > > > > common/mlx5: fix dynamic loading reference > > > > > > > drivers/common/mlx5/mlx5_common.c | 5 +++-- > > > > 1 file changed, 3 insertions(+), 2 deletions(-) > > > > > > > > diff --git a/drivers/common/mlx5/mlx5_common.c > > > > b/drivers/common/mlx5/mlx5_common.c > > > > index 610fb48..570a3f4 100644 > > > > --- a/drivers/common/mlx5/mlx5_common.c > > > > +++ b/drivers/common/mlx5/mlx5_common.c > > > > @@ -209,8 +209,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) > > > > @@ -249,6 +247,7 @@ enum mlx5_class > > > > mlx5_glue_path(glue_path, sizeof(glue_path)) : ""), > > > > }; > > > > unsigned int i = 0; > > > > + void *handle = NULL; > > > > void **sym; > > > > const char *dlmsg; > > > > > > > > @@ -320,8 +319,10 @@ enum mlx5_class > > > > mlx5_glue->fork_init(); > > > > return; > > > > glue_error: > > > > +#ifdef RTE_IBVERBS_LINK_DLOPEN > > > > if (handle) > > > > dlclose(handle); > > > > +#endif > > > > > > > > > What's about " #include " Is it compiled for you? > > Yes, still building fail. > > > If so, why dlclose is not known on your setup? > > When I fixed it, I found the codes in mlx5_glue_init, use the > > RTE_IBVERBS_LINK_DLOPEN. > > but dlclose is not included in it. I think we should add > > RTE_IBVERBS_LINK_DLOPEN to fix the building fail. > > I agree, but looks like the include should be in the define area too. No? No, the "dlfcn.h" in dpdk is not included in define area at all. [root@localhost dpdk-next-net]# grep -rwin "dlfcn.h" lib/librte_eal/common/eal_common_options.c:17:#include drivers/net/ark/ark_ethdev.c:7:#include drivers/net/mlx4/mlx4.c:11:#include drivers/common/mlx5/mlx5_common.c:5:#include examples/performance-thread/pthread_shim/pthread_shim.c:10:#include and other codes should be in define area, but not: drivers/net/ark/ark_ethdev.c:177 lib/librte_eal/common/eal_common_options.c:306 drivers/common/mlx5/mlx5_common.c:325(this patch fix) > > > > > > > > > > DRV_LOG(WARNING, "Cannot initialize MLX5 common due to > > > > missing" > > > > " run-time dependency on rdma-core libraries (libibverbs," > > > > " libmlx5)"); > > > > -- > > > > 1.8.3.1 > > > > > > > > > -- > > Thanks, > > Tonghao -- Thanks, Tonghao