mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: liushike <liushike123@gmail.com>
To: netdev@vger.kernel.org
Cc: jmaloy@redhat.com, tung.quang.nguyen@est.tech,
	davem@davemloft.net, edumazet@google.com, kuba@kernel.org,
	pabeni@redhat.com, horms@kernel.org, shuah@kernel.org,
	tipc-discussion@lists.sourceforge.net,
	linux-kselftest@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: [RFC net-next 0/2] tipc: notify pending connects of peer node loss
Date: Tue, 29 Sep 2026 06:47:40 +0000	[thread overview]
Message-ID: <20260929064742.576651-1-liushike123@gmail.com> (raw)

From: liushike <liushike@ruijie.com.cn>

This series notifies pending active opens when contact with the peer node
is lost, and adds selftests for both connection-oriented socket types.

A client can send SYN and wait in connect() while the listening server
has not called accept(). If the last usable link then disappears, the
unmodified kernel leaves that connect waiting instead of reporting node
loss. Registering pending connects lets node_lost_contact() notify them;
the client receives EHOSTUNREACH. A surviving link preserves the attempt.

Patch 1 changes connection registration and error notification. Patch 2
adds selftests and their build/maintainer integration.

I am proposing net-next for this long-standing behavior change, but would
appreciate guidance on whether net is the preferred target. This is an
RFC for review, including the target tree and historical attribution.

I have not reliably identified the original introducing commit for a
Fixes tag. Commit dadebc00299a ("tipc: eliminate port_connect()/port_disconnect()
functions") moved existing registration logic in 2014; its parent already
registered at connection completion, so that refactoring alone is not
evidence of introduction. No Fixes tag is guessed here.

Testing used the base-commit below for the before kernel and that base
plus this series for the after kernel. Both ran the identical final
selftest in x86_64 QEMU/KVM guests (2 vCPUs, 1536 MiB), with GCC 9.4.0
and binutils 2.34. Two network namespaces communicate over veth pairs;
fault injection disables TIPC Ethernet bearers, not physical cables.

Results (SOCK_STREAM and SOCK_SEQPACKET, nine cases each):
  Before: 8 passed, 10 failed, 0 skipped; exit status 1.
  After: 18 passed, 0 failed, 0 skipped; exit status 0.

On the before kernel, last-link loss, both-links loss and named node loss
left connect pending beyond the two-second assertion window. Nonblocking
connect and connection-wait timeout followed by node loss had no hangup
event and SO_ERROR remained zero. Normal accept, surviving-link failover,
rejection and named accept passed. These failures occurred after SYN
reached the listener, not during topology preparation.

On the after kernel all cases passed, including EHOSTUNREACH and POLLHUP
checks for asynchronous failure. The two-second bound is a test deadline,
not a measurement of millisecond-level latency.

The kernel configurations differ only in CONFIG_LOCALVERSION. The build
records include the base commit, patch and image hashes, configurations,
compiler output, launch script and both guest TAP logs.

liushike (2):
  tipc: abort pending connects when the peer node is lost
  selftests: net: cover pending TIPC connects on peer node loss

 MAINTAINERS                                 |   1 +
 net/tipc/node.c                             |  37 ++-
 net/tipc/node.h                             |   1 +
 net/tipc/socket.c                           |  38 ++-
 tools/testing/selftests/net/Makefile        |   1 +
 tools/testing/selftests/net/config          |   1 +
 tools/testing/selftests/net/tipc_connect.py | 278 ++++++++++++++++++++
 7 files changed, 353 insertions(+), 4 deletions(-)
 create mode 100755 tools/testing/selftests/net/tipc_connect.py


base-commit: 8830e65ed46de41f849eefb8ba227d4852c460f6
-- 
2.34.1


             reply	other threads:[~2026-09-29  6:48 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-09-29  6:47 liushike [this message]
2026-09-29  6:47 ` [RFC net-next 1/2] tipc: abort pending connects when the peer node is lost liushike
2026-09-29  6:47 ` [RFC net-next 2/2] selftests: net: cover pending TIPC connects on peer node loss liushike
2026-09-29  6:54 ` [RFC net-next 0/2] tipc: notify pending connects of " netdev-bot+sinfo

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20260929064742.576651-1-liushike123@gmail.com \
    --to=liushike123@gmail.com \
    --cc=davem@davemloft.net \
    --cc=edumazet@google.com \
    --cc=horms@kernel.org \
    --cc=jmaloy@redhat.com \
    --cc=kuba@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-kselftest@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    --cc=shuah@kernel.org \
    --cc=tipc-discussion@lists.sourceforge.net \
    --cc=tung.quang.nguyen@est.tech \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®