linux/drivers/net/netdevsim
Breno Leitao f712b97245 netdevsim: set the carrier when the device goes up
[ Upstream commit 1a8fed52f7 ]

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.

Commit 3762ec05a9 ("netdevsim: add NAPI support") added supported
for NAPI, calling netif_carrier_off() in nsim_stop(). This patch
re-enables the carrier symmetrically on nsim_open(), in case the device
is linked and the peer is up.

Signed-off-by: Breno Leitao <leitao@debian.org>
Fixes: 3762ec05a9 ("netdevsim: add NAPI support")
Reviewed-by: Andrew Lunn <andrew@lunn.ch>
Link: https://patch.msgid.link/20251014-netdevsim_fix-v2-1-53b40590dae1@debian.org
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
History 2025-10-23 16:24:31 +02:00
..
bpf.c netdevsim: 'support' multi-buf XDP 2025-03-12 13:39:59 -07:00
bus.c netdevsim: implement peer queue flow control 2025-07-14 17:36:50 -07:00
dev.c netdevsim: add fw_update_flash_chunk_time_ms debugfs knobs 2025-07-23 17:08:56 -07:00
ethtool.c netdevsim: implement peer queue flow control 2025-07-14 17:36:50 -07:00
fib.c netdevsim: Add trailing zero to terminate the string in nsim_nexthop_bucket_activity_write() 2024-10-29 11:43:01 -07:00
health.c netdevsim: prevent bad user input in nsim_dev_health_break_write() 2024-12-15 13:26:47 -08:00
hwstats.c netdevsim: remove redundant branch 2025-07-17 18:09:27 -07:00
ipsec.c xfrm: Add explicit dev to .xdo_dev_state_{add,delete,free} 2025-04-16 11:01:41 +02:00
macsec.c netdevsim: macsec: pad u64 to correct length in logs 2024-10-23 09:51:06 +02:00
Makefile netdevsim: add dummy macsec offload 2023-07-14 09:16:53 +01:00
netdev.c netdevsim: set the carrier when the device goes up 2025-10-23 16:24:31 +02:00
netdevsim.h netdevsim: add fw_update_flash_chunk_time_ms debugfs knobs 2025-07-23 17:08:56 -07:00
psample.c netdevsim: Only use sampling truncation length when valid 2021-04-22 13:23:56 -07:00
udp_tunnels.c netdevsim: remove udp_ports_sleep 2025-06-18 18:53:51 -07:00