Orange Pi5 kernel

Deprecated Linux kernel 5.10.110 for OrangePi 5/5B/5+ boards

3 Commits   0 Branches   0 Tags
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   1) // SPDX-License-Identifier: GPL-2.0 OR BSD-3-Clause
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   2) /*
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   3)  * Copyright (c) 2015-2018 Oracle.  All rights reserved.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   4)  * Copyright (c) 2005-2006 Network Appliance, Inc. All rights reserved.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   5)  *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   6)  * This software is available to you under a choice of one of two
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   7)  * licenses.  You may choose to be licensed under the terms of the GNU
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   8)  * General Public License (GPL) Version 2, available from the file
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   9)  * COPYING in the main directory of this source tree, or the BSD-type
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  10)  * license below:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  11)  *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  12)  * Redistribution and use in source and binary forms, with or without
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  13)  * modification, are permitted provided that the following conditions
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  14)  * are met:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  15)  *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  16)  *      Redistributions of source code must retain the above copyright
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  17)  *      notice, this list of conditions and the following disclaimer.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  18)  *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  19)  *      Redistributions in binary form must reproduce the above
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  20)  *      copyright notice, this list of conditions and the following
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  21)  *      disclaimer in the documentation and/or other materials provided
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  22)  *      with the distribution.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  23)  *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  24)  *      Neither the name of the Network Appliance, Inc. nor the names of
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  25)  *      its contributors may be used to endorse or promote products
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  26)  *      derived from this software without specific prior written
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  27)  *      permission.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  28)  *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  29)  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  30)  * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  31)  * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  32)  * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  33)  * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  34)  * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  35)  * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  36)  * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  37)  * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  38)  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  39)  * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  40)  *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  41)  * Author: Tom Tucker <tom@opengridcomputing.com>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  42)  */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  43) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  44) #include <linux/slab.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  45) #include <linux/fs.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  46) #include <linux/sysctl.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  47) #include <linux/workqueue.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  48) #include <linux/sunrpc/clnt.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  49) #include <linux/sunrpc/sched.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  50) #include <linux/sunrpc/svc_rdma.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  51) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  52) #define RPCDBG_FACILITY	RPCDBG_SVCXPRT
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  53) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  54) /* RPC/RDMA parameters */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  55) unsigned int svcrdma_ord = 16;	/* historical default */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  56) static unsigned int min_ord = 1;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  57) static unsigned int max_ord = 255;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  58) unsigned int svcrdma_max_requests = RPCRDMA_MAX_REQUESTS;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  59) unsigned int svcrdma_max_bc_requests = RPCRDMA_MAX_BC_REQUESTS;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  60) static unsigned int min_max_requests = 4;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  61) static unsigned int max_max_requests = 16384;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  62) unsigned int svcrdma_max_req_size = RPCRDMA_DEF_INLINE_THRESH;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  63) static unsigned int min_max_inline = RPCRDMA_DEF_INLINE_THRESH;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  64) static unsigned int max_max_inline = RPCRDMA_MAX_INLINE_THRESH;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  65) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  66) atomic_t rdma_stat_recv;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  67) atomic_t rdma_stat_read;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  68) atomic_t rdma_stat_write;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  69) atomic_t rdma_stat_sq_starve;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  70) atomic_t rdma_stat_rq_starve;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  71) atomic_t rdma_stat_rq_poll;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  72) atomic_t rdma_stat_rq_prod;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  73) atomic_t rdma_stat_sq_poll;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  74) atomic_t rdma_stat_sq_prod;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  75) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  76) /*
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  77)  * This function implements reading and resetting an atomic_t stat
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  78)  * variable through read/write to a proc file. Any write to the file
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  79)  * resets the associated statistic to zero. Any read returns it's
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  80)  * current value.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  81)  */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  82) static int read_reset_stat(struct ctl_table *table, int write,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  83) 			   void *buffer, size_t *lenp, loff_t *ppos)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  84) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  85) 	atomic_t *stat = (atomic_t *)table->data;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  86) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  87) 	if (!stat)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  88) 		return -EINVAL;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  89) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  90) 	if (write)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  91) 		atomic_set(stat, 0);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  92) 	else {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  93) 		char str_buf[32];
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  94) 		int len = snprintf(str_buf, 32, "%d\n", atomic_read(stat));
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  95) 		if (len >= 32)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  96) 			return -EFAULT;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  97) 		len = strlen(str_buf);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  98) 		if (*ppos > len) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  99) 			*lenp = 0;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 100) 			return 0;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 101) 		}
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 102) 		len -= *ppos;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 103) 		if (len > *lenp)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 104) 			len = *lenp;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 105) 		if (len)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 106) 			memcpy(buffer, str_buf, len);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 107) 		*lenp = len;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 108) 		*ppos += len;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 109) 	}
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 110) 	return 0;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 111) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 112) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 113) static struct ctl_table_header *svcrdma_table_header;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 114) static struct ctl_table svcrdma_parm_table[] = {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 115) 	{
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 116) 		.procname	= "max_requests",
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 117) 		.data		= &svcrdma_max_requests,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 118) 		.maxlen		= sizeof(unsigned int),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 119) 		.mode		= 0644,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 120) 		.proc_handler	= proc_dointvec_minmax,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 121) 		.extra1		= &min_max_requests,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 122) 		.extra2		= &max_max_requests
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 123) 	},
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 124) 	{
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 125) 		.procname	= "max_req_size",
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 126) 		.data		= &svcrdma_max_req_size,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 127) 		.maxlen		= sizeof(unsigned int),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 128) 		.mode		= 0644,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 129) 		.proc_handler	= proc_dointvec_minmax,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 130) 		.extra1		= &min_max_inline,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 131) 		.extra2		= &max_max_inline
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 132) 	},
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 133) 	{
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 134) 		.procname	= "max_outbound_read_requests",
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 135) 		.data		= &svcrdma_ord,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 136) 		.maxlen		= sizeof(unsigned int),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 137) 		.mode		= 0644,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 138) 		.proc_handler	= proc_dointvec_minmax,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 139) 		.extra1		= &min_ord,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 140) 		.extra2		= &max_ord,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 141) 	},
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 142) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 143) 	{
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 144) 		.procname	= "rdma_stat_read",
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 145) 		.data		= &rdma_stat_read,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 146) 		.maxlen		= sizeof(atomic_t),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 147) 		.mode		= 0644,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 148) 		.proc_handler	= read_reset_stat,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 149) 	},
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 150) 	{
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 151) 		.procname	= "rdma_stat_recv",
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 152) 		.data		= &rdma_stat_recv,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 153) 		.maxlen		= sizeof(atomic_t),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 154) 		.mode		= 0644,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 155) 		.proc_handler	= read_reset_stat,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 156) 	},
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 157) 	{
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 158) 		.procname	= "rdma_stat_write",
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 159) 		.data		= &rdma_stat_write,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 160) 		.maxlen		= sizeof(atomic_t),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 161) 		.mode		= 0644,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 162) 		.proc_handler	= read_reset_stat,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 163) 	},
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 164) 	{
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 165) 		.procname	= "rdma_stat_sq_starve",
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 166) 		.data		= &rdma_stat_sq_starve,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 167) 		.maxlen		= sizeof(atomic_t),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 168) 		.mode		= 0644,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 169) 		.proc_handler	= read_reset_stat,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 170) 	},
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 171) 	{
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 172) 		.procname	= "rdma_stat_rq_starve",
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 173) 		.data		= &rdma_stat_rq_starve,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 174) 		.maxlen		= sizeof(atomic_t),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 175) 		.mode		= 0644,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 176) 		.proc_handler	= read_reset_stat,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 177) 	},
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 178) 	{
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 179) 		.procname	= "rdma_stat_rq_poll",
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 180) 		.data		= &rdma_stat_rq_poll,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 181) 		.maxlen		= sizeof(atomic_t),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 182) 		.mode		= 0644,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 183) 		.proc_handler	= read_reset_stat,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 184) 	},
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 185) 	{
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 186) 		.procname	= "rdma_stat_rq_prod",
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 187) 		.data		= &rdma_stat_rq_prod,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 188) 		.maxlen		= sizeof(atomic_t),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 189) 		.mode		= 0644,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 190) 		.proc_handler	= read_reset_stat,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 191) 	},
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 192) 	{
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 193) 		.procname	= "rdma_stat_sq_poll",
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 194) 		.data		= &rdma_stat_sq_poll,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 195) 		.maxlen		= sizeof(atomic_t),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 196) 		.mode		= 0644,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 197) 		.proc_handler	= read_reset_stat,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 198) 	},
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 199) 	{
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 200) 		.procname	= "rdma_stat_sq_prod",
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 201) 		.data		= &rdma_stat_sq_prod,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 202) 		.maxlen		= sizeof(atomic_t),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 203) 		.mode		= 0644,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 204) 		.proc_handler	= read_reset_stat,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 205) 	},
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 206) 	{ },
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 207) };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 208) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 209) static struct ctl_table svcrdma_table[] = {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 210) 	{
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 211) 		.procname	= "svc_rdma",
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 212) 		.mode		= 0555,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 213) 		.child		= svcrdma_parm_table
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 214) 	},
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 215) 	{ },
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 216) };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 217) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 218) static struct ctl_table svcrdma_root_table[] = {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 219) 	{
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 220) 		.procname	= "sunrpc",
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 221) 		.mode		= 0555,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 222) 		.child		= svcrdma_table
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 223) 	},
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 224) 	{ },
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 225) };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 226) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 227) void svc_rdma_cleanup(void)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 228) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 229) 	dprintk("SVCRDMA Module Removed, deregister RPC RDMA transport\n");
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 230) 	if (svcrdma_table_header) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 231) 		unregister_sysctl_table(svcrdma_table_header);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 232) 		svcrdma_table_header = NULL;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 233) 	}
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 234) 	svc_unreg_xprt_class(&svc_rdma_class);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 235) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 236) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 237) int svc_rdma_init(void)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 238) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 239) 	dprintk("SVCRDMA Module Init, register RPC RDMA transport\n");
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 240) 	dprintk("\tsvcrdma_ord      : %d\n", svcrdma_ord);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 241) 	dprintk("\tmax_requests     : %u\n", svcrdma_max_requests);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 242) 	dprintk("\tmax_bc_requests  : %u\n", svcrdma_max_bc_requests);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 243) 	dprintk("\tmax_inline       : %d\n", svcrdma_max_req_size);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 244) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 245) 	if (!svcrdma_table_header)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 246) 		svcrdma_table_header =
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 247) 			register_sysctl_table(svcrdma_root_table);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 248) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 249) 	/* Register RDMA with the SVC transport switch */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 250) 	svc_reg_xprt_class(&svc_rdma_class);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 251) 	return 0;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 252) }