RDMA/bnxt_re: fix verbs undefined build errors

Message ID 20230701003059.23064-1-rdunlap@infradead.org
State New
Headers
Series RDMA/bnxt_re: fix verbs undefined build errors |

Commit Message

Randy Dunlap July 1, 2023, 12:30 a.m. UTC
  When INFINIBAND_USER_ACCESS is not set, the bnxt_re driver has
build errors:

ERROR: modpost: "uverbs_idr_class" [drivers/infiniband/hw/bnxt_re/bnxt_re.ko] undefined!
ERROR: modpost: "ib_uverbs_get_ucontext_file" [drivers/infiniband/hw/bnxt_re/bnxt_re.ko] undefined!
ERROR: modpost: "uverbs_destroy_def_handler" [drivers/infiniband/hw/bnxt_re/bnxt_re.ko] undefined!

Handle this case by making the driver depend on INFINIBAND_USER_ACCESS.

Fixes: 592e8b3226a2 ("RDMA/bnxt_re: Add bnxt_re driver build support")
Signed-off-by: Randy Dunlap <rdunlap@infradead.org>
Cc: Selvin Xavier <selvin.xavier@broadcom.com>
Cc: Jason Gunthorpe <jgg@nvidia.com>
Cc: Leon Romanovsky <leonro@nvidia.com>
Cc: linux-rdma@vger.kernel.org
Cc: Devesh Sharma <devesh.sharma@broadcom.com>
Cc: Somnath Kotur <somnath.kotur@broadcom.com>
Cc: Sriharsha Basavapatna <sriharsha.basavapatna@broadcom.com>
Cc: Doug Ledford <dledford@redhat.com>
---
 drivers/infiniband/hw/bnxt_re/Kconfig |    1 +
 1 file changed, 1 insertion(+)
  

Comments

Leon Romanovsky July 3, 2023, 1:28 p.m. UTC | #1
On Fri, Jun 30, 2023 at 05:30:59PM -0700, Randy Dunlap wrote:
> When INFINIBAND_USER_ACCESS is not set, the bnxt_re driver has
> build errors:
> 
> ERROR: modpost: "uverbs_idr_class" [drivers/infiniband/hw/bnxt_re/bnxt_re.ko] undefined!
> ERROR: modpost: "ib_uverbs_get_ucontext_file" [drivers/infiniband/hw/bnxt_re/bnxt_re.ko] undefined!
> ERROR: modpost: "uverbs_destroy_def_handler" [drivers/infiniband/hw/bnxt_re/bnxt_re.ko] undefined!
> 
> Handle this case by making the driver depend on INFINIBAND_USER_ACCESS.
> 
> Fixes: 592e8b3226a2 ("RDMA/bnxt_re: Add bnxt_re driver build support")
> Signed-off-by: Randy Dunlap <rdunlap@infradead.org>
> Cc: Selvin Xavier <selvin.xavier@broadcom.com>
> Cc: Jason Gunthorpe <jgg@nvidia.com>
> Cc: Leon Romanovsky <leonro@nvidia.com>
> Cc: linux-rdma@vger.kernel.org
> Cc: Devesh Sharma <devesh.sharma@broadcom.com>
> Cc: Somnath Kotur <somnath.kotur@broadcom.com>
> Cc: Sriharsha Basavapatna <sriharsha.basavapatna@broadcom.com>
> Cc: Doug Ledford <dledford@redhat.com>
> ---
>  drivers/infiniband/hw/bnxt_re/Kconfig |    1 +
>  1 file changed, 1 insertion(+)

I liked this variant [1] more as bnxt_re driver can theoretically work
without INFINIBAND_USER_ACCESS too.

[1] https://lore.kernel.org/all/20230703113025.356682-1-arnd@kernel.org

Thanks
  

Patch

diff -- a/drivers/infiniband/hw/bnxt_re/Kconfig b/drivers/infiniband/hw/bnxt_re/Kconfig
--- a/drivers/infiniband/hw/bnxt_re/Kconfig
+++ b/drivers/infiniband/hw/bnxt_re/Kconfig
@@ -3,6 +3,7 @@  config INFINIBAND_BNXT_RE
 	tristate "Broadcom Netxtreme HCA support"
 	depends on 64BIT
 	depends on INET && DCB && BNXT
+	depends on INFINIBAND_USER_ACCESS
 	help
 	  This driver supports Broadcom NetXtreme-E 10/25/40/50 gigabit
 	  RoCE HCAs.  To compile this driver as a module, choose M here: