aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHoang-Nam Nguyen <hnguyen@de.ibm.com>2006-11-06 18:56:39 -0500
committerRoland Dreier <rolandd@cisco.com>2006-11-09 15:41:57 -0500
commit7e28db5d8ff63b1cabc221c5cb84a5f45752f1c2 (patch)
tree4271d9afb545ab7e522a3a6e95c67a171f29cf84
parent40eb006685387b2861bd7196be0ab7144c5d5b71 (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>
-rw-r--r--drivers/infiniband/hw/ehca/ehca_hca.c17
-rw-r--r--drivers/infiniband/hw/ehca/ehca_irq.c17
-rw-r--r--drivers/infiniband/hw/ehca/ehca_iverbs.h8
-rw-r--r--drivers/infiniband/hw/ehca/ehca_main.c56
-rw-r--r--drivers/infiniband/hw/ehca/ehca_mrmw.c8
-rw-r--r--drivers/infiniband/hw/ehca/ehca_qp.c10
6 files changed, 81 insertions, 35 deletions
diff --git a/drivers/infiniband/hw/ehca/ehca_hca.c b/drivers/infiniband/hw/ehca/ehca_hca.c
index 5eae6ac4842..e1b618c5f68 100644
--- a/drivers/infiniband/hw/ehca/ehca_hca.c
+++ b/drivers/infiniband/hw/ehca/ehca_hca.c
@@ -40,6 +40,7 @@
40 */ 40 */
41 41
42#include "ehca_tools.h" 42#include "ehca_tools.h"
43#include "ehca_iverbs.h"
43#include "hcp_if.h" 44#include "hcp_if.h"
44 45
45int ehca_query_device(struct ib_device *ibdev, struct ib_device_attr *props) 46int ehca_query_device(struct ib_device *ibdev, struct ib_device_attr *props)
@@ -49,7 +50,7 @@ int ehca_query_device(struct ib_device *ibdev, struct ib_device_attr *props)
49 ib_device); 50 ib_device);
50 struct hipz_query_hca *rblock; 51 struct hipz_query_hca *rblock;
51 52
52 rblock = kzalloc(H_CB_ALIGNMENT, GFP_KERNEL); 53 rblock = ehca_alloc_fw_ctrlblock();
53 if (!rblock) { 54 if (!rblock) {
54 ehca_err(&shca->ib_device, "Can't allocate rblock memory."); 55 ehca_err(&shca->ib_device, "Can't allocate rblock memory.");
55 return -ENOMEM; 56 return -ENOMEM;
@@ -96,7 +97,7 @@ int ehca_query_device(struct ib_device *ibdev, struct ib_device_attr *props)
96 = min_t(int, rblock->max_total_mcast_qp_attach, INT_MAX); 97 = min_t(int, rblock->max_total_mcast_qp_attach, INT_MAX);
97 98
98query_device1: 99query_device1:
99 kfree(rblock); 100 ehca_free_fw_ctrlblock(rblock);
100 101
101 return ret; 102 return ret;
102} 103}
@@ -109,7 +110,7 @@ int ehca_query_port(struct ib_device *ibdev,
109 ib_device); 110 ib_device);
110 struct hipz_query_port *rblock; 111 struct hipz_query_port *rblock;
111 112
112 rblock = kzalloc(H_CB_ALIGNMENT, GFP_KERNEL); 113 rblock = ehca_alloc_fw_ctrlblock();
113 if (!rblock) { 114 if (!rblock) {
114 ehca_err(&shca->ib_device, "Can't allocate rblock memory."); 115 ehca_err(&shca->ib_device, "Can't allocate rblock memory.");
115 return -ENOMEM; 116 return -ENOMEM;
@@ -162,7 +163,7 @@ int ehca_query_port(struct ib_device *ibdev,
162 props->active_speed = 0x1; 163 props->active_speed = 0x1;
163 164
164query_port1: 165query_port1:
165 kfree(rblock); 166 ehca_free_fw_ctrlblock(rblock);
166 167
167 return ret; 168 return ret;
168} 169}
@@ -178,7 +179,7 @@ int ehca_query_pkey(struct ib_device *ibdev, u8 port, u16 index, u16 *pkey)
178 return -EINVAL; 179 return -EINVAL;
179 } 180 }
180 181
181 rblock = kzalloc(H_CB_ALIGNMENT, GFP_KERNEL); 182 rblock = ehca_alloc_fw_ctrlblock();
182 if (!rblock) { 183 if (!rblock) {
183 ehca_err(&shca->ib_device, "Can't allocate rblock memory."); 184 ehca_err(&shca->ib_device, "Can't allocate rblock memory.");
184 return -ENOMEM; 185 return -ENOMEM;
@@ -193,7 +194,7 @@ int ehca_query_pkey(struct ib_device *ibdev, u8 port, u16 index, u16 *pkey)
193 memcpy(pkey, &rblock->pkey_entries + index, sizeof(u16)); 194 memcpy(pkey, &rblock->pkey_entries + index, sizeof(u16));
194 195
195query_pkey1: 196query_pkey1:
196 kfree(rblock); 197 ehca_free_fw_ctrlblock(rblock);
197 198
198 return ret; 199 return ret;
199} 200}
@@ -211,7 +212,7 @@ int ehca_query_gid(struct ib_device *ibdev, u8 port,
211 return -EINVAL; 212 return -EINVAL;
212 } 213 }
213 214
214 rblock = kzalloc(H_CB_ALIGNMENT, GFP_KERNEL); 215 rblock = ehca_alloc_fw_ctrlblock();
215 if (!rblock) { 216 if (!rblock) {
216 ehca_err(&shca->ib_device, "Can't allocate rblock memory."); 217 ehca_err(&shca->ib_device, "Can't allocate rblock memory.");
217 return -ENOMEM; 218 return -ENOMEM;
@@ -227,7 +228,7 @@ int ehca_query_gid(struct ib_device *ibdev, u8 port,
227 memcpy(&gid->raw[8], &rblock->guid_entries[index], sizeof(u64)); 228 memcpy(&gid->raw[8], &rblock->guid_entries[index], sizeof(u64));
228 229
229query_gid1: 230query_gid1:
230 kfree(rblock); 231 ehca_free_fw_ctrlblock(rblock);
231 232
232 return ret; 233 return ret;
233} 234}
diff --git a/drivers/infiniband/hw/ehca/ehca_irq.c b/drivers/infiniband/hw/ehca/ehca_irq.c
index 048cc443d1e..c3ea746e904 100644
--- a/drivers/infiniband/hw/ehca/ehca_irq.c
+++ b/drivers/infiniband/hw/ehca/ehca_irq.c
@@ -45,6 +45,7 @@
45#include "ehca_tools.h" 45#include "ehca_tools.h"
46#include "hcp_if.h" 46#include "hcp_if.h"
47#include "hipz_fns.h" 47#include "hipz_fns.h"
48#include "ipz_pt_fn.h"
48 49
49#define EQE_COMPLETION_EVENT EHCA_BMASK_IBM(1,1) 50#define EQE_COMPLETION_EVENT EHCA_BMASK_IBM(1,1)
50#define EQE_CQ_QP_NUMBER EHCA_BMASK_IBM(8,31) 51#define EQE_CQ_QP_NUMBER EHCA_BMASK_IBM(8,31)
@@ -137,38 +138,36 @@ int ehca_error_data(struct ehca_shca *shca, void *data,
137 u64 *rblock; 138 u64 *rblock;
138 unsigned long block_count; 139 unsigned long block_count;
139 140
140 rblock = kzalloc(H_CB_ALIGNMENT, GFP_KERNEL); 141 rblock = ehca_alloc_fw_ctrlblock();
141 if (!rblock) { 142 if (!rblock) {
142 ehca_err(&shca->ib_device, "Cannot allocate rblock memory."); 143 ehca_err(&shca->ib_device, "Cannot allocate rblock memory.");
143 ret = -ENOMEM; 144 ret = -ENOMEM;
144 goto error_data1; 145 goto error_data1;
145 } 146 }
146 147
148 /* rblock must be 4K aligned and should be 4K large */
147 ret = hipz_h_error_data(shca->ipz_hca_handle, 149 ret = hipz_h_error_data(shca->ipz_hca_handle,
148 resource, 150 resource,
149 rblock, 151 rblock,
150 &block_count); 152 &block_count);
151 153
152 if (ret == H_R_STATE) { 154 if (ret == H_R_STATE)
153 ehca_err(&shca->ib_device, 155 ehca_err(&shca->ib_device,
154 "No error data is available: %lx.", resource); 156 "No error data is available: %lx.", resource);
155 }
156 else if (ret == H_SUCCESS) { 157 else if (ret == H_SUCCESS) {
157 int length; 158 int length;
158 159
159 length = EHCA_BMASK_GET(ERROR_DATA_LENGTH, rblock[0]); 160 length = EHCA_BMASK_GET(ERROR_DATA_LENGTH, rblock[0]);
160 161
161 if (length > PAGE_SIZE) 162 if (length > EHCA_PAGESIZE)
162 length = PAGE_SIZE; 163 length = EHCA_PAGESIZE;
163 164
164 print_error_data(shca, data, rblock, length); 165 print_error_data(shca, data, rblock, length);
165 } 166 } else
166 else {
167 ehca_err(&shca->ib_device, 167 ehca_err(&shca->ib_device,
168 "Error data could not be fetched: %lx", resource); 168 "Error data could not be fetched: %lx", resource);
169 }
170 169
171 kfree(rblock); 170 ehca_free_fw_ctrlblock(rblock);
172 171
173error_data1: 172error_data1:
174 return ret; 173 return ret;
diff --git a/drivers/infiniband/hw/ehca/ehca_iverbs.h b/drivers/infiniband/hw/ehca/ehca_iverbs.h
index 319c39d47f3..3720e3032cc 100644
--- a/drivers/infiniband/hw/ehca/ehca_iverbs.h
+++ b/drivers/infiniband/hw/ehca/ehca_iverbs.h
@@ -179,4 +179,12 @@ int ehca_mmap_register(u64 physical,void **mapped,
179 179
180int ehca_munmap(unsigned long addr, size_t len); 180int ehca_munmap(unsigned long addr, size_t len);
181 181
182#ifdef CONFIG_PPC_64K_PAGES
183void *ehca_alloc_fw_ctrlblock(void);
184void ehca_free_fw_ctrlblock(void *ptr);
185#else
186#define ehca_alloc_fw_ctrlblock() ((void *) get_zeroed_page(GFP_KERNEL))
187#define ehca_free_fw_ctrlblock(ptr) free_page((unsigned long)(ptr))
188#endif
189
182#endif 190#endif
diff --git a/drivers/infiniband/hw/ehca/ehca_main.c b/drivers/infiniband/hw/ehca/ehca_main.c
index 024d511c4b5..01f5aa9cb56 100644
--- a/drivers/infiniband/hw/ehca/ehca_main.c
+++ b/drivers/infiniband/hw/ehca/ehca_main.c
@@ -40,6 +40,9 @@
40 * POSSIBILITY OF SUCH DAMAGE. 40 * POSSIBILITY OF SUCH DAMAGE.
41 */ 41 */
42 42
43#ifdef CONFIG_PPC_64K_PAGES
44#include <linux/slab.h>
45#endif
43#include "ehca_classes.h" 46#include "ehca_classes.h"
44#include "ehca_iverbs.h" 47#include "ehca_iverbs.h"
45#include "ehca_mrmw.h" 48#include "ehca_mrmw.h"
@@ -49,7 +52,7 @@
49MODULE_LICENSE("Dual BSD/GPL"); 52MODULE_LICENSE("Dual BSD/GPL");
50MODULE_AUTHOR("Christoph Raisch <raisch@de.ibm.com>"); 53MODULE_AUTHOR("Christoph Raisch <raisch@de.ibm.com>");
51MODULE_DESCRIPTION("IBM eServer HCA InfiniBand Device Driver"); 54MODULE_DESCRIPTION("IBM eServer HCA InfiniBand Device Driver");
52MODULE_VERSION("SVNEHCA_0017"); 55MODULE_VERSION("SVNEHCA_0018");
53 56
54int ehca_open_aqp1 = 0; 57int ehca_open_aqp1 = 0;
55int ehca_debug_level = 0; 58int ehca_debug_level = 0;
@@ -94,11 +97,31 @@ spinlock_t ehca_cq_idr_lock;
94DEFINE_IDR(ehca_qp_idr); 97DEFINE_IDR(ehca_qp_idr);
95DEFINE_IDR(ehca_cq_idr); 98DEFINE_IDR(ehca_cq_idr);
96 99
100
97static struct list_head shca_list; /* list of all registered ehcas */ 101static struct list_head shca_list; /* list of all registered ehcas */
98static spinlock_t shca_list_lock; 102static spinlock_t shca_list_lock;
99 103
100static struct timer_list poll_eqs_timer; 104static struct timer_list poll_eqs_timer;
101 105
106#ifdef CONFIG_PPC_64K_PAGES
107static struct kmem_cache *ctblk_cache = NULL;
108
109void *ehca_alloc_fw_ctrlblock(void)
110{
111 void *ret = kmem_cache_zalloc(ctblk_cache, SLAB_KERNEL);
112 if (!ret)
113 ehca_gen_err("Out of memory for ctblk");
114 return ret;
115}
116
117void ehca_free_fw_ctrlblock(void *ptr)
118{
119 if (ptr)
120 kmem_cache_free(ctblk_cache, ptr);
121
122}
123#endif
124
102static int ehca_create_slab_caches(void) 125static int ehca_create_slab_caches(void)
103{ 126{
104 int ret; 127 int ret;
@@ -133,6 +156,17 @@ static int ehca_create_slab_caches(void)
133 goto create_slab_caches5; 156 goto create_slab_caches5;
134 } 157 }
135 158
159#ifdef CONFIG_PPC_64K_PAGES
160 ctblk_cache = kmem_cache_create("ehca_cache_ctblk",
161 EHCA_PAGESIZE, H_CB_ALIGNMENT,
162 SLAB_HWCACHE_ALIGN,
163 NULL, NULL);
164 if (!ctblk_cache) {
165 ehca_gen_err("Cannot create ctblk SLAB cache.");
166 ehca_cleanup_mrmw_cache();
167 goto create_slab_caches5;
168 }
169#endif
136 return 0; 170 return 0;
137 171
138create_slab_caches5: 172create_slab_caches5:
@@ -157,6 +191,10 @@ static void ehca_destroy_slab_caches(void)
157 ehca_cleanup_qp_cache(); 191 ehca_cleanup_qp_cache();
158 ehca_cleanup_cq_cache(); 192 ehca_cleanup_cq_cache();
159 ehca_cleanup_pd_cache(); 193 ehca_cleanup_pd_cache();
194#ifdef CONFIG_PPC_64K_PAGES
195 if (ctblk_cache)
196 kmem_cache_destroy(ctblk_cache);
197#endif
160} 198}
161 199
162#define EHCA_HCAAVER EHCA_BMASK_IBM(32,39) 200#define EHCA_HCAAVER EHCA_BMASK_IBM(32,39)
@@ -168,7 +206,7 @@ int ehca_sense_attributes(struct ehca_shca *shca)
168 u64 h_ret; 206 u64 h_ret;
169 struct hipz_query_hca *rblock; 207 struct hipz_query_hca *rblock;
170 208
171 rblock = kzalloc(H_CB_ALIGNMENT, GFP_KERNEL); 209 rblock = ehca_alloc_fw_ctrlblock();
172 if (!rblock) { 210 if (!rblock) {
173 ehca_gen_err("Cannot allocate rblock memory."); 211 ehca_gen_err("Cannot allocate rblock memory.");
174 return -ENOMEM; 212 return -ENOMEM;
@@ -211,7 +249,7 @@ int ehca_sense_attributes(struct ehca_shca *shca)
211 shca->sport[1].rate = IB_RATE_30_GBPS; 249 shca->sport[1].rate = IB_RATE_30_GBPS;
212 250
213num_ports1: 251num_ports1:
214 kfree(rblock); 252 ehca_free_fw_ctrlblock(rblock);
215 return ret; 253 return ret;
216} 254}
217 255
@@ -220,7 +258,7 @@ static int init_node_guid(struct ehca_shca *shca)
220 int ret = 0; 258 int ret = 0;
221 struct hipz_query_hca *rblock; 259 struct hipz_query_hca *rblock;
222 260
223 rblock = kzalloc(H_CB_ALIGNMENT, GFP_KERNEL); 261 rblock = ehca_alloc_fw_ctrlblock();
224 if (!rblock) { 262 if (!rblock) {
225 ehca_err(&shca->ib_device, "Can't allocate rblock memory."); 263 ehca_err(&shca->ib_device, "Can't allocate rblock memory.");
226 return -ENOMEM; 264 return -ENOMEM;
@@ -235,7 +273,7 @@ static int init_node_guid(struct ehca_shca *shca)
235 memcpy(&shca->ib_device.node_guid, &rblock->node_guid, sizeof(u64)); 273 memcpy(&shca->ib_device.node_guid, &rblock->node_guid, sizeof(u64));
236 274
237init_node_guid1: 275init_node_guid1:
238 kfree(rblock); 276 ehca_free_fw_ctrlblock(rblock);
239 return ret; 277 return ret;
240} 278}
241 279
@@ -431,7 +469,7 @@ static ssize_t ehca_show_##name(struct device *dev, \
431 \ 469 \
432 shca = dev->driver_data; \ 470 shca = dev->driver_data; \
433 \ 471 \
434 rblock = kzalloc(H_CB_ALIGNMENT, GFP_KERNEL); \ 472 rblock = ehca_alloc_fw_ctrlblock(); \
435 if (!rblock) { \ 473 if (!rblock) { \
436 dev_err(dev, "Can't allocate rblock memory."); \ 474 dev_err(dev, "Can't allocate rblock memory."); \
437 return 0; \ 475 return 0; \
@@ -439,12 +477,12 @@ static ssize_t ehca_show_##name(struct device *dev, \
439 \ 477 \
440 if (hipz_h_query_hca(shca->ipz_hca_handle, rblock) != H_SUCCESS) { \ 478 if (hipz_h_query_hca(shca->ipz_hca_handle, rblock) != H_SUCCESS) { \
441 dev_err(dev, "Can't query device properties"); \ 479 dev_err(dev, "Can't query device properties"); \
442 kfree(rblock); \ 480 ehca_free_fw_ctrlblock(rblock); \
443 return 0; \ 481 return 0; \
444 } \ 482 } \
445 \ 483 \
446 data = rblock->name; \ 484 data = rblock->name; \
447 kfree(rblock); \ 485 ehca_free_fw_ctrlblock(rblock); \
448 \ 486 \
449 if ((strcmp(#name, "num_ports") == 0) && (ehca_nr_ports == 1)) \ 487 if ((strcmp(#name, "num_ports") == 0) && (ehca_nr_ports == 1)) \
450 return snprintf(buf, 256, "1\n"); \ 488 return snprintf(buf, 256, "1\n"); \
@@ -752,7 +790,7 @@ int __init ehca_module_init(void)
752 int ret; 790 int ret;
753 791
754 printk(KERN_INFO "eHCA Infiniband Device Driver " 792 printk(KERN_INFO "eHCA Infiniband Device Driver "
755 "(Rel.: SVNEHCA_0017)\n"); 793 "(Rel.: SVNEHCA_0018)\n");
756 idr_init(&ehca_qp_idr); 794 idr_init(&ehca_qp_idr);
757 idr_init(&ehca_cq_idr); 795 idr_init(&ehca_cq_idr);
758 spin_lock_init(&ehca_qp_idr_lock); 796 spin_lock_init(&ehca_qp_idr_lock);
diff --git a/drivers/infiniband/hw/ehca/ehca_mrmw.c b/drivers/infiniband/hw/ehca/ehca_mrmw.c
index 5ca65441e1d..abce676c0ae 100644
--- a/drivers/infiniband/hw/ehca/ehca_mrmw.c
+++ b/drivers/infiniband/hw/ehca/ehca_mrmw.c
@@ -1013,7 +1013,7 @@ int ehca_reg_mr_rpages(struct ehca_shca *shca,
1013 u32 i; 1013 u32 i;
1014 u64 *kpage; 1014 u64 *kpage;
1015 1015
1016 kpage = kzalloc(H_CB_ALIGNMENT, GFP_KERNEL); 1016 kpage = ehca_alloc_fw_ctrlblock();
1017 if (!kpage) { 1017 if (!kpage) {
1018 ehca_err(&shca->ib_device, "kpage alloc failed"); 1018 ehca_err(&shca->ib_device, "kpage alloc failed");
1019 ret = -ENOMEM; 1019 ret = -ENOMEM;
@@ -1092,7 +1092,7 @@ int ehca_reg_mr_rpages(struct ehca_shca *shca,
1092 1092
1093 1093
1094ehca_reg_mr_rpages_exit1: 1094ehca_reg_mr_rpages_exit1:
1095 kfree(kpage); 1095 ehca_free_fw_ctrlblock(kpage);
1096ehca_reg_mr_rpages_exit0: 1096ehca_reg_mr_rpages_exit0:
1097 if (ret) 1097 if (ret)
1098 ehca_err(&shca->ib_device, "ret=%x shca=%p e_mr=%p pginfo=%p " 1098 ehca_err(&shca->ib_device, "ret=%x shca=%p e_mr=%p pginfo=%p "
@@ -1124,7 +1124,7 @@ inline int ehca_rereg_mr_rereg1(struct ehca_shca *shca,
1124 ehca_mrmw_map_acl(acl, &hipz_acl); 1124 ehca_mrmw_map_acl(acl, &hipz_acl);
1125 ehca_mrmw_set_pgsize_hipz_acl(&hipz_acl); 1125 ehca_mrmw_set_pgsize_hipz_acl(&hipz_acl);
1126 1126
1127 kpage = kzalloc(H_CB_ALIGNMENT, GFP_KERNEL); 1127 kpage = ehca_alloc_fw_ctrlblock();
1128 if (!kpage) { 1128 if (!kpage) {
1129 ehca_err(&shca->ib_device, "kpage alloc failed"); 1129 ehca_err(&shca->ib_device, "kpage alloc failed");
1130 ret = -ENOMEM; 1130 ret = -ENOMEM;
@@ -1181,7 +1181,7 @@ inline int ehca_rereg_mr_rereg1(struct ehca_shca *shca,
1181 } 1181 }
1182 1182
1183ehca_rereg_mr_rereg1_exit1: 1183ehca_rereg_mr_rereg1_exit1:
1184 kfree(kpage); 1184 ehca_free_fw_ctrlblock(kpage);
1185ehca_rereg_mr_rereg1_exit0: 1185ehca_rereg_mr_rereg1_exit0:
1186 if ( ret && (ret != -EAGAIN) ) 1186 if ( ret && (ret != -EAGAIN) )
1187 ehca_err(&shca->ib_device, "ret=%x lkey=%x rkey=%x " 1187 ehca_err(&shca->ib_device, "ret=%x lkey=%x rkey=%x "
diff --git a/drivers/infiniband/hw/ehca/ehca_qp.c b/drivers/infiniband/hw/ehca/ehca_qp.c
index 4394123cdbd..cf3e50ee2d0 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
1227modify_qp_exit1: 1227modify_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
1403query_qp_exit1: 1403query_qp_exit1:
1404 kfree(qpcb); 1404 ehca_free_fw_ctrlblock(qpcb);
1405 1405
1406 return ret; 1406 return ret;
1407} 1407}