aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--drivers/infiniband/core/iwcm.c27
1 files changed, 27 insertions, 0 deletions
diff --git a/drivers/infiniband/core/iwcm.c b/drivers/infiniband/core/iwcm.c
index 3d2e489ab732..ff9163dc1596 100644
--- a/drivers/infiniband/core/iwcm.c
+++ b/drivers/infiniband/core/iwcm.c
@@ -46,6 +46,7 @@
46#include <linux/completion.h> 46#include <linux/completion.h>
47#include <linux/slab.h> 47#include <linux/slab.h>
48#include <linux/module.h> 48#include <linux/module.h>
49#include <linux/sysctl.h>
49 50
50#include <rdma/iw_cm.h> 51#include <rdma/iw_cm.h>
51#include <rdma/ib_addr.h> 52#include <rdma/ib_addr.h>
@@ -65,6 +66,20 @@ struct iwcm_work {
65 struct list_head free_list; 66 struct list_head free_list;
66}; 67};
67 68
69static unsigned int default_backlog = 256;
70
71static struct ctl_table_header *iwcm_ctl_table_hdr;
72static struct ctl_table iwcm_ctl_table[] = {
73 {
74 .procname = "default_backlog",
75 .data = &default_backlog,
76 .maxlen = sizeof(default_backlog),
77 .mode = 0644,
78 .proc_handler = proc_dointvec,
79 },
80 { }
81};
82
68/* 83/*
69 * The following services provide a mechanism for pre-allocating iwcm_work 84 * The following services provide a mechanism for pre-allocating iwcm_work
70 * elements. The design pre-allocates them based on the cm_id type: 85 * elements. The design pre-allocates them based on the cm_id type:
@@ -425,6 +440,9 @@ int iw_cm_listen(struct iw_cm_id *cm_id, int backlog)
425 440
426 cm_id_priv = container_of(cm_id, struct iwcm_id_private, id); 441 cm_id_priv = container_of(cm_id, struct iwcm_id_private, id);
427 442
443 if (!backlog)
444 backlog = default_backlog;
445
428 ret = alloc_work_entries(cm_id_priv, backlog); 446 ret = alloc_work_entries(cm_id_priv, backlog);
429 if (ret) 447 if (ret)
430 return ret; 448 return ret;
@@ -1030,11 +1048,20 @@ static int __init iw_cm_init(void)
1030 if (!iwcm_wq) 1048 if (!iwcm_wq)
1031 return -ENOMEM; 1049 return -ENOMEM;
1032 1050
1051 iwcm_ctl_table_hdr = register_net_sysctl(&init_net, "net/iw_cm",
1052 iwcm_ctl_table);
1053 if (!iwcm_ctl_table_hdr) {
1054 pr_err("iw_cm: couldn't register sysctl paths\n");
1055 destroy_workqueue(iwcm_wq);
1056 return -ENOMEM;
1057 }
1058
1033 return 0; 1059 return 0;
1034} 1060}
1035 1061
1036static void __exit iw_cm_cleanup(void) 1062static void __exit iw_cm_cleanup(void)
1037{ 1063{
1064 unregister_net_sysctl_table(iwcm_ctl_table_hdr);
1038 destroy_workqueue(iwcm_wq); 1065 destroy_workqueue(iwcm_wq);
1039} 1066}
1040 1067