[QLGCVNIC] fix for [Bug 1317] BSOD during reboot when using large MTU for VNIC.
authoraestrin <aestrin@ad392aa1-c5ef-ae45-8dd8-e69d62a5ef86>
Wed, 5 Nov 2008 21:58:51 +0000 (21:58 +0000)
committeraestrin <aestrin@ad392aa1-c5ef-ae45-8dd8-e69d62a5ef86>
Wed, 5 Nov 2008 21:58:51 +0000 (21:58 +0000)
git-svn-id: svn://openib.tc.cornell.edu/gen1/trunk@1735 ad392aa1-c5ef-ae45-8dd8-e69d62a5ef86

ulp/qlgcvnic/kernel/vnic_driver.c

index 942fa57..daa8274 100644 (file)
@@ -1340,13 +1340,20 @@ vnic_oid_set_info(
        VNIC_ENTER( VNIC_DBG_OID );\r
 \r
        CL_ASSERT( adapter_context );\r
-       p_adapter = (vnic_adapter_t*)adapter_context;\r
-       p_netpath= p_adapter->p_currentPath;\r
-\r
        CL_ASSERT( p_bytes_read );\r
        CL_ASSERT( p_bytes_needed );\r
+\r
+       p_adapter = (vnic_adapter_t*)adapter_context;\r
        CL_ASSERT( !p_adapter->pending_set );\r
 \r
+       p_netpath = p_adapter->p_currentPath;\r
+       /* do not set anything until IB path initialized and NIC is enabled */\r
+       if( !netpath_is_valid( p_netpath ) || !p_netpath->carrier )\r
+       {\r
+               *p_bytes_read = 0;\r
+               return NDIS_STATUS_NOT_ACCEPTED;\r
+       }\r
+\r
        status = NDIS_STATUS_SUCCESS;\r
        *p_bytes_needed = 0;\r
        buf_len = sizeof(ULONG);\r
@@ -1357,26 +1364,14 @@ vnic_oid_set_info(
        oid_info.p_bytes_used = p_bytes_read;\r
        oid_info.p_bytes_needed = p_bytes_needed;\r
 \r
-       /* do not set anything until IB path initialized and NIC is enabled */\r
-       if( !p_adapter->p_currentPath->carrier )\r
-       {\r
-               *p_bytes_read = 0;\r
-               return NDIS_STATUS_NOT_ACCEPTED;\r
-       }\r
-\r
        switch( oid )\r
        {\r
        /* Required General */\r
        case OID_GEN_CURRENT_PACKET_FILTER:\r
                VNIC_TRACE( VNIC_DBG_OID,\r
                        ("  IOC %d received set for OID_GEN_CURRENT_PACKET_FILTER, %#x\n",\r
-                                               p_adapter->p_currentPath->pViport->ioc_num,\r
-                                               *(uint32_t*)info_buf  ));\r
-//             if ( !p_adapter->p_currentPath->carrier )\r
-//             {\r
-//                     status = NDIS_STATUS_NOT_ACCEPTED;\r
-//                     break;\r
-//             }\r
+                               p_netpath->pViport->ioc_num, *(uint32_t*)info_buf ) );\r
+\r
                if( info_buf_len < sizeof( p_adapter->packet_filter ) )\r
                {\r
                        status = NDIS_STATUS_INVALID_LENGTH;\r