Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 42547
b: refs/heads/master
c: 7c6e066
h: refs/heads/master
i:
  42545: 0a1381a
  42543: d32e417
v: v3
  • Loading branch information
Chuck Lever authored and Trond Myklebust committed Dec 6, 2006
1 parent 2d37d37 commit f2d6b23
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 12 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: c8475461829fd94f30208fbfa4eab7e5584c6495
refs/heads/master: 7c6e066ec29290bf062f5bff2984bad9be5809c7
3 changes: 0 additions & 3 deletions trunk/include/linux/sunrpc/xprt.h
Original file line number Diff line number Diff line change
Expand Up @@ -137,9 +137,6 @@ struct rpc_xprt {
unsigned long cong; /* current congestion */
unsigned long cwnd; /* congestion window */

size_t rcvsize, /* transport rcv buffer size */
sndsize; /* transport send buffer size */

size_t max_payload; /* largest RPC payload size,
in bytes */
unsigned int tsh_size; /* size of transport specific
Expand Down
24 changes: 16 additions & 8 deletions trunk/net/sunrpc/xprtsock.c
Original file line number Diff line number Diff line change
Expand Up @@ -151,6 +151,12 @@ struct sock_xprt {
*/
struct work_struct connect_worker;
unsigned short port;

/*
* UDP socket buffer size parameters
*/
size_t rcvsize,
sndsize;
};

/*
Expand Down Expand Up @@ -996,13 +1002,13 @@ static void xs_udp_do_set_buffer_size(struct rpc_xprt *xprt)
struct sock_xprt *transport = container_of(xprt, struct sock_xprt, xprt);
struct sock *sk = transport->inet;

if (xprt->rcvsize) {
if (transport->rcvsize) {
sk->sk_userlocks |= SOCK_RCVBUF_LOCK;
sk->sk_rcvbuf = xprt->rcvsize * xprt->max_reqs * 2;
sk->sk_rcvbuf = transport->rcvsize * xprt->max_reqs * 2;
}
if (xprt->sndsize) {
if (transport->sndsize) {
sk->sk_userlocks |= SOCK_SNDBUF_LOCK;
sk->sk_sndbuf = xprt->sndsize * xprt->max_reqs * 2;
sk->sk_sndbuf = transport->sndsize * xprt->max_reqs * 2;
sk->sk_write_space(sk);
}
}
Expand All @@ -1017,12 +1023,14 @@ static void xs_udp_do_set_buffer_size(struct rpc_xprt *xprt)
*/
static void xs_udp_set_buffer_size(struct rpc_xprt *xprt, size_t sndsize, size_t rcvsize)
{
xprt->sndsize = 0;
struct sock_xprt *transport = container_of(xprt, struct sock_xprt, xprt);

transport->sndsize = 0;
if (sndsize)
xprt->sndsize = sndsize + 1024;
xprt->rcvsize = 0;
transport->sndsize = sndsize + 1024;
transport->rcvsize = 0;
if (rcvsize)
xprt->rcvsize = rcvsize + 1024;
transport->rcvsize = rcvsize + 1024;

xs_udp_do_set_buffer_size(xprt);
}
Expand Down

0 comments on commit f2d6b23

Please sign in to comment.