patches for DPDK stable branches
 help / color / mirror / Atom feed
From: Robin Jarry <rjarry@redhat.com>
To: dev@dpdk.org
Cc: Robin Jarry <rjarry@redhat.com>, stable@dpdk.org
Subject: [PATCH] usertools/pmdinfo: fix usage typos
Date: Tue, 19 Sep 2023 12:20:13 +0200	[thread overview]
Message-ID: <20230919102012.419201-2-rjarry@redhat.com> (raw)

The docs and script usages are not consistent.

There is no .devices, .vendor_id nor .device_id fields. Fix usage to the
correct field names.

Some drivers do not expose any pci_ids, show how to use the []? jq
operator to avoid spurious errors.

Fixes: 0ce3cf4afd04 ("usertools/pmdinfo: rewrite simpler script")
Cc: stable@dpdk.org

Signed-off-by: Robin Jarry <rjarry@redhat.com>
---
 doc/guides/tools/pmdinfo.rst | 2 +-
 usertools/dpdk-pmdinfo.py    | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/doc/guides/tools/pmdinfo.rst b/doc/guides/tools/pmdinfo.rst
index a9217de4eef2..fdb90301715e 100644
--- a/doc/guides/tools/pmdinfo.rst
+++ b/doc/guides/tools/pmdinfo.rst
@@ -82,5 +82,5 @@ Get only the required kernel modules for a given device:
 .. code-block:: console
 
    $ dpdk-pmdinfo.py /usr/bin/dpdk-testpmd | \
-       jq '.[] | select(.pci_ids[] | .vendor == "15b3" and .device == "1013").kmod'
+       jq '.[] | select(.pci_ids[]? | .vendor == "15b3" and .device == "1013").kmod'
    "* ib_uverbs & mlx5_core & mlx5_ib"
diff --git a/usertools/dpdk-pmdinfo.py b/usertools/dpdk-pmdinfo.py
index 67d023a04711..2c728de7b8be 100755
--- a/usertools/dpdk-pmdinfo.py
+++ b/usertools/dpdk-pmdinfo.py
@@ -23,7 +23,7 @@
 Get only the required kernel modules for a given device:
 
   %(prog)s dpdk-testpmd | \
-  jq '.[] | select(.devices[] | .vendor_id == "15b3" and .device_id == "1013").kmod'
+  jq '.[] | select(.pci_ids[]? | .vendor == "15b3" and .device == "1013").kmod'
 """
 
 import argparse
-- 
2.41.0


             reply	other threads:[~2023-09-19 10:20 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-09-19 10:20 Robin Jarry [this message]
2023-09-27  7:56 ` David Marchand
2023-11-22 23:19   ` 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=20230919102012.419201-2-rjarry@redhat.com \
    --to=rjarry@redhat.com \
    --cc=dev@dpdk.org \
    --cc=stable@dpdk.org \
    /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;
as well as URLs for NNTP newsgroup(s).