acrn-kernel/net/smc
Wen Gu 906b3d6491 net/smc: Send out the remaining data in sndbuf before close
The current autocork algorithms will delay the data transmission
in BH context to smc_release_cb() when sock_lock is hold by user.

So there is a possibility that when connection is being actively
closed (sock_lock is hold by user now), some corked data still
remains in sndbuf, waiting to be sent by smc_release_cb(). This
will cause:

- smc_close_stream_wait(), which is called under the sock_lock,
  has a high probability of timeout because data transmission is
  delayed until sock_lock is released.

- Unexpected data sends may happen after connction closed and use
  the rtoken which has been deleted by remote peer through
  LLC_DELETE_RKEY messages.

So this patch will try to send out the remaining corked data in
sndbuf before active close process, to ensure data integrity and
avoid unexpected data transmission after close.

Reported-by: Guangguan Wang <guangguan.wang@linux.alibaba.com>
Fixes: 6b88af839d ("net/smc: don't send in the BH context if sock_owned_by_user")
Signed-off-by: Wen Gu <guwen@linux.alibaba.com>
Acked-by: Karsten Graul <kgraul@linux.ibm.com>
Link: https://lore.kernel.org/r/1648447836-111521-1-git-send-email-guwen@linux.alibaba.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
2022-03-28 16:06:27 -07:00
..
Kconfig
Makefile net/smc: fix compile warning for smc_sysctl 2022-03-07 11:59:17 +00:00
af_smc.c net/smc: fix compile warning for smc_sysctl 2022-03-07 11:59:17 +00:00
smc.h net/smc: don't send in the BH context if sock_owned_by_user 2022-03-01 14:25:12 +00:00
smc_cdc.c net/smc: don't send in the BH context if sock_owned_by_user 2022-03-01 14:25:12 +00:00
smc_cdc.h
smc_clc.c
smc_clc.h
smc_close.c net/smc: Send out the remaining data in sndbuf before close 2022-03-28 16:06:27 -07:00
smc_close.h
smc_core.c Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net 2022-03-03 11:55:12 -08:00
smc_core.h
smc_diag.c
smc_ib.c
smc_ib.h
smc_ism.c
smc_ism.h
smc_llc.c
smc_llc.h
smc_netlink.c net/smc: Add global configure for handshake limitation by netlink 2022-02-11 11:14:58 +00:00
smc_netlink.h
smc_netns.h
smc_pnet.c Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net 2022-02-24 17:54:25 -08:00
smc_pnet.h net/smc: Use a mutex for locking "struct smc_pnettable" 2022-02-24 09:09:33 -08:00
smc_rx.c
smc_rx.h
smc_stats.c
smc_stats.h
smc_sysctl.c net/smc: fix a memory leak in smc_sysctl_net_exit() 2022-03-26 14:17:01 -07:00
smc_sysctl.h net/smc: fix -Wmissing-prototypes warning when CONFIG_SYSCTL not set 2022-03-09 20:02:35 -08:00
smc_tracepoint.c
smc_tracepoint.h
smc_tx.c net: smc: fix different types in min() 2022-03-01 16:43:27 -08:00
smc_tx.h
smc_wr.c Revert "net/smc: don't req_notify until all CQEs drained" 2022-03-06 10:57:12 +00:00
smc_wr.h