net/smc: send directly on setting TCP_NODELAY

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>
This commit is contained in:
Dust Li 2022-03-01 17:43:59 +08:00 коммит произвёл David S. Miller
Родитель 12bbb0d163
Коммит b70a5cc045
1 изменённых файлов: 2 добавлений и 2 удалений

Просмотреть файл

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