linux/net/rds/iw_sysctl.c
<<
tion4tion4ti//spav31ti/spav class="lxr_search">tiontion4tion4tion4typ Searchtion4ti//spav31on4< ti/input typ ton4< 1 /div id < <1//a>/spav class="comment">/*//spav31< <2//a>/spav class="comment"> * Copyright (c) 2006 Oracle. All rights reserved.//spav31< <3//a>/spav class="comment"> *//spav31< <4//a>/spav class="comment"> * This software is available to you under a choice of one of two//spav31< <5//a>/spav class="comment"> * licenses. You may choose to be licensed under the terms of the GNU//spav31< <6//a>/spav class="comment"> * General Public License (GPL) Version>2, available from the file//spav31< <7//a>/spav class="comment"> * COPYING in the main directory of this source tree, or the//spav31< <8//a>/spav class="comment"> * OpenIB.org BSD license below://spav31< <9//a>/spav class="comment"> *//spav31< " a>/spav class="comment"> * Redistribution>and use in source and binary forms, with or//spav31< 11//a>/spav class="comment"> * without modification, are permitted provided that the following//spav31< 12//a>/spav class="comment"> * conditions are met://spav31< 13//a>/spav class="comment"> *//spav31< 14//a>/spav class="comment"> * - Redistributions of source code must retain the above//spav31< 15//a>/spav class="comment"> * copyright notice, this list of conditions and the following//spav31< 16//a>/spav class="comment"> * disclaimer.//spav31< 17//a>/spav class="comment"> *//spav31< 18//a>/spav class="comment"> * - Redistributions in binary form must reproduce the above//spav31< 19//a>/spav class="comment"> * copyright notice, this list of conditions and the following//spav31< 2 a>/spav class="comment"> * disclaimer in the documentation>and/or other materials//spav31< 21//a>/spav class="comment"> * provided with the distribution.//spav31< 22//a>/spav class="comment"> *//spav31< 23//a>/spav class="comment"> * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,//spav31< 24//a>/spav class="comment"> * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF//spav31< 25//a>/spav class="comment"> * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND//spav31< 26//a>/spav class="comment"> * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS//spav31< 27//a>/spav class="comment"> * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN//spav31< 28//a>/spav class="comment"> * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN//spav31< 29//a>/spav class="comment"> * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE//spav31< 3 a>/spav class="comment"> * SOFTWARE.//spav31< 31//a>/spav class="comment"> *//spav31< 32//a>/spav class="comment"> *///spav31< 33//a>#include <linux/kernel.h//a>>1< 34//a>#include <linux/sysctl.h//a>>1< 35//a>#include <linux/proc_fs.h//a>>1< 36//a>1< 37//a>#include "iw.h//a>"1< 38//a>1< 39//a>static structctl_table_header//a> */a href="+code=rds_iw_sysctl_hdr" class="sref">rds_iw_sysctl_hdr//a>;1< 40//a>1< 41//a>unsigned longrds_iw_sysctl_max_send_wr//a> =RDS_IW_DEFAULT_SEND_WR//a>;1< 42//a>unsigned longrds_iw_sysctl_max_recv_wr//a> =RDS_IW_DEFAULT_RECV_WR//a>;1< 43//a>unsigned longrds_iw_sysctl_max_recv_allocation//a> =<(128 * 1024 * 1024) /RDS_FRAG_SIZE//a>;1< 44//a>static unsigned longrds_iw_sysctl_max_wr_min//a> =<1;1< 45//a>/spav class="comment">/* hardware will fail CQ creation>long< 46//a>static unsigned longrds_iw_sysctl_max_wr_max//a> =<(/a href="+code=u32" class="sref">u32//a>)~0;1< 47//a>1< 48//a>unsigned longrds_iw_sysctl_max_unsig_wrs//a> =<16;1< 49//a>static unsigned longrds_iw_sysctl_max_unsig_wr_min//a> =<1;1< 50//a>static unsigned longrds_iw_sysctl_max_unsig_wr_max//a> =<64;1< 51//a>1< 52//a>unsigned longrds_iw_sysctl_max_unsig_bytes//a> =<(16 << 20);1< 53//a>static unsigned longrds_iw_sysctl_max_unsig_bytes_min//a> =<1;1< 54//a>static unsigned longrds_iw_sysctl_max_unsig_bytes_max//a> =<~0UL;1< 55//a>1< 56//a>unsigned intrds_iw_sysctl_flow_control//a> =<1;1< 57//a>1< 58//a>static /a href="+code=ctl_table" class="sref">ctl_table//a> /a href="+code=rds_iw_sysctl_table" class="sref">rds_iw_sysctl_table//a>[] =<{1< 59//a> {1< 60//a> ./a href="+code=procnam " class="sref">procnam //a> ="max_send_wr"< 61//a> ./a href="+code=data" class="sref">data//a> = &/a href="+code=rds_iw_sysctl_max_send_wr" class="sref">rds_iw_sysctl_max_send_wr//a>,1< 62//a> ./a href="+code=maxlen" class="sref">maxlen//a> = sizeof(unsigned long),1< 63//a> ./a href="+code=mode" class="sref">mode//a> = 0644,1< 64//a> ./a href="+code=proc_handler" class="sref">proc_handler//a> =proc_doulongvec_minmax//a>,1< 65//a> ./a href="+code=extra1" class="sref">extra1//a> = &/a href="+code=rds_iw_sysctl_max_wr_min" class="sref">rds_iw_sysctl_max_wr_min//a>,1< 66//a> ./a href="+code=extra2" class="sref">extra2//a> = &/a href="+code=rds_iw_sysctl_max_wr_max" class="sref">rds_iw_sysctl_max_wr_max//a>,1< 67//a> },1< 68//a> {1< 69//a> ./a href="+code=procnam " class="sref">procnam //a> ="max_recv_wr"< 70//a> ./a href="+code=data" class="sref">data//a> = &/a href="+code=rds_iw_sysctl_max_recv_wr" class="sref">rds_iw_sysctl_max_recv_wr//a>,1< 71//a> ./a href="+code=maxlen" class="sref">maxlen//a> = sizeof(unsigned long),1< 72//a> ./a href="+code=mode" class="sref">mode//a> = 0644,1< 73//a> ./a href="+code=proc_handler" class="sref">proc_handler//a> =proc_doulongvec_minmax//a>,1< 74//a> ./a href="+code=extra1" class="sref">extra1//a> = &/a href="+code=rds_iw_sysctl_max_wr_min" class="sref">rds_iw_sysctl_max_wr_min//a>,1< 75//a> ./a href="+code=extra2" class="sref">extra2//a> = &/a href="+code=rds_iw_sysctl_max_wr_max" class="sref">rds_iw_sysctl_max_wr_max//a>,1< 76//a> },1< 77//a> {1< 78//a> ./a href="+code=procnam " class="sref">procnam //a> ="max_unsignaled_wr"< 79//a> ./a href="+code=data" class="sref">data//a> = &/a href="+code=rds_iw_sysctl_max_unsig_wrs" class="sref">rds_iw_sysctl_max_unsig_wrs//a>,1< 80//a> ./a href="+code=maxlen" class="sref">maxlen//a> = sizeof(unsigned long),1< 81//a> ./a href="+code=mode" class="sref">mode//a> = 0644,1< 82//a> ./a href="+code=proc_handler" class="sref">proc_handler//a> =proc_doulongvec_minmax//a>,1< 83//a> ./a href="+code=extra1" class="sref">extra1//a> = &/a href="+code=rds_iw_sysctl_max_unsig_wr_min" class="sref">rds_iw_sysctl_max_unsig_wr_min//a>,1< 84//a> ./a href="+code=extra2" class="sref">extra2//a> = &/a href="+code=rds_iw_sysctl_max_unsig_wr_max" class="sref">rds_iw_sysctl_max_unsig_wr_max//a>,1< 85//a> },1< 86//a> {1< 87//a> ./a href="+code=procnam " class="sref">procnam //a> ="max_unsignaled_bytes"< 88//a> ./a href="+code=data" class="sref">data//a> = &/a href="+code=rds_iw_sysctl_max_unsig_bytes" class="sref">rds_iw_sysctl_max_unsig_bytes//a>,1< 89//a> ./a href="+code=maxlen" class="sref">maxlen//a> = sizeof(unsigned long),1< 90//a> ./a href="+code=mode" class="sref">mode//a> = 0644,1< 91//a> ./a href="+code=proc_handler" class="sref">proc_handler//a> =proc_doulongvec_minmax//a>,1< 92//a> ./a href="+code=extra1" class="sref">extra1//a> = &/a href="+code=rds_iw_sysctl_max_unsig_bytes_min" class="sref">rds_iw_sysctl_max_unsig_bytes_min//a>,1< 93//a> ./a href="+code=extra2" class="sref">extra2//a> = &/a href="+code=rds_iw_sysctl_max_unsig_bytes_max" class="sref">rds_iw_sysctl_max_unsig_bytes_max//a>,1< 94//a> },1< 95//a> {1< 96//a> ./a href="+code=procnam " class="sref">procnam //a> ="max_recv_allocation"< 97//a> ./a href="+code=data" class="sref">data//a> = &/a href="+code=rds_iw_sysctl_max_recv_allocation" class="sref">rds_iw_sysctl_max_recv_allocation//a>,1< 98//a> ./a href="+code=maxlen" class="sref">maxlen//a> = sizeof(unsigned long),1< 99//a> ./a href="+code=mode" class="sref">mode//a> = 0644,1<100//a> ./a href="+code=proc_handler" class="sref">proc_handler//a> =proc_doulongvec_minmax//a>,1<101//a> },1<102//a> {1<103//a> ./a href="+code=procnam " class="sref">procnam //a> ="flow_control"<104//a> ./a href="+code=data" class="sref">data//a> = &/a href="+code=rds_iw_sysctl_flow_control" class="sref">rds_iw_sysctl_flow_control//a>,1<105//a> ./a href="+code=maxlen" class="sref">maxlen//a> = sizeof(/a href="+code=rds_iw_sysctl_flow_control" class="sref">rds_iw_sysctl_flow_control//a>),1<106//a> ./a href="+code=mode" class="sref">mode//a> = 0644,1<107//a> ./a href="+code=proc_handler" class="sref">proc_handler//a> =proc_dointvec//a>,1<108//a> },1<109//a> { }1<1" a>};1<111//a>1<112//a>void /a href="+code=rds_iw_sysctl_exit" class="sref">rds_iw_sysctl_exit//a>(void)1<113//a>{1<114//a> if<(/a href="+code=rds_iw_sysctl_hdr" class="sref">rds_iw_sysctl_hdr//a>)1<115//a> /a href="+code=unregister_net_sysctl_table" class="sref">unregister_net_sysctl_table//a>(/a href="+code=rds_iw_sysctl_hdr" class="sref">rds_iw_sysctl_hdr//a>);1<116//a>}1<117//a>1<118//a>intrds_iw_sysctl_init//a>(void)1<119//a>{1<120//a> /a href="+code=rds_iw_sysctl_hdr" class="sref">rds_iw_sysctl_hdr//a> =register_net_sysctl//a>(&/a href="+code=init_net" class="sref">init_net//a>,"net/rds/iw"rds_iw_sysctl_table//a>);1<121//a> if<(!/a href="+code=rds_iw_sysctl_hdr" class="sref">rds_iw_sysctl_hdr//a>)1<122//a> return -/a href="+code=ENOMEM" class="sref">ENOMEM//a>;1<123//a> return 0;1<124//a>}1<125//a>//pre> The original LXR software by the LXR community//a>,by lxr@linux.no//a>. //div31/div class="subfooter"> lxr.linux.no kindly hosted by Redpill Linpro AS//a>,