aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/infiniband/sw
diff options
context:
space:
mode:
authorIra Weiny <ira.weiny@intel.com>2016-01-22 13:04:38 -0800
committerDoug Ledford <dledford@redhat.com>2016-03-10 20:37:27 -0500
commite85ec33d820e1f3f763a46f9fd41230ca0ce40c6 (patch)
treeacde61c970cf7808caa223b6ccb58cbcb7d0056f /drivers/infiniband/sw
parentIB/rdmavt: Remove unused variable from Queue Pair (diff)
downloadlinux-dev-e85ec33d820e1f3f763a46f9fd41230ca0ce40c6.tar.xz
linux-dev-e85ec33d820e1f3f763a46f9fd41230ca0ce40c6.zip
IB/rdmavt: add modify queue pair driver helpers
Low level drivers need to be able to check incoming attributes as well as be able to adjust their private data on queue pair modification. Add 2 driver callbacks, check_modify_qp and modify_qp, to facilitate this. Signed-off-by: Ira Weiny <ira.weiny@intel.com> Signed-off-by: Doug Ledford <dledford@redhat.com>
Diffstat (limited to 'drivers/infiniband/sw')
-rw-r--r--drivers/infiniband/sw/rdmavt/qp.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/drivers/infiniband/sw/rdmavt/qp.c b/drivers/infiniband/sw/rdmavt/qp.c
index 64b9c0191366..615358ec394d 100644
--- a/drivers/infiniband/sw/rdmavt/qp.c
+++ b/drivers/infiniband/sw/rdmavt/qp.c
@@ -970,6 +970,10 @@ int rvt_modify_qp(struct ib_qp *ibqp, struct ib_qp_attr *attr,
attr_mask, link))
goto inval;
+ if (rdi->driver_f.check_modify_qp &&
+ rdi->driver_f.check_modify_qp(qp, attr, attr_mask, udata))
+ goto inval;
+
if (attr_mask & IB_QP_AV) {
if (attr->ah_attr.dlid >= be16_to_cpu(IB_MULTICAST_LID_BASE))
goto inval;
@@ -1166,6 +1170,9 @@ int rvt_modify_qp(struct ib_qp *ibqp, struct ib_qp_attr *attr,
if (attr_mask & IB_QP_MAX_QP_RD_ATOMIC)
qp->s_max_rd_atomic = attr->max_rd_atomic;
+ if (rdi->driver_f.modify_qp)
+ rdi->driver_f.modify_qp(qp, attr, attr_mask, udata);
+
spin_unlock(&qp->s_lock);
spin_unlock_irq(&qp->r_lock);