From: Nimrod Oren <noren@nvidia.com>
To: Jakub Kicinski <kuba@kernel.org>, davem@davemloft.net
Cc: netdev@vger.kernel.org, edumazet@google.com, pabeni@redhat.com,
andrew+netdev@lunn.ch, horms@kernel.org, bobbyeshleman@gmail.com,
shuah@kernel.org, cjubran@nvidia.com, cratiu@nvidia.com,
willemb@google.com, petrm@nvidia.com,
linux-kselftest@vger.kernel.org
Subject: Re: [PATCH net-next v2] selftests: net: add ctl_file_write() helper
Date: Wed, 9 Sep 2026 21:39:24 +0300 [thread overview]
Message-ID: <9683c9d6-50ea-412a-a066-42fb71ddf346@nvidia.com> (raw)
In-Reply-To: <20260909180009.1894019-1-kuba@kernel.org>
On 09/09/2026 21:00, Jakub Kicinski wrote:
> Setting a sysctl or a sysfs attribute for the duration of a test and
> putting the old value back has been open coded multiple times.
>
> We generally avoid creating library helpers but this one is very
> common, and the defer is a little tricky as using the same function
> for defer as the initial write leads to an infinite loop (not that
> I would ever make such mistake!)
>
> Some of the conversions are not identical, but arguably ctl_file_write()
> semantics are more correct.
>
> Signed-off-by: Jakub Kicinski <kuba@kernel.org>
> ---
> v2:
> - rebase
> - drop the irq.py change which wasn't identical
> v1: https://lore.kernel.org/20260904174134.3789400-1-kuba@kernel.org
>
> CC: bobbyeshleman@gmail.com
> CC: shuah@kernel.org
> CC: cjubran@nvidia.com
> CC: cratiu@nvidia.com
> CC: noren@nvidia.com
> CC: willemb@google.com
> CC: petrm@nvidia.com
> CC: linux-kselftest@vger.kernel.org
> ---
> .../testing/selftests/drivers/net/gro_lib.py | 17 +++---------
> .../drivers/net/hw/devlink_rate_tc_bw.py | 5 ++--
> .../drivers/net/hw/lib/py/__init__.py | 4 +--
> .../selftests/drivers/net/hw/toeplitz.py | 10 +++----
> .../selftests/drivers/net/lib/py/__init__.py | 4 +--
> .../selftests/drivers/net/ring_reconfig.py | 26 ++++---------------
> .../testing/selftests/net/lib/py/__init__.py | 4 +--
> tools/testing/selftests/net/lib/py/utils.py | 22 ++++++++++++++++
> 8 files changed, 42 insertions(+), 50 deletions(-)
Reviewed-by: Nimrod Oren <noren@nvidia.com>
next prev parent reply other threads:[~2026-09-09 18:39 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-09-09 18:00 [PATCH net-next v2] selftests: net: add ctl_file_write() helper Jakub Kicinski
2026-09-09 18:39 ` Nimrod Oren [this message]
2026-09-09 18:42 ` Bobby Eshleman
2026-09-10 18:00 ` netdev-bot+sashiko
2026-09-11 1:50 ` patchwork-bot+netdevbpf
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=9683c9d6-50ea-412a-a066-42fb71ddf346@nvidia.com \
--to=noren@nvidia.com \
--cc=andrew+netdev@lunn.ch \
--cc=bobbyeshleman@gmail.com \
--cc=cjubran@nvidia.com \
--cc=cratiu@nvidia.com \
--cc=davem@davemloft.net \
--cc=edumazet@google.com \
--cc=horms@kernel.org \
--cc=kuba@kernel.org \
--cc=linux-kselftest@vger.kernel.org \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
--cc=petrm@nvidia.com \
--cc=shuah@kernel.org \
--cc=willemb@google.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.