DPDK-dev Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v1] dts: add default values for queue info
@ 2026-03-10 18:44 Andrew Bailey
  2026-03-12 21:12 ` Dean Marx
  2026-05-28  1:34 ` [v1] " Patrick Robb
  0 siblings, 2 replies; 4+ messages in thread
From: Andrew Bailey @ 2026-03-10 18:44 UTC (permalink / raw)
  To: probb; +Cc: dev, luca.vizzarro, dmarx, Andrew Bailey

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


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH v1] dts: add default values for queue info
  2026-03-10 18:44 [PATCH v1] dts: add default values for queue info Andrew Bailey
@ 2026-03-12 21:12 ` Dean Marx
  2026-04-10 14:36   ` Andrew Bailey
  2026-05-28  1:34 ` [v1] " Patrick Robb
  1 sibling, 1 reply; 4+ messages in thread
From: Dean Marx @ 2026-03-12 21:12 UTC (permalink / raw)
  To: Andrew Bailey; +Cc: probb, dev, luca.vizzarro

On Tue, Mar 10, 2026 at 2:44 PM Andrew Bailey <abailey@iol.unh.edu> wrote:
>
> 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>

Tested-by: Dean Marx <dmarx@iol.unh.edu>
Reviewed-by: Dean Marx <dmarx@iol.unh.edu>

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH v1] dts: add default values for queue info
  2026-03-12 21:12 ` Dean Marx
@ 2026-04-10 14:36   ` Andrew Bailey
  0 siblings, 0 replies; 4+ messages in thread
From: Andrew Bailey @ 2026-04-10 14:36 UTC (permalink / raw)
  To: Dean Marx; +Cc: probb, dev, luca.vizzarro

[-- Attachment #1: Type: text/plain, Size: 91 bytes --]

This is an update on the status of this patch.

This patch is pending review to be merged.

[-- Attachment #2: Type: text/html, Size: 120 bytes --]

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [v1] dts: add default values for queue info
  2026-03-10 18:44 [PATCH v1] dts: add default values for queue info Andrew Bailey
  2026-03-12 21:12 ` Dean Marx
@ 2026-05-28  1:34 ` Patrick Robb
  1 sibling, 0 replies; 4+ messages in thread
From: Patrick Robb @ 2026-05-28  1:34 UTC (permalink / raw)
  To: abailey; +Cc: dev, dmarx, luca.vizzarro, probb, Patrick Robb

Reviewed-by: Patrick Robb <patrickrobb1997@gmail.com>

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2026-05-28  1:35 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-03-10 18:44 [PATCH v1] dts: add default values for queue info Andrew Bailey
2026-03-12 21:12 ` Dean Marx
2026-04-10 14:36   ` Andrew Bailey
2026-05-28  1:34 ` [v1] " Patrick Robb

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox