Skip to content

Commit 9826939

Browse files
committed
RDMA/uverbs: Add empty rdma_uattrs_has_raw_cap() declaration
The call to rdma_uattrs_has_raw_cap() is placed in mlx5 fs.c file, which is compiled without relation to CONFIG_INFINIBAND_USER_ACCESS. Despite the check is used only in flows with CONFIG_INFINIBAND_USER_ACCESS=y|m, the compilers generate the following error for CONFIG_INFINIBAND_USER_ACCESS=n builds. >> ERROR: modpost: "rdma_uattrs_has_raw_cap" [drivers/infiniband/hw/mlx5/mlx5_ib.ko] undefined! Fixes: f458ccd ("RDMA/uverbs: Check CAP_NET_RAW in user namespace for flow create") Reported-by: kernel test robot <lkp@intel.com> Closes: https://lore.kernel.org/oe-kbuild-all/202507080725.bh7xrhpg-lkp@intel.com/ Link: https://patch.msgid.link/72dee6b379bd709255a5d8e8010b576d50e47170.1751967071.git.leon@kernel.org Reviewed-by: Zhu Yanjun <yanjun.zhu@linux.dev> Reviewed-by: Parav Pandit <parav@nvidia.com> Signed-off-by: Leon Romanovsky <leonro@nvidia.com>
1 parent 475ac07 commit 9826939

1 file changed

Lines changed: 6 additions & 2 deletions

File tree

include/rdma/ib_verbs.h

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4810,15 +4810,19 @@ struct ib_ucontext *ib_uverbs_get_ucontext_file(struct ib_uverbs_file *ufile);
48104810

48114811
#if IS_ENABLED(CONFIG_INFINIBAND_USER_ACCESS)
48124812
int uverbs_destroy_def_handler(struct uverbs_attr_bundle *attrs);
4813+
bool rdma_uattrs_has_raw_cap(const struct uverbs_attr_bundle *attrs);
48134814
#else
48144815
static inline int uverbs_destroy_def_handler(struct uverbs_attr_bundle *attrs)
48154816
{
48164817
return 0;
48174818
}
4819+
static inline bool
4820+
rdma_uattrs_has_raw_cap(const struct uverbs_attr_bundle *attrs)
4821+
{
4822+
return false;
4823+
}
48184824
#endif
48194825

4820-
bool rdma_uattrs_has_raw_cap(const struct uverbs_attr_bundle *attrs);
4821-
48224826
struct net_device *rdma_alloc_netdev(struct ib_device *device, u32 port_num,
48234827
enum rdma_netdev_t type, const char *name,
48244828
unsigned char name_assign_type,

0 commit comments

Comments
 (0)