@@ -95,11 +95,9 @@ static int mana_ib_create_qp_rss(struct ib_qp *ibqp, struct ib_pd *pd,
95
95
struct mana_ib_qp * qp = container_of (ibqp , struct mana_ib_qp , ibqp );
96
96
struct mana_ib_dev * mdev =
97
97
container_of (pd -> device , struct mana_ib_dev , ib_dev );
98
- struct gdma_context * gc = mdev_to_gc (mdev );
99
98
struct ib_rwq_ind_table * ind_tbl = attr -> rwq_ind_tbl ;
100
99
struct mana_ib_create_qp_rss_resp resp = {};
101
100
struct mana_ib_create_qp_rss ucmd = {};
102
- struct gdma_queue * * gdma_cq_allocated ;
103
101
mana_handle_t * mana_ind_table ;
104
102
struct mana_port_context * mpc ;
105
103
unsigned int ind_tbl_size ;
@@ -173,13 +171,6 @@ static int mana_ib_create_qp_rss(struct ib_qp *ibqp, struct ib_pd *pd,
173
171
goto fail ;
174
172
}
175
173
176
- gdma_cq_allocated = kcalloc (ind_tbl_size , sizeof (* gdma_cq_allocated ),
177
- GFP_KERNEL );
178
- if (!gdma_cq_allocated ) {
179
- ret = - ENOMEM ;
180
- goto fail ;
181
- }
182
-
183
174
qp -> port = port ;
184
175
185
176
for (i = 0 ; i < ind_tbl_size ; i ++ ) {
@@ -229,8 +220,6 @@ static int mana_ib_create_qp_rss(struct ib_qp *ibqp, struct ib_pd *pd,
229
220
ret = mana_ib_install_cq_cb (mdev , cq );
230
221
if (ret )
231
222
goto fail ;
232
-
233
- gdma_cq_allocated [i ] = gc -> cq_table [cq -> queue .id ];
234
223
}
235
224
resp .num_entries = i ;
236
225
@@ -250,7 +239,6 @@ static int mana_ib_create_qp_rss(struct ib_qp *ibqp, struct ib_pd *pd,
250
239
goto fail ;
251
240
}
252
241
253
- kfree (gdma_cq_allocated );
254
242
kfree (mana_ind_table );
255
243
256
244
return 0 ;
@@ -262,13 +250,10 @@ static int mana_ib_create_qp_rss(struct ib_qp *ibqp, struct ib_pd *pd,
262
250
wq = container_of (ibwq , struct mana_ib_wq , ibwq );
263
251
cq = container_of (ibcq , struct mana_ib_cq , ibcq );
264
252
265
- gc -> cq_table [cq -> queue .id ] = NULL ;
266
- kfree (gdma_cq_allocated [i ]);
267
-
253
+ mana_ib_remove_cq_cb (mdev , cq );
268
254
mana_destroy_wq_obj (mpc , GDMA_RQ , wq -> rx_object );
269
255
}
270
256
271
- kfree (gdma_cq_allocated );
272
257
kfree (mana_ind_table );
273
258
274
259
return ret ;
@@ -287,10 +272,8 @@ static int mana_ib_create_qp_raw(struct ib_qp *ibqp, struct ib_pd *ibpd,
287
272
struct mana_ib_ucontext * mana_ucontext =
288
273
rdma_udata_to_drv_context (udata , struct mana_ib_ucontext ,
289
274
ibucontext );
290
- struct gdma_context * gc = mdev_to_gc (mdev );
291
275
struct mana_ib_create_qp_resp resp = {};
292
276
struct mana_ib_create_qp ucmd = {};
293
- struct gdma_queue * gdma_cq = NULL ;
294
277
struct mana_obj_spec wq_spec = {};
295
278
struct mana_obj_spec cq_spec = {};
296
279
struct mana_port_context * mpc ;
@@ -395,14 +378,13 @@ static int mana_ib_create_qp_raw(struct ib_qp *ibqp, struct ib_pd *ibpd,
395
378
ibdev_dbg (& mdev -> ib_dev ,
396
379
"Failed copy udata for create qp-raw, %d\n" ,
397
380
err );
398
- goto err_release_gdma_cq ;
381
+ goto err_remove_cq_cb ;
399
382
}
400
383
401
384
return 0 ;
402
385
403
- err_release_gdma_cq :
404
- kfree (gdma_cq );
405
- gc -> cq_table [send_cq -> queue .id ] = NULL ;
386
+ err_remove_cq_cb :
387
+ mana_ib_remove_cq_cb (mdev , send_cq );
406
388
407
389
err_destroy_wq_obj :
408
390
mana_destroy_wq_obj (mpc , GDMA_SQ , qp -> qp_handle );
0 commit comments