From: Leon Romanovsky <leon@kernel.org>
To: Jason Gunthorpe <jgg@mellanox.com>
Cc: Doug Ledford <dledford@redhat.com>,
RDMA mailing list <linux-rdma@vger.kernel.org>,
Randy Dunlap <rdunlap@infradead.org>,
Yishai Hadas <yishaih@mellanox.com>,
Stephen Rothwell <sfr@canb.auug.org.au>,
Linux Next Mailing List <linux-next@vger.kernel.org>
Subject: Re: [PATCH rdma-rc] RDMA/mlx5: Fix compilation breakage without INFINIBAND_USER_ACCESS
Date: Thu, 30 Jan 2020 17:47:26 +0200 [thread overview]
Message-ID: <20200130154726.GH3326@unreal> (raw)
In-Reply-To: <20200130153426.GF21192@mellanox.com>
On Thu, Jan 30, 2020 at 11:34:26AM -0400, Jason Gunthorpe wrote:
> On Thu, Jan 30, 2020 at 01:29:57PM +0200, Leon Romanovsky wrote:
> > From: Leon Romanovsky <leonro@mellanox.com>
> >
> > Compilation of mlx5 driver without CONFIG_INFINIBAND_USER_ACCESS generates
> > the following error.
> >
> > on x86_64:
> >
> > ld: drivers/infiniband/hw/mlx5/main.o: in function `mlx5_ib_handler_MLX5_IB_METHOD_VAR_OBJ_ALLOC':
> > main.c:(.text+0x186d): undefined reference to `ib_uverbs_get_ucontext_file'
> > ld: drivers/infiniband/hw/mlx5/main.o:(.rodata+0x2480): undefined reference to `uverbs_idr_class'
> > ld: drivers/infiniband/hw/mlx5/main.o:(.rodata+0x24d8): undefined reference to `uverbs_destroy_def_handler'
> >
> > Guard the problematic code, so VAR objects API won't be compiled without CONFIG_INFINIBAND_USER_ACCESS.
> >
> > Fixes: 7be76bef320b ("IB/mlx5: Introduce VAR object and its alloc/destroy methods")
> > Reported-by: Randy Dunlap <rdunlap@infradead.org>
> > Signed-off-by: Leon Romanovsky <leonro@mellanox.com>
> > drivers/infiniband/hw/mlx5/main.c | 22 +++++++++++++---------
> > 1 file changed, 13 insertions(+), 9 deletions(-)
>
> Hurm. This is actually a side effect of some other code that needs to
> be deleted.. We can now make all the generated structs static and rely
> on compiler pruning to sort this out.
>
> So this:
>
> if (IS_ENABLED(CONFIG_INFINIBAND_USER_ACCESS))
> dev->ib_dev.driver_def = mlx5_ib_defs;
>
> Will cause the compiler to drop the entire tree of stuff, above
> references inclded.
It is viable solution too, more cryptic than previous one, but cleaner for sure.
Thanks
next prev parent reply other threads:[~2020-01-30 15:47 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-01-30 11:29 [PATCH rdma-rc] RDMA/mlx5: Fix compilation breakage without INFINIBAND_USER_ACCESS Leon Romanovsky
2020-01-30 13:38 ` Randy Dunlap
2020-01-30 15:34 ` Jason Gunthorpe
2020-01-30 15:47 ` Leon Romanovsky [this message]
2020-01-30 16:26 ` Randy Dunlap
2020-01-30 20:43 ` Jason Gunthorpe
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=20200130154726.GH3326@unreal \
--to=leon@kernel.org \
--cc=dledford@redhat.com \
--cc=jgg@mellanox.com \
--cc=linux-next@vger.kernel.org \
--cc=linux-rdma@vger.kernel.org \
--cc=rdunlap@infradead.org \
--cc=sfr@canb.auug.org.au \
--cc=yishaih@mellanox.com \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.