diff options
author | Mike Marciniszyn <mike.marciniszyn@intel.com> | 2015-11-09 19:13:57 -0500 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2015-11-19 16:55:37 -0800 |
commit | c2f3ffb08593d8cf587ee0e4c40197b5eb68bd38 (patch) | |
tree | a902fa71122109c6e31aa223b30f3d5ec3fca7d5 /drivers/staging/rdma/hfi1/qp.c | |
parent | staging: rdma: use kmalloc_array instead of kmalloc (diff) | |
download | linux-dev-c2f3ffb08593d8cf587ee0e4c40197b5eb68bd38.tar.xz linux-dev-c2f3ffb08593d8cf587ee0e4c40197b5eb68bd38.zip |
staging/rdma/hfi1: move hfi1_migrate_qp
Move hfi1_migrate_qp from ruc.c to qp.[hc] in prep for modifying the QP
workqueue.
Signed-off-by: Mike Marciniszyn <mike.marciniszyn@intel.com>
Signed-off-by: Ira Weiny <ira.weiny@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/staging/rdma/hfi1/qp.c')
-rw-r--r-- | drivers/staging/rdma/hfi1/qp.c | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/drivers/staging/rdma/hfi1/qp.c b/drivers/staging/rdma/hfi1/qp.c index f8c36166962f..a2bbf0b8316c 100644 --- a/drivers/staging/rdma/hfi1/qp.c +++ b/drivers/staging/rdma/hfi1/qp.c @@ -1685,3 +1685,23 @@ void qp_comm_est(struct hfi1_qp *qp) qp->ibqp.event_handler(&ev, qp->ibqp.qp_context); } } + +/* + * Switch to alternate path. + * The QP s_lock should be held and interrupts disabled. + */ +void hfi1_migrate_qp(struct hfi1_qp *qp) +{ + struct ib_event ev; + + qp->s_mig_state = IB_MIG_MIGRATED; + qp->remote_ah_attr = qp->alt_ah_attr; + qp->port_num = qp->alt_ah_attr.port_num; + qp->s_pkey_index = qp->s_alt_pkey_index; + qp->s_flags |= HFI1_S_AHG_CLEAR; + + ev.device = qp->ibqp.device; + ev.element.qp = &qp->ibqp; + ev.event = IB_EVENT_PATH_MIG; + qp->ibqp.event_handler(&ev, qp->ibqp.qp_context); +} |