Commit f6316032 authored by Leon Romanovsky's avatar Leon Romanovsky Committed by Jason Gunthorpe

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: default avatarLeon Romanovsky <leonro@mellanox.com>
Signed-off-by: default avatarJason Gunthorpe <jgg@mellanox.com>
parent feec576a
...@@ -59,6 +59,8 @@ ...@@ -59,6 +59,8 @@
#include <linux/mmu_notifier.h> #include <linux/mmu_notifier.h>
#include <linux/uaccess.h> #include <linux/uaccess.h>
#include <linux/cgroup_rdma.h> #include <linux/cgroup_rdma.h>
#include <linux/irqflags.h>
#include <linux/preempt.h>
#include <uapi/rdma/ib_user_verbs.h> #include <uapi/rdma/ib_user_verbs.h>
#include <rdma/restrack.h> #include <rdma/restrack.h>
#include <uapi/rdma/rdma_user_ioctl.h> #include <uapi/rdma/rdma_user_ioctl.h>
...@@ -2281,8 +2283,11 @@ struct uverbs_attr_bundle; ...@@ -2281,8 +2283,11 @@ struct uverbs_attr_bundle;
!__same_type(((struct drv_struct *)NULL)->member, \ !__same_type(((struct drv_struct *)NULL)->member, \
struct ib_struct))) 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) \ #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 #define DECLARE_RDMA_OBJ_SIZE(ib_struct) size_t size_##ib_struct
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment