Commit 00097048 authored by Litao Jiao's avatar Litao Jiao
Browse files

net/smc: send directly on setting TCP_NODELAY

mainline inclusion
from mainline-v5.18-rc1
commit b70a5cc0
category: bugfix
bugzilla: https://gitee.com/openeuler/kernel/issues/I78OQ2
CVE: NA

Reference: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/net/smc?id=b70a5cc045197aad9c159042621baf3c015f6cc7



--------------------------------

In commit ea785a1a("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: default avatarDust Li <dust.li@linux.alibaba.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
Signed-off-by: default avatarLitao Jiao <jiaolitao@sangfor.com.cn>
parent f80a4ca3
Loading
Loading
Loading
Loading
+4 −3
Original line number Diff line number Diff line
@@ -2227,9 +2227,10 @@ static int smc_setsockopt(struct socket *sock, int level, int optname,
		if (sk->sk_state != SMC_INIT &&
		    sk->sk_state != SMC_LISTEN &&
		    sk->sk_state != SMC_CLOSED) {
			if (val)
				mod_delayed_work(smc->conn.lgr->tx_wq,
						 &smc->conn.tx_work, 0);
			if (val) {
				smc_tx_pending(&smc->conn);
				cancel_delayed_work(&smc->conn.tx_work);
			}
		}
		break;
	case TCP_CORK: