Re: [PATCH net] netdevsim: set the carrier when the device goes up
From: Andrew Lunn
Date: Mon Oct 13 2025 - 13:25:37 EST
On Mon, Oct 13, 2025 at 10:09:22AM -0700, Breno Leitao wrote:
> Bringing a linked netdevsim device down and then up causes communication
> failure because both interfaces lack carrier. Basically a ifdown/ifup on
> the interface make the link broken.
>
> When a device is brought up, if it has a peer and this peer device is
> UP, set both carriers to on.
>
> Signed-off-by: Breno Leitao <leitao@xxxxxxxxxx>
> Fixes: 3762ec05a9fbda ("netdevsim: add NAPI support")
It was not obvious what adding NAPI has to do with carrier status. I
had to go look at 3762ec05a9fbda to see that that was when nsim_stop()
started to change the carrier on stop. This patch makes nsim_open()
somewhat symmetrical. If you need a respin, maybe expand the commit
message to explain this.
Otherwise this looks O.K. to me.
Reviewed-by: Andrew Lunn <andrew@xxxxxxx>
Andrew