From patchwork Thu Aug 1 16:23:59 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Petr Machata X-Patchwork-Id: 13750710 Received: from NAM02-SN1-obe.outbound.protection.outlook.com (mail-sn1nam02on2058.outbound.protection.outlook.com [40.107.96.58]) (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 A11E21B3742; Thu, 1 Aug 2024 16:25:10 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.96.58 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1722529512; cv=fail; b=D5wV36DYme2IDQyzvjjMR099tajynzy4PRw5yjmySeSvAYdTEBOwurSUj9NJvdpr8OnQzYTse7K40gIBw2F+Wy/kSTXNuDh1kOPI7vebkwtRNptQ+7IhzX4Jrt4pQjQH6fAa1yEGS0KRRUg9vnE7f439fXDRmV9KvR8nr1EbO10= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1722529512; c=relaxed/simple; bh=YNV4SvynVtr6/xqamAuMs/yvNNhYhoGAzBEkwvzFueo=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=AV7R4y4Q6Y4R1ex/Q9wkW9XT3gnbBaKqqx/ZC0MXWXAEOxLyx35QKie6P/st0cFUaSWJVUElS41pIvZ5xmXoelzYISluS/ElxjyEP/bEdfyRW0304AgIfVNKctTkGh9/OKVabL38GMt6bql1lBm9jLwaKcug9jvMr8Qd/o6waxc= ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=nvidia.com; spf=fail smtp.mailfrom=nvidia.com; dkim=pass (2048-bit key) header.d=Nvidia.com header.i=@Nvidia.com header.b=nPQgHNaP; arc=fail smtp.client-ip=40.107.96.58 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=nvidia.com Authentication-Results: smtp.subspace.kernel.org; spf=fail smtp.mailfrom=nvidia.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=Nvidia.com header.i=@Nvidia.com header.b="nPQgHNaP" ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=pSx5Ln+aZY+srLDT+PAojCf24T41QktpVO8lOzz0GgC3tzbUXrAc1c1k92NLm1p6KT6s04qeUHSw1Msx+ydGdVSJIUQG6Qe/lzPE9KHcENmCWW4kxUr5DbDHPi5pUPC5tjqY6UKejHwABxOfNs/LzH8z2VqhbBXft8PPbW8DDPD4xBCnXTfVx1rRs/3ig4L1rSNGKFhEBozkRnQYaUZzofVoh+MwoWmoHebDqX7Pu2GHWckKlbiAUByBEQ1TlAz+vT1EcT5HpE/i+gDFgKTGKgA9s+fe/P1eIWbZMuKzD4Y0iFLyKI1zzz54oxdckwNKtfrqZrV2gwiQWDUvAmwYsw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=lowOvcp7Owz/4IMJ9jReg6SaHu5QgB7Herp48Bc24lQ=; b=rIAaV3rGKR9N+tHufgN9W8Q5uWib4xGneXgkdRH0Fov5IilfXPPKqBP4Ox4ywD3z04GxHNh2dRyQ7BR0H6nuNq5oFDL8j2r+HXUkUVG9rqUB5H7NG00orHhkOfrtwJZcBR5e8F/4esU1Q07WZ4toEWtioEVTBCeWANqBFo8FyJRiIXgvUTtzqq4WdTd6iy+ttA58VzT3jGsMcb4tFSBg21P1C35j2Ghc609ohZTKPzCzixUzYe/nOxbjZ4k/DSS2Lyv9gGCpQtlSSJQOz5AaHrd1P/AOCLNpem74+cID8BvSevqy+VIZEj48blMQlzYlQcLij7WmXJEXnNNlEgWczA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 216.228.117.161) smtp.rcpttodomain=davemloft.net smtp.mailfrom=nvidia.com; dmarc=pass (p=reject sp=reject pct=100) action=none header.from=nvidia.com; dkim=none (message not signed); arc=none (0) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=Nvidia.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=lowOvcp7Owz/4IMJ9jReg6SaHu5QgB7Herp48Bc24lQ=; b=nPQgHNaPxrIGr8+xVZdg7mJ0DLpkHo8W4xFFDr/jXaG60NEMFjnLKCfdbufHTYHrBz3WOgKqr7/xnkxWK9jEHbQPcAlp+EQbObtOVYmE/4q1doSgZ2icfC0rKHBbZy8os04zdF1SQOdQkDGIT0k1nf1BU0yiL3BP3g9U1Sosivsf/Hz0Vteo7IIhEejWLnHyi1cTH5yRSgrcgjlboGy2dNRkrB+Z52qOpFytsbblULF9ajcuy5/YIYhkJ9FEuHwwjGSo3Tyo3QsumNTn8EK5QNyaLnp4coCZPDJl7nK0bdnBDkmv3QTjX0bD34aLhs9XMJST4rz/8jXyY7cZLnzcLg== Received: from BL1PR13CA0333.namprd13.prod.outlook.com (2603:10b6:208:2c6::8) by DS0PR12MB7825.namprd12.prod.outlook.com (2603:10b6:8:14d::13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7807.27; Thu, 1 Aug 2024 16:25:07 +0000 Received: from BN2PEPF000044A9.namprd04.prod.outlook.com (2603:10b6:208:2c6:cafe::77) by BL1PR13CA0333.outlook.office365.com (2603:10b6:208:2c6::8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7828.21 via Frontend Transport; Thu, 1 Aug 2024 16:25:07 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 216.228.117.161) smtp.mailfrom=nvidia.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=nvidia.com; Received-SPF: Pass (protection.outlook.com: domain of nvidia.com designates 216.228.117.161 as permitted sender) receiver=protection.outlook.com; client-ip=216.228.117.161; helo=mail.nvidia.com; pr=C Received: from mail.nvidia.com (216.228.117.161) by BN2PEPF000044A9.mail.protection.outlook.com (10.167.243.103) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7828.19 via Frontend Transport; Thu, 1 Aug 2024 16:25:06 +0000 Received: from rnnvmail201.nvidia.com (10.129.68.8) by mail.nvidia.com (10.129.200.67) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1544.4; Thu, 1 Aug 2024 09:24:52 -0700 Received: from fedora.mtl.com (10.126.230.35) by rnnvmail201.nvidia.com (10.129.68.8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1544.4; Thu, 1 Aug 2024 09:24:47 -0700 From: Petr Machata To: "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , CC: Ido Schimmel , Petr Machata , "David Ahern" , Donald Sharp , , Shuah Khan , Subject: [PATCH net-next 3/6] selftests: router_mpath: Sleep after MZ Date: Thu, 1 Aug 2024 18:23:59 +0200 Message-ID: X-Mailer: git-send-email 2.45.2 In-Reply-To: References: Precedence: bulk X-Mailing-List: linux-kselftest@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-ClientProxiedBy: rnnvmail202.nvidia.com (10.129.68.7) To rnnvmail201.nvidia.com (10.129.68.8) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: BN2PEPF000044A9:EE_|DS0PR12MB7825:EE_ X-MS-Office365-Filtering-Correlation-Id: 955dd238-20bb-4f45-1187-08dcb246814b X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|36860700013|1800799024|82310400026|376014; X-Microsoft-Antispam-Message-Info: 19womOp4Gm4V2i0ghj8PUeY37fGewu9rjEo1v76eBQKcVNN397xV8ZwNBjLx6FOCEFt7B9Ry3fXDkEjEERx0zHrRHUgV5Wx4PJMp/SqRCDXGdgLq7FOYtWbE6F4xOJdRC+yQ8cn7gc/zq4u7Q3l6T7xtRosxcffhMftAalsRpUrPfumlLQWKPQL9xRLwTi8vTPCdOHMVWefrSh6/stf679DUK8nY184tRYi1TLNNJVwLTEIgIAARMXQr+2wyrKnwV1L1UhcHc5tD4YEKRjUlSk3ZIE/3rqRnhU62dKucx+wyLi2rro0tt+iNjY/l/teAOh1XXWmwFUor7C4pxCzdk70jTZ+rbldXEbd+TCFgZUKE2YDgeeH4C2Yq3nCfI/9m2Iz62b7lhFgAyspM9ucWHti/affk0VWMhsgjHD5K94YsjVfb91eYksX5aEliis4SQpfY0nQk0apwa91TAw8/m0oGcs5GYc1nF7X1Rm5YhjQbJLCpOgtaPbBnvxo0hvl8Fjyo7rawyyj+9lBmIyEWQJciMHlE5dMCKvSWLNzTrnzsaZfToNeVY53mEBMmLTaJvWlUnHpR6svLzPQ+XAPESg9Xf7dzVRYCu2GBAovDArwKSA7GrWbReJOAZuy3ukKT2lOTNSdDjrqU4U/8Q6KpNzfFp/2cpF+z9D0mfYM2chd8gVTtnNYYIWguqvKTWbemqQStgXnKpHkoWOfUfzhSv+WGtHQv3yyXSY9oqhmPXwFPg9THDlwFKsxmJojl90T69cQhV95gGrFBV6ZO+JR7DCAf73N3DZpakxTmWXWvqrCa8f2nJsy4pPBlx1w8FtuogRP1la/wuSH7t7LTFs15d5RNhYWSsC4Jzd8z6d1v97FZeDYmj3Q8K1glmappaBxI6HhxUDYBQV9JUCwHJsXxaVYLF1wgC9fhjny3t19SFvFahCuXIYN5Nue+MImxK8GsBVaJyD+Qhi0AE0FfoM7EYNmv+tNUfQSqtLbc07ztVZ3s2Ns4LI5vAQ35No0Sv4NSGV/xsnG+bvb8l9/iWTRhDZiJGM4yIN2I57Fzgb2R2TAYq2ZPSkE/M7KlzNUkURlJYY1MxcAbX/ppEnQtTzzfLZ/j9M2/lUVq1Z/jfzdPt2Ne5nxu5jdJV6MIYz+OsJvuw0pPZvPw48zJt9CvavJZYIS0pnbSJ7zI2RsTchrU6NkngcHAS5w2tWshQCyRd/I1kmlTg3Idk8h09HmkO7yt59HD8rZZgy2j+TiCZeAMkGngDS5RszGnMzJQnGz6Ij1sC2tLMZA67EEq5hY7ljpPnaeYYjp8WYkOpnD+roi8++BsdKTnNOtBguvXdsOJFJaeK+11njtnOxys2pk7l3w72dVGcRhP7sXh3LpHkt7svx34gS9d0Rg/na0gACzbYXkwF2gXUZCwo8snzqJi6xMqNAvEx4mkUcL1QjpDmqy4bTXUhJu/huX2j2IEhMHooW2+ X-Forefront-Antispam-Report: CIP:216.228.117.161;CTRY:US;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:mail.nvidia.com;PTR:dc6edge2.nvidia.com;CAT:NONE;SFS:(13230040)(36860700013)(1800799024)(82310400026)(376014);DIR:OUT;SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 01 Aug 2024 16:25:06.3746 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 955dd238-20bb-4f45-1187-08dcb246814b X-MS-Exchange-CrossTenant-Id: 43083d15-7273-40c1-b7db-39efd9ccc17a X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=43083d15-7273-40c1-b7db-39efd9ccc17a;Ip=[216.228.117.161];Helo=[mail.nvidia.com] X-MS-Exchange-CrossTenant-AuthSource: BN2PEPF000044A9.namprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DS0PR12MB7825 In the context of an offloaded datapath, it may take a while for the ip link stats to be updated. This causes the test to fail when MZ_DELAY is too low. Sleep after the packets are sent for the link stats to get up to date. Signed-off-by: Petr Machata Reviewed-by: Ido Schimmel --- tools/testing/selftests/net/forwarding/router_mpath_nh.sh | 2 ++ tools/testing/selftests/net/forwarding/router_mpath_nh_res.sh | 2 ++ tools/testing/selftests/net/forwarding/router_multipath.sh | 2 ++ 3 files changed, 6 insertions(+) diff --git a/tools/testing/selftests/net/forwarding/router_mpath_nh.sh b/tools/testing/selftests/net/forwarding/router_mpath_nh.sh index 2ba44247c60a..c5a30f8f55b5 100755 --- a/tools/testing/selftests/net/forwarding/router_mpath_nh.sh +++ b/tools/testing/selftests/net/forwarding/router_mpath_nh.sh @@ -243,6 +243,7 @@ multipath4_test() ip vrf exec vrf-h1 $MZ $h1 -q -p 64 -A 192.0.2.2 -B 198.51.100.2 \ -d $MZ_DELAY -t udp "sp=1024,dp=0-32768" + sleep 1 t1_rp12=$(link_stats_tx_packets_get $rp12) t1_rp13=$(link_stats_tx_packets_get $rp13) @@ -276,6 +277,7 @@ multipath6_test() $MZ $h1 -6 -q -p 64 -A 2001:db8:1::2 -B 2001:db8:2::2 \ -d $MZ_DELAY -t udp "sp=1024,dp=0-32768" + sleep 1 t1_rp12=$(link_stats_tx_packets_get $rp12) t1_rp13=$(link_stats_tx_packets_get $rp13) diff --git a/tools/testing/selftests/net/forwarding/router_mpath_nh_res.sh b/tools/testing/selftests/net/forwarding/router_mpath_nh_res.sh index cd9e346436fc..bd35fe8be9aa 100755 --- a/tools/testing/selftests/net/forwarding/router_mpath_nh_res.sh +++ b/tools/testing/selftests/net/forwarding/router_mpath_nh_res.sh @@ -244,6 +244,7 @@ multipath4_test() ip vrf exec vrf-h1 $MZ $h1 -q -p 64 -A 192.0.2.2 -B 198.51.100.2 \ -d $MZ_DELAY -t udp "sp=1024,dp=0-32768" + sleep 1 t1_rp12=$(link_stats_tx_packets_get $rp12) t1_rp13=$(link_stats_tx_packets_get $rp13) @@ -274,6 +275,7 @@ multipath6_l4_test() $MZ $h1 -6 -q -p 64 -A 2001:db8:1::2 -B 2001:db8:2::2 \ -d $MZ_DELAY -t udp "sp=1024,dp=0-32768" + sleep 1 t1_rp12=$(link_stats_tx_packets_get $rp12) t1_rp13=$(link_stats_tx_packets_get $rp13) diff --git a/tools/testing/selftests/net/forwarding/router_multipath.sh b/tools/testing/selftests/net/forwarding/router_multipath.sh index e2be354167a1..46f365b557b7 100755 --- a/tools/testing/selftests/net/forwarding/router_multipath.sh +++ b/tools/testing/selftests/net/forwarding/router_multipath.sh @@ -180,6 +180,7 @@ multipath4_test() ip vrf exec vrf-h1 $MZ $h1 -q -p 64 -A 192.0.2.2 -B 198.51.100.2 \ -d $MZ_DELAY -t udp "sp=1024,dp=0-32768" + sleep 1 t1_rp12=$(link_stats_tx_packets_get $rp12) t1_rp13=$(link_stats_tx_packets_get $rp13) @@ -217,6 +218,7 @@ multipath6_test() $MZ $h1 -6 -q -p 64 -A 2001:db8:1::2 -B 2001:db8:2::2 \ -d $MZ_DELAY -t udp "sp=1024,dp=0-32768" + sleep 1 t1_rp12=$(link_stats_tx_packets_get $rp12) t1_rp13=$(link_stats_tx_packets_get $rp13) From patchwork Thu Aug 1 16:24:00 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Petr Machata X-Patchwork-Id: 13750711 Received: from NAM12-DM6-obe.outbound.protection.outlook.com (mail-dm6nam12on2042.outbound.protection.outlook.com [40.107.243.42]) (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 A9B641B3742; Thu, 1 Aug 2024 16:25:18 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.243.42 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1722529520; cv=fail; b=qaiZV1BlPAT1I9wRuFO56+tE6vi3aWdtwbb9S9JGw1oXYERBUFK5u395XGqYE5aPLDyKVOf0BmdRvr7XYn3QjW0mUeSA7OhwZlQPQCoekfAS0/i8Af96fAQXd5sgI/jqQEEWwAEINmVU1YW5slM+bw9WhAbWUSrWupcW7XMzzSE= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1722529520; c=relaxed/simple; bh=2pGCJWyiqC0QBQ2fAxEs0sQHMwX2/s0wo+M5GXZVuT8=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=DoB0cl113txKXl5YfMgQImAZx9K2D8Gy8jFuKnfeNZvLyojH6wSh7VAqGIQNroxnpYDVnmaBH6CjOOEgGlPiwHINPE9iMT9y5pq7DG+Yxgs3gvvnIQRAhYm+bbbtfmz+IBGbWVywKe6PJqvHaTCzar49wYU0lI/OmD5oFUv4Gbc= ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=nvidia.com; spf=fail smtp.mailfrom=nvidia.com; dkim=pass (2048-bit key) header.d=Nvidia.com header.i=@Nvidia.com header.b=YoztbcGd; arc=fail smtp.client-ip=40.107.243.42 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=nvidia.com Authentication-Results: smtp.subspace.kernel.org; spf=fail smtp.mailfrom=nvidia.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=Nvidia.com header.i=@Nvidia.com header.b="YoztbcGd" ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=ySxsA/n5Upn04hpw6yFwTKV0PwncEowhPL3pwDUr13VB6kbvaLLn5g2ewxJpYj72MSnWZvxzH/YPIDsyE8Z60e8BTTBHNEvJ6zW2uyiG2iZNIErh52v6nird/CQ3J26vkn8j2jaBOxQ+8K8E1SQPb35dZfgSAir03/IZjIVFyvFRlhvVC5YfjCrwAlxf/qOtZULvlnjx2Ok/KB/x1nLb3u7S5F0HipvAnxITnABm1jXE9fEM+KEtilbt78XwgcLcdaCJlrQIBc+Khj+Wz3c9b+bWUOcvq+To/Hx3sAGb9YMvRkaPz8RvriykB9rfwXcuaGbxTsRM3mCY+R1BCcaxgg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=Lt7A39m/g2wA4s+2utowuXDlgRp/tzcbPSdFdKbNH+s=; b=Gj10V9R0AzD6+R5LyDTB+1pEi4aCa8kJ/WbEn0UDpylE98khKTSFzqP4V8a3/Y+uc6xW1j42fmXj6rBcXUF0vGa8wxN0/CSt/+mV2QMD2GcqMEuwkXQkQcP1dqOAohkRMYSl9Pl7dJB71VMN0TFKTyomPNELKPAiiP/+E54+5w0bz7To1A/Oy9i3LJutzX4N94LN4lMO35gwKuEdfFUzP2yWqXEo7jogHtJYOsThgX3l6E7Cx60Tqysnp5CANhPBB+6RVLY3jVFaRVp1dlg0wA6LRFvZN8W4Xuk4xLTJ/z2wLRyeJopjofnVrW9k+c7AQCcrz1E6k1GrOeoNMV+g+A== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 216.228.117.161) smtp.rcpttodomain=davemloft.net smtp.mailfrom=nvidia.com; dmarc=pass (p=reject sp=reject pct=100) action=none header.from=nvidia.com; dkim=none (message not signed); arc=none (0) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=Nvidia.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=Lt7A39m/g2wA4s+2utowuXDlgRp/tzcbPSdFdKbNH+s=; b=YoztbcGdGNGJPRvkVZ7viYgYoBx0lIYKeSW8m0tglZdDzWJbbz2tyUPH/+5SgOHTIhR5vXUu30amWEwrnAR8/hGzKVl5M3805XSwzVAMbkcJnMXfs5pUbea8tc5r+N9Ax4/vVqX1cUDGqI2AmRYjcZ1Wb8ePFv3UsJsWms9VkUeEsB+1dcesTZyQc5EmTMh9iEzHmKNv2mv6P4cQwy+19rYrPjO1109L3c7Gsoik7BaZbL1OHzACW37YpA38bi3GeINcfrlbftVg2oPQ0jvM8NiWKXDPuBh0twsoOJ+QhTk1DRkhEQAi31MaWRXXcbq7pHnyrrhN+0U3ldy3YvVcFg== Received: from BN8PR03CA0031.namprd03.prod.outlook.com (2603:10b6:408:94::44) by PH0PR12MB8149.namprd12.prod.outlook.com (2603:10b6:510:297::7) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7828.22; Thu, 1 Aug 2024 16:25:15 +0000 Received: from BN2PEPF000044AB.namprd04.prod.outlook.com (2603:10b6:408:94:cafe::2) by BN8PR03CA0031.outlook.office365.com (2603:10b6:408:94::44) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7828.22 via Frontend Transport; Thu, 1 Aug 2024 16:25:15 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 216.228.117.161) smtp.mailfrom=nvidia.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=nvidia.com; Received-SPF: Pass (protection.outlook.com: domain of nvidia.com designates 216.228.117.161 as permitted sender) receiver=protection.outlook.com; client-ip=216.228.117.161; helo=mail.nvidia.com; pr=C Received: from mail.nvidia.com (216.228.117.161) by BN2PEPF000044AB.mail.protection.outlook.com (10.167.243.106) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7828.19 via Frontend Transport; Thu, 1 Aug 2024 16:25:14 +0000 Received: from rnnvmail201.nvidia.com (10.129.68.8) by mail.nvidia.com (10.129.200.67) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1544.4; Thu, 1 Aug 2024 09:24:57 -0700 Received: from fedora.mtl.com (10.126.230.35) by rnnvmail201.nvidia.com (10.129.68.8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1544.4; Thu, 1 Aug 2024 09:24:52 -0700 From: Petr Machata To: "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , CC: Ido Schimmel , Petr Machata , "David Ahern" , Donald Sharp , , Shuah Khan , Subject: [PATCH net-next 4/6] selftests: router_mpath_nh: Test 16-bit next hop weights Date: Thu, 1 Aug 2024 18:24:00 +0200 Message-ID: <9dcd5a4ff9583591c746d14eef4923e6deb5520a.1722519021.git.petrm@nvidia.com> X-Mailer: git-send-email 2.45.2 In-Reply-To: References: Precedence: bulk X-Mailing-List: linux-kselftest@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-ClientProxiedBy: rnnvmail202.nvidia.com (10.129.68.7) To rnnvmail201.nvidia.com (10.129.68.8) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: BN2PEPF000044AB:EE_|PH0PR12MB8149:EE_ X-MS-Office365-Filtering-Correlation-Id: dfd42e4a-a474-4f0f-ff23-08dcb24685fd X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|1800799024|376014|82310400026|36860700013; X-Microsoft-Antispam-Message-Info: 9lLcSUeMhCUK40A4gFKyCdwOv+8u468ESIyBSjpeGtyvod/CNSjWpTqMRavoOHpzmtsLNN/Tkq8fHVfoWh9HzqUmI6KCdcX0frikt1d+4sr6pwG5U5bPPMdmWfcxfCk72jpOcrNibgkEGYhQj9tRbMCCVV3mXLwInBQ72HQuG8BqywKdyxpOhCJ4h8VpLKHyXx4dnjCIHYEU7R+PNkxP9clsNZIS0pjerUuQ5DRWe7E8A77o8PahN0jajNl36yZNplBeFHjw4SFmmKMiecM+KIlWzBLjWe79lT/UtJRR5x8EuaheBIIguOnn/ypn4i83LvaL9QuG2Wqu5KG5d5sb4ubpKsbfxMTnz/v0i4Iu7A4zpa/VAGolvnaqybldtNKE7e1XSeNUWO28dd6Hn8YrvqAP5PMXThSMN8d4dWZSjfAXVytgkCAiJVuhsy6SI+9EERWBgsaEYvaFYTJ2IUZk79hYfU8od8Y7o3lfmFGqVz9To6OzQn/Rg9Sndp0ZdK1uQgzLps8oz7KVf0OzhNvYwjLk2c7i4NJvME9LBIo4wdErG+Jqs6/nys9VNXR+zFePLdn/TcjnV0KwJeBtYO0JvTsVazfPLwJQr8fABEgTa8RkwfB1BqSkNFxWP49spFgMPQQQiaVy0qsRYUaAHEWgX3hc9JGnI75K/70X4wHmBOhU1W7COjxRRhTl5KprugHcBlDrK47b1y9jK2H36mkazyF/DSWnxmiQnqwiF4aUoN6jILMHBOo5y2dX8K4g05VhZmX0dDNAQBXvSYJY0MbwWPhCkYZvT72b52/wgoLODAfuV+fSYTrbDhsRmTL6vW2pfVf4VmzJAdLvRD1h0Xq3hkhqGDGZQenWFLq/EgevbLrDzXAhnjqBy4pD+IiBn9jeLFk8dBLn0120qu8eyjoAWt7HM1NG7x5tWyTfDgMV2V2cofg5Yz/4uAgNfiBovnbJo28z07OsHz1ZKZAUUNiBvGlzB1E80EeFxoFh+Az9EoGjp84X2maFIiHffw6oMUy7UDXKtZMwtw4cmIxpX+4/2CR0xMj+oak/V2RCP/F3GThlWmokWN9q0iUmTGYq4g+CdlrZpwH7CsO+JXS6qGaR1IzJUck50/Z6WHvU5GzKi8MnlNctN94K83tz2pzMvmNfrp+S35xKlHzO4mYYoiOX8JmTTrxbWU83p16PRgWJYaX+ko9WQ136dBZyENXZTJLZUV8YB/v5DP3a5wTMG7xXRMQ3Iq7YGOdCQFy0FhLPkwe3RiI1zf0edpDWyjsW/0vtVBZX1T4LMx5AJPNiKsUBmuWc+x6yAkodwXtb4pwT1vqXeNgIN7XKsyib27vgdfu2sr4cQVd4Zp5brSYJdCbKL1jx5EunEOKOekFod8zvtO5d4oSVsFxVLTmJ4p6qYKuf3zrxb2k2jSXVgxtpp9v4Xk/0VF1AFSA2Jog6qjfB6mR8LYv6h/EFH66jY55nWsOh X-Forefront-Antispam-Report: CIP:216.228.117.161;CTRY:US;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:mail.nvidia.com;PTR:dc6edge2.nvidia.com;CAT:NONE;SFS:(13230040)(1800799024)(376014)(82310400026)(36860700013);DIR:OUT;SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 01 Aug 2024 16:25:14.3363 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: dfd42e4a-a474-4f0f-ff23-08dcb24685fd X-MS-Exchange-CrossTenant-Id: 43083d15-7273-40c1-b7db-39efd9ccc17a X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=43083d15-7273-40c1-b7db-39efd9ccc17a;Ip=[216.228.117.161];Helo=[mail.nvidia.com] X-MS-Exchange-CrossTenant-AuthSource: BN2PEPF000044AB.namprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: PH0PR12MB8149 Add tests that exercise full 16 bits of NH weight. To test the 255:65535, it is necessary to run more packets than for the other tests. On a debug kernel, the test can take up to a minute, therefore avoid the test when KSFT_MACHINE_SLOW. Signed-off-by: Petr Machata Reviewed-by: Ido Schimmel --- tools/testing/selftests/net/forwarding/lib.sh | 7 ++++ .../net/forwarding/router_mpath_nh.sh | 38 +++++++++++++++---- .../net/forwarding/router_mpath_nh_lib.sh | 13 +++++++ 3 files changed, 50 insertions(+), 8 deletions(-) diff --git a/tools/testing/selftests/net/forwarding/lib.sh b/tools/testing/selftests/net/forwarding/lib.sh index ff96bb7535ff..cb0fcd6f0293 100644 --- a/tools/testing/selftests/net/forwarding/lib.sh +++ b/tools/testing/selftests/net/forwarding/lib.sh @@ -509,6 +509,13 @@ xfail_on_slow() fi } +omit_on_slow() +{ + if [[ $KSFT_MACHINE_SLOW != yes ]]; then + "$@" + fi +} + xfail_on_veth() { local dev=$1; shift diff --git a/tools/testing/selftests/net/forwarding/router_mpath_nh.sh b/tools/testing/selftests/net/forwarding/router_mpath_nh.sh index c5a30f8f55b5..a7d8399c8d4f 100755 --- a/tools/testing/selftests/net/forwarding/router_mpath_nh.sh +++ b/tools/testing/selftests/net/forwarding/router_mpath_nh.sh @@ -40,6 +40,7 @@ ALL_TESTS=" ping_ipv4 ping_ipv6 multipath_test + multipath16_test ping_ipv4_blackhole ping_ipv6_blackhole nh_stats_test_v4 @@ -226,9 +227,11 @@ routing_nh_obj() multipath4_test() { - local desc="$1" - local weight_rp12=$2 - local weight_rp13=$3 + local desc=$1; shift + local weight_rp12=$1; shift + local weight_rp13=$1; shift + local ports=${1-sp=1024,dp=0-32768}; shift + local t0_rp12 t0_rp13 t1_rp12 t1_rp13 local packets_rp12 packets_rp13 @@ -242,7 +245,7 @@ multipath4_test() t0_rp13=$(link_stats_tx_packets_get $rp13) ip vrf exec vrf-h1 $MZ $h1 -q -p 64 -A 192.0.2.2 -B 198.51.100.2 \ - -d $MZ_DELAY -t udp "sp=1024,dp=0-32768" + -d $MZ_DELAY -t udp "$ports" sleep 1 t1_rp12=$(link_stats_tx_packets_get $rp12) @@ -259,9 +262,11 @@ multipath4_test() multipath6_test() { - local desc="$1" - local weight_rp12=$2 - local weight_rp13=$3 + local desc=$1; shift + local weight_rp12=$1; shift + local weight_rp13=$1; shift + local ports=${1-sp=1024,dp=0-32768}; shift + local t0_rp12 t0_rp13 t1_rp12 t1_rp13 local packets_rp12 packets_rp13 @@ -276,7 +281,7 @@ multipath6_test() t0_rp13=$(link_stats_tx_packets_get $rp13) $MZ $h1 -6 -q -p 64 -A 2001:db8:1::2 -B 2001:db8:2::2 \ - -d $MZ_DELAY -t udp "sp=1024,dp=0-32768" + -d $MZ_DELAY -t udp "$ports" sleep 1 t1_rp12=$(link_stats_tx_packets_get $rp12) @@ -315,6 +320,23 @@ multipath_test() multipath6_test "Weighted MP 11:45" 11 45 } +multipath16_test() +{ + check_nhgw16 104 || return + + log_info "Running 16-bit IPv4 multipath tests" + multipath4_test "65535:65535" 65535 65535 + multipath4_test "128:512" 128 512 + omit_on_slow \ + multipath4_test "255:65535" 255 65535 sp=1024-1026,dp=0-65535 + + log_info "Running 16-bit IPv6 multipath tests" + multipath6_test "65535:65535" 65535 65535 + multipath6_test "128:512" 128 512 + omit_on_slow \ + multipath6_test "255:65535" 255 65535 sp=1024-1026,dp=0-65535 +} + ping_ipv4_blackhole() { RET=0 diff --git a/tools/testing/selftests/net/forwarding/router_mpath_nh_lib.sh b/tools/testing/selftests/net/forwarding/router_mpath_nh_lib.sh index 2903294d8bca..507b2852dabe 100644 --- a/tools/testing/selftests/net/forwarding/router_mpath_nh_lib.sh +++ b/tools/testing/selftests/net/forwarding/router_mpath_nh_lib.sh @@ -117,3 +117,16 @@ __nh_stats_test_v6() $MZ -6 $h1 -A 2001:db8:1::2 -B 2001:db8:2::2 sysctl_restore net.ipv6.fib_multipath_hash_policy } + +check_nhgw16() +{ + local nhid=$1; shift + + ip nexthop replace id 9999 group "$nhid,65535" &>/dev/null + if (( $? )); then + log_test_skip "16-bit multipath tests" \ + "iproute2 or the kernel do not support 16-bit next hop weights" + return 1 + fi + ip nexthop del id 9999 ||: +} From patchwork Thu Aug 1 16:24:01 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Petr Machata X-Patchwork-Id: 13750712 Received: from NAM11-DM6-obe.outbound.protection.outlook.com (mail-dm6nam11on2070.outbound.protection.outlook.com [40.107.223.70]) (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 BB44A1B29CF; Thu, 1 Aug 2024 16:25:19 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.223.70 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1722529521; cv=fail; b=Bz/2XOPetTvvrdRSCagVShyVh0m9Wl+Qh7jQlQ+UIPw0HgyQiyaFy3GBAm96wpvPgpabiGD58EyLd8TJ6fUGA7FellG1jYPJ8P7mpIfAJz06eI2kuYZ3F6n9mkpIEQDNM7P0D3IH5esebHuFV2l2oAgLFf0/SZPCPKxMoSK0iY4= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1722529521; c=relaxed/simple; bh=RctU0eA9+EmIV37pfQ+scxV3pTzhUncIt1BoXc9SG+U=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=hkMst4aBXH/fbhNM24yqr4W/t7SDJa8mfOqHq2TshArK1pXMojfnGYZP/dXtCrNsrmuAWvoiG5Ciq7Xc+tCt0kny3jbmu2Zc13iewH8KK6de3AETtPZADaHra595pMl6IPJhX6YfvpNdgSj6/nli5DQp7sbMtsNRsBlmblfvMF0= ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=nvidia.com; spf=fail smtp.mailfrom=nvidia.com; dkim=pass (2048-bit key) header.d=Nvidia.com header.i=@Nvidia.com header.b=jjaTL77R; arc=fail smtp.client-ip=40.107.223.70 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=nvidia.com Authentication-Results: smtp.subspace.kernel.org; spf=fail smtp.mailfrom=nvidia.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=Nvidia.com header.i=@Nvidia.com header.b="jjaTL77R" ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=jAEgoJhyN/3FNfBfBye8eZ7h8k8ibsEQfe4GHeppAlFiq3AM0kzPFUWAKLm9npO/4awrk+6wIAViMSlnr8A9n4DCdtON+7i46R/ZeCta5mfmIx8FIuqQl/Pr9sZ9clomNgaKD8PhnTZ75kqcZ48RnlolSMQne3T+7IROjbdW5qL5zuse5zfhshjSDRiwwfsn+rPpZ3mh//R6h7w2H6FSe64e9G7hXzxnI94g1dAjX+Gd8G+P8lR4h5feqASHwpSRNKTO4GFtQ0r13LfJN3nsJW/ywi4Ibp3uzKgoRfp8A/k/lqlO1vE5Aq41g95ddHeQvT+YmzroPASFw1bELvXeLA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=as/eyFV872lUs3tUkcz7+AWGmcQqG4oDcQ0HkUo2mdE=; b=cP9aa7tM3JmkcQHZYF4PGdO8icQleHiuuWEWhAD1A9UwVEqfbSyiSeVM462qVeJgpgGmE243zINNcD2Si3c6P6LjsE8y6ZGfJPXVEZfC+d9sh69Q577xgrXLjE59VtKDYxI6kQ0c8mc5vBj4wNfgD0BDXTu7QZ7XNhF0UgTTQuxetTgT169HfPObSUPz1uII+xvR0OIOT3hrh1TLrab4zdd8zVjUVbRpzNNm+G36N+usaQASEeHnDVTLTtNY78XlkcvWzv9UBDQGL0ETlH6Yj6QwXcBiv5u6/pJVcxx9ZbI20aCtkaLn1o1M8wb6IJb5V6yBV7j/w41hM1jHdiny5g== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 216.228.117.160) smtp.rcpttodomain=davemloft.net smtp.mailfrom=nvidia.com; dmarc=pass (p=reject sp=reject pct=100) action=none header.from=nvidia.com; dkim=none (message not signed); arc=none (0) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=Nvidia.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=as/eyFV872lUs3tUkcz7+AWGmcQqG4oDcQ0HkUo2mdE=; b=jjaTL77RlpMbQpGjwtT+BUyUyO440gugawHXI8sPpJLj6WqIrUKJqo9mV07w2gcGMH7NDm6DCQl84w348e9mG2nfuEbiLm7VqCoaWt88bxO2WbihnVLkCrIT6OGEJLjueV0ZvPYY8Zn22HpSMcoQK4WWXSnXKrN/LC2MStd4JkdZIsA5Y4UbWghHmsP4N/EKXNrNMrCE/EF+BFlegZX9fkKr4olz3Kc2RwJ/0Vq54fIAkHO1a+4NpfV1e1HSKAKpByELN5+XCx91m3Stqvt4NEFbfphxtukdoczjQERXAnOSQMJmciUYX+xDB8hJlExMrXyFQ12Aybfy8ZyTj2kflQ== Received: from SJ0PR13CA0130.namprd13.prod.outlook.com (2603:10b6:a03:2c6::15) by DS0PR12MB8344.namprd12.prod.outlook.com (2603:10b6:8:fe::7) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7828.23; Thu, 1 Aug 2024 16:25:16 +0000 Received: from CO1PEPF000042AB.namprd03.prod.outlook.com (2603:10b6:a03:2c6:cafe::6e) by SJ0PR13CA0130.outlook.office365.com (2603:10b6:a03:2c6::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7849.7 via Frontend Transport; Thu, 1 Aug 2024 16:25:16 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 216.228.117.160) smtp.mailfrom=nvidia.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=nvidia.com; Received-SPF: Pass (protection.outlook.com: domain of nvidia.com designates 216.228.117.160 as permitted sender) receiver=protection.outlook.com; client-ip=216.228.117.160; helo=mail.nvidia.com; pr=C Received: from mail.nvidia.com (216.228.117.160) by CO1PEPF000042AB.mail.protection.outlook.com (10.167.243.40) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7828.19 via Frontend Transport; Thu, 1 Aug 2024 16:25:16 +0000 Received: from rnnvmail201.nvidia.com (10.129.68.8) by mail.nvidia.com (10.129.200.66) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1544.4; Thu, 1 Aug 2024 09:25:02 -0700 Received: from fedora.mtl.com (10.126.230.35) by rnnvmail201.nvidia.com (10.129.68.8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1544.4; Thu, 1 Aug 2024 09:24:57 -0700 From: Petr Machata To: "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , CC: Ido Schimmel , Petr Machata , "David Ahern" , Donald Sharp , , Shuah Khan , Subject: [PATCH net-next 5/6] selftests: router_mpath_nh_res: Test 16-bit next hop weights Date: Thu, 1 Aug 2024 18:24:01 +0200 Message-ID: X-Mailer: git-send-email 2.45.2 In-Reply-To: References: Precedence: bulk X-Mailing-List: linux-kselftest@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-ClientProxiedBy: rnnvmail202.nvidia.com (10.129.68.7) To rnnvmail201.nvidia.com (10.129.68.8) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: CO1PEPF000042AB:EE_|DS0PR12MB8344:EE_ X-MS-Office365-Filtering-Correlation-Id: fd720628-362e-4883-c5fb-08dcb2468712 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|376014|82310400026|1800799024|36860700013; X-Microsoft-Antispam-Message-Info: dR16R2R0VzXRjMu0jPes+/qN2V2zsCpSyAFbBHmeUw+jK6sVI9S9JmrA0mVfeY98f2jcC70HAuDv9JJrzAa5hinBlOI16CNrAs6T9RbotownxnL1Z4vvNPrCegiu9QunCq/kjZM+m5vmWEwOtHN+xZ89IwiGzGWIjRV/tpRzKr9v2Lg3Vf8H3RRCxDIaRA3w6xkb8MkhEzgjwl0tlsH4+CZ7ksEBGW+KUapO/YvEdL6K8wqRBeQOMr3VhX6cgyf4qbtuXKaOHsmLoSTrRsgixUVjU9tOGTA0Td2UJ82+N/8i10zo6zq1KNhKnHRrbLUy9e7JyzEliA9zplu4mN/SvKAf+5mZOMvkgIbiSpitDqTuAuEean2DS+pupfBp/R+ORK1rSvT6djOasmoWMycq6oMyyZunG4PrYozAfm1ObCTFnyg0tpAK1zDMP5FFj0t6w1G7ssuOIu8bGbSK47dvIwDoSh+uHpjpL1DDw+rxxoSJMSehDJwbWvEweJP0b3JoNmE4ZKNEAxCg+STZMTEZ2i+oBzJkrur68su1pPfm5Zr0bhxZ6yq4+m+hr6Dq8aClQHUMYnhIj/yOCwIP5uhCtEvib4fyuNLi6pzYeoUmKzx6Ka5zJYOUVNonFnQGwGeyt81xD7Qonoe9upbFlpPN/P+fUx90ZBdS412rrUfMJVR9msxs7afZZdWhs3yEd54e3M6RaKqHLu3wsHUdo7ehycBqi2EY8VQOiImyrn8qhygTlrv9t41BvzlABht/gQGe7IgCajXiAzq49XK/kXqgtzF5nfRtxMeQlTrrHEf7qqQ1YY5RvCPv3Ijza2mvz0lO9EmxgMYedN6KfRMDhrugTIs6Y4/I/O4MGEvpZSbZU2GhgUzMQPp4WEcZ1sO0w/6sFdsdSThWHJ11c7QlW6iGn9SZkpyfQETboyYXrC74IA5TJjnRloC5Xy72brM+DwL4WEXYHsBX8oDhdpQPWdmU9pR2GaibwqXg6Bjd0QUj4V3a04pD8IUEDQ96ojFWQJiIpmKPoFh3cKu4hN4xjJg6TRJAq5AmZ2xIu9Mjaaal27oY0LRkk9liv3p2tdWoUIv/XQ7nMV1aFrhfV/7WdWHOtymWdHdFqSvsIVirVi4Pf/fcMuW202ObLMR29R8D5vmHQWPrTNXBPvhDsTvamcNfBiH4r+KJuu0sjWfLYpeNZ0g4OqnJ+ic4cp3GqirG95TfnyEy1i3QJNghJ8h42qhK6E+ejUXdx0VImS6yM3DcOJtjEf6T/WCkgg00Lx5nqsY5uOhLJ53BjgrGR+QBUppKFBTv9fxtqEzkFreHlIZ7OKaePl3PleSwr4l3iN7S3dNfqsOZWXiEkP7hS4JwM9UpZ7x+i0/gySxvSOtOr2rLWDOhtRLj8biUul4V9ClvClVGU4U0LH0Ju96BjR0kggRTe1tnbc682/bsY6Eg9oT4iyeGTZXO0KtzjhLotEUTRDJW X-Forefront-Antispam-Report: CIP:216.228.117.160;CTRY:US;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:mail.nvidia.com;PTR:dc6edge1.nvidia.com;CAT:NONE;SFS:(13230040)(376014)(82310400026)(1800799024)(36860700013);DIR:OUT;SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 01 Aug 2024 16:25:16.2439 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: fd720628-362e-4883-c5fb-08dcb2468712 X-MS-Exchange-CrossTenant-Id: 43083d15-7273-40c1-b7db-39efd9ccc17a X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=43083d15-7273-40c1-b7db-39efd9ccc17a;Ip=[216.228.117.160];Helo=[mail.nvidia.com] X-MS-Exchange-CrossTenant-AuthSource: CO1PEPF000042AB.namprd03.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DS0PR12MB8344 Add tests that exercise full 16 bits of NH weight. Like in the previous patch, omit the 255:65535 test when KSFT_MACHINE_SLOW. Signed-off-by: Petr Machata Reviewed-by: Ido Schimmel --- .../net/forwarding/router_mpath_nh_res.sh | 56 ++++++++++++++++--- 1 file changed, 48 insertions(+), 8 deletions(-) diff --git a/tools/testing/selftests/net/forwarding/router_mpath_nh_res.sh b/tools/testing/selftests/net/forwarding/router_mpath_nh_res.sh index bd35fe8be9aa..88ddae05b39d 100755 --- a/tools/testing/selftests/net/forwarding/router_mpath_nh_res.sh +++ b/tools/testing/selftests/net/forwarding/router_mpath_nh_res.sh @@ -40,6 +40,7 @@ ALL_TESTS=" ping_ipv4 ping_ipv6 multipath_test + multipath16_test nh_stats_test_v4 nh_stats_test_v6 " @@ -228,9 +229,11 @@ routing_nh_obj() multipath4_test() { - local desc="$1" - local weight_rp12=$2 - local weight_rp13=$3 + local desc=$1; shift + local weight_rp12=$1; shift + local weight_rp13=$1; shift + local ports=${1-sp=1024,dp=0-32768}; shift + local t0_rp12 t0_rp13 t1_rp12 t1_rp13 local packets_rp12 packets_rp13 @@ -243,7 +246,7 @@ multipath4_test() t0_rp13=$(link_stats_tx_packets_get $rp13) ip vrf exec vrf-h1 $MZ $h1 -q -p 64 -A 192.0.2.2 -B 198.51.100.2 \ - -d $MZ_DELAY -t udp "sp=1024,dp=0-32768" + -d $MZ_DELAY -t udp "$ports" sleep 1 t1_rp12=$(link_stats_tx_packets_get $rp12) @@ -259,9 +262,11 @@ multipath4_test() multipath6_l4_test() { - local desc="$1" - local weight_rp12=$2 - local weight_rp13=$3 + local desc=$1; shift + local weight_rp12=$1; shift + local weight_rp13=$1; shift + local ports=${1-sp=1024,dp=0-32768}; shift + local t0_rp12 t0_rp13 t1_rp12 t1_rp13 local packets_rp12 packets_rp13 @@ -274,7 +279,7 @@ multipath6_l4_test() t0_rp13=$(link_stats_tx_packets_get $rp13) $MZ $h1 -6 -q -p 64 -A 2001:db8:1::2 -B 2001:db8:2::2 \ - -d $MZ_DELAY -t udp "sp=1024,dp=0-32768" + -d $MZ_DELAY -t udp "$ports" sleep 1 t1_rp12=$(link_stats_tx_packets_get $rp12) @@ -373,6 +378,41 @@ multipath_test() ip nexthop replace id 106 group 104,1/105,1 type resilient } +multipath16_test() +{ + check_nhgw16 104 || return + + log_info "Running 16-bit IPv4 multipath tests" + ip nexthop replace id 103 group 101/102 type resilient idle_timer 0 + + ip nexthop replace id 103 group 101,65535/102,65535 type resilient + multipath4_test "65535:65535" 65535 65535 + + ip nexthop replace id 103 group 101,128/102,512 type resilient + multipath4_test "128:512" 128 512 + + ip nexthop replace id 103 group 101,255/102,65535 type resilient + omit_on_slow \ + multipath4_test "255:65535" 255 65535 sp=1024-1026,dp=0-65535 + + ip nexthop replace id 103 group 101,1/102,1 type resilient + + log_info "Running 16-bit IPv6 L4 hash multipath tests" + ip nexthop replace id 106 group 104/105 type resilient idle_timer 0 + + ip nexthop replace id 106 group 104,65535/105,65535 type resilient + multipath6_l4_test "65535:65535" 65535 65535 + + ip nexthop replace id 106 group 104,128/105,512 type resilient + multipath6_l4_test "128:512" 128 512 + + ip nexthop replace id 106 group 104,255/105,65535 type resilient + omit_on_slow \ + multipath6_l4_test "255:65535" 255 65535 sp=1024-1026,dp=0-65535 + + ip nexthop replace id 106 group 104,1/105,1 type resilient +} + nh_stats_test_v4() { __nh_stats_test_v4 resilient From patchwork Thu Aug 1 16:24:02 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Petr Machata X-Patchwork-Id: 13750713 Received: from NAM11-DM6-obe.outbound.protection.outlook.com (mail-dm6nam11on2055.outbound.protection.outlook.com [40.107.223.55]) (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 3956D1B4C3D; Thu, 1 Aug 2024 16:25:31 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.223.55 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1722529537; cv=fail; b=KFuOEYDeYbaXJcM3QupGW+UerE8JvKP7CMQcVCBXZxCS6tPPOcsQY2UJmLItTBt3wzvJH3NZ2gp2e7XsDQOVbplKEYAosqVvtmNiiqUfE0yxAaPaVbYhMG1l1Vhe+CC3Bl8cFD1DCH4pGh9qkTsqg/r/7qIIhDOg5j9nAgnGUkY= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1722529537; c=relaxed/simple; bh=tv0iSH64v0IG4HbRIZsUC8d4ITJSf5yPJ329LRGahlk=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=e/jyuxCc6FuPD7+wHEavQbFp3Nt6S7gCP3VsnKHsypIfs+UV0P8saHOwyJPm46aeQ1BbcrCqKtGtbK7YzOcViiHBXa7IrXjdPvy/MzVjzAfzxNDnVWAGWhUwbBBFNpGJAlc7ZoHixDJz4lcuBQHeJ98uvKxJmDxCEVOlfUoqTn8= ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=nvidia.com; spf=fail smtp.mailfrom=nvidia.com; dkim=pass (2048-bit key) header.d=Nvidia.com header.i=@Nvidia.com header.b=HwNwv7ep; arc=fail smtp.client-ip=40.107.223.55 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=nvidia.com Authentication-Results: smtp.subspace.kernel.org; spf=fail smtp.mailfrom=nvidia.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=Nvidia.com header.i=@Nvidia.com header.b="HwNwv7ep" ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=QlZIK92SvUrgmoq8twEMUWpfU5n7Pw+73mnPmvVxfbqSYJ3dM6nQDutC737K9enFYHRVgxM8EC6GNayRHcEvGWB12J930vHvG6/yWq1omeR9kQifT04UARjBuS459uV8JJLAvy8Pk6ZBvTmC5bB4OXn9A9w/61ZdX3rVleZw5AKOiq/d+g+Ensi/wiD+XNVB8Lap+Xnr8cg2EjZ4ioJRTMQ8BytcbfhZNuI06JQlPLVXtQE+SRJ7am7SUoXjsp/wf0MI8oRxONFg+y5/AHrC9PH2Il05a4jxAK1J+4m2alRBWQt8GPcWHJSvoC7Ek9N5LGYApAG4Y4jjWTruQZHp4A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=ih8k17yJic6UTGeIlRDUMLxv6L8/nT3If/9igyh7TlU=; b=w5NhtZiu488my7sgddhWbo0IMdH3G4q0Ay774TvZtFCiR9RPbuao8AkzEl/zgyrnP9aJ2OlvEOmDjxfwoqjhRIZEqq8CydH1wtUM6FdFbyib06P793Ho4MYZnJqpmJGyTyK14OhnpwUU2yFptPhmpLNRK5X488LYqrIN/a/O5YVfc8t3vclZP176XaPCy2NXaDeZ7i410ZltGblftetANwdKU51o7j5icjf0rbWiw3dwRkln3L2KUaeD/55hIz0eMDfULXVyVQ3oJH9js+iavllgJ5SQDrK1g2kUagxU1Z2hGZvI67Uxnf5x6iXq2k3wDRs9oh/YlP/tSrCKQSUnXg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 216.228.117.161) smtp.rcpttodomain=davemloft.net smtp.mailfrom=nvidia.com; dmarc=pass (p=reject sp=reject pct=100) action=none header.from=nvidia.com; dkim=none (message not signed); arc=none (0) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=Nvidia.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=ih8k17yJic6UTGeIlRDUMLxv6L8/nT3If/9igyh7TlU=; b=HwNwv7ep/y7U5c4MsTP1OuiuVsBp7ybrNAuyDwbm3rjRAX/v4UX+JhvyYChZ46x0sNH0uT3Wrt700OZNrn5UeicXfa8Qz2qKKpVOdtj6gxvqe986KEzoJxFI2zRABPW5/eptYYcJY4TT/JT5Uree3CLg400wqyIdCFuisskhqXScv5B5+V/7kAmRGt57oQcFIyVRLGPO7SKEL5Cfp9+ZitbqPiVT3G81um/PdYMjQe5wxiGyk9RAy4lZTrBMAI5WCnE+h//VA9mTPl7O2JNwLQVCm8iw+KXsheOTYso7wNCoEUCnG4JWhVJca2roD5GuXAezhJXjTznjWi9wd+auSA== Received: from BN8PR03CA0033.namprd03.prod.outlook.com (2603:10b6:408:94::46) by CY8PR12MB7196.namprd12.prod.outlook.com (2603:10b6:930:58::12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7807.27; Thu, 1 Aug 2024 16:25:29 +0000 Received: from BN2PEPF000044AB.namprd04.prod.outlook.com (2603:10b6:408:94:cafe::97) by BN8PR03CA0033.outlook.office365.com (2603:10b6:408:94::46) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7828.22 via Frontend Transport; Thu, 1 Aug 2024 16:25:28 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 216.228.117.161) smtp.mailfrom=nvidia.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=nvidia.com; Received-SPF: Pass (protection.outlook.com: domain of nvidia.com designates 216.228.117.161 as permitted sender) receiver=protection.outlook.com; client-ip=216.228.117.161; helo=mail.nvidia.com; pr=C Received: from mail.nvidia.com (216.228.117.161) by BN2PEPF000044AB.mail.protection.outlook.com (10.167.243.106) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7828.19 via Frontend Transport; Thu, 1 Aug 2024 16:25:28 +0000 Received: from rnnvmail201.nvidia.com (10.129.68.8) by mail.nvidia.com (10.129.200.67) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1544.4; Thu, 1 Aug 2024 09:25:08 -0700 Received: from fedora.mtl.com (10.126.230.35) by rnnvmail201.nvidia.com (10.129.68.8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1544.4; Thu, 1 Aug 2024 09:25:03 -0700 From: Petr Machata To: "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , CC: Ido Schimmel , Petr Machata , "David Ahern" , Donald Sharp , , Shuah Khan , Subject: [PATCH net-next 6/6] selftests: fib_nexthops: Test 16-bit next hop weights Date: Thu, 1 Aug 2024 18:24:02 +0200 Message-ID: <25a1268c23bea0c95bed2521a6d709111730eccc.1722519021.git.petrm@nvidia.com> X-Mailer: git-send-email 2.45.2 In-Reply-To: References: Precedence: bulk X-Mailing-List: linux-kselftest@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-ClientProxiedBy: rnnvmail202.nvidia.com (10.129.68.7) To rnnvmail201.nvidia.com (10.129.68.8) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: BN2PEPF000044AB:EE_|CY8PR12MB7196:EE_ X-MS-Office365-Filtering-Correlation-Id: f4bd8f60-8fbe-41a7-70d9-08dcb2468e70 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|1800799024|82310400026|36860700013|376014; X-Microsoft-Antispam-Message-Info: zDa1gnaG2Zv1oJ8uwVXTrenm2ajOFBIfqd3ErPA+8qXJpsOfKX36YifQgEvbUlYxS9kEYToCLhzxHK6tN30igLe1eq8BUiHCrMD2tsxgoPab15ggsHb5hG3sc1/Ap4t3N+lFvDugr7R6bFSYPO9oYgtInpGszTUeK7OOt2k6OyIHFhg3tnvk1XcDwXyKfFW1TXCGT86Z2f+EkbDFuy9BChrvUYpvHvuA43BVJutHadOEv87XMdB78sH2VBAf4nMz1f9AQ+TXJ7AoV3H9RroPZaazTscK2IwKPT8FQnKlZ0voEvmYihwJhqf9mB22pT44t03QE/22bBhHtWOpm6Prm/Jgu0MpVWeY6eQyXXSp1NCtc3lZ811L95OsUs2vIVRKLlY/CVe/GHsCtUCI3w3hBGCsDSoOa+UvAmq2quz1UIQsTvH2LRz8IiYtk/g29JxJuKZSQkoxlYRAS6GA+6woxl9OdvnwUPIEgk2Xuk9TBRA40eRvi6j/XiGU12f6ft1c5kbtJ7J4YbYBQpLTxZaBzVjlj2MfSY/d3EIqy+UhtXu7y35xUQqDCK2JHZ/ah1/hINz+ObknCfEp7NYcVYjnZ2GUcRwFGYdrGeK9BD/x2Dghj75O4riJ0uCX9ApvLGU51ZvIBa/Wvchp2QjZ9/VU+xWFZmuBeKhlLk3Xk84bMIUbKegr0hJpVBsiuo+zyU5tomN6fvc8YmNVadMW4/DpwWRNRxuq7nZ+xB/9oExbaw00j8g8bjoMcY/lB682GKhrRv+KQeqZRqdlQvnGoPa2MTsa2m6eq/h+bVRSf6RN0Fw7QPDPncki/mey4Q1Pg+6NtCmD1er0KYspwznFAOH3R1RofEhkV6MrZ3XyZ5/3NGU1GQGzvNftuhTJAomU0EvNt59V5174kHnrzQ9X0SbbUbrZaaYN6dTLqwsJkUIRVCHFBJzJNVa3Dejur9GWSA5r1byW3tgwNF6abBxQ6V+y3K3GoJsRh4dZwURYrl6KKBasJsDMNO9yzFfWkJHV0nANMvQLULBcQUNYHg2P+7+Qw1Nt9+TkD3QMImav86L5ow9wYGCqUvu/uoB93SwLwVGZMdsLhnxBbTWETgMzmPOnaz2MXMWsGQ7IRro/l51SfVqTa0T2J/+TT10ysZ3RcVr58McsN+ObWhJOO1ZjV9smYJj0qbIZ3M7jA9Sr9yST6WZ8KidXLqn+Sc8Z6yZ+JXmPk59kEStAy/8QYNx3JL1udvuA+oeHlYyaSSEBHdsfFzYk9YEhCOS3yxlj3ptY/XYP2IIifiu+cQA5vE6qp3P4OIKBClgZNDjec2j+TWKoKpnjy3T5ipDQtf8G4E2/waL0V4+Sij+TvHWIGk7YkLrDlB8gkdVOmqnQr2K5ok2UStTFR6GOlry97TJ1OrEHlB0dAiJyMCiBHX4xtenO4/V5lGYyL6N37+612hyvyo+LErg+jyBkobkpf1jPsH1DgjAp X-Forefront-Antispam-Report: CIP:216.228.117.161;CTRY:US;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:mail.nvidia.com;PTR:dc6edge2.nvidia.com;CAT:NONE;SFS:(13230040)(1800799024)(82310400026)(36860700013)(376014);DIR:OUT;SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 01 Aug 2024 16:25:28.5081 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: f4bd8f60-8fbe-41a7-70d9-08dcb2468e70 X-MS-Exchange-CrossTenant-Id: 43083d15-7273-40c1-b7db-39efd9ccc17a X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=43083d15-7273-40c1-b7db-39efd9ccc17a;Ip=[216.228.117.161];Helo=[mail.nvidia.com] X-MS-Exchange-CrossTenant-AuthSource: BN2PEPF000044AB.namprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY8PR12MB7196 Add tests that attempt to create NH groups that use full 16 bits of NH weight. Signed-off-by: Petr Machata Reviewed-by: Ido Schimmel --- tools/testing/selftests/net/fib_nexthops.sh | 55 ++++++++++++++++++++- 1 file changed, 54 insertions(+), 1 deletion(-) diff --git a/tools/testing/selftests/net/fib_nexthops.sh b/tools/testing/selftests/net/fib_nexthops.sh index ac0b2c6a5761..77c83d9508d3 100755 --- a/tools/testing/selftests/net/fib_nexthops.sh +++ b/tools/testing/selftests/net/fib_nexthops.sh @@ -78,7 +78,12 @@ log_test() else ret=1 nfail=$((nfail+1)) - printf "TEST: %-60s [FAIL]\n" "${msg}" + if [[ $rc -eq $ksft_skip ]]; then + printf "TEST: %-60s [SKIP]\n" "${msg}" + else + printf "TEST: %-60s [FAIL]\n" "${msg}" + fi + if [ "$VERBOSE" = "1" ]; then echo " rc=$rc, expected $expected" fi @@ -923,6 +928,29 @@ ipv6_grp_fcnal() ipv6_grp_refs log_test $? 0 "Nexthop group replace refcounts" + + # + # 16-bit weights. + # + run_cmd "$IP nexthop add id 62 via 2001:db8:91::2 dev veth1" + run_cmd "$IP nexthop add id 63 via 2001:db8:91::3 dev veth1" + run_cmd "$IP nexthop add id 64 via 2001:db8:91::4 dev veth1" + run_cmd "$IP nexthop add id 65 via 2001:db8:91::5 dev veth1" + run_cmd "$IP nexthop add id 66 dev veth1" + + run_cmd "$IP nexthop add id 103 group 62,1000" + if [[ $? == 0 ]]; then + local GRP="id 103 group 62,254/63,255/64,256/65,257/66,65535" + run_cmd "$IP nexthop replace $GRP" + check_nexthop "id 103" "$GRP" + rc=$? + else + rc=$ksft_skip + fi + + $IP nexthop flush >/dev/null 2>&1 + + log_test $rc 0 "16-bit weights" } ipv6_res_grp_fcnal() @@ -987,6 +1015,31 @@ ipv6_res_grp_fcnal() check_nexthop_bucket "list id 102" \ "id 102 index 0 nhid 63 id 102 index 1 nhid 62 id 102 index 2 nhid 62 id 102 index 3 nhid 62" log_test $? 0 "Nexthop buckets updated after replace - nECMP" + + # + # 16-bit weights. + # + run_cmd "$IP nexthop add id 62 via 2001:db8:91::2 dev veth1" + run_cmd "$IP nexthop add id 63 via 2001:db8:91::3 dev veth1" + run_cmd "$IP nexthop add id 64 via 2001:db8:91::4 dev veth1" + run_cmd "$IP nexthop add id 65 via 2001:db8:91::5 dev veth1" + run_cmd "$IP nexthop add id 66 dev veth1" + + run_cmd "$IP nexthop add id 103 group 62,1000 type resilient buckets 32" + if [[ $? == 0 ]]; then + local GRP="id 103 group 62,254/63,255/64,256/65,257/66,65535 $(: + )type resilient buckets 32 idle_timer 0 $(: + )unbalanced_timer 0" + run_cmd "$IP nexthop replace $GRP" + check_nexthop "id 103" "$GRP unbalanced_time 0" + rc=$? + else + rc=$ksft_skip + fi + + $IP nexthop flush >/dev/null 2>&1 + + log_test $rc 0 "16-bit weights" } ipv6_fcnal_runtime()