From: Dennis Dalessandro <dennis.dalessandro-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
To: dledford-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org
Cc: linux-rdma-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
Ira Weiny <ira.weiny-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
Subject: [PATCH 2/7] IB/rdmavt: Add hardware driver send work request check
Date: Wed, 03 Feb 2016 14:14:45 -0800 [thread overview]
Message-ID: <20160203221441.1765.13106.stgit@scvm10.sc.intel.com> (raw)
In-Reply-To: <20160203221136.1765.8947.stgit-9QXIwq+3FY+1XWohqUldA0EOCMrvLtNR@public.gmane.org>
From: Ira Weiny <ira.weiny-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
Some hardware drivers requires additional checks on send WRs. Create an
optional call back to allow hardware drivers to reject a send WR.
Reviewed-by: Dennis Dalessandro <dennis.dalessandro-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
Signed-off-by: Ira Weiny <ira.weiny-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
---
drivers/infiniband/sw/rdmavt/qp.c | 4 ++++
include/rdma/rdma_vt.h | 2 ++
2 files changed, 6 insertions(+), 0 deletions(-)
diff --git a/drivers/infiniband/sw/rdmavt/qp.c b/drivers/infiniband/sw/rdmavt/qp.c
index 8efb0f5..34c92c0 100644
--- a/drivers/infiniband/sw/rdmavt/qp.c
+++ b/drivers/infiniband/sw/rdmavt/qp.c
@@ -1387,6 +1387,10 @@ static int rvt_post_one_wr(struct rvt_qp *qp, struct ib_send_wr *wr)
if (next == qp->s_last)
return -ENOMEM;
+ if (rdi->driver_f.check_send_wr &&
+ rdi->driver_f.check_send_wr(qp, wr))
+ return -EINVAL;
+
rkt = &rdi->lkey_table;
pd = ibpd_to_rvtpd(qp->ibqp.pd);
wqe = rvt_get_swqe_ptr(qp, qp->s_head);
diff --git a/include/rdma/rdma_vt.h b/include/rdma/rdma_vt.h
index 1b77065..52dfa9c 100644
--- a/include/rdma/rdma_vt.h
+++ b/include/rdma/rdma_vt.h
@@ -265,6 +265,8 @@ struct rvt_driver_provided {
void (*modify_qp)(struct rvt_qp *qp, struct ib_qp_attr *attr,
int attr_mask, struct ib_udata *udata);
+ int (*check_send_wr)(struct rvt_qp *qp, struct ib_send_wr *wr);
+
void (*notify_create_mad_agent)(struct rvt_dev_info *rdi, int port_idx);
void (*notify_free_mad_agent)(struct rvt_dev_info *rdi, int port_idx);
};
--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
next prev parent reply other threads:[~2016-02-03 22:14 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-02-03 22:14 [PATCH 0/7] IB/rdmavt: Finish adding core verbs support Dennis Dalessandro
[not found] ` <20160203221136.1765.8947.stgit-9QXIwq+3FY+1XWohqUldA0EOCMrvLtNR@public.gmane.org>
2016-02-03 22:14 ` [PATCH 1/7] IB/rdmavt: Add srq functionality to rdmavt Dennis Dalessandro
2016-02-03 22:14 ` Dennis Dalessandro [this message]
2016-02-03 22:14 ` [PATCH 3/7] IB/rdmavt: Add Mem affinity support Dennis Dalessandro
2016-02-03 22:15 ` [PATCH 4/7] IB/rdmavt: Clean up distinction between port number and index Dennis Dalessandro
2016-02-03 22:15 ` [PATCH 5/7] IB/rdmavt: Add query gid support Dennis Dalessandro
2016-02-03 22:15 ` [PATCH 6/7] IB/rdmavt: Add support for query_port, modify_port and get_port_immutable Dennis Dalessandro
2016-02-03 22:15 ` [PATCH 7/7] IB/rdmavt: Properly pass gfp to hw driver function Dennis Dalessandro
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20160203221441.1765.13106.stgit@scvm10.sc.intel.com \
--to=dennis.dalessandro-ral2jqcrhueavxtiumwx3w@public.gmane.org \
--cc=dledford-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org \
--cc=ira.weiny-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org \
--cc=linux-rdma-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.