From: Andrew Bailey <abailey@iol.unh.edu>
To: probb@iol.unh.edu
Cc: dev@dpdk.org, luca.vizzarro@arm.com, dmarx@iol.unh.edu,
Andrew Bailey <abailey@iol.unh.edu>
Subject: [PATCH v1] dts: add default values for queue info
Date: Tue, 10 Mar 2026 14:44:15 -0400 [thread overview]
Message-ID: <20260310184416.216482-1-abailey@iol.unh.edu> (raw)
Currently, an error is raised on some environments when running the
queue start stop test suite due to fields failing to populate with no
default. These fields are not accessed by the test suite and this commit
handles this case gracefully by setting the default to None instead of
crashing.
Bugzilla ID: 1901
Signed-off-by: Andrew Bailey <abailey@iol.unh.edu>
---
dts/api/testpmd/__init__.py | 8 +++++++-
dts/api/testpmd/types.py | 28 +++++++++++++++++++++-------
2 files changed, 28 insertions(+), 8 deletions(-)
diff --git a/dts/api/testpmd/__init__.py b/dts/api/testpmd/__init__.py
index 703cae487e..a9724df7e4 100644
--- a/dts/api/testpmd/__init__.py
+++ b/dts/api/testpmd/__init__.py
@@ -1293,9 +1293,15 @@ def start_port_queue(
)
def get_queue_ring_size(self, port_id: int, queue_id: int, is_rx_queue: bool) -> int:
- """Returns the current size of the ring on the specified queue."""
+ """Returns the current size of the ring on the specified queue.
+
+ Raises:
+ ValueError: If ring size could not be parsed from test pmd.
+ """
command = f"show {'rxq' if is_rx_queue else 'txq'} info {port_id} {queue_id}"
queue_info = TestPmdQueueInfo.parse(self.send_command(command))
+ if queue_info.ring_size is None:
+ raise ValueError("Ring size could not be gathered from test pmd.")
return queue_info.ring_size
def set_queue_ring_size(
diff --git a/dts/api/testpmd/types.py b/dts/api/testpmd/types.py
index 0d322aece2..a6cfcccfa0 100644
--- a/dts/api/testpmd/types.py
+++ b/dts/api/testpmd/types.py
@@ -400,19 +400,33 @@ class TestPmdQueueInfo(TextParser):
"""Dataclass representation of the common parts of the testpmd `show rxq/txq info` commands."""
#:
- prefetch_threshold: int = field(metadata=TextParser.find_int(r"prefetch threshold: (\d+)"))
+ prefetch_threshold: int | None = field(
+ default=None, metadata=TextParser.find_int(r"prefetch threshold: (\d+)")
+ )
#:
- host_threshold: int = field(metadata=TextParser.find_int(r"host threshold: (\d+)"))
+ host_threshold: int | None = field(
+ default=None, metadata=TextParser.find_int(r"host threshold: (\d+)")
+ )
#:
- writeback_threshold: int = field(metadata=TextParser.find_int(r"writeback threshold: (\d+)"))
+ writeback_threshold: int | None = field(
+ default=None, metadata=TextParser.find_int(r"writeback threshold: (\d+)")
+ )
#:
- free_threshold: int = field(metadata=TextParser.find_int(r"free threshold: (\d+)"))
+ free_threshold: int | None = field(
+ default=None, metadata=TextParser.find_int(r"free threshold: (\d+)")
+ )
#:
- deferred_start: bool = field(metadata=TextParser.find("deferred start: on"))
+ deferred_start: bool | None = field(
+ default=None, metadata=TextParser.find("deferred start: on")
+ )
#: The number of RXD/TXDs is just the ring size of the queue.
- ring_size: int = field(metadata=TextParser.find_int(r"Number of (?:RXDs|TXDs): (\d+)"))
+ ring_size: int | None = field(
+ default=None, metadata=TextParser.find_int(r"Number of (?:RXDs|TXDs): (\d+)")
+ )
#:
- is_queue_started: bool = field(metadata=TextParser.find("queue state: started"))
+ is_queue_started: bool | None = field(
+ default=None, metadata=TextParser.find("queue state: started")
+ )
#:
burst_mode: str | None = field(
default=None, metadata=TextParser.find(r"Burst mode: ([^\r\n]+)")
--
2.50.1
next reply other threads:[~2026-03-10 18:44 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-03-10 18:44 Andrew Bailey [this message]
2026-03-12 21:12 ` [PATCH v1] dts: add default values for queue info Dean Marx
2026-04-10 14:36 ` Andrew Bailey
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=20260310184416.216482-1-abailey@iol.unh.edu \
--to=abailey@iol.unh.edu \
--cc=dev@dpdk.org \
--cc=dmarx@iol.unh.edu \
--cc=luca.vizzarro@arm.com \
--cc=probb@iol.unh.edu \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox