Skip to content

Commit 1a70a05

Browse files
author
Roland Dreier
committed
IB/fmr_pool: Add prefix to all printks
Signed-off-by: Roland Dreier <[email protected]>
1 parent b7f008f commit 1a70a05

File tree

1 file changed

+17
-15
lines changed

1 file changed

+17
-15
lines changed

drivers/infiniband/core/fmr_pool.c

Lines changed: 17 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,8 @@
4343

4444
#include "core_priv.h"
4545

46+
#define PFX "fmr_pool: "
47+
4648
enum {
4749
IB_FMR_MAX_REMAPS = 32,
4850

@@ -150,7 +152,7 @@ static void ib_fmr_batch_release(struct ib_fmr_pool *pool)
150152

151153
#ifdef DEBUG
152154
if (fmr->ref_count !=0) {
153-
printk(KERN_WARNING "Unmapping FMR 0x%08x with ref count %d",
155+
printk(KERN_WARNING PFX "Unmapping FMR 0x%08x with ref count %d",
154156
fmr, fmr->ref_count);
155157
}
156158
#endif
@@ -168,7 +170,7 @@ static void ib_fmr_batch_release(struct ib_fmr_pool *pool)
168170

169171
ret = ib_unmap_fmr(&fmr_list);
170172
if (ret)
171-
printk(KERN_WARNING "ib_unmap_fmr returned %d", ret);
173+
printk(KERN_WARNING PFX "ib_unmap_fmr returned %d", ret);
172174

173175
spin_lock_irq(&pool->pool_lock);
174176
list_splice(&unmap_list, &pool->free_list);
@@ -226,20 +228,20 @@ struct ib_fmr_pool *ib_create_fmr_pool(struct ib_pd *pd,
226228
device = pd->device;
227229
if (!device->alloc_fmr || !device->dealloc_fmr ||
228230
!device->map_phys_fmr || !device->unmap_fmr) {
229-
printk(KERN_WARNING "Device %s does not support fast memory regions",
231+
printk(KERN_INFO PFX "Device %s does not support FMRs\n",
230232
device->name);
231233
return ERR_PTR(-ENOSYS);
232234
}
233235

234236
attr = kmalloc(sizeof *attr, GFP_KERNEL);
235237
if (!attr) {
236-
printk(KERN_WARNING "couldn't allocate device attr struct");
238+
printk(KERN_WARNING PFX "couldn't allocate device attr struct");
237239
return ERR_PTR(-ENOMEM);
238240
}
239241

240242
ret = ib_query_device(device, attr);
241243
if (ret) {
242-
printk(KERN_WARNING "couldn't query device");
244+
printk(KERN_WARNING PFX "couldn't query device: %d", ret);
243245
kfree(attr);
244246
return ERR_PTR(ret);
245247
}
@@ -253,7 +255,7 @@ struct ib_fmr_pool *ib_create_fmr_pool(struct ib_pd *pd,
253255

254256
pool = kmalloc(sizeof *pool, GFP_KERNEL);
255257
if (!pool) {
256-
printk(KERN_WARNING "couldn't allocate pool struct");
258+
printk(KERN_WARNING PFX "couldn't allocate pool struct");
257259
return ERR_PTR(-ENOMEM);
258260
}
259261

@@ -270,7 +272,7 @@ struct ib_fmr_pool *ib_create_fmr_pool(struct ib_pd *pd,
270272
kmalloc(IB_FMR_HASH_SIZE * sizeof *pool->cache_bucket,
271273
GFP_KERNEL);
272274
if (!pool->cache_bucket) {
273-
printk(KERN_WARNING "Failed to allocate cache in pool");
275+
printk(KERN_WARNING PFX "Failed to allocate cache in pool");
274276
ret = -ENOMEM;
275277
goto out_free_pool;
276278
}
@@ -294,7 +296,7 @@ struct ib_fmr_pool *ib_create_fmr_pool(struct ib_pd *pd,
294296
"ib_fmr(%s)",
295297
device->name);
296298
if (IS_ERR(pool->thread)) {
297-
printk(KERN_WARNING "couldn't start cleanup thread");
299+
printk(KERN_WARNING PFX "couldn't start cleanup thread");
298300
ret = PTR_ERR(pool->thread);
299301
goto out_free_pool;
300302
}
@@ -311,8 +313,8 @@ struct ib_fmr_pool *ib_create_fmr_pool(struct ib_pd *pd,
311313
fmr = kmalloc(sizeof *fmr + params->max_pages_per_fmr * sizeof (u64),
312314
GFP_KERNEL);
313315
if (!fmr) {
314-
printk(KERN_WARNING "failed to allocate fmr struct "
315-
"for FMR %d", i);
316+
printk(KERN_WARNING PFX "failed to allocate fmr "
317+
"struct for FMR %d", i);
316318
goto out_fail;
317319
}
318320

@@ -323,7 +325,8 @@ struct ib_fmr_pool *ib_create_fmr_pool(struct ib_pd *pd,
323325

324326
fmr->fmr = ib_alloc_fmr(pd, params->access, &fmr_attr);
325327
if (IS_ERR(fmr->fmr)) {
326-
printk(KERN_WARNING "fmr_create failed for FMR %d", i);
328+
printk(KERN_WARNING PFX "fmr_create failed "
329+
"for FMR %d", i);
327330
kfree(fmr);
328331
goto out_fail;
329332
}
@@ -378,7 +381,7 @@ void ib_destroy_fmr_pool(struct ib_fmr_pool *pool)
378381
}
379382

380383
if (i < pool->pool_size)
381-
printk(KERN_WARNING "pool still has %d regions registered",
384+
printk(KERN_WARNING PFX "pool still has %d regions registered",
382385
pool->pool_size - i);
383386

384387
kfree(pool->cache_bucket);
@@ -463,8 +466,7 @@ struct ib_pool_fmr *ib_fmr_pool_map_phys(struct ib_fmr_pool *pool_handle,
463466
list_add(&fmr->list, &pool->free_list);
464467
spin_unlock_irqrestore(&pool->pool_lock, flags);
465468

466-
printk(KERN_WARNING "fmr_map returns %d\n",
467-
result);
469+
printk(KERN_WARNING PFX "fmr_map returns %d\n", result);
468470

469471
return ERR_PTR(result);
470472
}
@@ -516,7 +518,7 @@ int ib_fmr_pool_unmap(struct ib_pool_fmr *fmr)
516518

517519
#ifdef DEBUG
518520
if (fmr->ref_count < 0)
519-
printk(KERN_WARNING "FMR %p has ref count %d < 0",
521+
printk(KERN_WARNING PFX "FMR %p has ref count %d < 0",
520522
fmr, fmr->ref_count);
521523
#endif
522524

0 commit comments

Comments
 (0)