reschedule hearbeat messages if other control Queue send is not completed, typo in...
[mirror/winof/.git] / ulp / inic / kernel / vnic_viport.c
index 388f685..02be3cf 100644 (file)
@@ -654,8 +654,15 @@ viport_timeout(
        if( p_viport && p_viport->data.connected )\r
        {\r
                // TODO: What about send failure?\r
-               control_heartbeatReq( &p_viport->control,\r
-                                               p_viport->port_config.hbTimeout );\r
+               if( !p_viport->control.reqOutstanding )\r
+               {\r
+                       control_heartbeatReq( &p_viport->control,\r
+                                                       p_viport->port_config.hbTimeout );\r
+               }\r
+               else\r
+               {       /* send WQE is taken, send heartbeat later */\r
+                       viport_timer( p_viport, p_viport->port_config.hbInterval );\r
+               }\r
        }\r
 }\r
 \r
@@ -923,6 +930,12 @@ _viport_process_query(
        if( !InterlockedCompareExchange( &p_viport->updates, 0, 0 ) )\r
        {\r
                VNIC_TRACE_EXIT( VNIC_DBG_VIPORT, ("No updates.\n") );\r
+               /*  now can restart heartbeats */\r
+               if( !p_viport->timerActive &&\r
+                       p_viport->port_config.hbInterval )\r
+               {\r
+                       viport_timer( p_viport, p_viport->port_config.hbInterval );\r
+               }\r
                return NDIS_STATUS_SUCCESS;\r
        }\r
 \r
@@ -935,6 +948,8 @@ _viport_process_query(
        {\r
                status = NDIS_STATUS_PENDING;\r
        }\r
+       /* stop heartbeat timer to serve another query */\r
+       viport_timerStop( p_viport );\r
 \r
        // Handle update bits one at a time.\r
        if( p_viport->updates & NEED_ADDRESS_CONFIG )\r