From nobody Mon Oct 6 03:14:01 2025 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 2C5D2226D0C for ; Fri, 25 Jul 2025 03:50:44 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=170.10.133.124 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1753415446; cv=none; b=p5J8xCC/ZtRxvdlFvIh8687YIPtLgxws5hNpTt4b3QuebOPN4MqaHoDO8Q0tXPzI1B16RT1kQomBuX+J/SzBUiqhb6wld2fA3oPGiIrquLic5lhwGt2/QFWAhbY9aoKVWFJzQG1NpCn1uLb/lijNYLxw0u2CWoBQDcLgjDd0rQI= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1753415446; c=relaxed/simple; bh=fCJxRZ/FM2eScA1Yqd4ouGWZ0gc+qVaV9V8SgiiE5SY=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=AGOTbS9TcbGMQodcOEfFc5OiHLrjw1tqxfTMiojepPkNSFNdRjYkIy8rDyV3Fi+rEt81OYslY5nDpuxRxU67XEsibNwkrrp5w21bxiJfXVIqR4CVsPXV8l4nVJd08NafLV2wnUm4IPLJ8kHJs+uqjHZbJeqp69mO24QT2+i6DZQ= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=redhat.com; spf=pass smtp.mailfrom=redhat.com; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b=EcwwMSX4; arc=none smtp.client-ip=170.10.133.124 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=redhat.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=redhat.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="EcwwMSX4" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1753415443; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding; bh=CDqOduZNxWnbZSoqqq7n2RgVln6pLZG+oZF2xiPbDm4=; b=EcwwMSX4qsd5rXAWQODhwD14Xio3xiEJyNooQIgHXw+3bV3RbEh0IxL6/oaw30C+r7rLui K5ZTKJ5WHmIdkspnBoRAXADVLfPxrDfLthI+jSRHLUM0ZGQ0QwmXwY6M93CNi0LeMXcY1c UD8IYgaKKN3QH3d1tBah6ka8NwI/M1o= Received: from mx-prod-mc-02.mail-002.prod.us-west-2.aws.redhat.com (ec2-54-186-198-63.us-west-2.compute.amazonaws.com [54.186.198.63]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-52-44yUy-CnNj-BSbuackteyg-1; Thu, 24 Jul 2025 23:50:40 -0400 X-MC-Unique: 44yUy-CnNj-BSbuackteyg-1 X-Mimecast-MFC-AGG-ID: 44yUy-CnNj-BSbuackteyg_1753415438 Received: from mx-prod-int-05.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-05.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.17]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-02.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 637E51956087; Fri, 25 Jul 2025 03:50:38 +0000 (UTC) Received: from xmu-thinkpadx1carbon3rd.raycom.csb (unknown [10.72.120.26]) by mx-prod-int-05.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id D965D195608D; Fri, 25 Jul 2025 03:50:31 +0000 (UTC) From: Xiumei Mu To: "David S . Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Shuah Khan Cc: Simon Horman , netdev@vger.kernel.org, linux-kselftest@vger.kernel.org, linux-kernel@vger.kernel.org, Long Xin , Sabrina Dubroca , Shannon Nelson , Hangbin Liu Subject: [PATCH net v2] selftests: rtnetlink.sh: remove esp4_offload after test Date: Fri, 25 Jul 2025 11:50:28 +0800 Message-ID: <6d3a1d777c4de4eb0ca94ced9e77be8d48c5b12f.1753415428.git.xmu@redhat.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 3.0 on 10.30.177.17 Content-Type: text/plain; charset="utf-8" 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 Reviewed-by: Shannon Nelson Reviewed-by: Hangbin Liu --- Changes in v2: - add test results in description - Enhanced logic for rmmod esp4_offload - fix shellcheck warning: SC2086 (The quoting issue) --- --- tools/testing/selftests/net/rtnetlink.sh | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/tools/testing/selftests/net/rtnetlink.sh b/tools/testing/selft= ests/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=3D$sysfsd/ipsec sysfsnet=3D/sys/bus/netdevsim/devices/netdevsim0/net/ probed=3Dfalse + esp4_offload_probed_default=3Dfalse + + if lsmod | grep -q esp4_offload; then + esp4_offload_probed_default=3Dtrue + fi =20 if ! mount | grep -q debugfs; then mount -t debugfs none /sys/kernel/debug/ &> /dev/null @@ -766,6 +771,7 @@ EOF fi =20 # 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 =20 --=20 2.50.1