All of lore.kernel.org
 help / color / mirror / Atom feed
From: Hangbin Liu <liuhangbin@gmail.com>
To: Xiumei Mu <xmu@redhat.com>
Cc: "David S . Miller" <davem@davemloft.net>,
	Eric Dumazet <edumazet@google.com>,
	Jakub Kicinski <kuba@kernel.org>, Paolo Abeni <pabeni@redhat.com>,
	Shuah Khan <shuah@kernel.org>, Simon Horman <horms@kernel.org>,
	netdev@vger.kernel.org, linux-kselftest@vger.kernel.org,
	linux-kernel@vger.kernel.org, Long Xin <lxin@redhat.com>,
	Sabrina Dubroca <sd@queasysnail.net>,
	Shannon Nelson <sln@onemain.com>
Subject: Re: [PATCH net v2] selftests: rtnetlink.sh: remove esp4_offload after test
Date: Fri, 25 Jul 2025 03:53:48 +0000	[thread overview]
Message-ID: <aIL_zAGaP_8HDTS6@fedora> (raw)
In-Reply-To: <6d3a1d777c4de4eb0ca94ced9e77be8d48c5b12f.1753415428.git.xmu@redhat.com>

On Fri, Jul 25, 2025 at 11:50:28AM +0800, Xiumei Mu wrote:
> The esp4_offload module, loaded during IPsec offload tests, should
> be reset to its default settings after testing.
> Otherwise, leaving it enabled could unintentionally affect subsequence
> test cases by keeping offload active.
> 
> Without this fix:
> $ lsmod | grep offload; ./rtnetlink.sh -t kci_test_ipsec_offload ; lsmod | grep offload;
> PASS: ipsec_offload
> esp4_offload           12288  0
> esp4                   32768  1 esp4_offload
> 
> With this fix:
> $ lsmod | grep offload; ./rtnetlink.sh -t kci_test_ipsec_offload ; lsmod | grep offload;
> PASS: ipsec_offload
> 
> Fixes: 2766a11161cc ("selftests: rtnetlink: add ipsec offload API test")
> Signed-off-by: Xiumei Mu <xmu@redhat.com>
> Reviewed-by: Shannon Nelson <sln@onemain.com>
> ---
> Changes in v2:
> - add test results in description
> - Enhanced logic for rmmod esp4_offload
> - fix shellcheck warning: SC2086 (The quoting issue)
> ---

nit: extra ---

Reviewed-by: Hangbin Liu <liuhangbin@gmail.com>

> ---
>  tools/testing/selftests/net/rtnetlink.sh | 6 ++++++
>  1 file changed, 6 insertions(+)
> 
> diff --git a/tools/testing/selftests/net/rtnetlink.sh b/tools/testing/selftests/net/rtnetlink.sh
> index 2e8243a65b50..d2298da320a6 100755
> --- a/tools/testing/selftests/net/rtnetlink.sh
> +++ b/tools/testing/selftests/net/rtnetlink.sh
> @@ -673,6 +673,11 @@ kci_test_ipsec_offload()
>  	sysfsf=$sysfsd/ipsec
>  	sysfsnet=/sys/bus/netdevsim/devices/netdevsim0/net/
>  	probed=false
> +	esp4_offload_probed_default=false
> +
> +	if lsmod | grep -q esp4_offload; then
> +		esp4_offload_probed_default=true
> +	fi
>  
>  	if ! mount | grep -q debugfs; then
>  		mount -t debugfs none /sys/kernel/debug/ &> /dev/null
> @@ -766,6 +771,7 @@ EOF
>  	fi
>  
>  	# clean up any leftovers
> +	! "$esp4_offload_probed_default" && lsmod | grep -q esp4_offload && rmmod esp4_offload
>  	echo 0 > /sys/bus/netdevsim/del_device
>  	$probed && rmmod netdevsim
>  
> -- 
> 2.50.1
> 

  reply	other threads:[~2025-07-25  3:53 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-07-25  3:50 [PATCH net v2] selftests: rtnetlink.sh: remove esp4_offload after test Xiumei Mu
2025-07-25  3:53 ` Hangbin Liu [this message]
2025-07-26 18:40 ` 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=aIL_zAGaP_8HDTS6@fedora \
    --to=liuhangbin@gmail.com \
    --cc=davem@davemloft.net \
    --cc=edumazet@google.com \
    --cc=horms@kernel.org \
    --cc=kuba@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-kselftest@vger.kernel.org \
    --cc=lxin@redhat.com \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    --cc=sd@queasysnail.net \
    --cc=shuah@kernel.org \
    --cc=sln@onemain.com \
    --cc=xmu@redhat.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.