]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
RDMA: Update the query_device() op
authorJason Gunthorpe <jgg@nvidia.com>
Tue, 26 May 2026 16:15:06 +0000 (13:15 -0300)
committerJason Gunthorpe <jgg@nvidia.com>
Wed, 3 Jun 2026 18:12:43 +0000 (15:12 -0300)
commitbad4e98893afdfe0b1a03433d3af53972bafc67c
tree490a8d35f4b42f27715283e36bab00397faedfaf
parent43b57d73ebbe5e7964a8b3ee3ffde0948fae6e2e
RDMA: Update the query_device() op

This op hasn't followed the normal pattern of passing NULL for udata when
invoked by the kernel. Instead the kernel caller creates a dummy ib_udata
on the stack and passes that in. It does not seem to currently be a bug,
but this flow should be modernized to use the new API flow and in the
process accept NULL as well.

Only mlx4 uses an input request structure, have every other driver call
ib_is_udata_in_empty() to enforce the lack of request structs.

Use ib_respond_empty_udata() in every driver that does not use a response
struct.

Ensure a check for NULL udata before calling ib_respond_udata() in
bnxt_re, efa, and mlx5.

Make mlx4 safe to be called with NULL.

Link: https://patch.msgid.link/r/2-v1-922fa8e828ba+f7-ib_udata_stack_jgg@nvidia.com
Signed-off-by: Jason Gunthorpe <jgg@nvidia.com>
17 files changed:
drivers/infiniband/core/device.c
drivers/infiniband/hw/bnxt_re/ib_verbs.c
drivers/infiniband/hw/cxgb4/provider.c
drivers/infiniband/hw/erdma/erdma_verbs.c
drivers/infiniband/hw/hns/hns_roce_main.c
drivers/infiniband/hw/ionic/ionic_ibdev.c
drivers/infiniband/hw/irdma/verbs.c
drivers/infiniband/hw/mana/main.c
drivers/infiniband/hw/mlx4/main.c
drivers/infiniband/hw/mthca/mthca_provider.c
drivers/infiniband/hw/ocrdma/ocrdma_verbs.c
drivers/infiniband/hw/qedr/verbs.c
drivers/infiniband/hw/usnic/usnic_ib_verbs.c
drivers/infiniband/hw/vmw_pvrdma/pvrdma_verbs.c
drivers/infiniband/sw/rdmavt/vt.c
drivers/infiniband/sw/rxe/rxe_verbs.c
drivers/infiniband/sw/siw/siw_verbs.c