[PATCH] RPC: allow RPC client's port range to be adjustable

Select an RPC client source port between 650 and 1023 instead of between
 1 and 800.  The old range conflicts with a number of network services.
 Provide sysctls to allow admins to select a different port range.

 Note that this doesn't affect user-level RPC library behavior, which
 still uses 1 to 800.

 Based on a suggestion by Olaf Kirch <okir@suse.de>.

 Test-plan:
 Repeated mount and unmount.  Destructive testing.  Idle timeouts.

 Signed-off-by: Chuck Lever <cel@netapp.com>
 Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
This commit is contained in:
Chuck Lever
2005-08-25 16:25:54 -07:00
committed by Trond Myklebust
parent 555ee3af16
commit 529b33c6db
4 changed files with 53 additions and 18 deletions

View File

@@ -51,6 +51,17 @@ extern unsigned int xprt_tcp_slot_table_entries;
#define RPC_CALLHDRSIZE 6
#define RPC_REPHDRSIZE 4
/*
* Parameters for choosing a free port
*/
extern unsigned int xprt_min_resvport;
extern unsigned int xprt_max_resvport;
#define RPC_MIN_RESVPORT (1U)
#define RPC_MAX_RESVPORT (65535U)
#define RPC_DEF_MIN_RESVPORT (650U)
#define RPC_DEF_MAX_RESVPORT (1023U)
/*
* This describes a timeout strategy
*/
@@ -62,6 +73,9 @@ struct rpc_timeout {
unsigned char to_exponential;
};
struct rpc_task;
struct rpc_xprt;
/*
* This describes a complete RPC request
*/
@@ -107,9 +121,6 @@ struct rpc_rqst {
#define rq_svec rq_snd_buf.head
#define rq_slen rq_snd_buf.len
struct rpc_task;
struct rpc_xprt;
struct rpc_xprt_ops {
void (*set_buffer_size)(struct rpc_xprt *xprt);
int (*reserve_xprt)(struct rpc_task *task);