diff options
author | Ursula Braun <ubraun@linux.vnet.ibm.com> | 2017-01-09 18:55:24 +0300 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2017-01-10 00:07:40 +0300 |
commit | 952310ccf2d861966cfb8706f16d5e4eb585edb7 (patch) | |
tree | 4fa87adda90c714695c213638f2ca320f9a9a67d /net/smc/smc_core.c | |
parent | e6727f39004bd95725342b3b343a14c7d59df07f (diff) | |
download | linux-952310ccf2d861966cfb8706f16d5e4eb585edb7.tar.xz |
smc: receive data from RMBE
move RMBE data into user space buffer and update managing cursors
Signed-off-by: Ursula Braun <ubraun@linux.vnet.ibm.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/smc/smc_core.c')
-rw-r--r-- | net/smc/smc_core.c | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/net/smc/smc_core.c b/net/smc/smc_core.c index 537e387b9e85..e5c63950fc28 100644 --- a/net/smc/smc_core.c +++ b/net/smc/smc_core.c @@ -489,6 +489,15 @@ struct smc_buf_desc *smc_rmb_get_slot(struct smc_link_group *lgr, return NULL; } +/* one of the conditions for announcing a receiver's current window size is + * that it "results in a minimum increase in the window size of 10% of the + * receive buffer space" [RFC7609] + */ +static inline int smc_rmb_wnd_update_limit(int rmbe_size) +{ + return min_t(int, rmbe_size / 10, SOCK_MIN_SNDBUF / 2); +} + /* create the tx buffer for an SMC socket */ int smc_sndbuf_create(struct smc_sock *smc) { @@ -620,6 +629,7 @@ int smc_rmb_create(struct smc_sock *smc) conn->rmbe_size_short = tmp_bufsize_short; smc->sk.sk_rcvbuf = tmp_bufsize * 2; atomic_set(&conn->bytes_to_rcv, 0); + conn->rmbe_update_limit = smc_rmb_wnd_update_limit(tmp_bufsize); return 0; } else { return -ENOMEM; |