From a9848ac90d8876f12ec7c3fa3aa51f14a2fa0ab4 Mon Sep 17 00:00:00 2001 From: aestrin Date: Wed, 5 Nov 2008 21:58:51 +0000 Subject: [PATCH] [QLGCVNIC] fix for [Bug 1317] BSOD during reboot when using large MTU for VNIC. git-svn-id: svn://openib.tc.cornell.edu/gen1@1735 ad392aa1-c5ef-ae45-8dd8-e69d62a5ef86 --- trunk/ulp/qlgcvnic/kernel/vnic_driver.c | 29 ++++++++++--------------- 1 file changed, 12 insertions(+), 17 deletions(-) diff --git a/trunk/ulp/qlgcvnic/kernel/vnic_driver.c b/trunk/ulp/qlgcvnic/kernel/vnic_driver.c index 942fa571..daa8274f 100644 --- a/trunk/ulp/qlgcvnic/kernel/vnic_driver.c +++ b/trunk/ulp/qlgcvnic/kernel/vnic_driver.c @@ -1340,13 +1340,20 @@ vnic_oid_set_info( VNIC_ENTER( VNIC_DBG_OID ); CL_ASSERT( adapter_context ); - p_adapter = (vnic_adapter_t*)adapter_context; - p_netpath= p_adapter->p_currentPath; - CL_ASSERT( p_bytes_read ); CL_ASSERT( p_bytes_needed ); + + p_adapter = (vnic_adapter_t*)adapter_context; CL_ASSERT( !p_adapter->pending_set ); + p_netpath = p_adapter->p_currentPath; + /* do not set anything until IB path initialized and NIC is enabled */ + if( !netpath_is_valid( p_netpath ) || !p_netpath->carrier ) + { + *p_bytes_read = 0; + return NDIS_STATUS_NOT_ACCEPTED; + } + status = NDIS_STATUS_SUCCESS; *p_bytes_needed = 0; buf_len = sizeof(ULONG); @@ -1357,26 +1364,14 @@ vnic_oid_set_info( oid_info.p_bytes_used = p_bytes_read; oid_info.p_bytes_needed = p_bytes_needed; - /* do not set anything until IB path initialized and NIC is enabled */ - if( !p_adapter->p_currentPath->carrier ) - { - *p_bytes_read = 0; - return NDIS_STATUS_NOT_ACCEPTED; - } - switch( oid ) { /* Required General */ case OID_GEN_CURRENT_PACKET_FILTER: VNIC_TRACE( VNIC_DBG_OID, (" IOC %d received set for OID_GEN_CURRENT_PACKET_FILTER, %#x\n", - p_adapter->p_currentPath->pViport->ioc_num, - *(uint32_t*)info_buf )); -// if ( !p_adapter->p_currentPath->carrier ) -// { -// status = NDIS_STATUS_NOT_ACCEPTED; -// break; -// } + p_netpath->pViport->ioc_num, *(uint32_t*)info_buf ) ); + if( info_buf_len < sizeof( p_adapter->packet_filter ) ) { status = NDIS_STATUS_INVALID_LENGTH; -- 2.41.0