public inbox for dev@dpdk.org
 help / color / mirror / Atom feed
From: Bruce Richardson <bruce.richardson@intel.com>
To: dev@dpdk.org
Cc: thierry.herbelot@6wind.com, rjarry@redhat.com,
	Bruce Richardson <bruce.richardson@intel.com>,
	stable@dpdk.org
Subject: [PATCH] usertools/pmdinfo: fix search for PMD info string
Date: Tue, 17 Feb 2026 12:48:44 +0000	[thread overview]
Message-ID: <20260217124844.1458644-1-bruce.richardson@intel.com> (raw)
In-Reply-To: <20260123162104.1854187-1-thierry.herbelot@6wind.com>

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@dpdk.org

Signed-off-by: Bruce Richardson <bruce.richardson@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


  parent reply	other threads:[~2026-02-17 12:48 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-01-23 16:21 [PATCH] drivers/net: reorder Intel drivers list in meson script Thierry Herbelot
2026-01-23 16:27 ` [V2] " Thierry Herbelot
2026-01-23 16:50   ` Bruce Richardson
2026-01-23 16:57     ` Thierry Herbelot
2026-02-16 10:48       ` Bruce Richardson
2026-02-16 11:32         ` Bruce Richardson
2026-02-16 17:39           ` Thomas Monjalon
2026-02-17 12:48 ` Bruce Richardson [this message]
2026-02-17 17:53   ` [PATCH] usertools/pmdinfo: fix search for PMD info string David Marchand
2026-02-17 17:59     ` Bruce Richardson
2026-02-18  7:43       ` Thierry Herbelot
2026-02-18  8:38       ` David Marchand
2026-02-18  9:41   ` Robin Jarry
2026-03-17 13:57     ` Thomas Monjalon

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=20260217124844.1458644-1-bruce.richardson@intel.com \
    --to=bruce.richardson@intel.com \
    --cc=dev@dpdk.org \
    --cc=rjarry@redhat.com \
    --cc=stable@dpdk.org \
    --cc=thierry.herbelot@6wind.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox