[pnfs] [PATCH 07/10] nfs41: New NFSv4.1 header files.
Ricardo Labiaga
ricardo.labiaga at netapp.com
Wed Jan 2 19:01:48 EST 2008
New header files for NFSv4.1 backchannel transport operations.
Signed-off-by: Ricardo Labiaga <ricardo.labiaga at netapp.com>
---
include/linux/sunrpc/bc_xprt.h | 25 +++++++++++++++++++++++++
include/linux/sunrpc/xprt_params.h | 23 +++++++++++++++++++++++
2 files changed, 48 insertions(+), 0 deletions(-)
create mode 100644 include/linux/sunrpc/bc_xprt.h
create mode 100644 include/linux/sunrpc/xprt_params.h
diff --git a/include/linux/sunrpc/bc_xprt.h b/include/linux/sunrpc/bc_xprt.h
new file mode 100644
index 0000000..7a8ff35
--- /dev/null
+++ b/include/linux/sunrpc/bc_xprt.h
@@ -0,0 +1,25 @@
+/*
+ * This file is Distributed under GPL. See Documentation/COPYING.
+ *
+ * Author: Rahul Iyer <iyer at netapp.com>
+ *
+ * Functions to create and manage the backchannel
+ */
+
+#ifndef _LINUX_SUNRPC_BC_XPRT_H
+#define _LINUX_SUNRPC_BC_XPRT_H
+
+#include <linux/sunrpc/svcsock.h>
+#include <linux/sunrpc/xprt.h>
+
+#ifdef CONFIG_NFS_V4_1
+struct rpc_rqst *xprt_alloc_bc_request(struct rpc_xprt *xprt);
+void xprt_free_bc_request(struct rpc_rqst *req);
+int xprt_setup_backchannel(struct rpc_xprt *, unsigned int min_reqs);
+void xprt_destroy_backchannel(struct rpc_xprt *);
+
+struct rpc_task *rpc_alloc_task(void);
+void rpc_free_task(struct rpc_task *task);
+#endif /* CONFIG_NFS_V4_1 */
+#endif
+
diff --git a/include/linux/sunrpc/xprt_params.h b/include/linux/sunrpc/xprt_params.h
new file mode 100644
index 0000000..8951826
--- /dev/null
+++ b/include/linux/sunrpc/xprt_params.h
@@ -0,0 +1,23 @@
+#ifndef _LINUX_SUNRPC_XPRT_PARAMS_H
+#define _LINUX_SUNRPC_XPRT_PARAMS_H
+
+/*
+ * The transport code maintains an estimate on the maximum number of out-
+ * standing RPC requests, using a smoothed version of the congestion
+ * avoidance implemented in 44BSD. This is basically the Van Jacobson
+ * congestion algorithm: If a retransmit occurs, the congestion window is
+ * halved; otherwise, it is incremented by 1/cwnd when
+ *
+ * - a reply is received and
+ * - a full number of requests are outstanding and
+ * - the congestion window hasn't been updated recently.
+ */
+#define RPC_CWNDSHIFT (8U)
+#define RPC_CWNDSCALE (1U << RPC_CWNDSHIFT)
+#define RPC_INITCWND RPC_CWNDSCALE
+#define RPC_MAXCWND(xprt) ((xprt)->max_reqs << RPC_CWNDSHIFT)
+
+#define RPCXPRT_CONGESTED(xprt) ((xprt)->cong >= (xprt)->cwnd)
+
+#endif
+
--
1.5.3.3
More information about the pNFS
mailing list