From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=100.103.45.18 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796318873; b=evM+TeNG7vpKUc6EcrSaUjYa754F+E2+7UT+bcaLvvbXtMrZrqNBuTGYNy4EHx255iKG m0PekfNsh40ssy16OyyYx+RY9/HK3aCifny7H/OoEeGwcRZ33BGiqnq4dVERCk1oBdzAF zYxRX29E+cq+zKLbNxQjMq98IdLOKsv4bfYsORAfqkl/nZK/1Lxu01kJo8VQ9HeOjhllh ECpuqoEEMmteXtJWLNkAY3F52A1dyDxs3kGbABvkEm+0TygHV66lrwsP2snY2x+9hyTYP y7+NEZsIhhSC+6oqQuurwIPfmfm/1LkZLbx1bH4rb4WWFjPBlSm+MUf5lw76RM1O+qA== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796318873; h=Received:DKIM-Signature:Subject:From:To:Cc:Date:Message-ID: In-Reply-To:References:X-sashiko-severity:Content-Type: Content-Transfer-Encoding:MIME-Version; bh=hmLZKLB2tMglNXSGIm9+K2eQa/Kozn1ItrrQynH/J1o=; b=1ZNDu5iXsSi9+GOwMm9B4wVMp4XfPWufcKLlWEYD1rdK22LKj0dEdald/A2sVnx2ULrO 9fjRNLpeiL7LU6ihvRK1WY6ZEonKg++ha03zSRUHUvZbHdH5f8n9S/BXtfLVCYROM96Ku A6MKEc0wyH1OGuPvKPeX0x6UPbqxLR0b+tCtBbO/HHqMLnQadVCzWBtZzuMwpTiqsZYoo md+WCX2jiY/SJ/C1rGSc12WUPZ2jZ+hGbZzT02KJ5wSRloBVg3ccFRkmHdsynqb3gpRV+ igT4uV0n6lHUKjnYRm690d6QhFWXOjqFbh9M+4jYyMaye5Kt1COgubDdRDDnaWh7Emg== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=CSKowRaU; arc=none smtp.remote-ip=100.103.45.18 Received: from smtp.kernel.org (quasi.space.kernel.org [100.103.45.18]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id C7498606A33D for ; Thu, 3 Dec 2026 17:27:53 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=CSKowRaU Received: by smtp.kernel.org (Postfix) with ESMTPSA id 0640B1F00893; Thu, 3 Dec 2026 17:27:52 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1796318873; bh=hmLZKLB2tMglNXSGIm9+K2eQa/Kozn1ItrrQynH/J1o=; h=Subject:From:To:Cc:Date:In-Reply-To:References; b=CSKowRaUmn58o405sv8xU/XglWB0z+Lh5jXiML8t9wJKXus8rUcfP1U00g6UomDlu 1ldK5ywnzaIUhVdFL2v8bQTzJjqr14CkDBo8xZG7N55FdNeRmST1ZvlZVsYIaIS//k 0RAHrze3vh/xiQ50cheMqriEvE4tOdro/1sCelTVF9d7MwykRGgOi6x0F2ZFkrJuGd 9suWDI1hK6e2tEJQQiAKcTQDi3escht+ZEeH8LrHS1CTp5SrWfvTmC0tZzaL9gJFbL xIlYfEbz99RNuBpcTmLa6uI4Ks9dHqhB49MsX2Noxb4tcBk372YAeNNamO5/4Jb/l1 6c4u3dprNtwBQ== Subject: Re: [PATCH net-next] netdevsim: add debugfs knobs to fail net-shaper ops From: netdev-bot+sashiko@kernel.org To: chenguang.zhao@linux.dev Cc: kuba@kernel.org, andrew+netdev@lunn.ch, davem@davemloft.net, edumazet@kernel.org, pabeni@redhat.com, netdev@vger.kernel.org, zhaochenguang@kylinos.cn Date: Thu, 03 Dec 2026 17:27:52 +0000 Message-ID: <179631887253.3146.4402323430500483472@kernel.org> In-Reply-To: <20261201022735.3588142-1-chenguang.zhao@linux.dev> References: <20261201022735.3588142-1-chenguang.zhao@linux.dev> X-sashiko-severity: Medium Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 8bit X-Mailing-List: netdev@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Thank you for your contribution! Sashiko AI review found 2 potential issue(s) to consider. Critical: 0 · High: 0 · Medium: 1 · Low: 1 If you believe none of the issues are legitimate, please reply to each issue of Medium severity or higher and explain why the AI is wrong. If any of them are legitimate and you plan to respin, please let patchwork know by including "pw-bot: cr" as a separate line at the end of your reply (one such reply per series is enough). - [Medium] The patch adds three netdevsim debugfs knobs for fault injection: fail_shaper_set, fail_shaper_del and fail_shaper_group. - [Low] The commit message says the net-shaper core "never rolls back a driver failure against netdevsim" and adds all three knobs as the fix. -- netdevsim: add debugfs knobs to fail net-shaper ops This commit adds three per-PF debugfs bools to netdevsim: fail_shaper_set, fail_shaper_del and fail_shaper_group. Each one makes the matching net-shaper driver callback return -EINVAL with an extack message. The goal is to let the net-shaper core's failure handling be tested against netdevsim. > nsim_shaper_set(), nsim_shaper_del() and nsim_shaper_group() always > return success, so the net-shaper core never rolls back a driver > failure against netdevsim. Add per-PF debugfs bools that make those > callbacks return -EINVAL. [Severity: Low] Is this rollback rationale accurate for the del knob? The core only calls net_shaper_rollback() after a failed ops->set in net_shaper_nl_set_doit(), and in the rollback label after a failed ops->group. A failed ops->delete just returns the error: net/shaper/shaper.c:__net_shaper_delete() { ... ret = ops->delete(binding, &handle, extack); if (ret < 0) return ret; ... } So fail_shaper_del never reaches any rollback logic. It only checks that the error gets back to userspace, plus whatever partial state the core leaves behind. For a NODE delete, for example, net_shaper_pre_del_node() has already run before __net_shaper_delete() fails. Could the commit message describe what each knob actually covers? > diff --git a/drivers/net/netdevsim/netdev.c b/drivers/net/netdevsim/netdev.c > index 0372a9bd63bbb..fce044a455be7 100644 > --- a/drivers/net/netdevsim/netdev.c > +++ b/drivers/net/netdevsim/netdev.c [ ... ] > @@ -1193,6 +1229,15 @@ struct netdevsim *nsim_create(struct nsim_dev *nsim_dev, > &nsim_qreset_fops); > ns->vlan_dfs = debugfs_create_file("vlan", 0400, nsim_dev_port->ddir, > ns, &nsim_vlan_fops); > + if (nsim_dev_port_is_pf(nsim_dev_port)) { > + debugfs_create_bool("fail_shaper_set", 0600, nsim_dev_port->ddir, > + &ns->fail_shaper_set); > + debugfs_create_bool("fail_shaper_del", 0600, nsim_dev_port->ddir, > + &ns->fail_shaper_del); > + debugfs_create_bool("fail_shaper_group", 0600, > + nsim_dev_port->ddir, > + &ns->fail_shaper_group); > + } [Severity: Medium] Should this come with a selftest that uses the new knobs? Documentation/process/maintainer-netdev.rst says: netdevsim is reserved for use by upstream tests only, so any new netdevsim features must be accompanied by selftests under tools/testing/selftests/. At this commit, a grep for fail_shaper only matches drivers/net/netdevsim/netdev.c and netdevsim.h. Nothing under tools/testing/selftests/ uses it. The text below the --- line says the goal is to test the net-shaper rollback, but no upstream test runs these paths: net/shaper/shaper.c:net_shaper_nl_set_doit() { ... ret = ops->set(binding, &shaper, info->extack); if (ret) { net_shaper_rollback(binding); return ret; } ... } The rollback label after a failed ops->group is in the same state. tools/testing/selftests/drivers/net/shaper.py already runs against netdevsim through NetDrvEnv. Could the set and group failure cases be added there, checking that the hierarchy is unchanged after a failed request? > return ns; > > err_free_netdev: [ ... ] -- Sashiko AI review · https://netdev-ai.bots.linux.dev/sashiko/#/patchset/20261201022735.3588142-1-chenguang.zhao%40linux.dev