]> git.proxmox.com Git - mirror_ubuntu-jammy-kernel.git/commit
net/smc: don't send CDC/LLC message if link not ready
authorDust Li <dust.li@linux.alibaba.com>
Tue, 28 Dec 2021 09:03:24 +0000 (17:03 +0800)
committerAndrea Righi <andrea.righi@canonical.com>
Fri, 21 Jan 2022 14:49:19 +0000 (15:49 +0100)
commitbe0e11d9648ad61028cfa04fe17a69cfe49058db
treef5ff686232e5a203d7e67620bd3e0b1e33cddb95
parenta3423c41916e364d45a99f6511bab9bf48aeb6a4
net/smc: don't send CDC/LLC message if link not ready

BugLink: https://bugs.launchpad.net/bugs/1956926
[ Upstream commit 90cee52f2e780345d3629e278291aea5ac74f40f ]

We found smc_llc_send_link_delete_all() sometimes wait
for 2s timeout when testing with RDMA link up/down.
It is possible when a smc_link is in ACTIVATING state,
the underlaying QP is still in RESET or RTR state, which
cannot send any messages out.

smc_llc_send_link_delete_all() use smc_link_usable() to
checks whether the link is usable, if the QP is still in
RESET or RTR state, but the smc_link is in ACTIVATING, this
LLC message will always fail without any CQE entering the
CQ, and we will always wait 2s before timeout.

Since we cannot send any messages through the QP before
the QP enter RTS. I add a wrapper smc_link_sendable()
which checks the state of QP along with the link state.
And replace smc_link_usable() with smc_link_sendable()
in all LLC & CDC message sending routine.

Fixes: 5f08318f617b ("smc: connection data control (CDC)")
Signed-off-by: Dust Li <dust.li@linux.alibaba.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Sasha Levin <sashal@kernel.org>
Signed-off-by: Paolo Pisati <p.pisati@gmail.com>
net/smc/smc_core.c
net/smc/smc_core.h
net/smc/smc_llc.c
net/smc/smc_wr.c
net/smc/smc_wr.h