From mboxrd@z Thu Jan  1 00:00:00 1970
Return-Path: <dev-bounces@dpdk.org>
Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124])
	by inbox.dpdk.org (Postfix) with ESMTP id C0D06A034C;
	Sun, 27 Mar 2022 17:36:37 +0200 (CEST)
Received: from [217.70.189.124] (localhost [127.0.0.1])
	by mails.dpdk.org (Postfix) with ESMTP id 920064288F;
	Sun, 27 Mar 2022 17:36:02 +0200 (CEST)
Received: from mga14.intel.com (mga14.intel.com [192.55.52.115])
 by mails.dpdk.org (Postfix) with ESMTP id 6CBB642885
 for <dev@dpdk.org>; Sun, 27 Mar 2022 17:36:00 +0200 (CEST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple;
 d=intel.com; i=@intel.com; q=dns/txt; s=Intel;
 t=1648395360; x=1679931360;
 h=from:to:cc:subject:date:message-id:in-reply-to: references;
 bh=f9iIhO50rLyIGKCTBiUd876H7y7ZRQkY7IipgetRm0o=;
 b=SSRP4hu7SjPZv2rx12iMrF+8ngBkld0FgXeYlo6DX8IvFOb4gLxcb44C
 Ane8UQt2MaYp4Xo8xeGzdK7CazUhIel5Ue8XXwcEvea0m6Mz1GkAfuod4
 UJ8FKdvK69ByZMcPQ8HxkNirggCfoy+wKk3y1r5Ic1py7U/hdWOR4N974
 SyRisW/5E5Qc9b4nZZU0UqcwcwMeDbY/3HqBvJ8V2GXuiommank3JJSyE
 mnWl5XVLF0h4Bh4W9oXjlO9tsNPFGCWZU2jwgRxOgtkrrZJtJM1tlMAEI
 jd0Ioro6b1jG6Et3qu4xElkS1LjpHCe6vZ93ZUAjSirdSZ0/J7GJr/frb A==;
X-IronPort-AV: E=McAfee;i="6200,9189,10299"; a="259045651"
X-IronPort-AV: E=Sophos;i="5.90,215,1643702400"; d="scan'208";a="259045651"
Received: from orsmga008.jf.intel.com ([10.7.209.65])
 by fmsmga103.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384;
 27 Mar 2022 08:36:00 -0700
X-ExtLoop1: 1
X-IronPort-AV: E=Sophos;i="5.90,215,1643702400"; d="scan'208";a="562421549"
Received: from dpdk-dipei.sh.intel.com ([10.67.110.238])
 by orsmga008.jf.intel.com with ESMTP; 27 Mar 2022 08:35:58 -0700
From: Andy Pei <andy.pei@intel.com>
To: dev@dpdk.org
Cc: chenbo.xia@intel.com, maxime.coquelin@redhat.com, gang.cao@intel.com,
 changpeng.liu@intel.com
Subject: [PATCH v4 08/16] usertools: add support for virtio blk device
Date: Sun, 27 Mar 2022 22:51:31 +0800
Message-Id: <1648392699-60113-9-git-send-email-andy.pei@intel.com>
X-Mailer: git-send-email 1.8.3.1
In-Reply-To: <1648392699-60113-1-git-send-email-andy.pei@intel.com>
References: <1643093258-47258-2-git-send-email-andy.pei@intel.com>
 <1648392699-60113-1-git-send-email-andy.pei@intel.com>
X-BeenThere: dev@dpdk.org
X-Mailman-Version: 2.1.29
Precedence: list
List-Id: DPDK patches and discussions <dev.dpdk.org>
List-Unsubscribe: <https://mails.dpdk.org/options/dev>,
 <mailto:dev-request@dpdk.org?subject=unsubscribe>
List-Archive: <http://mails.dpdk.org/archives/dev/>
List-Post: <mailto:dev@dpdk.org>
List-Help: <mailto:dev-request@dpdk.org?subject=help>
List-Subscribe: <https://mails.dpdk.org/listinfo/dev>,
 <mailto:dev-request@dpdk.org?subject=subscribe>
Errors-To: dev-bounces@dpdk.org

Signed-off-by: Andy Pei <andy.pei@intel.com>
---
 usertools/dpdk-devbind.py | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/usertools/dpdk-devbind.py b/usertools/dpdk-devbind.py
index ace4627..cbe336f 100755
--- a/usertools/dpdk-devbind.py
+++ b/usertools/dpdk-devbind.py
@@ -14,6 +14,8 @@
 from os.path import join as path_join
 
 # The PCI base class for all devices
+virtio_blk_class = {'Class': '01', 'Vendor': "1af4", 'Device': '1001',
+                    'SVendor': '8086', 'SDevice': '0002'}
 network_class = {'Class': '02', 'Vendor': None, 'Device': None,
                  'SVendor': None, 'SDevice': None}
 acceleration_class = {'Class': '12', 'Vendor': None, 'Device': None,
@@ -72,6 +74,7 @@
 cn9k_ree = {'Class': '08', 'Vendor': '177d', 'Device': 'a0f4',
                  'SVendor': None, 'SDevice': None}
 
+virtio_blk_devices = [virtio_blk_class]
 network_devices = [network_class, cavium_pkx, avp_vnic, ifpga_class]
 baseband_devices = [acceleration_class]
 crypto_devices = [encryption_class, intel_processor_class]
@@ -587,6 +590,9 @@ def show_status():
     Displays to the user what devices are bound to the igb_uio driver, the
     kernel driver or to no driver'''
 
+    if status_dev in ["virtio_blk", "all"]:
+        show_device_status(virtio_blk_devices, "virtio_blk")
+
     if status_dev in ["net", "all"]:
         show_device_status(network_devices, "Network", if_field=True)
 
@@ -746,6 +752,7 @@ def do_arg_actions():
         if b_flag is not None:
             clear_data()
             # refresh if we have changed anything
+            get_device_details(virtio_blk_devices)
             get_device_details(network_devices)
             get_device_details(baseband_devices)
             get_device_details(crypto_devices)
@@ -769,6 +776,7 @@ def main():
     parse_args()
     check_modules()
     clear_data()
+    get_device_details(virtio_blk_devices)
     get_device_details(network_devices)
     get_device_details(baseband_devices)
     get_device_details(crypto_devices)
-- 
1.8.3.1