net/smc: no tx work trigger for fallback sockets
authorUrsula Braun <ubraun@linux.ibm.com>
Tue, 15 May 2018 15:04:54 +0000 (17:04 +0200)
committerDavid S. Miller <davem@davemloft.net>
Wed, 16 May 2018 15:49:19 +0000 (11:49 -0400)
If TCP_NODELAY is set or TCP_CORK is reset, setsockopt triggers the
tx worker. This does not make sense, if the SMC socket switched to
the TCP fallback when the connection is created. This patch adds
the additional check for the fallback case.

Signed-off-by: Ursula Braun <ubraun@linux.ibm.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/smc/af_smc.c

index 17688a0..83403be 100644 (file)
@@ -1353,14 +1353,14 @@ static int smc_setsockopt(struct socket *sock, int level, int optname,
                break;
        case TCP_NODELAY:
                if (sk->sk_state != SMC_INIT && sk->sk_state != SMC_LISTEN) {
-                       if (val)
+                       if (val && !smc->use_fallback)
                                mod_delayed_work(system_wq, &smc->conn.tx_work,
                                                 0);
                }
                break;
        case TCP_CORK:
                if (sk->sk_state != SMC_INIT && sk->sk_state != SMC_LISTEN) {
-                       if (!val)
+                       if (!val && !smc->use_fallback)
                                mod_delayed_work(system_wq, &smc->conn.tx_work,
                                                 0);
                }