diff options
author | Hans Wippel <hwippel@linux.ibm.com> | 2018-05-18 09:34:10 +0200 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2018-05-18 13:15:01 -0400 |
commit | 69cb7dc0218b2c54416722eddf181e720f24c305 (patch) | |
tree | 521471fca3a62bfcd69228b4ea9224a86bf133f5 /net/smc/smc_core.c | |
parent | d6830519a9de10621651433459d2c72a7145dd25 (diff) | |
download | linux-69cb7dc0218b2c54416722eddf181e720f24c305.tar.gz linux-69cb7dc0218b2c54416722eddf181e720f24c305.tar.bz2 linux-69cb7dc0218b2c54416722eddf181e720f24c305.zip |
net/smc: add common buffer size in send and receive buffer descriptors
In addition to the buffer references, SMC currently stores the sizes of
the receive and send buffers in each connection as separate variables.
This patch introduces a buffer length variable in the common buffer
descriptor and uses this length instead.
Signed-off-by: Hans Wippel <hwippel@linux.ibm.com>
Signed-off-by: Ursula Braun <ubraun@linux.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 | 8 |
1 files changed, 2 insertions, 6 deletions
diff --git a/net/smc/smc_core.c b/net/smc/smc_core.c index 08c05cd0bbae..6396426080f9 100644 --- a/net/smc/smc_core.c +++ b/net/smc/smc_core.c @@ -236,15 +236,12 @@ out: static void smc_buf_unuse(struct smc_connection *conn) { - if (conn->sndbuf_desc) { + if (conn->sndbuf_desc) conn->sndbuf_desc->used = 0; - conn->sndbuf_size = 0; - } if (conn->rmb_desc) { if (!conn->rmb_desc->regerr) { conn->rmb_desc->reused = 1; conn->rmb_desc->used = 0; - conn->rmbe_size = 0; } else { /* buf registration failed, reuse not possible */ struct smc_link_group *lgr = conn->lgr; @@ -616,6 +613,7 @@ static struct smc_buf_desc *smc_new_buf_create(struct smc_link_group *lgr, } } + buf_desc->len = bufsize; return buf_desc; } @@ -675,14 +673,12 @@ static int __smc_buf_create(struct smc_sock *smc, bool is_rmb) if (is_rmb) { conn->rmb_desc = buf_desc; - conn->rmbe_size = bufsize; conn->rmbe_size_short = bufsize_short; smc->sk.sk_rcvbuf = bufsize * 2; atomic_set(&conn->bytes_to_rcv, 0); conn->rmbe_update_limit = smc_rmb_wnd_update_limit(bufsize); } else { conn->sndbuf_desc = buf_desc; - conn->sndbuf_size = bufsize; smc->sk.sk_sndbuf = bufsize * 2; atomic_set(&conn->sndbuf_space, bufsize); } |