Commit af1cb95d authored by Noa Osherovich's avatar Noa Osherovich Committed by Doug Ledford

IB/uverbs: Enable WQ creation and modification with cvlan offload

Enable user space application via WQ creation and modification to
turn on and off cvlan offload.
Signed-off-by: default avatarNoa Osherovich <noaos@mellanox.com>
Reviewed-by: default avatarMaor Gottlieb <maorg@mellanox.com>
Reviewed-by: default avatarYishai Hadas <yishaih@mellanox.com>
Signed-off-by: default avatarLeon Romanovsky <leon@kernel.org>
Signed-off-by: default avatarDoug Ledford <dledford@redhat.com>
parent 5f23d426
...@@ -3356,6 +3356,9 @@ int ib_uverbs_ex_create_wq(struct ib_uverbs_file *file, ...@@ -3356,6 +3356,9 @@ int ib_uverbs_ex_create_wq(struct ib_uverbs_file *file,
wq_init_attr.wq_context = file; wq_init_attr.wq_context = file;
wq_init_attr.wq_type = cmd.wq_type; wq_init_attr.wq_type = cmd.wq_type;
wq_init_attr.event_handler = ib_uverbs_wq_event_handler; wq_init_attr.event_handler = ib_uverbs_wq_event_handler;
if (ucore->inlen >= (offsetof(typeof(cmd), create_flags) +
sizeof(cmd.create_flags)))
wq_init_attr.create_flags = cmd.create_flags;
obj->uevent.events_reported = 0; obj->uevent.events_reported = 0;
INIT_LIST_HEAD(&obj->uevent.event_list); INIT_LIST_HEAD(&obj->uevent.event_list);
wq = pd->device->create_wq(pd, &wq_init_attr, uhw); wq = pd->device->create_wq(pd, &wq_init_attr, uhw);
...@@ -3511,7 +3514,7 @@ int ib_uverbs_ex_modify_wq(struct ib_uverbs_file *file, ...@@ -3511,7 +3514,7 @@ int ib_uverbs_ex_modify_wq(struct ib_uverbs_file *file,
if (!cmd.attr_mask) if (!cmd.attr_mask)
return -EINVAL; return -EINVAL;
if (cmd.attr_mask > (IB_WQ_STATE | IB_WQ_CUR_STATE)) if (cmd.attr_mask > (IB_WQ_STATE | IB_WQ_CUR_STATE | IB_WQ_FLAGS))
return -EINVAL; return -EINVAL;
wq = idr_read_wq(cmd.wq_handle, file->ucontext); wq = idr_read_wq(cmd.wq_handle, file->ucontext);
...@@ -3520,6 +3523,10 @@ int ib_uverbs_ex_modify_wq(struct ib_uverbs_file *file, ...@@ -3520,6 +3523,10 @@ int ib_uverbs_ex_modify_wq(struct ib_uverbs_file *file,
wq_attr.curr_wq_state = cmd.curr_wq_state; wq_attr.curr_wq_state = cmd.curr_wq_state;
wq_attr.wq_state = cmd.wq_state; wq_attr.wq_state = cmd.wq_state;
if (cmd.attr_mask & IB_WQ_FLAGS) {
wq_attr.flags = cmd.flags;
wq_attr.flags_mask = cmd.flags_mask;
}
ret = wq->device->modify_wq(wq, &wq_attr, cmd.attr_mask, uhw); ret = wq->device->modify_wq(wq, &wq_attr, cmd.attr_mask, uhw);
put_wq_read(wq); put_wq_read(wq);
return ret; return ret;
......
...@@ -1061,6 +1061,8 @@ struct ib_uverbs_ex_create_wq { ...@@ -1061,6 +1061,8 @@ struct ib_uverbs_ex_create_wq {
__u32 cq_handle; __u32 cq_handle;
__u32 max_wr; __u32 max_wr;
__u32 max_sge; __u32 max_sge;
__u32 create_flags; /* Use enum ib_wq_flags */
__u32 reserved;
}; };
struct ib_uverbs_ex_create_wq_resp { struct ib_uverbs_ex_create_wq_resp {
...@@ -1089,6 +1091,8 @@ struct ib_uverbs_ex_modify_wq { ...@@ -1089,6 +1091,8 @@ struct ib_uverbs_ex_modify_wq {
__u32 wq_handle; __u32 wq_handle;
__u32 wq_state; __u32 wq_state;
__u32 curr_wq_state; __u32 curr_wq_state;
__u32 flags; /* Use enum ib_wq_flags */
__u32 flags_mask; /* Use enum ib_wq_flags */
}; };
/* Prevent memory allocation rather than max expected size */ /* Prevent memory allocation rather than max expected size */
......
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