From: Ursula Braun <ubraun@linux.vnet.ibm.com>
To: davem@davemloft.net
Cc: netdev@vger.kernel.org, linux-s390@vger.kernel.org,
jwi@linux.vnet.ibm.com, schwidefsky@de.ibm.com,
heiko.carstens@de.ibm.com, raspl@linux.vnet.ibm.com,
geert@linux-m68k.org, ubraun@linux.vnet.ibm.com
Subject: [PATCH net 1/2] net/smc: use sk_rcvbuf as start for rmb creation
Date: Tue, 21 Nov 2017 13:23:53 +0100 [thread overview]
Message-ID: <20171121122354.44006-2-ubraun@linux.vnet.ibm.com> (raw)
In-Reply-To: <20171121122354.44006-1-ubraun@linux.vnet.ibm.com>
From: Ursula Braun <ursula.braun@de.ibm.com>
Commit 3e034725c0d8 ("net/smc: common functions for RMBs and send buffers")
merged handling of SMC receive and send buffers. It introduced sk_buf_size
as merged start value for size determination. But since sk_buf_size is not
used at all, sk_sndbuf is erroneously used as start for rmb creation.
This patch makes sure, sk_buf_size is really used as intended, and
sk_rcvbuf is used as start value for rmb creation.
Fixes: 3e034725c0d8 ("net/smc: common functions for RMBs and send buffers")
Signed-off-by: Ursula Braun <ubraun@linux.vnet.ibm.com>
Reviewed-by: Hans Wippel <hwippel@linux.vnet.ibm.com>
---
net/smc/smc_core.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/net/smc/smc_core.c b/net/smc/smc_core.c
index 2578fbd95664..3b5e5d4bc763 100644
--- a/net/smc/smc_core.c
+++ b/net/smc/smc_core.c
@@ -575,7 +575,7 @@ static int __smc_buf_create(struct smc_sock *smc, bool is_rmb)
/* use socket send buffer size (w/o overhead) as start value */
sk_buf_size = smc->sk.sk_sndbuf / 2;
- for (bufsize_short = smc_compress_bufsize(smc->sk.sk_sndbuf / 2);
+ for (bufsize_short = smc_compress_bufsize(sk_buf_size);
bufsize_short >= 0; bufsize_short--) {
if (is_rmb) {
--
2.13.5
next prev parent reply other threads:[~2017-11-21 12:24 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-11-21 12:23 [PATCH net 0/2] net/smc: fixes for smc buffer handling Ursula Braun
2017-11-21 12:23 ` Ursula Braun [this message]
2017-11-21 12:23 ` [PATCH net 2/2] net/smc: Fix preinitialization of buf_desc in __smc_buf_create() Ursula Braun
2017-11-23 16:34 ` [PATCH net 0/2] net/smc: fixes for smc buffer handling David Miller
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20171121122354.44006-2-ubraun@linux.vnet.ibm.com \
--to=ubraun@linux.vnet.ibm.com \
--cc=davem@davemloft.net \
--cc=geert@linux-m68k.org \
--cc=heiko.carstens@de.ibm.com \
--cc=jwi@linux.vnet.ibm.com \
--cc=linux-s390@vger.kernel.org \
--cc=netdev@vger.kernel.org \
--cc=raspl@linux.vnet.ibm.com \
--cc=schwidefsky@de.ibm.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).