diff options
author | Leon Romanovsky | 2019-02-03 13:55:50 +0100 |
---|---|---|
committer | Jason Gunthorpe | 2019-02-09 00:50:58 +0100 |
commit | 30471d4b20335d9bd9ae9b2382a1e1e97d18d86d (patch) | |
tree | e467a16ce8529808d9bb36acaec3c52c2c5ba82e /drivers/infiniband/core | |
parent | IB/core: Don't register each MAD agent for LSM notifier (diff) | |
download | kernel-qcow2-linux-30471d4b20335d9bd9ae9b2382a1e1e97d18d86d.tar.gz kernel-qcow2-linux-30471d4b20335d9bd9ae9b2382a1e1e97d18d86d.tar.xz kernel-qcow2-linux-30471d4b20335d9bd9ae9b2382a1e1e97d18d86d.zip |
RDMA/core: Share driver structure size with core
Add new macros to be used in drivers while registering ops structure and
IB/core while calling allocation routines, so drivers won't need to
perform kzalloc/kfree in their paths.
The change in allocation stage allows us to initialize common fields prior
to calling to drivers (e.g. restrack).
Signed-off-by: Leon Romanovsky <leonro@mellanox.com>
Signed-off-by: Jason Gunthorpe <jgg@mellanox.com>
Diffstat (limited to 'drivers/infiniband/core')
-rw-r--r-- | drivers/infiniband/core/device.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/drivers/infiniband/core/device.c b/drivers/infiniband/core/device.c index 32cd35c9b21e..d806a5c7b202 100644 --- a/drivers/infiniband/core/device.c +++ b/drivers/infiniband/core/device.c @@ -1228,6 +1228,8 @@ void ib_set_device_ops(struct ib_device *dev, const struct ib_device_ops *ops) (ptr)->name = ops->name; \ } while (0) +#define SET_OBJ_SIZE(ptr, name) SET_DEVICE_OP(ptr, size_##name) + SET_DEVICE_OP(dev_ops, add_gid); SET_DEVICE_OP(dev_ops, advise_mr); SET_DEVICE_OP(dev_ops, alloc_dm); |