diff options
author | Chuck Lever <chuck.lever@oracle.com> | 2015-10-24 17:28:32 -0400 |
---|---|---|
committer | Anna Schumaker <Anna.Schumaker@Netapp.com> | 2015-11-02 16:29:13 -0500 |
commit | 76566773a1f1c2295ed901b6f1241cfe10d99029 (patch) | |
tree | 91395d3bb57a2733d6b4a8f3461a759770e83e92 /net | |
parent | 0f2e3bdab6590a5d8900e7d701e21ac9af19924c (diff) |
NFS: Enable client side NFSv4.1 backchannel to use other transports
Forechannel transports get their own "bc_up" method to create an
endpoint for the backchannel service.
Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
[Anna Schumaker: Add forward declaration of struct net to xprt.h]
Signed-off-by: Anna Schumaker <Anna.Schumaker@Netapp.com>
Diffstat (limited to 'net')
-rw-r--r-- | net/sunrpc/xprtrdma/backchannel.c | 21 | ||||
-rw-r--r-- | net/sunrpc/xprtrdma/transport.c | 1 | ||||
-rw-r--r-- | net/sunrpc/xprtrdma/xprt_rdma.h | 1 | ||||
-rw-r--r-- | net/sunrpc/xprtsock.c | 12 |
4 files changed, 35 insertions, 0 deletions
diff --git a/net/sunrpc/xprtrdma/backchannel.c b/net/sunrpc/xprtrdma/backchannel.c index 0b3387fe3f0d..2dcb44f69e53 100644 --- a/net/sunrpc/xprtrdma/backchannel.c +++ b/net/sunrpc/xprtrdma/backchannel.c | |||
@@ -7,6 +7,7 @@ | |||
7 | #include <linux/module.h> | 7 | #include <linux/module.h> |
8 | #include <linux/sunrpc/xprt.h> | 8 | #include <linux/sunrpc/xprt.h> |
9 | #include <linux/sunrpc/svc.h> | 9 | #include <linux/sunrpc/svc.h> |
10 | #include <linux/sunrpc/svc_xprt.h> | ||
10 | 11 | ||
11 | #include "xprt_rdma.h" | 12 | #include "xprt_rdma.h" |
12 | 13 | ||
@@ -174,6 +175,26 @@ out_err: | |||
174 | } | 175 | } |
175 | 176 | ||
176 | /** | 177 | /** |
178 | * xprt_rdma_bc_up - Create transport endpoint for backchannel service | ||
179 | * @serv: server endpoint | ||
180 | * @net: network namespace | ||
181 | * | ||
182 | * The "xprt" is an implied argument: it supplies the name of the | ||
183 | * backchannel transport class. | ||
184 | * | ||
185 | * Returns zero on success, negative errno on failure | ||
186 | */ | ||
187 | int xprt_rdma_bc_up(struct svc_serv *serv, struct net *net) | ||
188 | { | ||
189 | int ret; | ||
190 | |||
191 | ret = svc_create_xprt(serv, "rdma-bc", net, PF_INET, 0, 0); | ||
192 | if (ret < 0) | ||
193 | return ret; | ||
194 | return 0; | ||
195 | } | ||
196 | |||
197 | /** | ||
177 | * rpcrdma_bc_marshal_reply - Send backwards direction reply | 198 | * rpcrdma_bc_marshal_reply - Send backwards direction reply |
178 | * @rqst: buffer containing RPC reply data | 199 | * @rqst: buffer containing RPC reply data |
179 | * | 200 | * |
diff --git a/net/sunrpc/xprtrdma/transport.c b/net/sunrpc/xprtrdma/transport.c index 845278e63be0..8c545f7d7525 100644 --- a/net/sunrpc/xprtrdma/transport.c +++ b/net/sunrpc/xprtrdma/transport.c | |||
@@ -708,6 +708,7 @@ static struct rpc_xprt_ops xprt_rdma_procs = { | |||
708 | .inject_disconnect = xprt_rdma_inject_disconnect, | 708 | .inject_disconnect = xprt_rdma_inject_disconnect, |
709 | #if defined(CONFIG_SUNRPC_BACKCHANNEL) | 709 | #if defined(CONFIG_SUNRPC_BACKCHANNEL) |
710 | .bc_setup = xprt_rdma_bc_setup, | 710 | .bc_setup = xprt_rdma_bc_setup, |
711 | .bc_up = xprt_rdma_bc_up, | ||
711 | .bc_free_rqst = xprt_rdma_bc_free_rqst, | 712 | .bc_free_rqst = xprt_rdma_bc_free_rqst, |
712 | .bc_destroy = xprt_rdma_bc_destroy, | 713 | .bc_destroy = xprt_rdma_bc_destroy, |
713 | #endif | 714 | #endif |
diff --git a/net/sunrpc/xprtrdma/xprt_rdma.h b/net/sunrpc/xprtrdma/xprt_rdma.h index eb87d96e80ca..f8dd17be9f43 100644 --- a/net/sunrpc/xprtrdma/xprt_rdma.h +++ b/net/sunrpc/xprtrdma/xprt_rdma.h | |||
@@ -520,6 +520,7 @@ void xprt_rdma_cleanup(void); | |||
520 | */ | 520 | */ |
521 | #if defined(CONFIG_SUNRPC_BACKCHANNEL) | 521 | #if defined(CONFIG_SUNRPC_BACKCHANNEL) |
522 | int xprt_rdma_bc_setup(struct rpc_xprt *, unsigned int); | 522 | int xprt_rdma_bc_setup(struct rpc_xprt *, unsigned int); |
523 | int xprt_rdma_bc_up(struct svc_serv *, struct net *); | ||
523 | int rpcrdma_bc_post_recv(struct rpcrdma_xprt *, unsigned int); | 524 | int rpcrdma_bc_post_recv(struct rpcrdma_xprt *, unsigned int); |
524 | void rpcrdma_bc_receive_call(struct rpcrdma_xprt *, struct rpcrdma_rep *); | 525 | void rpcrdma_bc_receive_call(struct rpcrdma_xprt *, struct rpcrdma_rep *); |
525 | int rpcrdma_bc_marshal_reply(struct rpc_rqst *); | 526 | int rpcrdma_bc_marshal_reply(struct rpc_rqst *); |
diff --git a/net/sunrpc/xprtsock.c b/net/sunrpc/xprtsock.c index 44a81e4c6783..dc4706711224 100644 --- a/net/sunrpc/xprtsock.c +++ b/net/sunrpc/xprtsock.c | |||
@@ -1306,6 +1306,17 @@ static inline int _xs_tcp_read_data(struct rpc_xprt *xprt, | |||
1306 | xs_tcp_read_reply(xprt, desc) : | 1306 | xs_tcp_read_reply(xprt, desc) : |
1307 | xs_tcp_read_callback(xprt, desc); | 1307 | xs_tcp_read_callback(xprt, desc); |
1308 | } | 1308 | } |
1309 | |||
1310 | static int xs_tcp_bc_up(struct svc_serv *serv, struct net *net) | ||
1311 | { | ||
1312 | int ret; | ||
1313 | |||
1314 | ret = svc_create_xprt(serv, "tcp-bc", net, PF_INET, 0, | ||
1315 | SVC_SOCK_ANONYMOUS); | ||
1316 | if (ret < 0) | ||
1317 | return ret; | ||
1318 | return 0; | ||
1319 | } | ||
1309 | #else | 1320 | #else |
1310 | static inline int _xs_tcp_read_data(struct rpc_xprt *xprt, | 1321 | static inline int _xs_tcp_read_data(struct rpc_xprt *xprt, |
1311 | struct xdr_skb_reader *desc) | 1322 | struct xdr_skb_reader *desc) |
@@ -2582,6 +2593,7 @@ static struct rpc_xprt_ops xs_tcp_ops = { | |||
2582 | .inject_disconnect = xs_inject_disconnect, | 2593 | .inject_disconnect = xs_inject_disconnect, |
2583 | #ifdef CONFIG_SUNRPC_BACKCHANNEL | 2594 | #ifdef CONFIG_SUNRPC_BACKCHANNEL |
2584 | .bc_setup = xprt_setup_bc, | 2595 | .bc_setup = xprt_setup_bc, |
2596 | .bc_up = xs_tcp_bc_up, | ||
2585 | .bc_free_rqst = xprt_free_bc_rqst, | 2597 | .bc_free_rqst = xprt_free_bc_rqst, |
2586 | .bc_destroy = xprt_destroy_bc, | 2598 | .bc_destroy = xprt_destroy_bc, |
2587 | #endif | 2599 | #endif |