[PATCH] usertools/pmdinfo: fix search for PMD info string
Bruce Richardson
bruce.richardson at intel.com
Tue Feb 17 13:48:44 CET 2026
The PMD_INFO_STRING constant string is not guaranteed to appear in the
output binary immediately after an unprintable character. Because of
this, in some cases the information for a driver could be missed by the
PMD info script as it only checks for the prefix at the start of strings
that it finds. Change the script to use "s.find()" rather than
"s.startswith()" to fix this issue.
Fixes: 0ce3cf4afd04 ("usertools/pmdinfo: rewrite simpler script")
Cc: stable at dpdk.org
Signed-off-by: Bruce Richardson <bruce.richardson at intel.com>
---
usertools/dpdk-pmdinfo.py | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/usertools/dpdk-pmdinfo.py b/usertools/dpdk-pmdinfo.py
index 9251c69db9..a4913f2209 100755
--- a/usertools/dpdk-pmdinfo.py
+++ b/usertools/dpdk-pmdinfo.py
@@ -221,8 +221,9 @@ def find_strings(buf: bytes, prefix: str) -> Iterator[str]:
if b == 0:
# end of string
s = view[start:i].tobytes().decode("ascii")
- if s.startswith(prefix):
- yield s[len(prefix) :]
+ idx = s.find(prefix)
+ if idx >= 0:
+ yield s[idx + len(prefix) :]
# There can be byte sequences where a non-printable byte
# follows a printable one. Ignore that.
start = None
--
2.51.0
More information about the stable
mailing list