xref: /OK3568_Linux_fs/kernel/include/linux/sunrpc/xprtrdma.h (revision 4882a59341e53eb6f0b4789bf948001014eff981)
1*4882a593Smuzhiyun /* SPDX-License-Identifier: GPL-2.0 OR BSD-3-Clause */
2*4882a593Smuzhiyun /*
3*4882a593Smuzhiyun  * Copyright (c) 2003-2007 Network Appliance, Inc. All rights reserved.
4*4882a593Smuzhiyun  *
5*4882a593Smuzhiyun  * This software is available to you under a choice of one of two
6*4882a593Smuzhiyun  * licenses.  You may choose to be licensed under the terms of the GNU
7*4882a593Smuzhiyun  * General Public License (GPL) Version 2, available from the file
8*4882a593Smuzhiyun  * COPYING in the main directory of this source tree, or the BSD-type
9*4882a593Smuzhiyun  * license below:
10*4882a593Smuzhiyun  *
11*4882a593Smuzhiyun  * Redistribution and use in source and binary forms, with or without
12*4882a593Smuzhiyun  * modification, are permitted provided that the following conditions
13*4882a593Smuzhiyun  * are met:
14*4882a593Smuzhiyun  *
15*4882a593Smuzhiyun  *      Redistributions of source code must retain the above copyright
16*4882a593Smuzhiyun  *      notice, this list of conditions and the following disclaimer.
17*4882a593Smuzhiyun  *
18*4882a593Smuzhiyun  *      Redistributions in binary form must reproduce the above
19*4882a593Smuzhiyun  *      copyright notice, this list of conditions and the following
20*4882a593Smuzhiyun  *      disclaimer in the documentation and/or other materials provided
21*4882a593Smuzhiyun  *      with the distribution.
22*4882a593Smuzhiyun  *
23*4882a593Smuzhiyun  *      Neither the name of the Network Appliance, Inc. nor the names of
24*4882a593Smuzhiyun  *      its contributors may be used to endorse or promote products
25*4882a593Smuzhiyun  *      derived from this software without specific prior written
26*4882a593Smuzhiyun  *      permission.
27*4882a593Smuzhiyun  *
28*4882a593Smuzhiyun  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
29*4882a593Smuzhiyun  * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
30*4882a593Smuzhiyun  * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
31*4882a593Smuzhiyun  * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
32*4882a593Smuzhiyun  * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
33*4882a593Smuzhiyun  * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
34*4882a593Smuzhiyun  * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
35*4882a593Smuzhiyun  * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
36*4882a593Smuzhiyun  * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
37*4882a593Smuzhiyun  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
38*4882a593Smuzhiyun  * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
39*4882a593Smuzhiyun  */
40*4882a593Smuzhiyun 
41*4882a593Smuzhiyun #ifndef _LINUX_SUNRPC_XPRTRDMA_H
42*4882a593Smuzhiyun #define _LINUX_SUNRPC_XPRTRDMA_H
43*4882a593Smuzhiyun 
44*4882a593Smuzhiyun /*
45*4882a593Smuzhiyun  * Constants. Max RPC/NFS header is big enough to account for
46*4882a593Smuzhiyun  * additional marshaling buffers passed down by Linux client.
47*4882a593Smuzhiyun  *
48*4882a593Smuzhiyun  * RDMA header is currently fixed max size, and is big enough for a
49*4882a593Smuzhiyun  * fully-chunked NFS message (read chunks are the largest). Note only
50*4882a593Smuzhiyun  * a single chunk type per message is supported currently.
51*4882a593Smuzhiyun  */
52*4882a593Smuzhiyun #define RPCRDMA_MIN_SLOT_TABLE	(4U)
53*4882a593Smuzhiyun #define RPCRDMA_DEF_SLOT_TABLE	(128U)
54*4882a593Smuzhiyun #define RPCRDMA_MAX_SLOT_TABLE	(16384U)
55*4882a593Smuzhiyun 
56*4882a593Smuzhiyun #define RPCRDMA_MIN_INLINE  (1024)	/* min inline thresh */
57*4882a593Smuzhiyun #define RPCRDMA_DEF_INLINE  (4096)	/* default inline thresh */
58*4882a593Smuzhiyun #define RPCRDMA_MAX_INLINE  (65536)	/* max inline thresh */
59*4882a593Smuzhiyun 
60*4882a593Smuzhiyun /* Memory registration strategies, by number.
61*4882a593Smuzhiyun  * This is part of a kernel / user space API. Do not remove. */
62*4882a593Smuzhiyun enum rpcrdma_memreg {
63*4882a593Smuzhiyun 	RPCRDMA_BOUNCEBUFFERS = 0,
64*4882a593Smuzhiyun 	RPCRDMA_REGISTER,
65*4882a593Smuzhiyun 	RPCRDMA_MEMWINDOWS,
66*4882a593Smuzhiyun 	RPCRDMA_MEMWINDOWS_ASYNC,
67*4882a593Smuzhiyun 	RPCRDMA_MTHCAFMR,
68*4882a593Smuzhiyun 	RPCRDMA_FRWR,
69*4882a593Smuzhiyun 	RPCRDMA_ALLPHYSICAL,
70*4882a593Smuzhiyun 	RPCRDMA_LAST
71*4882a593Smuzhiyun };
72*4882a593Smuzhiyun 
73*4882a593Smuzhiyun #endif /* _LINUX_SUNRPC_XPRTRDMA_H */
74