From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=74.125.82.171 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796552483; b=HPFTpzuqCwPp9tbLrYGPVpeaeVbYbv3JyXaZrAI07wJwkBaoUwe0l/eUUVP6YdRJu9QZ qxiFjNsSjrvC4umgosskOr3DCOIs80+a2XVgW1e+KG2OsRzlXkQ6lbLOGR6Gz5GVlx0mz uyn5RvBwTg/UIHuE9iRrw/FLxuXuYV1pKFKQMgi1J3ziSdAAtgU1kWvnrWe6vunJ7KxwH 6OoJ1rojOyG8IcTTD8mLubw6GkTuPOwJE8mLgWhY3KrD/4oRtWkdCcCnkt8JXxp6keMN5 LcJIAig4i0r57nNsf7FtylCLmw6J3u5jzxJxNsXmozMu8iaPnSV5x4rdFxfA6ko8y9Q== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796552483; h=DMARC-Filter:Received:DKIM-Signature:X-Google-DKIM-Signature: X-Forwarded-Encrypted:X-Gm-Message-State:X-Gm-Gg:X-Received:Received: From:To:Cc:Subject:Date:Message-ID:X-Mailer:In-Reply-To:References: MIME-Version:Content-Transfer-Encoding; bh=63bnIuy4tCCK4SwhEZm6yxE16tIo8u9YqxsolKCDZJw=; b=v3mkM/ZtwZHW+VUJZkIT5zIIJIr30Ii3lxJz5OA7nrnLGc1UWDgzguQvJ5skSHD6ErDb H7fkPjg46RgsZyscQWhFRieOD4rSk8hMIay9idHQx9hN24ApshaACiGmvWzH33akoWFA9 wlpPHUnRN8G668Hy/zqo7hR+oSFY9LdPnZgL1eLnlayhYj7Z2wg6ECaPO8runBRkejaIq Xgy3rsEsplXMV14avA9QiPI0xVOQccOYeoWfzgPafLGbD2ZCuykyutY5Op9U7Dmw10pCJ p/jwCcNvLwQwqt1T5wKCr2tlpiLXbt1zdzASi02JXK1Xu7zrG/6i/66hL78CJoukpTg== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20260707 header.b=GE8aUaKr; arc=none smtp.remote-ip=74.125.82.171 Received: from mail-dy1-f171.google.com (mail-dy1-f171.google.com [74.125.82.171]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 1AFB5606A31F for ; Sun, 6 Dec 2026 10:21:22 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org 1AFB5606A31F 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.a=rsa-sha256 header.s=20260707 header.b=GE8aUaKr Received: by mail-dy1-f171.google.com with SMTP id 5a478bee46e88-3866a784546so3292387eec.0 for ; Sun, 06 Dec 2026 02:21:22 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20260707; t=1796552482; x=1797157282; 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:content-type; bh=63bnIuy4tCCK4SwhEZm6yxE16tIo8u9YqxsolKCDZJw=; b=GE8aUaKrHBrkUwmdwXCACBVWDj4wUZH6rygWBQWmi8ZtZqtnKCfU11Er2CEteKKEl+ 8/QNgoEiK6KNnc2V8D2A95QvOukZIoMjq0pNxWY4yNoOILjlpb/WacRfKJXQW3uTXS6z Cv9RcxHjLu4jjgt9LHNkunz+H/pZxkOj/KCeu/d+ys8+wo9Izo8QSeGuG1LYuiG+xcUE hPTCTkNak7LfNbRFEAl611utjFUagEFtxoOp+ocqfXm0/JyXrND2WsnkjKA+InOUF/oE mSFpvEXKcTDzUw56Oc7otJLFp/bbNWLZluyxBuATFl8fkzZx5WAsy2Rtl+CNucdYez7z Jo5Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20260707; t=1796552482; x=1797157282; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to:content-type; bh=63bnIuy4tCCK4SwhEZm6yxE16tIo8u9YqxsolKCDZJw=; b=jHEG2N2LbhOg/hSyD70NjlbbIq5KDwVggfw8mHqCoE36ajs0wzr0FbrE12M2BCLAfY QShIbvdqZgUIOeYdMPcZXUcLbBq+doyM7j5W+szJ7QRRgawnIDe/eR2IAAuPIZG+cmyS +j/ApjZORRPuHMFeySy3q2uX7UsZ5bUrc2f/0k2iS70UUAtzb+qfGTPDWRVukbux+BXg /JwgtHFqGxG/tzE5u32ZaO0yl3OPEcrohGarxnquL/N2ft5445Tk8a9FxpUlAznzyJ6Z UvO+fRgLC4Wa2qwvKG3TjSnyTE8ssEhrL/VImwvRZfDWCjdBmG1qq3xwM+pIf/iaXjEJ Kx5A== X-Forwarded-Encrypted: i=1; AL+hErEkmAWyAL9nBWQ6ZCR8YEwYKADHnc/pOg3xiUNiiPoiaKZ4sCjF24phZ6zGTM+6iKkuZTxjQ3U=@vger.kernel.org X-Gm-Message-State: AB4q+uE2rNvRRcG2y3AnC3F0ujT4FzyydxVBM1VZecyU3yHAd5a5IGIs NnufIlmfKj9tfP+Yxbzw2isYtZBHmYoPVAXw1bYJy5HrBax+NA0c+No= X-Gm-Gg: AZFdTZfteSeVIg8vglaQiQ6p/xtwYIZqk7AaIRgpjwEG6LNlum27gMcHuTOoq54h9aV KiP5V/ZQ52KJ28MroNX1/Pyy84YXjTFTGypij5GHyozTSAGkfISDkSs93WMgQ0vUkFtz5NLRStJ Zui0fXF2owTdNyMuouIrc4K3/VrzIYYIERd4cXt0OpEoF1TSVblYCuVjElNyD9VNcUDDN5hpKf+ 86jgxdnTb5pY7atbFrKwTjwEuTQRAl03X4te0JoA/Kchsm7PMqqMWoZxzwbA+WKHIXP0O4nfQCM 9FgDjpFiR0wYc/yoPevLeCCP73lsU9QG+A8BCqrTGWBRC8y/nbIFsRrLy55F2QC1mCq7o2aECvg iVu4vN8koDPPvedZBJ8oWTTeZQpvzNzBJTz8sS15IYwybb0xojAZcv3K5ofCR/Tx30EsQZd6VE+ SQqhSsrJyY23HYIbZjhqjGvC6eRnmnVom9Ki2FYwYMdDKLzeyZl1SO/hAKrdOOjQycLSS4y1Hky NNtUYpRzxentTdBAYlDXNHIeg2ZM2ayTY8/26NOWkOTH+7NnM5JoCngZy92S+cWGdxXM8T7Xz/k +Tw1izVSAwjx3NHwgbQ2 X-Received: by 2002:a05:693c:4153:10b0:389:147a:fc4d with SMTP id 5a478bee46e88-389147b0693mr1596547eec.39.1796552482100; Sun, 06 Dec 2026 02:21:22 -0800 (PST) Received: from kali ([39.52.248.243]) by smtp.gmail.com with ESMTPSA id 5a478bee46e88-38752204591sm33937507eec.21.2026.12.06.02.21.13 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 06 Dec 2026 02:21:21 -0800 (PST) From: Muhammad Umer To: jhs@mojatatu.com, jiri@resnulli.us Cc: davem@davemloft.net, edumazet@kernel.org, kuba@kernel.org, pabeni@redhat.com, horms@kernel.org, willemb@google.com, shuah@kernel.org, netdev@vger.kernel.org, linux-kselftest@vger.kernel.org Subject: [PATCH net 2/2] selftests/tc-testing: add gact goto chain cross-block bind tests Date: Sun, 6 Dec 2026 05:20:12 -0500 Message-ID: <20261206102012.2264-3-mumer.mobi@gmail.com> X-Mailer: git-send-email 2.53.0 In-Reply-To: <20261206102012.2264-1-mumer.mobi@gmail.com> References: <20261206102012.2264-1-mumer.mobi@gmail.com> X-Mailing-List: netdev@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Add two gact cases: binding an action whose goto chain belongs to the block of another qdisc must fail and leave the action untouched, while binding it from a filter of the same block keeps working. The first case fails without the previous patch and passes with it. These tests were written with the help of an AI assistant. Signed-off-by: Muhammad Umer --- .../actions/gact-goto-chain-block.json | 54 +++++++++++++++++++ 1 file changed, 54 insertions(+) create mode 100644 tools/testing/selftests/tc-testing/tc-tests/actions/gact-goto-chain-block.json diff --git a/tools/testing/selftests/tc-testing/tc-tests/actions/gact-goto-chain-block.json b/tools/testing/selftests/tc-testing/tc-tests/actions/gact-goto-chain-block.json new file mode 100644 index 00000000000..147c5200b52 --- /dev/null +++ b/tools/testing/selftests/tc-testing/tc-tests/actions/gact-goto-chain-block.json @@ -0,0 +1,54 @@ +[ + { + "id": "23ab", + "name": "Reject binding an action whose goto chain is in another block", + "category": [ + "actions", + "gact" + ], + "plugins": { + "requires": "nsPlugin" + }, + "setup": [ + "$TC qdisc add dev $DUMMY root handle 1: drr", + "$TC class add dev $DUMMY parent 1: classid 1:1 drr", + "$TC filter add dev $DUMMY parent 1: chain 5 protocol all prio 1 matchall classid 1:1", + "$TC filter add dev $DUMMY parent 1: chain 0 protocol all prio 1 matchall action gact goto chain 5 index 77", + "$TC qdisc add dev $DEV1 root handle 2: htb" + ], + "cmdUnderTest": "$TC filter add dev $DEV1 parent 2: protocol all prio 1 matchall action gact pass index 77", + "expExitCode": "2", + "verifyCmd": "$TC actions get action gact index 77", + "matchPattern": "index 77 ref 1 bind 1", + "matchCount": "1", + "teardown": [ + "$TC qdisc del dev $DEV1 root", + "$TC qdisc del dev $DUMMY root" + ] + }, + { + "id": "8ada", + "name": "Bind an action whose goto chain is in the same block", + "category": [ + "actions", + "gact" + ], + "plugins": { + "requires": "nsPlugin" + }, + "setup": [ + "$TC qdisc add dev $DUMMY root handle 1: drr", + "$TC class add dev $DUMMY parent 1: classid 1:1 drr", + "$TC filter add dev $DUMMY parent 1: chain 5 protocol all prio 1 matchall classid 1:1", + "$TC filter add dev $DUMMY parent 1: chain 0 protocol all prio 1 matchall action gact goto chain 5 index 77" + ], + "cmdUnderTest": "$TC filter add dev $DUMMY parent 1: chain 0 protocol all prio 2 matchall action gact pass index 77", + "expExitCode": "0", + "verifyCmd": "$TC actions get action gact index 77", + "matchPattern": "index 77 ref 2 bind 2", + "matchCount": "1", + "teardown": [ + "$TC qdisc del dev $DUMMY root" + ] + } +] -- 2.53.0