Commit 38eb44fa authored by Artemy Kovalyov's avatar Artemy Kovalyov Committed by Doug Ledford

IB/uverbs: Add new SRQ type IB_SRQT_TM

Add new SRQ type capable of new tag matching feature.

When SRQ receives a message it will search through the matching list
for the corresponding posted receive buffer. The process of searching
the matching list is called tag matching.

In case the tag matching results in a match, the received message will
be placed in the address specified by the receive buffer. In case no
match was found the message will be placed in a generic buffer until the
corresponding receive buffer will be posted. These messages are called
unexpected and their set is called an unexpected list.
Signed-off-by: default avatarArtemy Kovalyov <artemyko@mellanox.com>
Reviewed-by: default avatarYossi Itigin <yosefe@mellanox.com>
Signed-off-by: default avatarLeon Romanovsky <leon@kernel.org>
Signed-off-by: default avatarDoug Ledford <dledford@redhat.com>
parent 9382d4e1
...@@ -1438,7 +1438,7 @@ static int create_qp(struct ib_uverbs_file *file, ...@@ -1438,7 +1438,7 @@ static int create_qp(struct ib_uverbs_file *file,
if (cmd->is_srq) { if (cmd->is_srq) {
srq = uobj_get_obj_read(srq, cmd->srq_handle, srq = uobj_get_obj_read(srq, cmd->srq_handle,
file->ucontext); file->ucontext);
if (!srq || srq->srq_type != IB_SRQT_BASIC) { if (!srq || srq->srq_type == IB_SRQT_XRC) {
ret = -EINVAL; ret = -EINVAL;
goto err_put; goto err_put;
} }
...@@ -3481,6 +3481,9 @@ static int __uverbs_create_xsrq(struct ib_uverbs_file *file, ...@@ -3481,6 +3481,9 @@ static int __uverbs_create_xsrq(struct ib_uverbs_file *file,
if (IS_ERR(obj)) if (IS_ERR(obj))
return PTR_ERR(obj); return PTR_ERR(obj);
if (cmd->srq_type == IB_SRQT_TM)
attr.ext.tag_matching.max_num_tags = cmd->max_num_tags;
if (cmd->srq_type == IB_SRQT_XRC) { if (cmd->srq_type == IB_SRQT_XRC) {
xrcd_uobj = uobj_get_read(uobj_get_type(xrcd), cmd->xrcd_handle, xrcd_uobj = uobj_get_read(uobj_get_type(xrcd), cmd->xrcd_handle,
file->ucontext); file->ucontext);
...@@ -3615,6 +3618,7 @@ ssize_t ib_uverbs_create_srq(struct ib_uverbs_file *file, ...@@ -3615,6 +3618,7 @@ ssize_t ib_uverbs_create_srq(struct ib_uverbs_file *file,
if (copy_from_user(&cmd, buf, sizeof cmd)) if (copy_from_user(&cmd, buf, sizeof cmd))
return -EFAULT; return -EFAULT;
memset(&xcmd, 0, sizeof(xcmd));
xcmd.response = cmd.response; xcmd.response = cmd.response;
xcmd.user_handle = cmd.user_handle; xcmd.user_handle = cmd.user_handle;
xcmd.srq_type = IB_SRQT_BASIC; xcmd.srq_type = IB_SRQT_BASIC;
......
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