From nobody Sun Feb 8 17:21:49 2026 Received: from mail-wm1-f44.google.com (mail-wm1-f44.google.com [209.85.128.44]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id DD7EF32ABE1 for ; Sun, 18 Jan 2026 11:00:31 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.44 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1768734035; cv=none; b=pO7xROoHRMZ7VfxQ6hxGic0lP4ngXf0nNd0LoAqFvioIupZPwTJhFhxkKcOatGhW5F8301sqfJo3MHx845UHhBnnr9xySzOREp/XZI0Q6qrS68UT4VO7AdzZ9guKreGOu4ogew0tKYCRh10XdR9HMskj7We5o1cK6Uaa4ZMPg20= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1768734035; c=relaxed/simple; bh=oZlSrKc5HSf8OTgk8Y9zCO1ND/6B7m7anVTBiZTQDCE=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=u+MYWk2lciLYs5EuraDxQnpCrleSPg3Cay175T1dA6LpRpHuCON1DJY+vIk0Ev/VXJSjXb8RmWVTgr9dwRTuiElQSbA5xMbs75Od+NY8mny1jQMuwCBnCwGmbbaihAEXuA7s9xX86VfgWcuWIujaixLYMgXc//s1ZGLJzqlpMKw= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=ZM6xEzUr; arc=none smtp.client-ip=209.85.128.44 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="ZM6xEzUr" Received: by mail-wm1-f44.google.com with SMTP id 5b1f17b1804b1-4801c1ad878so22827335e9.1 for ; Sun, 18 Jan 2026 03:00:31 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1768734030; x=1769338830; darn=vger.kernel.org; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=J4d7URFdeCPYu3U6zdfTOnUzmMHd/kT6rS033v+6Sa8=; b=ZM6xEzUrJlnixDJMgVzB0RlaEAtNQNqH5SfVkeIQEauMxckLI/TBKtHBnpuff55nnR Qfmk47OrfmbJOlfBU+m2KUiJtiI3FDPAkWsKsGa8DnEuFF599MdIf4ZtHFi3AAGRjv/x BpG789CWMVFeDXo7P3mALGDwQp4u8h4NOFqdcclPAncfwOLdWdVh3Nhr9B0JM1DfF/kQ AbIUtIKq4zL3U1kLQuFruCJLCb1pEGzDDtZKWFrv0kSidyFsmfThvScE80Auz7FlKlPH cckli9Xk8oduWAfjRFJPO/AhERzVETjQEOOJk88n+IhYJ03uxhSa4BRjv6vcDialNYL4 xkxg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1768734030; x=1769338830; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-gg:x-gm-message-state:from:to :cc:subject:date:message-id:reply-to; bh=J4d7URFdeCPYu3U6zdfTOnUzmMHd/kT6rS033v+6Sa8=; b=UvE01JHuIWDlVuNlWGUsqCrocxekiCvyM60r/7yB6IUrYpidSfrOOFLfVjfrUA53ND e3JoJLhfMg4FqXkQ+bYKGmcXuxxLan4z3TKmPhpUDszEJILy3mNYmwVD9WDHZ/Z1SzkH 7KeAy553P/wdVnsact2VpxwVgNfGV9EXrpAnoi4YJXODw2FvNqggygNuG/x7b7imSKcx k0i1WSW3mV311ObhmM+IMXx2nSZb6Ll71SyiZlnny5ebUnzbfjBZDxynKL7OlKP593ps bTfpOXv7aN8IgNtWzy+pX19MwC3+RDrfkOkwkAEWNsmsxxWWw5I80mEDNGGhsRokJ3sX ThUA== X-Forwarded-Encrypted: i=1; AJvYcCUlZiG3/OUsIfv0L6g8nqC2Yixc6W+cmGY5hi3b+g4ptoLW2XZ8VQLXS008BI3jMOlyLtjL0z64pD/uf4k=@vger.kernel.org X-Gm-Message-State: AOJu0Yw5kiuIqTGVj3J4P28EBLoy3hKy+F5OhtTbkX3I+kmCESFoJ4dx oqw0JoYBl+kMNmpk5Se3pIEC+PVgr3dxX/Y7ujTzv2TFeL4XqjH5dNHb X-Gm-Gg: AY/fxX5VFO+2Y+Xhoh6SRq+2+nHjLg6cvyixHG5N6uxzypOI9GnCILAEtRNyIaj22OV R1p49XJDY2e9GdbAezJKqZp1sMwJ0OtGV1uE7zmHYThABs8A/aQv3qfN5Y2aCc7Y9whK9pMYByU YqI6ExCtLb9LwKRRiztYjqERbAxlIKIK4sVipaYhL4kjE+7h3dVVp4vcfcG2jtbwp45ykXjzIS0 RPS8u6ReoQo7vBuuF3N9+Pa9anvDUrkswNH0xVJdH3NA+l80pxyW0ArLFhHfRDoeAZGzW5h50Ug mNawdGJ1DqaxVKhsRaCVBv4+SqzT7G2Fmr4G+gqq+jaU6DpyFH9qk7xgcJCRnaEehp3o3SsW78F Svo7bJqieRkGFdLAnfJKD/3KIet4wQMBCv4adox2W+wjfqaUoDj9FILzP/2rl0ojcy4AARon8Pq P2DAVgo9JFt/WZ8Q== X-Received: by 2002:a05:600c:4448:b0:465:a51d:d4 with SMTP id 5b1f17b1804b1-4801e2fdd54mr95040255e9.6.1768734029915; Sun, 18 Jan 2026 03:00:29 -0800 (PST) Received: from [192.168.1.243] ([143.58.192.3]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-4356992201csm16864635f8f.2.2026.01.18.03.00.28 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 18 Jan 2026 03:00:29 -0800 (PST) From: Andre Carvalho Date: Sun, 18 Jan 2026 11:00:23 +0000 Subject: [PATCH net-next v11 3/7] netconsole: add STATE_DEACTIVATED to track targets disabled by low level Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20260118-netcons-retrigger-v11-3-4de36aebcf48@gmail.com> References: <20260118-netcons-retrigger-v11-0-4de36aebcf48@gmail.com> In-Reply-To: <20260118-netcons-retrigger-v11-0-4de36aebcf48@gmail.com> To: Breno Leitao , Andrew Lunn , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Shuah Khan , Simon Horman Cc: netdev@vger.kernel.org, linux-kernel@vger.kernel.org, linux-kselftest@vger.kernel.org, Andre Carvalho X-Mailer: b4 0.14.3 X-Developer-Signature: v=1; a=ed25519-sha256; t=1768734024; l=2409; i=asantostc@gmail.com; s=20250807; h=from:subject:message-id; bh=Bc0ee9DYK1oiSRrahxYGeDv2Y4gYudwUsG3FQq7nt2Y=; b=w47Bv0mJSq0H++87nzW6h5KMtb3quL1YV8R5bcPQBf+b6qibDRwH/Xr8ZeczEx6pVS526X8qp lrjJUKt/nNBD6Mn65spkAIhk/Po4No1vvdD2+IQ7ZEqu04Z7jMsQ0UG X-Developer-Key: i=asantostc@gmail.com; a=ed25519; pk=eWre+RwFHCxkiaQrZLsjC67mZ/pZnzSM/f7/+yFXY4Q= From: Breno Leitao When the low level interface brings a netconsole target down, record this using a new STATE_DEACTIVATED state. This allows netconsole to distinguish between targets explicitly disabled by users and those deactivated due to interface state changes. It also enables automatic recovery and re-enabling of targets if the underlying low-level interfaces come back online. From a code perspective, anything that is not STATE_ENABLED is disabled. Devices (de)enslaving are marked STATE_DISABLED to prevent automatically resuming as enslaved interfaces cannot have netconsole enabled. Signed-off-by: Breno Leitao Signed-off-by: Andre Carvalho --- drivers/net/netconsole.c | 20 +++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) diff --git a/drivers/net/netconsole.c b/drivers/net/netconsole.c index b21ecea60d52..7a1e5559fc0d 100644 --- a/drivers/net/netconsole.c +++ b/drivers/net/netconsole.c @@ -122,6 +122,7 @@ enum sysdata_feature { enum target_state { STATE_DISABLED, STATE_ENABLED, + STATE_DEACTIVATED, }; =20 /** @@ -580,6 +581,14 @@ static ssize_t enabled_store(struct config_item *item, if (ret) goto out_unlock; =20 + /* When the user explicitly enables or disables a target that is + * currently deactivated, reset its state to disabled. The DEACTIVATED + * state only tracks interface-driven deactivation and should _not_ + * persist when the user manually changes the target's enabled state. + */ + if (nt->state =3D=3D STATE_DEACTIVATED) + nt->state =3D STATE_DISABLED; + ret =3D -EINVAL; current_enabled =3D nt->state =3D=3D STATE_ENABLED; if (enabled =3D=3D current_enabled) { @@ -1445,10 +1454,19 @@ static int netconsole_netdev_event(struct notifier_= block *this, break; case NETDEV_RELEASE: case NETDEV_JOIN: - case NETDEV_UNREGISTER: + /* transition target to DISABLED instead of + * DEACTIVATED when (de)enslaving devices as + * their targets should not be automatically + * resumed when the interface is brought up. + */ nt->state =3D STATE_DISABLED; list_move(&nt->list, &target_cleanup_list); stopped =3D true; + break; + case NETDEV_UNREGISTER: + nt->state =3D STATE_DEACTIVATED; + list_move(&nt->list, &target_cleanup_list); + stopped =3D true; } } netconsole_target_put(nt); --=20 2.52.0