Skip to content

Commit 9ea4463

Browse files
committed
Merge tag 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/dledford/rdma
Pull rdma updates from Doug Ledford: "Initial roundup of 4.6 merge window patches. This is the first of two pull requests. It is the smaller request, but touches for more different things (this is everything but what is in or going into staging). The pull request for the code in staging/rdma is on hold until after we decide what to do on the write/writev API issue and may be partially deferred until 4.7 as a result. Summary: - cxgb4 updates - nes updates - unification of iwarp portmapper code to core - add drain_cq API - various ib_core updates - minor ipoib updates - minor mlx4 updates - more significant mlx5 updates (including a minor merge conflict with net-next tree...merge is simple to resolve and Stephen's resolution was confirmed by Mellanox) - trivial net/9p rdma conversion - ocrdma RoCEv2 update - srpt updates" * tag 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/dledford/rdma: (85 commits) iwpm: crash fix for large connections test iw_cxgb3: support for iWARP port mapping iw_cxgb4: remove port mapper related code iw_nes: remove port mapper related code iwcm: common code for port mapper net/9p: convert to new CQ API IB/mlx5: Add support for don't trap rules net/mlx5_core: Introduce forward to next priority action net/mlx5_core: Create anchor of last flow table iser: Accept arbitrary sg lists mapping if the device supports it mlx5: Add arbitrary sg list support IB/core: Add arbitrary sg_list support IB/mlx5: Expose correct max_fast_reg_page_list_len IB/mlx5: Make coding style more consistent IB/mlx5: Convert UMR CQ to new CQ API IB/ocrdma: Skip using unneeded intermediate variable IB/ocrdma: Skip using unneeded intermediate variable IB/ocrdma: Delete unnecessary variable initialisations in 11 functions IB/core: Documentation fix in the MAD header file IB/core: trivial prink cleanup. ...
2 parents 9dffdb3 + 082eaa5 commit 9ea4463

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

90 files changed

+3618
-1973
lines changed

drivers/infiniband/core/cache.c

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1043,8 +1043,8 @@ static void ib_cache_update(struct ib_device *device,
10431043

10441044
ret = ib_query_port(device, port, tprops);
10451045
if (ret) {
1046-
printk(KERN_WARNING "ib_query_port failed (%d) for %s\n",
1047-
ret, device->name);
1046+
pr_warn("ib_query_port failed (%d) for %s\n",
1047+
ret, device->name);
10481048
goto err;
10491049
}
10501050

@@ -1067,8 +1067,8 @@ static void ib_cache_update(struct ib_device *device,
10671067
for (i = 0; i < pkey_cache->table_len; ++i) {
10681068
ret = ib_query_pkey(device, port, i, pkey_cache->table + i);
10691069
if (ret) {
1070-
printk(KERN_WARNING "ib_query_pkey failed (%d) for %s (index %d)\n",
1071-
ret, device->name, i);
1070+
pr_warn("ib_query_pkey failed (%d) for %s (index %d)\n",
1071+
ret, device->name, i);
10721072
goto err;
10731073
}
10741074
}
@@ -1078,8 +1078,8 @@ static void ib_cache_update(struct ib_device *device,
10781078
ret = ib_query_gid(device, port, i,
10791079
gid_cache->table + i, NULL);
10801080
if (ret) {
1081-
printk(KERN_WARNING "ib_query_gid failed (%d) for %s (index %d)\n",
1082-
ret, device->name, i);
1081+
pr_warn("ib_query_gid failed (%d) for %s (index %d)\n",
1082+
ret, device->name, i);
10831083
goto err;
10841084
}
10851085
}
@@ -1161,8 +1161,7 @@ int ib_cache_setup_one(struct ib_device *device)
11611161
GFP_KERNEL);
11621162
if (!device->cache.pkey_cache ||
11631163
!device->cache.lmc_cache) {
1164-
printk(KERN_WARNING "Couldn't allocate cache "
1165-
"for %s\n", device->name);
1164+
pr_warn("Couldn't allocate cache for %s\n", device->name);
11661165
return -ENOMEM;
11671166
}
11681167

drivers/infiniband/core/cma.c

Lines changed: 15 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1206,13 +1206,21 @@ static int cma_save_req_info(const struct ib_cm_event *ib_event,
12061206
req->has_gid = true;
12071207
req->service_id = req_param->primary_path->service_id;
12081208
req->pkey = be16_to_cpu(req_param->primary_path->pkey);
1209+
if (req->pkey != req_param->bth_pkey)
1210+
pr_warn_ratelimited("RDMA CMA: got different BTH P_Key (0x%x) and primary path P_Key (0x%x)\n"
1211+
"RDMA CMA: in the future this may cause the request to be dropped\n",
1212+
req_param->bth_pkey, req->pkey);
12091213
break;
12101214
case IB_CM_SIDR_REQ_RECEIVED:
12111215
req->device = sidr_param->listen_id->device;
12121216
req->port = sidr_param->port;
12131217
req->has_gid = false;
12141218
req->service_id = sidr_param->service_id;
12151219
req->pkey = sidr_param->pkey;
1220+
if (req->pkey != sidr_param->bth_pkey)
1221+
pr_warn_ratelimited("RDMA CMA: got different BTH P_Key (0x%x) and SIDR request payload P_Key (0x%x)\n"
1222+
"RDMA CMA: in the future this may cause the request to be dropped\n",
1223+
sidr_param->bth_pkey, req->pkey);
12161224
break;
12171225
default:
12181226
return -EINVAL;
@@ -1713,7 +1721,7 @@ static int cma_ib_handler(struct ib_cm_id *cm_id, struct ib_cm_event *ib_event)
17131721
event.param.conn.private_data_len = IB_CM_REJ_PRIVATE_DATA_SIZE;
17141722
break;
17151723
default:
1716-
printk(KERN_ERR "RDMA CMA: unexpected IB CM event: %d\n",
1724+
pr_err("RDMA CMA: unexpected IB CM event: %d\n",
17171725
ib_event->event);
17181726
goto out;
17191727
}
@@ -2186,8 +2194,8 @@ static void cma_listen_on_dev(struct rdma_id_private *id_priv,
21862194

21872195
ret = rdma_listen(id, id_priv->backlog);
21882196
if (ret)
2189-
printk(KERN_WARNING "RDMA CMA: cma_listen_on_dev, error %d, "
2190-
"listening on device %s\n", ret, cma_dev->device->name);
2197+
pr_warn("RDMA CMA: cma_listen_on_dev, error %d, listening on device %s\n",
2198+
ret, cma_dev->device->name);
21912199
}
21922200

21932201
static void cma_listen_on_all(struct rdma_id_private *id_priv)
@@ -3239,7 +3247,7 @@ static int cma_sidr_rep_handler(struct ib_cm_id *cm_id,
32393247
event.status = 0;
32403248
break;
32413249
default:
3242-
printk(KERN_ERR "RDMA CMA: unexpected IB CM event: %d\n",
3250+
pr_err("RDMA CMA: unexpected IB CM event: %d\n",
32433251
ib_event->event);
32443252
goto out;
32453253
}
@@ -4003,8 +4011,8 @@ static int cma_netdev_change(struct net_device *ndev, struct rdma_id_private *id
40034011
if ((dev_addr->bound_dev_if == ndev->ifindex) &&
40044012
(net_eq(dev_net(ndev), dev_addr->net)) &&
40054013
memcmp(dev_addr->src_dev_addr, ndev->dev_addr, ndev->addr_len)) {
4006-
printk(KERN_INFO "RDMA CM addr change for ndev %s used by id %p\n",
4007-
ndev->name, &id_priv->id);
4014+
pr_info("RDMA CM addr change for ndev %s used by id %p\n",
4015+
ndev->name, &id_priv->id);
40084016
work = kzalloc(sizeof *work, GFP_KERNEL);
40094017
if (!work)
40104018
return -ENOMEM;
@@ -4287,7 +4295,7 @@ static int __init cma_init(void)
42874295
goto err;
42884296

42894297
if (ibnl_add_client(RDMA_NL_RDMA_CM, RDMA_NL_RDMA_CM_NUM_OPS, cma_cb_table))
4290-
printk(KERN_WARNING "RDMA CMA: failed to add netlink callback\n");
4298+
pr_warn("RDMA CMA: failed to add netlink callback\n");
42914299
cma_configfs_init();
42924300

42934301
return 0;

drivers/infiniband/core/device.c

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -115,8 +115,8 @@ static int ib_device_check_mandatory(struct ib_device *device)
115115

116116
for (i = 0; i < ARRAY_SIZE(mandatory_table); ++i) {
117117
if (!*(void **) ((void *) device + mandatory_table[i].offset)) {
118-
printk(KERN_WARNING "Device %s is missing mandatory function %s\n",
119-
device->name, mandatory_table[i].name);
118+
pr_warn("Device %s is missing mandatory function %s\n",
119+
device->name, mandatory_table[i].name);
120120
return -EINVAL;
121121
}
122122
}
@@ -255,8 +255,8 @@ static int add_client_context(struct ib_device *device, struct ib_client *client
255255

256256
context = kmalloc(sizeof *context, GFP_KERNEL);
257257
if (!context) {
258-
printk(KERN_WARNING "Couldn't allocate client context for %s/%s\n",
259-
device->name, client->name);
258+
pr_warn("Couldn't allocate client context for %s/%s\n",
259+
device->name, client->name);
260260
return -ENOMEM;
261261
}
262262

@@ -343,29 +343,29 @@ int ib_register_device(struct ib_device *device,
343343

344344
ret = read_port_immutable(device);
345345
if (ret) {
346-
printk(KERN_WARNING "Couldn't create per port immutable data %s\n",
347-
device->name);
346+
pr_warn("Couldn't create per port immutable data %s\n",
347+
device->name);
348348
goto out;
349349
}
350350

351351
ret = ib_cache_setup_one(device);
352352
if (ret) {
353-
printk(KERN_WARNING "Couldn't set up InfiniBand P_Key/GID cache\n");
353+
pr_warn("Couldn't set up InfiniBand P_Key/GID cache\n");
354354
goto out;
355355
}
356356

357357
memset(&device->attrs, 0, sizeof(device->attrs));
358358
ret = device->query_device(device, &device->attrs, &uhw);
359359
if (ret) {
360-
printk(KERN_WARNING "Couldn't query the device attributes\n");
360+
pr_warn("Couldn't query the device attributes\n");
361361
ib_cache_cleanup_one(device);
362362
goto out;
363363
}
364364

365365
ret = ib_device_register_sysfs(device, port_callback);
366366
if (ret) {
367-
printk(KERN_WARNING "Couldn't register device %s with driver model\n",
368-
device->name);
367+
pr_warn("Couldn't register device %s with driver model\n",
368+
device->name);
369369
ib_cache_cleanup_one(device);
370370
goto out;
371371
}
@@ -566,8 +566,8 @@ void ib_set_client_data(struct ib_device *device, struct ib_client *client,
566566
goto out;
567567
}
568568

569-
printk(KERN_WARNING "No client context found for %s/%s\n",
570-
device->name, client->name);
569+
pr_warn("No client context found for %s/%s\n",
570+
device->name, client->name);
571571

572572
out:
573573
spin_unlock_irqrestore(&device->client_data_lock, flags);
@@ -960,13 +960,13 @@ static int __init ib_core_init(void)
960960

961961
ret = class_register(&ib_class);
962962
if (ret) {
963-
printk(KERN_WARNING "Couldn't create InfiniBand device class\n");
963+
pr_warn("Couldn't create InfiniBand device class\n");
964964
goto err_comp;
965965
}
966966

967967
ret = ibnl_init();
968968
if (ret) {
969-
printk(KERN_WARNING "Couldn't init IB netlink interface\n");
969+
pr_warn("Couldn't init IB netlink interface\n");
970970
goto err_sysfs;
971971
}
972972

drivers/infiniband/core/fmr_pool.c

Lines changed: 15 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -150,8 +150,8 @@ static void ib_fmr_batch_release(struct ib_fmr_pool *pool)
150150

151151
#ifdef DEBUG
152152
if (fmr->ref_count !=0) {
153-
printk(KERN_WARNING PFX "Unmapping FMR 0x%08x with ref count %d\n",
154-
fmr, fmr->ref_count);
153+
pr_warn(PFX "Unmapping FMR 0x%08x with ref count %d\n",
154+
fmr, fmr->ref_count);
155155
}
156156
#endif
157157
}
@@ -167,7 +167,7 @@ static void ib_fmr_batch_release(struct ib_fmr_pool *pool)
167167

168168
ret = ib_unmap_fmr(&fmr_list);
169169
if (ret)
170-
printk(KERN_WARNING PFX "ib_unmap_fmr returned %d\n", ret);
170+
pr_warn(PFX "ib_unmap_fmr returned %d\n", ret);
171171

172172
spin_lock_irq(&pool->pool_lock);
173173
list_splice(&unmap_list, &pool->free_list);
@@ -222,8 +222,7 @@ struct ib_fmr_pool *ib_create_fmr_pool(struct ib_pd *pd,
222222
device = pd->device;
223223
if (!device->alloc_fmr || !device->dealloc_fmr ||
224224
!device->map_phys_fmr || !device->unmap_fmr) {
225-
printk(KERN_INFO PFX "Device %s does not support FMRs\n",
226-
device->name);
225+
pr_info(PFX "Device %s does not support FMRs\n", device->name);
227226
return ERR_PTR(-ENOSYS);
228227
}
229228

@@ -233,13 +232,10 @@ struct ib_fmr_pool *ib_create_fmr_pool(struct ib_pd *pd,
233232
max_remaps = device->attrs.max_map_per_fmr;
234233

235234
pool = kmalloc(sizeof *pool, GFP_KERNEL);
236-
if (!pool) {
237-
printk(KERN_WARNING PFX "couldn't allocate pool struct\n");
235+
if (!pool)
238236
return ERR_PTR(-ENOMEM);
239-
}
240237

241238
pool->cache_bucket = NULL;
242-
243239
pool->flush_function = params->flush_function;
244240
pool->flush_arg = params->flush_arg;
245241

@@ -251,7 +247,7 @@ struct ib_fmr_pool *ib_create_fmr_pool(struct ib_pd *pd,
251247
kmalloc(IB_FMR_HASH_SIZE * sizeof *pool->cache_bucket,
252248
GFP_KERNEL);
253249
if (!pool->cache_bucket) {
254-
printk(KERN_WARNING PFX "Failed to allocate cache in pool\n");
250+
pr_warn(PFX "Failed to allocate cache in pool\n");
255251
ret = -ENOMEM;
256252
goto out_free_pool;
257253
}
@@ -275,7 +271,7 @@ struct ib_fmr_pool *ib_create_fmr_pool(struct ib_pd *pd,
275271
"ib_fmr(%s)",
276272
device->name);
277273
if (IS_ERR(pool->thread)) {
278-
printk(KERN_WARNING PFX "couldn't start cleanup thread\n");
274+
pr_warn(PFX "couldn't start cleanup thread\n");
279275
ret = PTR_ERR(pool->thread);
280276
goto out_free_pool;
281277
}
@@ -294,11 +290,8 @@ struct ib_fmr_pool *ib_create_fmr_pool(struct ib_pd *pd,
294290

295291
for (i = 0; i < params->pool_size; ++i) {
296292
fmr = kmalloc(bytes_per_fmr, GFP_KERNEL);
297-
if (!fmr) {
298-
printk(KERN_WARNING PFX "failed to allocate fmr "
299-
"struct for FMR %d\n", i);
293+
if (!fmr)
300294
goto out_fail;
301-
}
302295

303296
fmr->pool = pool;
304297
fmr->remap_count = 0;
@@ -307,8 +300,8 @@ struct ib_fmr_pool *ib_create_fmr_pool(struct ib_pd *pd,
307300

308301
fmr->fmr = ib_alloc_fmr(pd, params->access, &fmr_attr);
309302
if (IS_ERR(fmr->fmr)) {
310-
printk(KERN_WARNING PFX "fmr_create failed "
311-
"for FMR %d\n", i);
303+
pr_warn(PFX "fmr_create failed for FMR %d\n",
304+
i);
312305
kfree(fmr);
313306
goto out_fail;
314307
}
@@ -363,8 +356,8 @@ void ib_destroy_fmr_pool(struct ib_fmr_pool *pool)
363356
}
364357

365358
if (i < pool->pool_size)
366-
printk(KERN_WARNING PFX "pool still has %d regions registered\n",
367-
pool->pool_size - i);
359+
pr_warn(PFX "pool still has %d regions registered\n",
360+
pool->pool_size - i);
368361

369362
kfree(pool->cache_bucket);
370363
kfree(pool);
@@ -463,7 +456,7 @@ struct ib_pool_fmr *ib_fmr_pool_map_phys(struct ib_fmr_pool *pool_handle,
463456
list_add(&fmr->list, &pool->free_list);
464457
spin_unlock_irqrestore(&pool->pool_lock, flags);
465458

466-
printk(KERN_WARNING PFX "fmr_map returns %d\n", result);
459+
pr_warn(PFX "fmr_map returns %d\n", result);
467460

468461
return ERR_PTR(result);
469462
}
@@ -517,8 +510,8 @@ int ib_fmr_pool_unmap(struct ib_pool_fmr *fmr)
517510

518511
#ifdef DEBUG
519512
if (fmr->ref_count < 0)
520-
printk(KERN_WARNING PFX "FMR %p has ref count %d < 0\n",
521-
fmr, fmr->ref_count);
513+
pr_warn(PFX "FMR %p has ref count %d < 0\n",
514+
fmr, fmr->ref_count);
522515
#endif
523516

524517
spin_unlock_irqrestore(&pool->pool_lock, flags);

0 commit comments

Comments
 (0)