OSDN Git Service

net/smc: align the connect behaviour with TCP
authorGuangguan Wang <guangguan.wang@linux.alibaba.com>
Fri, 13 May 2022 02:24:53 +0000 (10:24 +0800)
committerDavid S. Miller <davem@davemloft.net>
Mon, 16 May 2022 09:40:07 +0000 (10:40 +0100)
commit3aba103006bcc4a7472b7c9506b3bc065ffb7992
tree3d897b9dd01cbd610f8192ca34074e83d5ea7832
parente97e68b56e78303581a03b26e95f6c0c03ecbbe2
net/smc: align the connect behaviour with TCP

Connect with O_NONBLOCK will not be completed immediately
and returns -EINPROGRESS. It is possible to use selector/poll
for completion by selecting the socket for writing. After select
indicates writability, a second connect function call will return
0 to indicate connected successfully as TCP does, but smc returns
-EISCONN. Use socket state for smc to indicate connect state, which
can help smc aligning the connect behaviour with TCP.

Signed-off-by: Guangguan Wang <guangguan.wang@linux.alibaba.com>
Acked-by: Karsten Graul <kgraul@linux.ibm.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/smc/af_smc.c