File tree Expand file tree Collapse file tree 8 files changed +45
-19
lines changed Expand file tree Collapse file tree 8 files changed +45
-19
lines changed Original file line number Diff line number Diff line change @@ -967,6 +967,11 @@ static __be32 nfs4_callback_compound(struct svc_rqst *rqstp)
967
967
nops -- ;
968
968
}
969
969
970
+ if (svc_is_backchannel (rqstp ) && cps .clp ) {
971
+ rqstp -> bc_to_initval = cps .clp -> cl_rpcclient -> cl_timeout -> to_initval ;
972
+ rqstp -> bc_to_retries = cps .clp -> cl_rpcclient -> cl_timeout -> to_retries ;
973
+ }
974
+
970
975
* hdr_res .status = status ;
971
976
* hdr_res .nops = htonl (nops );
972
977
nfs4_cb_free_slot (& cps );
Original file line number Diff line number Diff line change 20
20
#ifdef CONFIG_SUNRPC_BACKCHANNEL
21
21
struct rpc_rqst * xprt_lookup_bc_request (struct rpc_xprt * xprt , __be32 xid );
22
22
void xprt_complete_bc_request (struct rpc_rqst * req , uint32_t copied );
23
- void xprt_init_bc_request (struct rpc_rqst * req , struct rpc_task * task );
23
+ void xprt_init_bc_request (struct rpc_rqst * req , struct rpc_task * task ,
24
+ const struct rpc_timeout * to );
24
25
void xprt_free_bc_request (struct rpc_rqst * req );
25
26
int xprt_setup_backchannel (struct rpc_xprt * , unsigned int min_reqs );
26
27
void xprt_destroy_backchannel (struct rpc_xprt * , unsigned int max_reqs );
Original file line number Diff line number Diff line change @@ -37,6 +37,17 @@ struct rpc_wait {
37
37
struct list_head timer_list ; /* Timer list */
38
38
};
39
39
40
+ /*
41
+ * This describes a timeout strategy
42
+ */
43
+ struct rpc_timeout {
44
+ unsigned long to_initval , /* initial timeout */
45
+ to_maxval , /* max timeout */
46
+ to_increment ; /* if !exponential */
47
+ unsigned int to_retries ; /* max # of retries */
48
+ unsigned char to_exponential ;
49
+ };
50
+
40
51
/*
41
52
* This is the RPC task struct
42
53
*/
@@ -205,7 +216,8 @@ struct rpc_wait_queue {
205
216
*/
206
217
struct rpc_task * rpc_new_task (const struct rpc_task_setup * );
207
218
struct rpc_task * rpc_run_task (const struct rpc_task_setup * );
208
- struct rpc_task * rpc_run_bc_task (struct rpc_rqst * req );
219
+ struct rpc_task * rpc_run_bc_task (struct rpc_rqst * req ,
220
+ struct rpc_timeout * timeout );
209
221
void rpc_put_task (struct rpc_task * );
210
222
void rpc_put_task_async (struct rpc_task * );
211
223
bool rpc_task_set_rpc_status (struct rpc_task * task , int rpc_status );
Original file line number Diff line number Diff line change @@ -250,6 +250,8 @@ struct svc_rqst {
250
250
struct net * rq_bc_net ; /* pointer to backchannel's
251
251
* net namespace
252
252
*/
253
+ unsigned long bc_to_initval ;
254
+ unsigned int bc_to_retries ;
253
255
void * * rq_lease_breaker ; /* The v4 client breaking a lease */
254
256
unsigned int rq_status_counter ; /* RPC processing counter */
255
257
};
Original file line number Diff line number Diff line change 30
30
#define RPC_MAXCWND (xprt ) ((xprt)->max_reqs << RPC_CWNDSHIFT)
31
31
#define RPCXPRT_CONGESTED (xprt ) ((xprt)->cong >= (xprt)->cwnd)
32
32
33
- /*
34
- * This describes a timeout strategy
35
- */
36
- struct rpc_timeout {
37
- unsigned long to_initval , /* initial timeout */
38
- to_maxval , /* max timeout */
39
- to_increment ; /* if !exponential */
40
- unsigned int to_retries ; /* max # of retries */
41
- unsigned char to_exponential ;
42
- };
43
-
44
33
enum rpc_display_format_t {
45
34
RPC_DISPLAY_ADDR = 0 ,
46
35
RPC_DISPLAY_PORT ,
Original file line number Diff line number Diff line change @@ -1311,8 +1311,10 @@ static void call_bc_encode(struct rpc_task *task);
1311
1311
* rpc_run_bc_task - Allocate a new RPC task for backchannel use, then run
1312
1312
* rpc_execute against it
1313
1313
* @req: RPC request
1314
+ * @timeout: timeout values to use for this task
1314
1315
*/
1315
- struct rpc_task * rpc_run_bc_task (struct rpc_rqst * req )
1316
+ struct rpc_task * rpc_run_bc_task (struct rpc_rqst * req ,
1317
+ struct rpc_timeout * timeout )
1316
1318
{
1317
1319
struct rpc_task * task ;
1318
1320
struct rpc_task_setup task_setup_data = {
@@ -1331,7 +1333,7 @@ struct rpc_task *rpc_run_bc_task(struct rpc_rqst *req)
1331
1333
return task ;
1332
1334
}
1333
1335
1334
- xprt_init_bc_request (req , task );
1336
+ xprt_init_bc_request (req , task , timeout );
1335
1337
1336
1338
task -> tk_action = call_bc_encode ;
1337
1339
atomic_inc (& task -> tk_count );
Original file line number Diff line number Diff line change @@ -1557,6 +1557,7 @@ void svc_process_bc(struct rpc_rqst *req, struct svc_rqst *rqstp)
1557
1557
{
1558
1558
struct rpc_task * task ;
1559
1559
int proc_error ;
1560
+ struct rpc_timeout timeout ;
1560
1561
1561
1562
/* Build the svc_rqst used by the common processing routine */
1562
1563
rqstp -> rq_xid = req -> rq_xid ;
@@ -1602,8 +1603,16 @@ void svc_process_bc(struct rpc_rqst *req, struct svc_rqst *rqstp)
1602
1603
return ;
1603
1604
}
1604
1605
/* Finally, send the reply synchronously */
1606
+ if (rqstp -> bc_to_initval > 0 ) {
1607
+ timeout .to_initval = rqstp -> bc_to_initval ;
1608
+ timeout .to_retries = rqstp -> bc_to_initval ;
1609
+ } else {
1610
+ timeout .to_initval = req -> rq_xprt -> timeout -> to_initval ;
1611
+ timeout .to_initval = req -> rq_xprt -> timeout -> to_retries ;
1612
+ }
1605
1613
memcpy (& req -> rq_snd_buf , & rqstp -> rq_res , sizeof (req -> rq_snd_buf ));
1606
- task = rpc_run_bc_task (req );
1614
+ task = rpc_run_bc_task (req , & timeout );
1615
+
1607
1616
if (IS_ERR (task ))
1608
1617
return ;
1609
1618
Original file line number Diff line number Diff line change @@ -1986,7 +1986,8 @@ void xprt_release(struct rpc_task *task)
1986
1986
1987
1987
#ifdef CONFIG_SUNRPC_BACKCHANNEL
1988
1988
void
1989
- xprt_init_bc_request (struct rpc_rqst * req , struct rpc_task * task )
1989
+ xprt_init_bc_request (struct rpc_rqst * req , struct rpc_task * task ,
1990
+ const struct rpc_timeout * to )
1990
1991
{
1991
1992
struct xdr_buf * xbufp = & req -> rq_snd_buf ;
1992
1993
@@ -1999,8 +2000,13 @@ xprt_init_bc_request(struct rpc_rqst *req, struct rpc_task *task)
1999
2000
*/
2000
2001
xbufp -> len = xbufp -> head [0 ].iov_len + xbufp -> page_len +
2001
2002
xbufp -> tail [0 ].iov_len ;
2002
-
2003
- xprt_init_majortimeo (task , req , req -> rq_xprt -> timeout );
2003
+ /*
2004
+ * Backchannel Replies are sent with !RPC_TASK_SOFT and
2005
+ * RPC_TASK_NO_RETRANS_TIMEOUT. The major timeout setting
2006
+ * affects only how long each Reply waits to be sent when
2007
+ * a transport connection cannot be established.
2008
+ */
2009
+ xprt_init_majortimeo (task , req , to );
2004
2010
}
2005
2011
#endif
2006
2012
You can’t perform that action at this time.
0 commit comments