DPDK patches and discussions
 help / color / mirror / Atom feed
* [dpdk-dev] [PATCH v1] dpdk-devbind.py: Virtio interface issue.
@ 2016-08-25  2:25 souvikdey33
  2016-08-25  9:51 ` Mcnamara, John
                   ` (5 more replies)
  0 siblings, 6 replies; 19+ messages in thread
From: souvikdey33 @ 2016-08-25  2:25 UTC (permalink / raw)
  To: nhorman, dev; +Cc: souvikdey33

This change is required to have the interface name for virtio interfaces.
When we execute the status command the for virtio inerfaces we get
Sample output without the change:
0000:00:04.0 'Virtio network device' if= drv=virtio-pci unused=virtio_pci,igb_uio
Though for other drivers this works.
Sample output with the change:
0000:00:04.0 'Virtio network device' if=eth0 drv=virtio-pci unused=virtio_pci,igb_uio

souvikdey33 (1):
  Signed-off-by: souvikdey33 <sodey@sonusnet.com>

 tools/dpdk-devbind.py | 9 +++++++++
 1 file changed, 9 insertions(+)

 From d9e8937b8d88a22ee5519fde2c728b377bc8fb1f Mon Sep 17 00:00:00 2001
From: souvikdey33 <sodey@sonusnet.com>
Date: Wed, 24 Aug 2016 19:56:36 -0400
Subject: [PATCH v1] Signed-off-by: souvikdey33 <sodey@sonusnet.com>

When we execute the status command the for virtio inerfaces the interface name is not shown.
Sample output without the change.
0000:00:04.0 'Virtio network device' if= drv=virtio-pci unused=virtio_pci,igb_uio
Though for other this works.
---
 tools/dpdk-devbind.py | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/tools/dpdk-devbind.py b/tools/dpdk-devbind.py
index b69ca2a..9829e25 100755
--- a/tools/dpdk-devbind.py
+++ b/tools/dpdk-devbind.py
@@ -36,6 +36,8 @@ import sys
 import os
 import getopt
 import subprocess
+import commands
+
 from os.path import exists, abspath, dirname, basename
 
 # The PCI base class for NETWORK devices
@@ -222,8 +224,15 @@ def get_pci_device_details(dev_id):
         device[name] = value
     # check for a unix interface name
     sys_path = "/sys/bus/pci/devices/%s/net/" % dev_id
+    #The path for virtio devices are different. Get the correct path.
+	virtio = "/sys/bus/pci/devices/%s/" % dev_id
+    cmd = " ls %s | grep 'virt' " %virtio
+    virtio = commands.getoutput(cmd)
+    virtio_sys_path = "/sys/bus/pci/devices/%s/%s/net/" % (dev_id,virtio)
     if exists(sys_path):
         device["Interface"] = ",".join(os.listdir(sys_path))
+    elif exists(virt_path):
+        device["Interface"] = ",".join(os.listdir(virtio_sys_path))
     else:
         device["Interface"] = ""
     # check if a port is used for ssh connection
-- 
2.9.3.windows.1

^ permalink raw reply	[flat|nested] 19+ messages in thread

end of thread, other threads:[~2016-10-04  9:59 UTC | newest]

Thread overview: 19+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-08-25  2:25 [dpdk-dev] [PATCH v1] dpdk-devbind.py: Virtio interface issue souvikdey33
2016-08-25  9:51 ` Mcnamara, John
2016-08-25 10:19   ` Thomas Monjalon
2016-08-25 10:27     ` Mcnamara, John
2016-08-26  0:37 ` Stephen Hemminger
2016-08-26  3:59 ` [dpdk-dev] [PATCH v2] tools: fix issue with virtio interfaces souvikdey33
2016-08-26  5:50 ` souvikdey33
2016-08-26 11:35 ` [dpdk-dev] [PATCH v3] " souvikdey33
2016-10-04  9:59   ` Thomas Monjalon
2016-08-26 15:55 ` [dpdk-dev] [PATCH v1] dpdk-devbind.py: Virtio interface issue Stephen Hemminger
2016-08-27  0:20   ` Dey, Souvik
2016-08-29 15:09     ` Mussar, Gary
2016-08-29 23:16       ` Dey, Souvik
2016-08-29 23:33         ` Stephen Hemminger
2016-08-30 12:56         ` Neil Horman
2016-08-30 13:12         ` Mussar, Gary
2016-09-01 10:59       ` Mcnamara, John
2016-09-01 22:08         ` Dey, Souvik
2016-09-02 12:57         ` Mussar, Gary

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