aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/sunrpc
diff options
context:
space:
mode:
authorIngo Molnar <mingo@kernel.org>2015-02-28 02:03:10 -0500
committerIngo Molnar <mingo@kernel.org>2015-02-28 02:03:10 -0500
commit5838d18955b52467f4b30486e62a31727b39998d (patch)
tree8aeb8412156bab93a6b39f2de4a8d6c912ddb31a /include/linux/sunrpc
parent579deee571a755c485ad702ef82c77a98a2ccc05 (diff)
parent895c8b7b4623d4f55e260e5dee2574b4f7113105 (diff)
Merge branch 'linus' into x86/urgent, to merge dependent patch
Signed-off-by: Ingo Molnar <mingo@kernel.org>
Diffstat (limited to 'include/linux/sunrpc')
-rw-r--r--include/linux/sunrpc/clnt.h3
-rw-r--r--include/linux/sunrpc/metrics.h7
-rw-r--r--include/linux/sunrpc/rpc_rdma.h14
-rw-r--r--include/linux/sunrpc/svc.h2
-rw-r--r--include/linux/sunrpc/svc_rdma.h15
-rw-r--r--include/linux/sunrpc/xprt.h6
6 files changed, 37 insertions, 10 deletions
diff --git a/include/linux/sunrpc/clnt.h b/include/linux/sunrpc/clnt.h
index d86acc63b25f..598ba80ec30c 100644
--- a/include/linux/sunrpc/clnt.h
+++ b/include/linux/sunrpc/clnt.h
@@ -57,7 +57,7 @@ struct rpc_clnt {
57 const struct rpc_timeout *cl_timeout; /* Timeout strategy */ 57 const struct rpc_timeout *cl_timeout; /* Timeout strategy */
58 58
59 int cl_nodelen; /* nodename length */ 59 int cl_nodelen; /* nodename length */
60 char cl_nodename[UNX_MAXNODENAME]; 60 char cl_nodename[UNX_MAXNODENAME+1];
61 struct rpc_pipe_dir_head cl_pipedir_objects; 61 struct rpc_pipe_dir_head cl_pipedir_objects;
62 struct rpc_clnt * cl_parent; /* Points to parent of clones */ 62 struct rpc_clnt * cl_parent; /* Points to parent of clones */
63 struct rpc_rtt cl_rtt_default; 63 struct rpc_rtt cl_rtt_default;
@@ -112,6 +112,7 @@ struct rpc_create_args {
112 struct sockaddr *saddress; 112 struct sockaddr *saddress;
113 const struct rpc_timeout *timeout; 113 const struct rpc_timeout *timeout;
114 const char *servername; 114 const char *servername;
115 const char *nodename;
115 const struct rpc_program *program; 116 const struct rpc_program *program;
116 u32 prognumber; /* overrides program->number */ 117 u32 prognumber; /* overrides program->number */
117 u32 version; 118 u32 version;
diff --git a/include/linux/sunrpc/metrics.h b/include/linux/sunrpc/metrics.h
index eecb5a71e6c0..694eecb2f1b5 100644
--- a/include/linux/sunrpc/metrics.h
+++ b/include/linux/sunrpc/metrics.h
@@ -79,6 +79,8 @@ struct rpc_clnt;
79struct rpc_iostats * rpc_alloc_iostats(struct rpc_clnt *); 79struct rpc_iostats * rpc_alloc_iostats(struct rpc_clnt *);
80void rpc_count_iostats(const struct rpc_task *, 80void rpc_count_iostats(const struct rpc_task *,
81 struct rpc_iostats *); 81 struct rpc_iostats *);
82void rpc_count_iostats_metrics(const struct rpc_task *,
83 struct rpc_iostats *);
82void rpc_print_iostats(struct seq_file *, struct rpc_clnt *); 84void rpc_print_iostats(struct seq_file *, struct rpc_clnt *);
83void rpc_free_iostats(struct rpc_iostats *); 85void rpc_free_iostats(struct rpc_iostats *);
84 86
@@ -87,6 +89,11 @@ void rpc_free_iostats(struct rpc_iostats *);
87static inline struct rpc_iostats *rpc_alloc_iostats(struct rpc_clnt *clnt) { return NULL; } 89static inline struct rpc_iostats *rpc_alloc_iostats(struct rpc_clnt *clnt) { return NULL; }
88static inline void rpc_count_iostats(const struct rpc_task *task, 90static inline void rpc_count_iostats(const struct rpc_task *task,
89 struct rpc_iostats *stats) {} 91 struct rpc_iostats *stats) {}
92static inline void rpc_count_iostats_metrics(const struct rpc_task *task,
93 struct rpc_iostats *stats)
94{
95}
96
90static inline void rpc_print_iostats(struct seq_file *seq, struct rpc_clnt *clnt) {} 97static inline void rpc_print_iostats(struct seq_file *seq, struct rpc_clnt *clnt) {}
91static inline void rpc_free_iostats(struct rpc_iostats *stats) {} 98static inline void rpc_free_iostats(struct rpc_iostats *stats) {}
92 99
diff --git a/include/linux/sunrpc/rpc_rdma.h b/include/linux/sunrpc/rpc_rdma.h
index b78f16b1dea3..f33c5a4d6fe4 100644
--- a/include/linux/sunrpc/rpc_rdma.h
+++ b/include/linux/sunrpc/rpc_rdma.h
@@ -42,6 +42,9 @@
42 42
43#include <linux/types.h> 43#include <linux/types.h>
44 44
45#define RPCRDMA_VERSION 1
46#define rpcrdma_version cpu_to_be32(RPCRDMA_VERSION)
47
45struct rpcrdma_segment { 48struct rpcrdma_segment {
46 __be32 rs_handle; /* Registered memory handle */ 49 __be32 rs_handle; /* Registered memory handle */
47 __be32 rs_length; /* Length of the chunk in bytes */ 50 __be32 rs_length; /* Length of the chunk in bytes */
@@ -95,7 +98,10 @@ struct rpcrdma_msg {
95 } rm_body; 98 } rm_body;
96}; 99};
97 100
98#define RPCRDMA_HDRLEN_MIN 28 101/*
102 * Smallest RPC/RDMA header: rm_xid through rm_type, then rm_nochunks
103 */
104#define RPCRDMA_HDRLEN_MIN (sizeof(__be32) * 7)
99 105
100enum rpcrdma_errcode { 106enum rpcrdma_errcode {
101 ERR_VERS = 1, 107 ERR_VERS = 1,
@@ -115,4 +121,10 @@ enum rpcrdma_proc {
115 RDMA_ERROR = 4 /* An RPC RDMA encoding error */ 121 RDMA_ERROR = 4 /* An RPC RDMA encoding error */
116}; 122};
117 123
124#define rdma_msg cpu_to_be32(RDMA_MSG)
125#define rdma_nomsg cpu_to_be32(RDMA_NOMSG)
126#define rdma_msgp cpu_to_be32(RDMA_MSGP)
127#define rdma_done cpu_to_be32(RDMA_DONE)
128#define rdma_error cpu_to_be32(RDMA_ERROR)
129
118#endif /* _LINUX_SUNRPC_RPC_RDMA_H */ 130#endif /* _LINUX_SUNRPC_RPC_RDMA_H */
diff --git a/include/linux/sunrpc/svc.h b/include/linux/sunrpc/svc.h
index 6f22cfeef5e3..fae6fb947fc8 100644
--- a/include/linux/sunrpc/svc.h
+++ b/include/linux/sunrpc/svc.h
@@ -110,7 +110,7 @@ struct svc_serv {
110 * We use sv_nrthreads as a reference count. svc_destroy() drops 110 * We use sv_nrthreads as a reference count. svc_destroy() drops
111 * this refcount, so we need to bump it up around operations that 111 * this refcount, so we need to bump it up around operations that
112 * change the number of threads. Horrible, but there it is. 112 * change the number of threads. Horrible, but there it is.
113 * Should be called with the BKL held. 113 * Should be called with the "service mutex" held.
114 */ 114 */
115static inline void svc_get(struct svc_serv *serv) 115static inline void svc_get(struct svc_serv *serv)
116{ 116{
diff --git a/include/linux/sunrpc/svc_rdma.h b/include/linux/sunrpc/svc_rdma.h
index 975da754c778..df8edf8ec914 100644
--- a/include/linux/sunrpc/svc_rdma.h
+++ b/include/linux/sunrpc/svc_rdma.h
@@ -63,8 +63,6 @@ extern atomic_t rdma_stat_rq_prod;
63extern atomic_t rdma_stat_sq_poll; 63extern atomic_t rdma_stat_sq_poll;
64extern atomic_t rdma_stat_sq_prod; 64extern atomic_t rdma_stat_sq_prod;
65 65
66#define RPCRDMA_VERSION 1
67
68/* 66/*
69 * Contexts are built when an RDMA request is created and are a 67 * Contexts are built when an RDMA request is created and are a
70 * record of the resources that can be recovered when the request 68 * record of the resources that can be recovered when the request
@@ -79,6 +77,7 @@ struct svc_rdma_op_ctxt {
79 enum ib_wr_opcode wr_op; 77 enum ib_wr_opcode wr_op;
80 enum ib_wc_status wc_status; 78 enum ib_wc_status wc_status;
81 u32 byte_len; 79 u32 byte_len;
80 u32 position;
82 struct svcxprt_rdma *xprt; 81 struct svcxprt_rdma *xprt;
83 unsigned long flags; 82 unsigned long flags;
84 enum dma_data_direction direction; 83 enum dma_data_direction direction;
@@ -150,6 +149,10 @@ struct svcxprt_rdma {
150 struct ib_cq *sc_rq_cq; 149 struct ib_cq *sc_rq_cq;
151 struct ib_cq *sc_sq_cq; 150 struct ib_cq *sc_sq_cq;
152 struct ib_mr *sc_phys_mr; /* MR for server memory */ 151 struct ib_mr *sc_phys_mr; /* MR for server memory */
152 int (*sc_reader)(struct svcxprt_rdma *,
153 struct svc_rqst *,
154 struct svc_rdma_op_ctxt *,
155 int *, u32 *, u32, u32, u64, bool);
153 u32 sc_dev_caps; /* distilled device caps */ 156 u32 sc_dev_caps; /* distilled device caps */
154 u32 sc_dma_lkey; /* local dma key */ 157 u32 sc_dma_lkey; /* local dma key */
155 unsigned int sc_frmr_pg_list_len; 158 unsigned int sc_frmr_pg_list_len;
@@ -178,8 +181,6 @@ struct svcxprt_rdma {
178#define RPCRDMA_MAX_REQ_SIZE 4096 181#define RPCRDMA_MAX_REQ_SIZE 4096
179 182
180/* svc_rdma_marshal.c */ 183/* svc_rdma_marshal.c */
181extern void svc_rdma_rcl_chunk_counts(struct rpcrdma_read_chunk *,
182 int *, int *);
183extern int svc_rdma_xdr_decode_req(struct rpcrdma_msg **, struct svc_rqst *); 184extern int svc_rdma_xdr_decode_req(struct rpcrdma_msg **, struct svc_rqst *);
184extern int svc_rdma_xdr_decode_deferred_req(struct svc_rqst *); 185extern int svc_rdma_xdr_decode_deferred_req(struct svc_rqst *);
185extern int svc_rdma_xdr_encode_error(struct svcxprt_rdma *, 186extern int svc_rdma_xdr_encode_error(struct svcxprt_rdma *,
@@ -197,6 +198,12 @@ extern int svc_rdma_xdr_get_reply_hdr_len(struct rpcrdma_msg *);
197 198
198/* svc_rdma_recvfrom.c */ 199/* svc_rdma_recvfrom.c */
199extern int svc_rdma_recvfrom(struct svc_rqst *); 200extern int svc_rdma_recvfrom(struct svc_rqst *);
201extern int rdma_read_chunk_lcl(struct svcxprt_rdma *, struct svc_rqst *,
202 struct svc_rdma_op_ctxt *, int *, u32 *,
203 u32, u32, u64, bool);
204extern int rdma_read_chunk_frmr(struct svcxprt_rdma *, struct svc_rqst *,
205 struct svc_rdma_op_ctxt *, int *, u32 *,
206 u32, u32, u64, bool);
200 207
201/* svc_rdma_sendto.c */ 208/* svc_rdma_sendto.c */
202extern int svc_rdma_sendto(struct svc_rqst *); 209extern int svc_rdma_sendto(struct svc_rqst *);
diff --git a/include/linux/sunrpc/xprt.h b/include/linux/sunrpc/xprt.h
index 9d27ac45b909..8b93ef53df3c 100644
--- a/include/linux/sunrpc/xprt.h
+++ b/include/linux/sunrpc/xprt.h
@@ -347,6 +347,9 @@ void xprt_force_disconnect(struct rpc_xprt *xprt);
347void xprt_conditional_disconnect(struct rpc_xprt *xprt, unsigned int cookie); 347void xprt_conditional_disconnect(struct rpc_xprt *xprt, unsigned int cookie);
348int xs_swapper(struct rpc_xprt *xprt, int enable); 348int xs_swapper(struct rpc_xprt *xprt, int enable);
349 349
350bool xprt_lock_connect(struct rpc_xprt *, struct rpc_task *, void *);
351void xprt_unlock_connect(struct rpc_xprt *, void *);
352
350/* 353/*
351 * Reserved bit positions in xprt->state 354 * Reserved bit positions in xprt->state
352 */ 355 */
@@ -357,10 +360,7 @@ int xs_swapper(struct rpc_xprt *xprt, int enable);
357#define XPRT_BOUND (4) 360#define XPRT_BOUND (4)
358#define XPRT_BINDING (5) 361#define XPRT_BINDING (5)
359#define XPRT_CLOSING (6) 362#define XPRT_CLOSING (6)
360#define XPRT_CONNECTION_ABORT (7)
361#define XPRT_CONNECTION_CLOSE (8)
362#define XPRT_CONGESTED (9) 363#define XPRT_CONGESTED (9)
363#define XPRT_CONNECTION_REUSE (10)
364 364
365static inline void xprt_set_connected(struct rpc_xprt *xprt) 365static inline void xprt_set_connected(struct rpc_xprt *xprt)
366{ 366{