[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <4d7cb2f1a05beef5076372b19da4b7d3f08b79d2.1728473602.git.petrm@nvidia.com>
Date: Wed, 9 Oct 2024 14:06:21 +0200
From: Petr Machata <petrm@...dia.com>
To: "David S. Miller" <davem@...emloft.net>, Eric Dumazet
<edumazet@...gle.com>, Jakub Kicinski <kuba@...nel.org>, Paolo Abeni
<pabeni@...hat.com>, <netdev@...r.kernel.org>
CC: <linux-kselftest@...r.kernel.org>, Shuah Khan <shuah@...nel.org>,
"Benjamin Poirier" <bpoirier@...dia.com>, Hangbin Liu <liuhangbin@...il.com>,
"Vladimir Oltean" <vladimir.oltean@....com>, Ido Schimmel
<idosch@...dia.com>, "Przemek Kitszel" <przemyslaw.kitszel@...el.com>, Petr
Machata <petrm@...dia.com>, <mlxsw@...dia.com>
Subject: [PATCH net-next 03/10] selftests: forwarding: lib: Allow passing PID to stop_traffic()
Now that it is possible to schedule a deferral of stop_traffic() right
after the traffic is started, we do not have to rely on the %% magic to
kill the background process that was started last. Instead we can just give
the PID explicitly. This makes it possible to start other background
processes after the traffic is started without confusing the cleanup.
Signed-off-by: Petr Machata <petrm@...dia.com>
---
tools/testing/selftests/net/forwarding/lib.sh | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/tools/testing/selftests/net/forwarding/lib.sh b/tools/testing/selftests/net/forwarding/lib.sh
index 76e6d7698caf..89c25f72b10c 100644
--- a/tools/testing/selftests/net/forwarding/lib.sh
+++ b/tools/testing/selftests/net/forwarding/lib.sh
@@ -1768,8 +1768,10 @@ start_tcp_traffic()
stop_traffic()
{
+ local pid=${1-%%}; shift
+
# Suppress noise from killing mausezahn.
- { kill %% && wait %%; } 2>/dev/null
+ { kill $pid && wait $pid; } 2>/dev/null
}
declare -A cappid
--
2.45.0
Powered by blists - more mailing lists