diff options
author | Ursula Braun <ubraun@linux.ibm.com> | 2018-11-22 10:26:39 +0100 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2018-11-23 17:20:32 -0800 |
commit | 2b59f58e34e78abec2bccd2413ae9e7ea509a855 (patch) | |
tree | e7e9be9226ee9050428a4d8ca53a571ef9f92cfd /net/smc/smc_clc.c | |
parent | 90d8b29cb4b251cd874aa00a50d11b28a7322986 (diff) | |
download | linux-2b59f58e34e78abec2bccd2413ae9e7ea509a855.tar.gz linux-2b59f58e34e78abec2bccd2413ae9e7ea509a855.tar.bz2 linux-2b59f58e34e78abec2bccd2413ae9e7ea509a855.zip |
net/smc: short wait for late smc_clc_wait_msg
After sending one of the initial LLC messages CONFIRM LINK or
ADD LINK, there is already a wait for the LLC response. It does
not make sense to wait another long time for a CLC DECLINE. Thus
this patch introduces a shorter wait time for these cases.
Signed-off-by: Ursula Braun <ubraun@linux.ibm.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/smc/smc_clc.c')
-rw-r--r-- | net/smc/smc_clc.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/net/smc/smc_clc.c b/net/smc/smc_clc.c index 62043d69e3a3..776e9dfc915d 100644 --- a/net/smc/smc_clc.c +++ b/net/smc/smc_clc.c @@ -265,7 +265,7 @@ out: * clcsock error, -EINTR, -ECONNRESET, -EPROTO otherwise. */ int smc_clc_wait_msg(struct smc_sock *smc, void *buf, int buflen, - u8 expected_type) + u8 expected_type, unsigned long timeout) { long rcvtimeo = smc->clcsock->sk->sk_rcvtimeo; struct sock *clc_sk = smc->clcsock->sk; @@ -285,7 +285,7 @@ int smc_clc_wait_msg(struct smc_sock *smc, void *buf, int buflen, * sizeof(struct smc_clc_msg_hdr) */ krflags = MSG_PEEK | MSG_WAITALL; - smc->clcsock->sk->sk_rcvtimeo = CLC_WAIT_TIME; + clc_sk->sk_rcvtimeo = timeout; iov_iter_kvec(&msg.msg_iter, READ, &vec, 1, sizeof(struct smc_clc_msg_hdr)); len = sock_recvmsg(smc->clcsock, &msg, krflags); @@ -351,7 +351,7 @@ int smc_clc_wait_msg(struct smc_sock *smc, void *buf, int buflen, } out: - smc->clcsock->sk->sk_rcvtimeo = rcvtimeo; + clc_sk->sk_rcvtimeo = rcvtimeo; return reason_code; } |