From: Tonghao Zhang <xiangxia.m.yue@gmail.com>
To: Matan Azrad <matan@mellanox.com>
Cc: Raslan Darawsheh <rasland@mellanox.com>,
Ali Alnubani <alialnu@mellanox.com>,
"dev@dpdk.org" <dev@dpdk.org>,
"stable@dpdk.org" <stable@dpdk.org>
Subject: Re: [dpdk-dev] [PATCH dpdk-dev v2] common/mlx5: fix possible building error
Date: Wed, 4 Mar 2020 23:13:42 +0800 [thread overview]
Message-ID: <CAMDZJNWKuMrO3PAz+C1g=_01C4mNpJrSnJtbUbV7OQm1BEASOg@mail.gmail.com> (raw)
In-Reply-To: <AM0PR0502MB4019DF79F914A8848750BBA3D2E50@AM0PR0502MB4019.eurprd05.prod.outlook.com>
On Wed, Mar 4, 2020 at 10:25 PM Matan Azrad <matan@mellanox.com> wrote:
>
>
>
> From: Tonghao Zhang
> > On Tue, Mar 3, 2020 at 3:15 PM Matan Azrad <matan@mellanox.com> wrote:
> > >
> > >
> > > Hi
> > >
> > > From: xiangxia.m.yue@gmail.com
> > > > From: Tonghao Zhang <xiangxia.m.yue@gmail.com>
> > > >
> > > > 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 <xiangxia.m.yue@gmail.com>
> > > > Tested-by: Ali Alnubani <alialnu@mellanox.com>
> > >
> > > 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 <dlfcn.h> " 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 <dlfcn.h>
drivers/net/ark/ark_ethdev.c:7:#include <dlfcn.h>
drivers/net/mlx4/mlx4.c:11:#include <dlfcn.h>
drivers/common/mlx5/mlx5_common.c:5:#include <dlfcn.h>
examples/performance-thread/pthread_shim/pthread_shim.c:10:#include <dlfcn.h>
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
next prev parent reply other threads:[~2020-03-04 15:14 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-03-02 10:55 xiangxia.m.yue
2020-03-03 7:15 ` Matan Azrad
2020-03-04 13:55 ` Tonghao Zhang
2020-03-04 14:25 ` Matan Azrad
2020-03-04 15:13 ` Tonghao Zhang [this message]
2020-03-04 16:03 ` Matan Azrad
2020-03-05 6:59 ` Tonghao Zhang
2020-03-06 14:27 ` [dpdk-dev] [PATCH dpdk-dev v3] common/mlx5: fix dynamic loading reference xiangxia.m.yue
2020-03-08 6:39 ` Matan Azrad
2020-03-09 9:10 ` Raslan Darawsheh
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to='CAMDZJNWKuMrO3PAz+C1g=_01C4mNpJrSnJtbUbV7OQm1BEASOg@mail.gmail.com' \
--to=xiangxia.m.yue@gmail.com \
--cc=alialnu@mellanox.com \
--cc=dev@dpdk.org \
--cc=matan@mellanox.com \
--cc=rasland@mellanox.com \
--cc=stable@dpdk.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).