ib_sysctl.c (46557bef3f3834ac33031c7be27d39d90d507442) ib_sysctl.c (6d4561110a3e9fa742aeec6717248a491dfb1878)
1/*
2 * Copyright (c) 2006 Oracle. All rights reserved.
3 *
4 * This software is available to you under a choice of one of two
5 * licenses. You may choose to be licensed under the terms of the GNU
6 * General Public License (GPL) Version 2, available from the file
7 * COPYING in the main directory of this source tree, or the
8 * OpenIB.org BSD license below:

--- 53 unchanged lines hidden (view full) ---

62 * setting this to 1 and moving init/refill of send/recv
63 * rings from ib_cm_connect_complete() back into ib_setup_qp()
64 * will cause credits to be added before protocol negotiation.
65 */
66unsigned int rds_ib_sysctl_flow_control = 0;
67
68ctl_table rds_ib_sysctl_table[] = {
69 {
1/*
2 * Copyright (c) 2006 Oracle. All rights reserved.
3 *
4 * This software is available to you under a choice of one of two
5 * licenses. You may choose to be licensed under the terms of the GNU
6 * General Public License (GPL) Version 2, available from the file
7 * COPYING in the main directory of this source tree, or the
8 * OpenIB.org BSD license below:

--- 53 unchanged lines hidden (view full) ---

62 * setting this to 1 and moving init/refill of send/recv
63 * rings from ib_cm_connect_complete() back into ib_setup_qp()
64 * will cause credits to be added before protocol negotiation.
65 */
66unsigned int rds_ib_sysctl_flow_control = 0;
67
68ctl_table rds_ib_sysctl_table[] = {
69 {
70 .ctl_name = CTL_UNNUMBERED,
71 .procname = "max_send_wr",
72 .data = &rds_ib_sysctl_max_send_wr,
73 .maxlen = sizeof(unsigned long),
74 .mode = 0644,
70 .procname = "max_send_wr",
71 .data = &rds_ib_sysctl_max_send_wr,
72 .maxlen = sizeof(unsigned long),
73 .mode = 0644,
75 .proc_handler = &proc_doulongvec_minmax,
74 .proc_handler = proc_doulongvec_minmax,
76 .extra1 = &rds_ib_sysctl_max_wr_min,
77 .extra2 = &rds_ib_sysctl_max_wr_max,
78 },
79 {
75 .extra1 = &rds_ib_sysctl_max_wr_min,
76 .extra2 = &rds_ib_sysctl_max_wr_max,
77 },
78 {
80 .ctl_name = CTL_UNNUMBERED,
81 .procname = "max_recv_wr",
82 .data = &rds_ib_sysctl_max_recv_wr,
83 .maxlen = sizeof(unsigned long),
84 .mode = 0644,
79 .procname = "max_recv_wr",
80 .data = &rds_ib_sysctl_max_recv_wr,
81 .maxlen = sizeof(unsigned long),
82 .mode = 0644,
85 .proc_handler = &proc_doulongvec_minmax,
83 .proc_handler = proc_doulongvec_minmax,
86 .extra1 = &rds_ib_sysctl_max_wr_min,
87 .extra2 = &rds_ib_sysctl_max_wr_max,
88 },
89 {
84 .extra1 = &rds_ib_sysctl_max_wr_min,
85 .extra2 = &rds_ib_sysctl_max_wr_max,
86 },
87 {
90 .ctl_name = CTL_UNNUMBERED,
91 .procname = "max_unsignaled_wr",
92 .data = &rds_ib_sysctl_max_unsig_wrs,
93 .maxlen = sizeof(unsigned long),
94 .mode = 0644,
88 .procname = "max_unsignaled_wr",
89 .data = &rds_ib_sysctl_max_unsig_wrs,
90 .maxlen = sizeof(unsigned long),
91 .mode = 0644,
95 .proc_handler = &proc_doulongvec_minmax,
92 .proc_handler = proc_doulongvec_minmax,
96 .extra1 = &rds_ib_sysctl_max_unsig_wr_min,
97 .extra2 = &rds_ib_sysctl_max_unsig_wr_max,
98 },
99 {
93 .extra1 = &rds_ib_sysctl_max_unsig_wr_min,
94 .extra2 = &rds_ib_sysctl_max_unsig_wr_max,
95 },
96 {
100 .ctl_name = CTL_UNNUMBERED,
101 .procname = "max_unsignaled_bytes",
102 .data = &rds_ib_sysctl_max_unsig_bytes,
103 .maxlen = sizeof(unsigned long),
104 .mode = 0644,
97 .procname = "max_unsignaled_bytes",
98 .data = &rds_ib_sysctl_max_unsig_bytes,
99 .maxlen = sizeof(unsigned long),
100 .mode = 0644,
105 .proc_handler = &proc_doulongvec_minmax,
101 .proc_handler = proc_doulongvec_minmax,
106 .extra1 = &rds_ib_sysctl_max_unsig_bytes_min,
107 .extra2 = &rds_ib_sysctl_max_unsig_bytes_max,
108 },
109 {
102 .extra1 = &rds_ib_sysctl_max_unsig_bytes_min,
103 .extra2 = &rds_ib_sysctl_max_unsig_bytes_max,
104 },
105 {
110 .ctl_name = CTL_UNNUMBERED,
111 .procname = "max_recv_allocation",
112 .data = &rds_ib_sysctl_max_recv_allocation,
113 .maxlen = sizeof(unsigned long),
114 .mode = 0644,
106 .procname = "max_recv_allocation",
107 .data = &rds_ib_sysctl_max_recv_allocation,
108 .maxlen = sizeof(unsigned long),
109 .mode = 0644,
115 .proc_handler = &proc_doulongvec_minmax,
110 .proc_handler = proc_doulongvec_minmax,
116 },
117 {
111 },
112 {
118 .ctl_name = CTL_UNNUMBERED,
119 .procname = "flow_control",
120 .data = &rds_ib_sysctl_flow_control,
121 .maxlen = sizeof(rds_ib_sysctl_flow_control),
122 .mode = 0644,
113 .procname = "flow_control",
114 .data = &rds_ib_sysctl_flow_control,
115 .maxlen = sizeof(rds_ib_sysctl_flow_control),
116 .mode = 0644,
123 .proc_handler = &proc_dointvec,
117 .proc_handler = proc_dointvec,
124 },
118 },
125 { .ctl_name = 0}
119 { }
126};
127
128static struct ctl_path rds_ib_sysctl_path[] = {
120};
121
122static struct ctl_path rds_ib_sysctl_path[] = {
129 { .procname = "net", .ctl_name = CTL_NET, },
130 { .procname = "rds", .ctl_name = CTL_UNNUMBERED, },
131 { .procname = "ib", .ctl_name = CTL_UNNUMBERED, },
123 { .procname = "net", },
124 { .procname = "rds", },
125 { .procname = "ib", },
132 { }
133};
134
135void rds_ib_sysctl_exit(void)
136{
137 if (rds_ib_sysctl_hdr)
138 unregister_sysctl_table(rds_ib_sysctl_hdr);
139}
140
141int __init rds_ib_sysctl_init(void)
142{
143 rds_ib_sysctl_hdr = register_sysctl_paths(rds_ib_sysctl_path, rds_ib_sysctl_table);
144 if (rds_ib_sysctl_hdr == NULL)
145 return -ENOMEM;
146 return 0;
147}
126 { }
127};
128
129void rds_ib_sysctl_exit(void)
130{
131 if (rds_ib_sysctl_hdr)
132 unregister_sysctl_table(rds_ib_sysctl_hdr);
133}
134
135int __init rds_ib_sysctl_init(void)
136{
137 rds_ib_sysctl_hdr = register_sysctl_paths(rds_ib_sysctl_path, rds_ib_sysctl_table);
138 if (rds_ib_sysctl_hdr == NULL)
139 return -ENOMEM;
140 return 0;
141}