]> git.proxmox.com Git - mirror_ubuntu-jammy-kernel.git/commitdiff
net/smc: send directly on setting TCP_NODELAY
authorDust Li <dust.li@linux.alibaba.com>
Tue, 1 Mar 2022 09:43:59 +0000 (17:43 +0800)
committerStefan Bader <stefan.bader@canonical.com>
Wed, 27 Apr 2022 09:59:51 +0000 (11:59 +0200)
BugLink: https://bugs.launchpad.net/bugs/1969107
commit b70a5cc045197aad9c159042621baf3c015f6cc7 upstream.

In commit ea785a1a573b("net/smc: Send directly when
TCP_CORK is cleared"), we don't use delayed work
to implement cork.

This patch use the same algorithm, removes the
delayed work when setting TCP_NODELAY and send
directly in setsockopt(). This also makes the
TCP_NODELAY the same as TCP.

Cc: Tony Lu <tonylu@linux.alibaba.com>
Signed-off-by: Dust Li <dust.li@linux.alibaba.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
(cherry picked from commit 7f48521172fb63b9948e86987462cea62564fc2b)
Signed-off-by: Paolo Pisati <paolo.pisati@canonical.com>
net/smc/af_smc.c

index dbb6ba2035308d345ecdac13647265dc089ca5b7..dbcbfda7ec0acbc8f8b2451af79939c543e0240e 100644 (file)
@@ -2619,8 +2619,8 @@ static int smc_setsockopt(struct socket *sock, int level, int optname,
                    sk->sk_state != SMC_CLOSED) {
                        if (val) {
                                SMC_STAT_INC(smc, ndly_cnt);
-                               mod_delayed_work(smc->conn.lgr->tx_wq,
-                                                &smc->conn.tx_work, 0);
+                               smc_tx_pending(&smc->conn);
+                               cancel_delayed_work(&smc->conn.tx_work);
                        }
                }
                break;