aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSteve Wise <swise@opengridcomputing.com>2010-08-13 16:56:34 -0400
committerRoland Dreier <rolandd@cisco.com>2010-10-23 16:41:40 -0400
commit97cb7e40c69618ba03030b467faf60dc3ee982ee (patch)
tree89a355ff5a86a2c2f544a23d1f77b7361263d165
parent252a52aa4fa22a668f019e55b3aac3ff71ec1c29 (diff)
RDMA/ucma: Allow tuning the max listen backlog
For iWARP connections, the connect request is carried in a TCP payload on an already established TCP connection. So if the ucma's backlog is full, the connection request is transmitted and acked at the TCP level by the time the connect request gets dropped in the ucma. The end result is the connection gets rejected by the iWARP provider. Further, a 32 node 256NP OpenMPI job will generate > 128 connect requests on some ranks. This patch increases the default max backlog to 1024, and adds a sysctl variable so the backlog can be adjusted at run time. Signed-off-by: Steve Wise <swise@opengridcomputing.com> Signed-off-by: Roland Dreier <rolandd@cisco.com>
-rw-r--r--drivers/infiniband/core/ucma.c39
1 files changed, 33 insertions, 6 deletions
diff --git a/drivers/infiniband/core/ucma.c b/drivers/infiniband/core/ucma.c
index ac7edc24165..b2748a67398 100644
--- a/drivers/infiniband/core/ucma.c
+++ b/drivers/infiniband/core/ucma.c
@@ -40,6 +40,7 @@
40#include <linux/in6.h> 40#include <linux/in6.h>
41#include <linux/miscdevice.h> 41#include <linux/miscdevice.h>
42#include <linux/slab.h> 42#include <linux/slab.h>
43#include <linux/sysctl.h>
43 44
44#include <rdma/rdma_user_cm.h> 45#include <rdma/rdma_user_cm.h>
45#include <rdma/ib_marshall.h> 46#include <rdma/ib_marshall.h>
@@ -50,8 +51,24 @@ MODULE_AUTHOR("Sean Hefty");
50MODULE_DESCRIPTION("RDMA Userspace Connection Manager Access"); 51MODULE_DESCRIPTION("RDMA Userspace Connection Manager Access");
51MODULE_LICENSE("Dual BSD/GPL"); 52MODULE_LICENSE("Dual BSD/GPL");
52 53
53enum { 54static unsigned int max_backlog = 1024;
54 UCMA_MAX_BACKLOG = 128 55
56static struct ctl_table_header *ucma_ctl_table_hdr;
57static ctl_table ucma_ctl_table[] = {
58 {
59 .procname = "max_backlog",
60 .data = &max_backlog,
61 .maxlen = sizeof max_backlog,
62 .mode = 0644,
63 .proc_handler = proc_dointvec,
64 },
65 { }
66};
67
68static struct ctl_path ucma_ctl_path[] = {
69 { .procname = "net" },
70 { .procname = "rdma_ucm" },
71 { }
55}; 72};
56 73
57struct ucma_file { 74struct ucma_file {
@@ -686,8 +703,8 @@ static ssize_t ucma_listen(struct ucma_file *file, const char __user *inbuf,
686 if (IS_ERR(ctx)) 703 if (IS_ERR(ctx))
687 return PTR_ERR(ctx); 704 return PTR_ERR(ctx);
688 705
689 ctx->backlog = cmd.backlog > 0 && cmd.backlog < UCMA_MAX_BACKLOG ? 706 ctx->backlog = cmd.backlog > 0 && cmd.backlog < max_backlog ?
690 cmd.backlog : UCMA_MAX_BACKLOG; 707 cmd.backlog : max_backlog;
691 ret = rdma_listen(ctx->cm_id, ctx->backlog); 708 ret = rdma_listen(ctx->cm_id, ctx->backlog);
692 ucma_put_ctx(ctx); 709 ucma_put_ctx(ctx);
693 return ret; 710 return ret;
@@ -1279,16 +1296,26 @@ static int __init ucma_init(void)
1279 ret = device_create_file(ucma_misc.this_device, &dev_attr_abi_version); 1296 ret = device_create_file(ucma_misc.this_device, &dev_attr_abi_version);
1280 if (ret) { 1297 if (ret) {
1281 printk(KERN_ERR "rdma_ucm: couldn't create abi_version attr\n"); 1298 printk(KERN_ERR "rdma_ucm: couldn't create abi_version attr\n");
1282 goto err; 1299 goto err1;
1300 }
1301
1302 ucma_ctl_table_hdr = register_sysctl_paths(ucma_ctl_path, ucma_ctl_table);
1303 if (!ucma_ctl_table_hdr) {
1304 printk(KERN_ERR "rdma_ucm: couldn't register sysctl paths\n");
1305 ret = -ENOMEM;
1306 goto err2;
1283 } 1307 }
1284 return 0; 1308 return 0;
1285err: 1309err2:
1310 device_remove_file(ucma_misc.this_device, &dev_attr_abi_version);
1311err1:
1286 misc_deregister(&ucma_misc); 1312 misc_deregister(&ucma_misc);
1287 return ret; 1313 return ret;
1288} 1314}
1289 1315
1290static void __exit ucma_cleanup(void) 1316static void __exit ucma_cleanup(void)
1291{ 1317{
1318 unregister_sysctl_table(ucma_ctl_table_hdr);
1292 device_remove_file(ucma_misc.this_device, &dev_attr_abi_version); 1319 device_remove_file(ucma_misc.this_device, &dev_attr_abi_version);
1293 misc_deregister(&ucma_misc); 1320 misc_deregister(&ucma_misc);
1294 idr_destroy(&ctx_idr); 1321 idr_destroy(&ctx_idr);