diff options
author | Hoang-Nam Nguyen <hnguyen@de.ibm.com> | 2006-11-06 18:56:39 -0500 |
---|---|---|
committer | Roland Dreier <rolandd@cisco.com> | 2006-11-09 15:41:57 -0500 |
commit | 7e28db5d8ff63b1cabc221c5cb84a5f45752f1c2 (patch) | |
tree | 4271d9afb545ab7e522a3a6e95c67a171f29cf84 /drivers/infiniband/hw/ehca/ehca_qp.c | |
parent | 40eb006685387b2861bd7196be0ab7144c5d5b71 (diff) |
IB/ehca: Assure 4K alignment for firmware control blocks
Assure 4K alignment for firmware control blocks in 64K page mode,
because kzalloc()'s result address might not be 4K aligned if 64K
pages are enabled. Thus, we introduce wrappers called
ehca_{alloc,free}_fw_ctrlblock(), which use a slab cache for objects
with 4K length and 4K alignment in order to alloc/free firmware
control blocks in 64K page mode. In 4K page mode those wrappers just
are defines of get_zeroed_page() and free_page().
Signed-off-by: Hoang-Nam Nguyen <hnguyen@de.ibm.com>
Signed-off-by: Roland Dreier <rolandd@cisco.com>
Diffstat (limited to 'drivers/infiniband/hw/ehca/ehca_qp.c')
-rw-r--r-- | drivers/infiniband/hw/ehca/ehca_qp.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/drivers/infiniband/hw/ehca/ehca_qp.c b/drivers/infiniband/hw/ehca/ehca_qp.c index 4394123cdbd7..cf3e50ee2d06 100644 --- a/drivers/infiniband/hw/ehca/ehca_qp.c +++ b/drivers/infiniband/hw/ehca/ehca_qp.c | |||
@@ -811,8 +811,8 @@ static int internal_modify_qp(struct ib_qp *ibqp, | |||
811 | unsigned long spl_flags = 0; | 811 | unsigned long spl_flags = 0; |
812 | 812 | ||
813 | /* do query_qp to obtain current attr values */ | 813 | /* do query_qp to obtain current attr values */ |
814 | mqpcb = kzalloc(H_CB_ALIGNMENT, GFP_KERNEL); | 814 | mqpcb = ehca_alloc_fw_ctrlblock(); |
815 | if (mqpcb == NULL) { | 815 | if (!mqpcb) { |
816 | ehca_err(ibqp->device, "Could not get zeroed page for mqpcb " | 816 | ehca_err(ibqp->device, "Could not get zeroed page for mqpcb " |
817 | "ehca_qp=%p qp_num=%x ", my_qp, ibqp->qp_num); | 817 | "ehca_qp=%p qp_num=%x ", my_qp, ibqp->qp_num); |
818 | return -ENOMEM; | 818 | return -ENOMEM; |
@@ -1225,7 +1225,7 @@ modify_qp_exit2: | |||
1225 | } | 1225 | } |
1226 | 1226 | ||
1227 | modify_qp_exit1: | 1227 | modify_qp_exit1: |
1228 | kfree(mqpcb); | 1228 | ehca_free_fw_ctrlblock(mqpcb); |
1229 | 1229 | ||
1230 | return ret; | 1230 | return ret; |
1231 | } | 1231 | } |
@@ -1277,7 +1277,7 @@ int ehca_query_qp(struct ib_qp *qp, | |||
1277 | return -EINVAL; | 1277 | return -EINVAL; |
1278 | } | 1278 | } |
1279 | 1279 | ||
1280 | qpcb = kzalloc(H_CB_ALIGNMENT, GFP_KERNEL ); | 1280 | qpcb = ehca_alloc_fw_ctrlblock(); |
1281 | if (!qpcb) { | 1281 | if (!qpcb) { |
1282 | ehca_err(qp->device,"Out of memory for qpcb " | 1282 | ehca_err(qp->device,"Out of memory for qpcb " |
1283 | "ehca_qp=%p qp_num=%x", my_qp, qp->qp_num); | 1283 | "ehca_qp=%p qp_num=%x", my_qp, qp->qp_num); |
@@ -1401,7 +1401,7 @@ int ehca_query_qp(struct ib_qp *qp, | |||
1401 | ehca_dmp(qpcb, 4*70, "qp_num=%x", qp->qp_num); | 1401 | ehca_dmp(qpcb, 4*70, "qp_num=%x", qp->qp_num); |
1402 | 1402 | ||
1403 | query_qp_exit1: | 1403 | query_qp_exit1: |
1404 | kfree(qpcb); | 1404 | ehca_free_fw_ctrlblock(qpcb); |
1405 | 1405 | ||
1406 | return ret; | 1406 | return ret; |
1407 | } | 1407 | } |