aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/infiniband/hw/mthca/mthca_qp.c
diff options
context:
space:
mode:
authorRoland Dreier <roland@topspin.com>2005-06-27 17:36:45 -0400
committerLinus Torvalds <torvalds@ppc970.osdl.org>2005-06-27 18:11:46 -0400
commited878458eeff9754d66f1b0325df6ebbfcdce668 (patch)
treeeab302706f069a7922e1d953b5f33b61bdc868a4 /drivers/infiniband/hw/mthca/mthca_qp.c
parent80fd8238734c852a8ed1ea39f8444a2df33bd161 (diff)
[PATCH] IB/mthca: Align FW command mailboxes to 4K
Future versions of Mellanox HCA firmware will require command mailboxes to be aligned to 4K. Support this by using a pci_pool to allocate all mailboxes. This has the added benefit of shrinking the source and text of mthca. Signed-off-by: Roland Dreier <roland@topspin.com> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'drivers/infiniband/hw/mthca/mthca_qp.c')
-rw-r--r--drivers/infiniband/hw/mthca/mthca_qp.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/drivers/infiniband/hw/mthca/mthca_qp.c b/drivers/infiniband/hw/mthca/mthca_qp.c
index a92e870dfb97..163a8ef4186f 100644
--- a/drivers/infiniband/hw/mthca/mthca_qp.c
+++ b/drivers/infiniband/hw/mthca/mthca_qp.c
@@ -589,7 +589,7 @@ int mthca_modify_qp(struct ib_qp *ibqp, struct ib_qp_attr *attr, int attr_mask)
589 struct mthca_dev *dev = to_mdev(ibqp->device); 589 struct mthca_dev *dev = to_mdev(ibqp->device);
590 struct mthca_qp *qp = to_mqp(ibqp); 590 struct mthca_qp *qp = to_mqp(ibqp);
591 enum ib_qp_state cur_state, new_state; 591 enum ib_qp_state cur_state, new_state;
592 void *mailbox = NULL; 592 struct mthca_mailbox *mailbox;
593 struct mthca_qp_param *qp_param; 593 struct mthca_qp_param *qp_param;
594 struct mthca_qp_context *qp_context; 594 struct mthca_qp_context *qp_context;
595 u32 req_param, opt_param; 595 u32 req_param, opt_param;
@@ -646,10 +646,10 @@ int mthca_modify_qp(struct ib_qp *ibqp, struct ib_qp_attr *attr, int attr_mask)
646 return -EINVAL; 646 return -EINVAL;
647 } 647 }
648 648
649 mailbox = kmalloc(sizeof (*qp_param) + MTHCA_CMD_MAILBOX_EXTRA, GFP_KERNEL); 649 mailbox = mthca_alloc_mailbox(dev, GFP_KERNEL);
650 if (!mailbox) 650 if (IS_ERR(mailbox))
651 return -ENOMEM; 651 return PTR_ERR(mailbox);
652 qp_param = MAILBOX_ALIGN(mailbox); 652 qp_param = mailbox->buf;
653 qp_context = &qp_param->context; 653 qp_context = &qp_param->context;
654 memset(qp_param, 0, sizeof *qp_param); 654 memset(qp_param, 0, sizeof *qp_param);
655 655
@@ -872,7 +872,7 @@ int mthca_modify_qp(struct ib_qp *ibqp, struct ib_qp_attr *attr, int attr_mask)
872 } 872 }
873 873
874 err = mthca_MODIFY_QP(dev, state_table[cur_state][new_state].trans, 874 err = mthca_MODIFY_QP(dev, state_table[cur_state][new_state].trans,
875 qp->qpn, 0, qp_param, 0, &status); 875 qp->qpn, 0, mailbox, 0, &status);
876 if (status) { 876 if (status) {
877 mthca_warn(dev, "modify QP %d returned status %02x.\n", 877 mthca_warn(dev, "modify QP %d returned status %02x.\n",
878 state_table[cur_state][new_state].trans, status); 878 state_table[cur_state][new_state].trans, status);
@@ -882,7 +882,7 @@ int mthca_modify_qp(struct ib_qp *ibqp, struct ib_qp_attr *attr, int attr_mask)
882 if (!err) 882 if (!err)
883 qp->state = new_state; 883 qp->state = new_state;
884 884
885 kfree(mailbox); 885 mthca_free_mailbox(dev, mailbox);
886 886
887 if (is_sqp(dev, qp)) 887 if (is_sqp(dev, qp))
888 store_attrs(to_msqp(qp), attr, attr_mask); 888 store_attrs(to_msqp(qp), attr, attr_mask);