diff options
Diffstat (limited to 'drivers/infiniband/hw/ipath/ipath_qp.c')
-rw-r--r-- | drivers/infiniband/hw/ipath/ipath_qp.c | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/drivers/infiniband/hw/ipath/ipath_qp.c b/drivers/infiniband/hw/ipath/ipath_qp.c index 812b42c500e..ded970bd13e 100644 --- a/drivers/infiniband/hw/ipath/ipath_qp.c +++ b/drivers/infiniband/hw/ipath/ipath_qp.c | |||
@@ -340,6 +340,7 @@ static void ipath_reset_qp(struct ipath_qp *qp, enum ib_qp_type type) | |||
340 | qp->s_flags &= IPATH_S_SIGNAL_REQ_WR; | 340 | qp->s_flags &= IPATH_S_SIGNAL_REQ_WR; |
341 | qp->s_hdrwords = 0; | 341 | qp->s_hdrwords = 0; |
342 | qp->s_wqe = NULL; | 342 | qp->s_wqe = NULL; |
343 | qp->s_pkt_delay = 0; | ||
343 | qp->s_psn = 0; | 344 | qp->s_psn = 0; |
344 | qp->r_psn = 0; | 345 | qp->r_psn = 0; |
345 | qp->r_msn = 0; | 346 | qp->r_msn = 0; |
@@ -563,8 +564,10 @@ int ipath_modify_qp(struct ib_qp *ibqp, struct ib_qp_attr *attr, | |||
563 | if (attr_mask & IB_QP_ACCESS_FLAGS) | 564 | if (attr_mask & IB_QP_ACCESS_FLAGS) |
564 | qp->qp_access_flags = attr->qp_access_flags; | 565 | qp->qp_access_flags = attr->qp_access_flags; |
565 | 566 | ||
566 | if (attr_mask & IB_QP_AV) | 567 | if (attr_mask & IB_QP_AV) { |
567 | qp->remote_ah_attr = attr->ah_attr; | 568 | qp->remote_ah_attr = attr->ah_attr; |
569 | qp->s_dmult = ipath_ib_rate_to_mult(attr->ah_attr.static_rate); | ||
570 | } | ||
568 | 571 | ||
569 | if (attr_mask & IB_QP_PATH_MTU) | 572 | if (attr_mask & IB_QP_PATH_MTU) |
570 | qp->path_mtu = attr->path_mtu; | 573 | qp->path_mtu = attr->path_mtu; |
@@ -850,6 +853,7 @@ struct ib_qp *ipath_create_qp(struct ib_pd *ibpd, | |||
850 | goto bail_qp; | 853 | goto bail_qp; |
851 | } | 854 | } |
852 | qp->ip = NULL; | 855 | qp->ip = NULL; |
856 | qp->s_tx = NULL; | ||
853 | ipath_reset_qp(qp, init_attr->qp_type); | 857 | ipath_reset_qp(qp, init_attr->qp_type); |
854 | break; | 858 | break; |
855 | 859 | ||
@@ -955,12 +959,20 @@ int ipath_destroy_qp(struct ib_qp *ibqp) | |||
955 | /* Stop the sending tasklet. */ | 959 | /* Stop the sending tasklet. */ |
956 | tasklet_kill(&qp->s_task); | 960 | tasklet_kill(&qp->s_task); |
957 | 961 | ||
962 | if (qp->s_tx) { | ||
963 | atomic_dec(&qp->refcount); | ||
964 | if (qp->s_tx->txreq.flags & IPATH_SDMA_TXREQ_F_FREEBUF) | ||
965 | kfree(qp->s_tx->txreq.map_addr); | ||
966 | } | ||
967 | |||
958 | /* Make sure the QP isn't on the timeout list. */ | 968 | /* Make sure the QP isn't on the timeout list. */ |
959 | spin_lock_irqsave(&dev->pending_lock, flags); | 969 | spin_lock_irqsave(&dev->pending_lock, flags); |
960 | if (!list_empty(&qp->timerwait)) | 970 | if (!list_empty(&qp->timerwait)) |
961 | list_del_init(&qp->timerwait); | 971 | list_del_init(&qp->timerwait); |
962 | if (!list_empty(&qp->piowait)) | 972 | if (!list_empty(&qp->piowait)) |
963 | list_del_init(&qp->piowait); | 973 | list_del_init(&qp->piowait); |
974 | if (qp->s_tx) | ||
975 | list_add(&qp->s_tx->txreq.list, &dev->txreq_free); | ||
964 | spin_unlock_irqrestore(&dev->pending_lock, flags); | 976 | spin_unlock_irqrestore(&dev->pending_lock, flags); |
965 | 977 | ||
966 | /* | 978 | /* |