From: Jamal Hadi Salim <jhs@mojatatu.com>
To: netdev@vger.kernel.org
Cc: Jamal Hadi Salim <jhs@mojatatu.com>,
Jiri Pirko <jiri@resnulli.us>,
"David S. Miller" <davem@davemloft.net>,
Eric Dumazet <edumazet@google.com>,
Jakub Kicinski <kuba@kernel.org>, Paolo Abeni <pabeni@redhat.com>,
Simon Horman <horms@kernel.org>,
Willem de Bruijn <willemdebruijn.kernel@gmail.com>,
Jason Wang <jasowangio@gmail.com>,
Andrew Lunn <andrew+netdev@lunn.ch>,
vega@nebusec.ai, Victor Nogueira <victor@mojatatu.com>
Subject: [PATCH net 2/2] selftests: tc-testing: add tx_queue_len cap regression tests
Date: Fri, 28 Aug 2026 08:19:02 -0400 [thread overview]
Message-ID: <20260828121902.66837-2-jhs@mojatatu.com> (raw)
In-Reply-To: <20260828121902.66837-1-jhs@mojatatu.com>
Add two test cases for the S16_MAX tx_queue_len cap in
netif_change_tx_queue_len():
1. Set path: set txqueuelen to 100000000. On a fixed kernel the
change is rejected with -ERANGE (exit code 2) and txqueuelen
stays at the default 1000.
2. Resize path: set txqueuelen to 500, attach pfifo_fast, then raise
txqueuelen to 100000000. On a fixed kernel the resize is rejected
with -ERANGE and txqueuelen rolls back to 500.
Signed-off-by: Jamal Hadi Salim <jhs@mojatatu.com>
---
.../tc-tests/qdiscs/pfifo_fast.json | 51 ++++++++++++++++---
1 file changed, 45 insertions(+), 6 deletions(-)
diff --git a/tools/testing/selftests/tc-testing/tc-tests/qdiscs/pfifo_fast.json b/tools/testing/selftests/tc-testing/tc-tests/qdiscs/pfifo_fast.json
index 30da27fe8806..03668d86bd0a 100644
--- a/tools/testing/selftests/tc-testing/tc-tests/qdiscs/pfifo_fast.json
+++ b/tools/testing/selftests/tc-testing/tc-tests/qdiscs/pfifo_fast.json
@@ -9,8 +9,7 @@
"plugins": {
"requires": "nsPlugin"
},
- "setup": [
- ],
+ "setup": [],
"cmdUnderTest": "$TC qdisc add dev $DUMMY handle 1: root pfifo_fast",
"expExitCode": "0",
"verifyCmd": "$TC qdisc show dev $DUMMY",
@@ -30,8 +29,7 @@
"plugins": {
"requires": "nsPlugin"
},
- "setup": [
- ],
+ "setup": [],
"cmdUnderTest": "$TC qdisc add dev $DUMMY handle 1: root pfifo_fast",
"expExitCode": "0",
"verifyCmd": "$TC -s qdisc show dev $DUMMY",
@@ -81,8 +79,7 @@
"verifyCmd": "$TC qdisc show dev $DUMMY",
"matchPattern": "qdisc pfifo_fast 1: root refcnt [0-9]+ bands 3 priomap",
"matchCount": "0",
- "teardown": [
- ]
+ "teardown": []
},
{
"id": "4385",
@@ -105,5 +102,47 @@
"teardown": [
"$TC qdisc del dev $DUMMY handle 1: root"
]
+ },
+ {
+ "id": "ed33",
+ "name": "Reject tx_queue_len exceeding S16_MAX at set time",
+ "category": [
+ "qdisc",
+ "pfifo_fast"
+ ],
+ "plugins": {
+ "requires": "nsPlugin"
+ },
+ "setup": [],
+ "cmdUnderTest": "$IP link set dev $DUMMY txqueuelen 100000000",
+ "expExitCode": "2",
+ "verifyCmd": "$IP link show dev $DUMMY",
+ "matchPattern": "qlen 1000$",
+ "matchCount": "1",
+ "teardown": []
+ },
+ {
+ "id": "04b5",
+ "name": "Reject tx_queue_len resize exceeding S16_MAX, rollback to original",
+ "category": [
+ "qdisc",
+ "pfifo_fast"
+ ],
+ "plugins": {
+ "requires": "nsPlugin"
+ },
+ "setup": [
+ "$IP link set dev $DUMMY txqueuelen 500",
+ "$TC qdisc add dev $DUMMY handle 1: root pfifo_fast"
+ ],
+ "cmdUnderTest": "$IP link set dev $DUMMY txqueuelen 100000000",
+ "expExitCode": "2",
+ "verifyCmd": "$IP link show dev $DUMMY",
+ "matchPattern": "qlen 500$",
+ "matchCount": "1",
+ "teardown": [
+ "$TC qdisc del dev $DUMMY handle 1: root",
+ "$IP link set dev $DUMMY txqueuelen 1000"
+ ]
}
]
--
2.43.0
next prev parent reply other threads:[~2026-08-28 12:19 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-08-28 12:19 [PATCH net 1/2] net: cap tx_queue_len at S16_MAX to prevent oversized ring allocations Jamal Hadi Salim
2026-08-28 12:19 ` Jamal Hadi Salim [this message]
2026-09-01 3:08 ` Jakub Kicinski
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20260828121902.66837-2-jhs@mojatatu.com \
--to=jhs@mojatatu.com \
--cc=andrew+netdev@lunn.ch \
--cc=davem@davemloft.net \
--cc=edumazet@google.com \
--cc=horms@kernel.org \
--cc=jasowangio@gmail.com \
--cc=jiri@resnulli.us \
--cc=kuba@kernel.org \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
--cc=vega@nebusec.ai \
--cc=victor@mojatatu.com \
--cc=willemdebruijn.kernel@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.