[ofw] [patch] [winverb] fix BS in WinVerbs when getting an event for non IB port

Uri Habusha urih at mellanox.co.il
Sun Dec 12 08:03:31 PST 2010


During our testing we got a BS in WinVerbs. It happens when we running a VPI scenario in which one port is IB and the second port is ETH.  The test bring down the ETH link, as a result an event is created and low level driver calls to winverbs to handle it.

WinVerbs doesn't create a port object for ETH port, so when trying to access the ports object the driver got a BS.

Since the IB always should be the first port, the simple fix is to check that port number of the event is less or equal for PortCount this promise that port object is exist for the port.

Index: wv_device.c
===================================================================
--- wv_device.c (revision 3010)
+++ wv_device.c              (working copy)
@@ -135,8 +135,10 @@
                                                WvDeviceCompleteRequests(&dev->pPorts[i], STATUS_SUCCESS, event);
                                }
                } else {
-                              WvDeviceCompleteRequests(&dev->pPorts[pEvent->port_number - 1],
+                                             if(pEvent->port_number <= dev->PortCount) {
+                                                             WvDeviceCompleteRequests(&dev->pPorts[pEvent->port_number - 1],
                                                                                                                                 STATUS_SUCCESS, event);
+                                             }
                }
 }

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openfabrics.org/pipermail/ofw/attachments/20101212/1f636b52/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: wv.patch
Type: application/octet-stream
Size: 506 bytes
Desc: wv.patch
URL: <http://lists.openfabrics.org/pipermail/ofw/attachments/20101212/1f636b52/attachment.obj>


More information about the ofw mailing list