public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Yohei Kojima <yk@y-koj.net>
To: Breno Leitao <leitao@debian.org>
Cc: Jakub Kicinski <kuba@kernel.org>,
	Andrew Lunn <andrew+netdev@lunn.ch>,
	"David S. Miller" <davem@davemloft.net>,
	Eric Dumazet <edumazet@google.com>,
	Paolo Abeni <pabeni@redhat.com>, Andrew Lunn <andrew@lunn.ch>,
	netdev@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH net v2 1/2] net: netdevsim: fix inconsistent carrier state after link/unlink
Date: Thu, 1 Jan 2026 01:06:56 +0900	[thread overview]
Message-ID: <aVVKICvpimILHy5s@desktop.homenetwork> (raw)
In-Reply-To: <4xxshlplnoulncmfkinnuzvwx7bbnukkwds7go75cese4scrws@6xlfsy35t7gg>

On Wed, Dec 31, 2025 at 02:16:53AM -0800, Breno Leitao wrote:
> Hello Yohei,
> 
> On Wed, Dec 31, 2025 at 01:03:29AM +0900, yk@y-koj.net wrote:
> > From: Yohei Kojima <yk@y-koj.net>
> > 
> > This patch fixes the edge case behavior on ifup/ifdown and
> > linking/unlinking two netdevsim interfaces:
> > 
> > 1. unlink two interfaces netdevsim1 and netdevsim2
> > 2. ifdown netdevsim1
> > 3. ifup netdevsim1
> > 4. link two interfaces netdevsim1 and netdevsim2
> 
> > 5. (Now two interfaces are linked in terms of netdevsim peer, but
> >     carrier state of the two interfaces remains DOWN.)
> 
> That seems a real issue, in fact. The carriers are only getting up when
> opening the device, not when linking. Thus, this patch makes sense to
> me.
> 
> > This inconsistent behavior is caused by the current implementation,
> > which only cares about the "link, then ifup" order, not "ifup, then
> > link" order. This patch fixes the inconsistency by calling
> > netif_carrier_on() when two netdevsim interfaces are linked.
> > 
> > This patch fixes buggy behavior on NetworkManager-based systems which
> > causes the netdevsim test to fail with the following error:
> > 
> >   # timeout set to 600
> >   # selftests: drivers/net/netdevsim: peer.sh
> >   # 2025/12/25 00:54:03 socat[9115] W address is opened in read-write mode but only supports read-only
> >   # 2025/12/25 00:56:17 socat[9115] W connect(7, AF=2 192.168.1.1:1234, 16): Connection timed out
> >   # 2025/12/25 00:56:17 socat[9115] E TCP:192.168.1.1:1234: Connection timed out
> >   # expected 3 bytes, got 0
> >   # 2025/12/25 00:56:17 socat[9109] W exiting on signal 15
> >   not ok 13 selftests: drivers/net/netdevsim: peer.sh # exit=1
> > 
> > This patch also solves timeout on TCP Fast Open (TFO) test in
> > NetworkManager-based systems because it also depends on netdevsim's
> > carrier consistency.
> > 
> > Fixes: 1a8fed52f7be ("netdevsim: set the carrier when the device goes up")
> > Signed-off-by: Yohei Kojima <yk@y-koj.net>
> 
> Reviewed-by: Breno Leitao <leitao@debian.org>

Thank you for the review!  

> 
> Thanks for the fix!

When I encountered this bug, I could easily identify where to fix thanks
to your previous commit. Thanks again for your support!

Best regards,
Yohei Kojima

  reply	other threads:[~2025-12-31 16:07 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-12-30 16:03 [PATCH net v2 0/2] net: netdevsim: fix inconsistent carrier state after link/unlink yk
2025-12-30 16:03 ` [PATCH net v2 1/2] " yk
2025-12-31 10:16   ` Breno Leitao
2025-12-31 16:06     ` Yohei Kojima [this message]
2026-01-04 18:54   ` Jakub Kicinski
2026-01-05 15:36     ` Yohei Kojima
2025-12-30 16:03 ` [PATCH net v2 2/2] selftests: netdevsim: add carrier state consistency test yk

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=aVVKICvpimILHy5s@desktop.homenetwork \
    --to=yk@y-koj.net \
    --cc=andrew+netdev@lunn.ch \
    --cc=andrew@lunn.ch \
    --cc=davem@davemloft.net \
    --cc=edumazet@google.com \
    --cc=kuba@kernel.org \
    --cc=leitao@debian.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    /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