diff options
author | Bryan O'Sullivan <bos@pathscale.com> | 2006-07-01 07:35:50 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@g5.osdl.org> | 2006-07-01 12:55:58 -0400 |
commit | ddd4bb22108417fdc5c35324bd13a3265581ae76 (patch) | |
tree | 5cc35e54e8761af27746bae48ef66318237ad8a0 /drivers/infiniband/hw/ipath/ipath_qp.c | |
parent | 759d57686dab8169ca68bbf938ce8e965d1e107a (diff) |
[PATCH] IB/ipath: share more common code between RC and UC protocols
Signed-off-by: Ralph Campbell <ralph.campbell@qlogic.com>
Signed-off-by: Bryan O'Sullivan <bryan.osullivan@qlogic.com>
Cc: "Michael S. Tsirkin" <mst@mellanox.co.il>
Cc: Roland Dreier <rolandd@cisco.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'drivers/infiniband/hw/ipath/ipath_qp.c')
-rw-r--r-- | drivers/infiniband/hw/ipath/ipath_qp.c | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/drivers/infiniband/hw/ipath/ipath_qp.c b/drivers/infiniband/hw/ipath/ipath_qp.c index 28fffbd4bee6..e1d31bccf3eb 100644 --- a/drivers/infiniband/hw/ipath/ipath_qp.c +++ b/drivers/infiniband/hw/ipath/ipath_qp.c | |||
@@ -709,9 +709,7 @@ struct ib_qp *ipath_create_qp(struct ib_pd *ibpd, | |||
709 | spin_lock_init(&qp->r_rq.lock); | 709 | spin_lock_init(&qp->r_rq.lock); |
710 | atomic_set(&qp->refcount, 0); | 710 | atomic_set(&qp->refcount, 0); |
711 | init_waitqueue_head(&qp->wait); | 711 | init_waitqueue_head(&qp->wait); |
712 | tasklet_init(&qp->s_task, | 712 | tasklet_init(&qp->s_task, ipath_do_ruc_send, |
713 | init_attr->qp_type == IB_QPT_RC ? | ||
714 | ipath_do_rc_send : ipath_do_uc_send, | ||
715 | (unsigned long)qp); | 713 | (unsigned long)qp); |
716 | INIT_LIST_HEAD(&qp->piowait); | 714 | INIT_LIST_HEAD(&qp->piowait); |
717 | INIT_LIST_HEAD(&qp->timerwait); | 715 | INIT_LIST_HEAD(&qp->timerwait); |
@@ -896,9 +894,9 @@ void ipath_get_credit(struct ipath_qp *qp, u32 aeth) | |||
896 | * as many packets as we like. Otherwise, we have to | 894 | * as many packets as we like. Otherwise, we have to |
897 | * honor the credit field. | 895 | * honor the credit field. |
898 | */ | 896 | */ |
899 | if (credit == IPS_AETH_CREDIT_INVAL) { | 897 | if (credit == IPS_AETH_CREDIT_INVAL) |
900 | qp->s_lsn = (u32) -1; | 898 | qp->s_lsn = (u32) -1; |
901 | } else if (qp->s_lsn != (u32) -1) { | 899 | else if (qp->s_lsn != (u32) -1) { |
902 | /* Compute new LSN (i.e., MSN + credit) */ | 900 | /* Compute new LSN (i.e., MSN + credit) */ |
903 | credit = (aeth + credit_table[credit]) & IPS_MSN_MASK; | 901 | credit = (aeth + credit_table[credit]) & IPS_MSN_MASK; |
904 | if (ipath_cmp24(credit, qp->s_lsn) > 0) | 902 | if (ipath_cmp24(credit, qp->s_lsn) > 0) |