From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 0CC0A42602 for ; Tue, 19 Sep 2023 12:20:30 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 06EC540A77; Tue, 19 Sep 2023 12:20:30 +0200 (CEST) Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by mails.dpdk.org (Postfix) with ESMTP id E379F40A70 for ; Tue, 19 Sep 2023 12:20:28 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1695118828; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=wgfeuH3N54lk8JaNfnExneTsCDwhxAwUjwdF4ycThfE=; b=ghzf+2r+cg2/Mt3nLLJxlEu8HHMXdd8ZR+I6ZCy5Sw/4XAHYXnpXFhKo06N75uE4plK7ai PY8AFKvDCdzaK4iE3EYLvtJn9J+/82FaPr6X0Q3LllGXRsbKep9eH/R5mlFCeee2ltoppC Rvehp6hX+RsYohwf7GX3JXWAB4Xos/I= Received: from mimecast-mx02.redhat.com (mx-ext.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-80-kAWrgHEQM6GClAAYfBcsow-1; Tue, 19 Sep 2023 06:20:25 -0400 X-MC-Unique: kAWrgHEQM6GClAAYfBcsow-1 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.rdu2.redhat.com [10.11.54.4]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id BADEB3801EEC; Tue, 19 Sep 2023 10:20:24 +0000 (UTC) Received: from ringo.redhat.com (unknown [10.39.208.33]) by smtp.corp.redhat.com (Postfix) with ESMTP id E96A320268CB; Tue, 19 Sep 2023 10:20:23 +0000 (UTC) From: Robin Jarry To: dev@dpdk.org Cc: Robin Jarry , stable@dpdk.org Subject: [PATCH] usertools/pmdinfo: fix usage typos Date: Tue, 19 Sep 2023 12:20:13 +0200 Message-ID: <20230919102012.419201-2-rjarry@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.1 on 10.11.54.4 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset="US-ASCII"; x-default=true X-BeenThere: stable@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: patches for DPDK stable branches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: stable-bounces@dpdk.org 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 --- 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