From patchwork Thu Sep 5 03:07:02 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Willem de Bruijn X-Patchwork-Id: 13791656 X-Patchwork-Delegate: kuba@kernel.org Received: from mail-qt1-f176.google.com (mail-qt1-f176.google.com [209.85.160.176]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 7BF222E62B; Thu, 5 Sep 2024 03:12:39 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.160.176 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1725505961; cv=none; b=UheWexuiqyYNd1iZU+yCN1S9WBn/ZVE/+ihUcKh4qpCtAlpr5IVpkOB1NrA2x4iMuAXF6/MJduiXoXObCnboWPhSTBZTqV3NlvLKeSl2wcKiEr+u5GKuxsjfp68gVNFK+aLLJcJhKk4up0LSrXP0owQ3SyoBVOGNPw3bJtftyFw= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1725505961; c=relaxed/simple; bh=d8AhDdoglvtooKQv+WxQt6tXKFyK2xLVDySG8cEQWCU=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=DHY87y0ft0fMIckEkMcIoa1D8RIIu3GQF/voj4KXzpLcFZ1jb1JyW09IIQiEh6Rp8rR45jAAk4KPqrc/zFUn4+bwVkdYCu5/yW1eeCtFyEz1BK4N9l4BsCMqv71Kmax99FoHwF2RRZZU/aihfFicOZ6XcG8osUT3UrY8umC6A0M= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=gcfQgR0U; arc=none smtp.client-ip=209.85.160.176 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="gcfQgR0U" Received: by mail-qt1-f176.google.com with SMTP id d75a77b69052e-456855afe0fso1589621cf.3; Wed, 04 Sep 2024 20:12:39 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1725505958; x=1726110758; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=W4yLmSdW1x7Wh/eU1K+nbRedbO4GPtqk0jcElDx/XVc=; b=gcfQgR0UcRWgxLwYnAqX0YoU6ksmLiE2k/SSiQKvfLytDVVGyS6XQQISsQr4UZsr+Q sJIMbyhU5HF4vbtdV/QkqxCKVijgCOvrL1vtB6jKOJYI37uJF5mACs0MDWN4gB7aAP2H cR7bd473enrdaZ1Jo/pgBKrOjovkNx3dffH7oCYbCVE812QyM/JTinN4dpyDePG1ys/6 kRqji8ASU0IrlmmYdQv4KsdDBdw4Iza7DEYlT9q7lvwybC3UnGnewgJxlPlrMV07/6KT j4gOBqzhP9MGDru06p3tYVI7Q2T9kmyq2vYZVIKbFlusgcbiMPnqwM+Azke3YSW2QAun GE0A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1725505958; x=1726110758; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=W4yLmSdW1x7Wh/eU1K+nbRedbO4GPtqk0jcElDx/XVc=; b=Ot1bRKyzU1IX0qT0WkwNGyOnC+K6NrxUYme3cJT0xcRPpuxgh2oRCSUbDEwKY3tasw HSIPX7GEyrNBnPqx5lVTIYkE25S0NnTrdNUD9vf1vWKke5haHXUnX4Mz1WPuSoEjbJsY CCuncbPef5uOir+vtx9LBLVfo9Y/n2DzIf1cEYeCELnoVy0lOZ4HxV8bXu98UKY4+Kcj HoUPnZ+HgU87H6l93THQWHy/ie2uoyUo0c+lrTzyC/ixTVtXarTkkrjbYpg4bs00duvC 53nlRsVZuDNj9DScd9HZNc0rGnSdEDtuRp80hWxOHZpwOOyHFoKOu+h9BNLNDaMzPtmb vVmA== X-Forwarded-Encrypted: i=1; AJvYcCXDoQnqwFbPV06sVQQV3Tad1mljFUJYrhkE5JsVmLO6N/ZLML7nBnt8sdqWMIckNh4vgzHZOHbElGEEPIzWPDs=@vger.kernel.org X-Gm-Message-State: AOJu0YzgnkSzeeKfpiRsWQvt3ROIPqTSiHlxmMOTousenhtyB+IdtWR3 G9fgkLad4k7JQV/3YsCRnfL8Tc+mXTd68h+d5G70KD7ETaGHBsJvv0i1yA== X-Google-Smtp-Source: AGHT+IHAH73LKizmkuvJqRtgG+tG5N5ez7QifCdaqkHv2x+zT6oGCWFBRTxgKvneVpHT7GFDIn3ucQ== X-Received: by 2002:ac8:7f84:0:b0:457:e16a:b065 with SMTP id d75a77b69052e-457e16ab29cmr107252061cf.19.1725505958178; Wed, 04 Sep 2024 20:12:38 -0700 (PDT) Received: from willemb.c.googlers.com.com (193.132.150.34.bc.googleusercontent.com. [34.150.132.193]) by smtp.gmail.com with ESMTPSA id d75a77b69052e-45801a153f0sm3819611cf.12.2024.09.04.20.12.37 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 04 Sep 2024 20:12:37 -0700 (PDT) From: Willem de Bruijn To: netdev@vger.kernel.org Cc: davem@davemloft.net, kuba@kernel.org, edumazet@google.com, pabeni@redhat.com, ncardwell@google.com, shuah@kernel.org, linux-kselftest@vger.kernel.org, fw@strlen.de, Willem de Bruijn Subject: [PATCH net-next 1/2] selftests: support interpreted scripts with ksft_runner.sh Date: Wed, 4 Sep 2024 23:07:02 -0400 Message-ID: <20240905031233.1528830-2-willemdebruijn.kernel@gmail.com> X-Mailer: git-send-email 2.46.0.469.g59c65b2a67-goog In-Reply-To: <20240905031233.1528830-1-willemdebruijn.kernel@gmail.com> References: <20240905031233.1528830-1-willemdebruijn.kernel@gmail.com> Precedence: bulk X-Mailing-List: netdev@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Patchwork-Delegate: kuba@kernel.org From: Willem de Bruijn Support testcases that are themselves not executable, but need an interpreter to run them. If a test file is not executable, but an executable file ksft_runner.sh exists in the TARGET dir, kselftest will run ./ksft_runner.sh ./$BASENAME_TEST Packetdrill may add hundreds of packetdrill scripts for testing. These scripts must be passed to the packetdrill process. Have kselftest run each test directly, as it already solves common runner requirements like parallel execution and isolation (netns). A previous RFC added a wrapper in between, which would have to reimplement such functionality. Link: https://lore.kernel.org/netdev/66d4d97a4cac_3df182941a@willemb.c.googlers.com.notmuch/T/ Signed-off-by: Willem de Bruijn --- tools/testing/selftests/kselftest/runner.sh | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/tools/testing/selftests/kselftest/runner.sh b/tools/testing/selftests/kselftest/runner.sh index 74954f6a8f94b..2c3c58e65a419 100644 --- a/tools/testing/selftests/kselftest/runner.sh +++ b/tools/testing/selftests/kselftest/runner.sh @@ -111,8 +111,11 @@ run_one() stdbuf="/usr/bin/stdbuf --output=L " fi eval kselftest_cmd_args="\$${kselftest_cmd_args_ref:-}" - cmd="$stdbuf ./$BASENAME_TEST $kselftest_cmd_args" - if [ ! -x "$TEST" ]; then + if [ -x "$TEST" ]; then + cmd="$stdbuf ./$BASENAME_TEST $kselftest_cmd_args" + elif [ -x "./ksft_runner.sh" ]; then + cmd="$stdbuf ./ksft_runner.sh ./$BASENAME_TEST" + else echo "# Warning: file $TEST is not executable" if [ $(head -n 1 "$TEST" | cut -c -2) = "#!" ] From patchwork Thu Sep 5 03:07:03 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Willem de Bruijn X-Patchwork-Id: 13791657 X-Patchwork-Delegate: kuba@kernel.org Received: from mail-vk1-f181.google.com (mail-vk1-f181.google.com [209.85.221.181]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 3CDEA42AA2; Thu, 5 Sep 2024 03:12:40 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.221.181 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1725505962; cv=none; b=VeT21Z1YvGVjWiB+BnIjf/h/e127kl2o2rYJ7dNFueQY3X34+Nuoo+f/8NcIqCvE3DXGnyNPf9qBnEqe4HmbruW24momOirQ+9o7oBqmSCOIhf44zkf7EssXXqZMhqouxHCKtoaXbUr2KxqOEoBLoIXR+XF4JJXEB1wO79ho8Jo= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1725505962; c=relaxed/simple; bh=e4kqL7Hw0VXuFrEHQ5u5S5s0rxgo03NtGfh4E8DCcSY=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=oIpsO3H7T4wjSVuUVavp0qfko9QfHZ/jzIc35uiQmekMaDdLOT7ScyCRxFsxTg4iHDpCOhc9baOTh+8BGD4Xxjt7tvN7tUd1HKEeosIsERsaOrhvLjiaB95FywVsLnmb53tebbgDTnmAPrtALU1a62ypDpHwUZRvoeQlPiYWq44= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=hQxSNcux; arc=none smtp.client-ip=209.85.221.181 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="hQxSNcux" Received: by mail-vk1-f181.google.com with SMTP id 71dfb90a1353d-4fcf4ae95dbso121970e0c.0; Wed, 04 Sep 2024 20:12:40 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1725505959; x=1726110759; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=/qefVb86hilWABFHmKbSeavsOvYhWalW/io0KUr/hVU=; b=hQxSNcuxitmEifjcvCq0WiEFYfF6rtw01eJwKCAZmjdJuZhCtotPSxA8z3no8shksF IpiOxVaiwWpNdBiTgXy8DMqvHlljFrDpp2ZRXT05eG/EqTjiOCF1hsw40s+u/wiJkww6 TDK2DMBCW2aID+qfLuz0jl9xMM5ajyGDf9Wmn+SV0S11YcHEwSeBL0iCKiL28oJRKSRG aJnAqScGjQqT9HDI+/THZ81T1x+kCvzetGp0DIjX7m5At+BfTSHbepsMGJOW8tfo5hey jbrPTwla3A+H7k7pI8VyNtcvTFgEA8BlADT3G1u+bNp8VjutYngjo/LNXkQrMBOyCCK/ DztQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1725505959; x=1726110759; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=/qefVb86hilWABFHmKbSeavsOvYhWalW/io0KUr/hVU=; b=bciFgR2uBxTSwj0y2gUQTblTuzhiwLGha3jxq0FMxR+gOaPMaWFiBmUF9mlnkEy29Y kfpHzxFVEuhdU31kSnWyY4cQYrbdr6fYXfaYTkSTALHMDALrHTdtCy9Tp+AeLBX87ywa KV6rDkyzAtJsIBfTAZU3iYZ3GPOU3tii083laD3mf9LVPrAZ3TKinmTNyX8OiNDvG4cX YZTmMP4+OLJKlc9MCBf498K8UbJXcK5CWpr37NXD5/6BIsoj8xaXLatqW6GJUA//egfe HKry2P8OdBOGTSSUFOqqVK7+0R83qeJhMgsH+f1rTOleWQhVyZhvIwE169dFJID0gxVe NqeQ== X-Forwarded-Encrypted: i=1; AJvYcCUcWUojZlNKb9iNb8nPP5wX4GKl9DvqLmw9tQJDrDXYh0SbILe2nEnG1sWDAyrSusfQBcSKFujFsSKV1QHhm78=@vger.kernel.org X-Gm-Message-State: AOJu0Yy6oec0/k1zmxwLKRNwQnRUu9HpPPvtJeHke0znqGiZ4B1CxQXL eJIZ1vDywW/sqCSxoC9qjP5lYdvBw5iEzMxos9YCk0c2B2A7iweyadw11w== X-Google-Smtp-Source: AGHT+IGJZHldCmEsN6YcF6KrUCDsUxhynI/yfOhNoGMFUsQ290tj70pmC7862Gk2RNG/5lh/IOJQLg== X-Received: by 2002:a05:6122:221b:b0:4fc:e4f5:7f83 with SMTP id 71dfb90a1353d-5009b1305bfmr18321382e0c.9.1725505958908; Wed, 04 Sep 2024 20:12:38 -0700 (PDT) Received: from willemb.c.googlers.com.com (193.132.150.34.bc.googleusercontent.com. [34.150.132.193]) by smtp.gmail.com with ESMTPSA id d75a77b69052e-45801a153f0sm3819611cf.12.2024.09.04.20.12.38 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 04 Sep 2024 20:12:38 -0700 (PDT) From: Willem de Bruijn To: netdev@vger.kernel.org Cc: davem@davemloft.net, kuba@kernel.org, edumazet@google.com, pabeni@redhat.com, ncardwell@google.com, shuah@kernel.org, linux-kselftest@vger.kernel.org, fw@strlen.de, Willem de Bruijn Subject: [PATCH net-next 2/2] selftests/net: integrate packetdrill with ksft Date: Wed, 4 Sep 2024 23:07:03 -0400 Message-ID: <20240905031233.1528830-3-willemdebruijn.kernel@gmail.com> X-Mailer: git-send-email 2.46.0.469.g59c65b2a67-goog In-Reply-To: <20240905031233.1528830-1-willemdebruijn.kernel@gmail.com> References: <20240905031233.1528830-1-willemdebruijn.kernel@gmail.com> Precedence: bulk X-Mailing-List: netdev@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Patchwork-Delegate: kuba@kernel.org From: Willem de Bruijn Lay the groundwork to import into kselftests the over 150 packetdrill TCP/IP conformance tests on github.com/google/packetdrill. Florian recently added support for packetdrill tests in nf_conntrack, in commit a8a388c2aae49 ("selftests: netfilter: add packetdrill based conntrack tests"). This patch takes a slightly different approach. It relies on ksft_runner.sh to run every *.pkt file in the directory. Any future imports of packetdrill tests should require no additional coding. Just add the *.pkt files. Initially import only two features/directories from github. One with a single script, and one with two. This was the only reason to pick tcp/inq and tcp/md5. The path replaces the directory hierarchy in github with a flat space of files: $(subst /,_,$(wildcard tcp/**/*.pkt)). This is the most straightforward option to integrate with kselftests. The Linked thread reviewed two ways to maintain the hierarchy: TEST_PROGS_RECURSE and PRESERVE_TEST_DIRS. But both introduce significant changes to kselftest infra and with that risk to existing tests. Implementation notes: - restore alphabetical order when adding the new directory to tools/testing/selftests/Makefile - imported *.pkt files and support verbatim from the github project, except for - update `source ./defaults.sh` path (to adjust for flat dir) - add SPDX headers - remove one author statement - Acknowledgment: drop an e (checkpatch) Tested: make -C tools/testing/selftests \ TARGETS=net/packetdrill \ run_tests make -C tools/testing/selftests \ TARGETS=net/packetdrill \ install INSTALL_PATH=$KSFT_INSTALL_PATH # in virtme-ng export KSELFTEST_PKT_INTERP=./packetdrill_ksft.sh ./run_kselftest.sh -c net/packetdrill ./run_kselftest.sh -t net/packetdrill:tcp_inq_client.pkt Link: https://lore.kernel.org/netdev/20240827193417.2792223-1-willemdebruijn.kernel@gmail.com/ Signed-off-by: Willem de Bruijn --- Changes: - RFC -> v1 - replace custom runner with ksft_runner.sh (previous patch in series) and ktap_helpers.sh - flatten the github tcp/**/*.pkt directory structure - add config for MD5 dependency - drop unused set_sysctls.py --- tools/testing/selftests/Makefile | 5 +- .../selftests/net/packetdrill/Makefile | 9 +++ .../testing/selftests/net/packetdrill/config | 1 + .../selftests/net/packetdrill/defaults.sh | 63 +++++++++++++++++++ .../selftests/net/packetdrill/ksft_runner.sh | 41 ++++++++++++ .../net/packetdrill/tcp_inq_client.pkt | 51 +++++++++++++++ .../net/packetdrill/tcp_inq_server.pkt | 51 +++++++++++++++ .../tcp_md5_md5-only-on-client-ack.pkt | 28 +++++++++ 8 files changed, 247 insertions(+), 2 deletions(-) create mode 100644 tools/testing/selftests/net/packetdrill/Makefile create mode 100644 tools/testing/selftests/net/packetdrill/config create mode 100755 tools/testing/selftests/net/packetdrill/defaults.sh create mode 100755 tools/testing/selftests/net/packetdrill/ksft_runner.sh create mode 100644 tools/testing/selftests/net/packetdrill/tcp_inq_client.pkt create mode 100644 tools/testing/selftests/net/packetdrill/tcp_inq_server.pkt create mode 100644 tools/testing/selftests/net/packetdrill/tcp_md5_md5-only-on-client-ack.pkt diff --git a/tools/testing/selftests/Makefile b/tools/testing/selftests/Makefile index a5f1c0c27dff9..3b7df54773170 100644 --- a/tools/testing/selftests/Makefile +++ b/tools/testing/selftests/Makefile @@ -65,10 +65,11 @@ TARGETS += net/af_unix TARGETS += net/forwarding TARGETS += net/hsr TARGETS += net/mptcp -TARGETS += net/openvswitch -TARGETS += net/tcp_ao TARGETS += net/netfilter +TARGETS += net/openvswitch +TARGETS += net/packetdrill TARGETS += net/rds +TARGETS += net/tcp_ao TARGETS += nsfs TARGETS += perf_events TARGETS += pidfd diff --git a/tools/testing/selftests/net/packetdrill/Makefile b/tools/testing/selftests/net/packetdrill/Makefile new file mode 100644 index 0000000000000..870f7258dc8d7 --- /dev/null +++ b/tools/testing/selftests/net/packetdrill/Makefile @@ -0,0 +1,9 @@ +# SPDX-License-Identifier: GPL-2.0 + +TEST_INCLUDES := ksft_runner.sh \ + defaults.sh \ + ../../kselftest/ktap_helpers.sh + +TEST_PROGS := $(wildcard *.pkt) + +include ../../lib.mk diff --git a/tools/testing/selftests/net/packetdrill/config b/tools/testing/selftests/net/packetdrill/config new file mode 100644 index 0000000000000..b92ad2fb56b63 --- /dev/null +++ b/tools/testing/selftests/net/packetdrill/config @@ -0,0 +1 @@ +CONFIG_TCP_MD5SIG=y diff --git a/tools/testing/selftests/net/packetdrill/defaults.sh b/tools/testing/selftests/net/packetdrill/defaults.sh new file mode 100755 index 0000000000000..1095a7b22f44d --- /dev/null +++ b/tools/testing/selftests/net/packetdrill/defaults.sh @@ -0,0 +1,63 @@ +#!/bin/bash +# SPDX-License-Identifier: GPL-2.0 +# +# Set standard production config values that relate to TCP behavior. + +# Flush old cached data (fastopen cookies). +ip tcp_metrics flush all > /dev/null 2>&1 + +# TCP min, default, and max receive and send buffer sizes. +sysctl -q net.ipv4.tcp_rmem="4096 540000 $((15*1024*1024))" +sysctl -q net.ipv4.tcp_wmem="4096 $((256*1024)) 4194304" + +# TCP timestamps. +sysctl -q net.ipv4.tcp_timestamps=1 + +# TCP SYN(ACK) retry thresholds +sysctl -q net.ipv4.tcp_syn_retries=5 +sysctl -q net.ipv4.tcp_synack_retries=5 + +# TCP Forward RTO-Recovery, RFC 5682. +sysctl -q net.ipv4.tcp_frto=2 + +# TCP Selective Acknowledgements (SACK) +sysctl -q net.ipv4.tcp_sack=1 + +# TCP Duplicate Selective Acknowledgements (DSACK) +sysctl -q net.ipv4.tcp_dsack=1 + +# TCP FACK (Forward Acknowldgement) +sysctl -q net.ipv4.tcp_fack=0 + +# TCP reordering degree ("dupthresh" threshold for entering Fast Recovery). +sysctl -q net.ipv4.tcp_reordering=3 + +# TCP congestion control. +sysctl -q net.ipv4.tcp_congestion_control=cubic + +# TCP slow start after idle. +sysctl -q net.ipv4.tcp_slow_start_after_idle=0 + +# TCP RACK and TLP. +sysctl -q net.ipv4.tcp_early_retrans=4 net.ipv4.tcp_recovery=1 + +# TCP method for deciding when to defer sending to accumulate big TSO packets. +sysctl -q net.ipv4.tcp_tso_win_divisor=3 + +# TCP Explicit Congestion Notification (ECN) +sysctl -q net.ipv4.tcp_ecn=0 + +sysctl -q net.ipv4.tcp_pacing_ss_ratio=200 +sysctl -q net.ipv4.tcp_pacing_ca_ratio=120 +sysctl -q net.ipv4.tcp_notsent_lowat=4294967295 > /dev/null 2>&1 + +sysctl -q net.ipv4.tcp_fastopen=0x70403 +sysctl -q net.ipv4.tcp_fastopen_key=a1a1a1a1-b2b2b2b2-c3c3c3c3-d4d4d4d4 + +sysctl -q net.ipv4.tcp_syncookies=1 + +# Override the default qdisc on the tun device. +# Many tests fail with timing errors if the default +# is FQ and that paces their flows. +tc qdisc add dev tun0 root pfifo + diff --git a/tools/testing/selftests/net/packetdrill/ksft_runner.sh b/tools/testing/selftests/net/packetdrill/ksft_runner.sh new file mode 100755 index 0000000000000..2f62caccbbbc5 --- /dev/null +++ b/tools/testing/selftests/net/packetdrill/ksft_runner.sh @@ -0,0 +1,41 @@ +#!/bin/bash +# SPDX-License-Identifier: GPL-2.0 + +source "$(dirname $(realpath $0))/../../kselftest/ktap_helpers.sh" + +readonly ipv4_args=('--ip_version=ipv4 ' + '--local_ip=192.168.0.1 ' + '--gateway_ip=192.168.0.1 ' + '--netmask_ip=255.255.0.0 ' + '--remote_ip=192.0.2.1 ' + '-D CMSG_LEVEL_IP=SOL_IP ' + '-D CMSG_TYPE_RECVERR=IP_RECVERR ') + +readonly ipv6_args=('--ip_version=ipv6 ' + '--mtu=1520 ' + '--local_ip=fd3d:0a0b:17d6::1 ' + '--gateway_ip=fd3d:0a0b:17d6:8888::1 ' + '--remote_ip=fd3d:fa7b:d17d::1 ' + '-D CMSG_LEVEL_IP=SOL_IPV6 ' + '-D CMSG_TYPE_RECVERR=IPV6_RECVERR ') + +if [ $# -ne 1 ]; then + ktap_exit_fail_msg "usage: $0