summaryrefslogtreecommitdiffstats
path: root/drivers/infiniband/hw/mlx5/flow.c
diff options
context:
space:
mode:
authorJason Gunthorpe <jgg@mellanox.com>2018-07-26 05:40:18 +0200
committerJason Gunthorpe <jgg@mellanox.com>2018-08-01 22:55:48 +0200
commite83f0ecdc40f2c3d63ff0e7f17462a29d12684a2 (patch)
tree3d8df27cf0e51e1353f49582cde9235c29603856 /drivers/infiniband/hw/mlx5/flow.c
parentIB/uverbs: Do not pass struct ib_device to the write based methods (diff)
downloadlinux-e83f0ecdc40f2c3d63ff0e7f17462a29d12684a2.tar.xz
linux-e83f0ecdc40f2c3d63ff0e7f17462a29d12684a2.zip
IB/uverbs: Do not pass struct ib_device to the ioctl methods
This does the same as the patch before, except for ioctl. The rules are the same, but for the ioctl methods the core code handles setting up the uobject. - Retrieve the ib_dev from the uobject->context->device. This is safe under ioctl as the core has already done rdma_alloc_begin_uobject and so CREATE calls are entirely protected by the rwsem. - Retrieve the ib_dev from uobject->object - Call ib_uverbs_get_ucontext() Signed-off-by: Jason Gunthorpe <jgg@mellanox.com>
Diffstat (limited to 'drivers/infiniband/hw/mlx5/flow.c')
-rw-r--r--drivers/infiniband/hw/mlx5/flow.c8
1 files changed, 3 insertions, 5 deletions
diff --git a/drivers/infiniband/hw/mlx5/flow.c b/drivers/infiniband/hw/mlx5/flow.c
index ee398a9b5f26..1a29f47f836e 100644
--- a/drivers/infiniband/hw/mlx5/flow.c
+++ b/drivers/infiniband/hw/mlx5/flow.c
@@ -39,8 +39,7 @@ static const struct uverbs_attr_spec mlx5_ib_flow_type[] = {
};
static int UVERBS_HANDLER(MLX5_IB_METHOD_CREATE_FLOW)(
- struct ib_device *ib_dev, struct ib_uverbs_file *file,
- struct uverbs_attr_bundle *attrs)
+ struct ib_uverbs_file *file, struct uverbs_attr_bundle *attrs)
{
struct mlx5_ib_flow_handler *flow_handler;
struct mlx5_ib_flow_matcher *fs_matcher;
@@ -109,7 +108,7 @@ static int UVERBS_HANDLER(MLX5_IB_METHOD_CREATE_FLOW)(
if (IS_ERR(flow_handler))
return PTR_ERR(flow_handler);
- ib_set_flow(uobj, &flow_handler->ibflow, qp, ib_dev);
+ ib_set_flow(uobj, &flow_handler->ibflow, qp, &dev->ib_dev);
return 0;
}
@@ -129,8 +128,7 @@ static int flow_matcher_cleanup(struct ib_uobject *uobject,
}
static int UVERBS_HANDLER(MLX5_IB_METHOD_FLOW_MATCHER_CREATE)(
- struct ib_device *ib_dev, struct ib_uverbs_file *file,
- struct uverbs_attr_bundle *attrs)
+ struct ib_uverbs_file *file, struct uverbs_attr_bundle *attrs)
{
struct ib_uobject *uobj = uverbs_attr_get_uobject(
attrs, MLX5_IB_ATTR_FLOW_MATCHER_CREATE_HANDLE);