Skip to contentSkip to conversation

usertools/pmdinfo: fix usage typos

PATCH Applied Robin Jarry 3 participants 3 messages Sep 19, 2023 – Nov 22, 2023

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 usertools/pmdinfo: fix usage typos

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")
---
 doc/guides/tools/pmdinfo.rst | 2 +-
 usertools/dpdk-pmdinfo.py    | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)
doc/guides/tools/pmdinfo.rst +1 -1
index a9217de4eef2..fdb90301715e 100644
@@ -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"
usertools/dpdk-pmdinfo.py +1 -1
index 67d023a04711..2c728de7b8be 100755
@@ -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
Signature · 1 line
2.41.0
Reviewed-by on v1 1/1
#1 lore raw
Quoted 6 lines · Robin Jarry

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.

Quoted 7 lines

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")

My jq-ryu was not enough, thanks for the fix :-).

Signature · 1 line
David Marchand
#2 lore raw

27/09/2023 09:56, David Marchand:

Quoted 10 lines · Robin Jarry
Quoted 9 lines

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.

Quoted 7 lines
Quoted 4 lines
Fixes 0ce3cf4afd04 ("usertools/pmdinfo: rewrite simpler script")

My jq-ryu was not enough, thanks for the fix :-).

Applied, thanks.