Re: [PATCH 1/1] pyverbs: fix speed_to_str(), to handle disabled links

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 12/23/19 6:39 AM, Noa Osherovich wrote:
...
diff --git a/pyverbs/device.pyx b/pyverbs/device.pyx
index 33d133fd..cf7b75de 100755
--- a/pyverbs/device.pyx
+++ b/pyverbs/device.pyx
@@ -923,8 +923,8 @@ def width_to_str(width):
def speed_to_str(speed):
-    l = {1: '2.5 Gbps', 2: '5.0 Gbps', 4: '5.0 Gbps', 8: '10.0 Gbps',
-         16: '14.0 Gbps', 32: '25.0 Gbps', 64: '50.0 Gbps'}
+    l = {0: '0.0 Gbps', 1: '2.5 Gbps', 2: '5.0 Gbps', 4: '5.0 Gbps',
+         8: '10.0 Gbps', 16: '14.0 Gbps', 32: '25.0 Gbps', 64: '50.0 Gbps'}
       try:
           return '{s} ({n})'.format(s=l[speed], n=speed)
       except KeyError:

This seems OK to me. BTW, what's the reported active_width for disabled links?
Maybe width_to_str could use a similar fix.


Thanks for reviewing this! The reported active_width for disabled links on my
systems is showing up the same as for active links ("4X" in this case). So I don't
think we need a fix for width_to_str().

thanks,
--
John Hubbard
NVIDIA



[Index of Archives]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Photo]     [Yosemite News]     [Yosemite Photos]     [Linux Kernel]     [Linux SCSI]     [XFree86]

  Powered by Linux