win-pvdrivers

changeset 584:40a40d4aa88a

Fix a possible Dpc race in xennet_rx.
Remove some old code.
author James Harper <james.harper@bendigoit.com.au>
date Sun Jun 07 20:19:20 2009 +1000 (2009-06-07)
parents 10147bb21470
children 19b4c4d2b621
files xennet/xennet_rx.c
line diff
     1.1 --- a/xennet/xennet_rx.c	Sun Jun 07 20:18:43 2009 +1000
     1.2 +++ b/xennet/xennet_rx.c	Sun Jun 07 20:19:20 2009 +1000
     1.3 @@ -654,7 +654,13 @@ XenNet_RxBufferCheck(PKDPC dpc, PVOID co
     1.4    ASSERT(xi->connected);
     1.5  
     1.6    KeAcquireSpinLockAtDpcLevel(&xi->rx_lock);
     1.7 -
     1.8 +  
     1.9 +  if (xi->shutting_down)
    1.10 +  {
    1.11 +    /* there is a chance that our Dpc had been queued just before the shutdown... */
    1.12 +    KeReleaseSpinLockFromDpcLevel(&xi->rx_lock);
    1.13 +    return;
    1.14 +  }
    1.15    InitializeListHead(&rx_packet_list);
    1.16  
    1.17    do {
    1.18 @@ -785,19 +791,6 @@ XenNet_RxBufferCheck(PKDPC dpc, PVOID co
    1.19    {
    1.20      PNDIS_PACKET packet = CONTAINING_RECORD(entry, NDIS_PACKET, MiniportReservedEx[0]);
    1.21      packets[packet_count++] = packet;
    1.22 -#if 0    
    1.23 -    KdPrint((__DRIVER_NAME "     Adding packet %p to indicate list\n", packet));
    1.24 -{
    1.25 -    PVOID addr;
    1.26 -    UINT buffer_length;
    1.27 -    UINT total_length;
    1.28 -    PNDIS_BUFFER buffer;
    1.29 -
    1.30 -    NdisGetFirstBufferFromPacketSafe(packet, &buffer, &addr, &buffer_length, &total_length, NormalPagePriority);
    1.31 -    KdPrint((__DRIVER_NAME "     buffer = %p, addr = %p, buffer_length = %d, total_length = %d\n", buffer, addr, buffer_length, total_length));
    1.32 -    ASSERT(total_length <= xi->config_mtu + XN_HDR_SIZE);
    1.33 -}   
    1.34 -#endif
    1.35      entry = RemoveHeadList(&rx_packet_list);
    1.36      if (packet_count == MAXIMUM_PACKETS_PER_INDICATE || entry == &rx_packet_list)
    1.37      {