From: Leon Romanovsky Date: Thu, 28 Mar 2019 13:12:58 +0000 (+0200) Subject: RDMA/core: Support object allocation in atomic context X-Git-Tag: v5.2-rc1~114^2~90 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=f6316032fd3243d3544603d94f237b976f90bb73;p=thirdparty%2Fkernel%2Flinux.git RDMA/core: Support object allocation in atomic context AH objects are allocated in atomic context and those allocations should be done with GFP_ATOMIC. Signed-off-by: Leon Romanovsky Signed-off-by: Jason Gunthorpe --- diff --git a/include/rdma/ib_verbs.h b/include/rdma/ib_verbs.h index 0e24f6b6c61da..7e965bc06477d 100644 --- a/include/rdma/ib_verbs.h +++ b/include/rdma/ib_verbs.h @@ -59,6 +59,8 @@ #include #include #include +#include +#include #include #include #include @@ -2281,8 +2283,11 @@ struct uverbs_attr_bundle; !__same_type(((struct drv_struct *)NULL)->member, \ struct ib_struct))) +#define rdma_zalloc_drv_obj_gfp(ib_dev, ib_type, gfp) \ + ((struct ib_type *)kzalloc(ib_dev->ops.size_##ib_type, gfp)) + #define rdma_zalloc_drv_obj(ib_dev, ib_type) \ - ((struct ib_type *)kzalloc(ib_dev->ops.size_##ib_type, GFP_KERNEL)) + rdma_zalloc_drv_obj_gfp(ib_dev, ib_type, GFP_KERNEL) #define DECLARE_RDMA_OBJ_SIZE(ib_struct) size_t size_##ib_struct