win-pvdrivers

changeset 948:12145457bd45 0.11.0.312

properly report the number of NBL's, instead of 0.
author James Harper <james.harper@bendigoit.com.au>
date Mon Aug 22 23:14:35 2011 +1000 (2011-08-22)
parents a05b13795cb2
children 2edc59bf9e0a
files xennet/xennet6_rx.c
line diff
     1.1 --- a/xennet/xennet6_rx.c	Mon Aug 22 23:14:01 2011 +1000
     1.2 +++ b/xennet/xennet6_rx.c	Mon Aug 22 23:14:35 2011 +1000
     1.3 @@ -189,6 +189,7 @@ typedef struct {
     1.4    PNET_BUFFER_LIST first_nbl;
     1.5    PNET_BUFFER_LIST last_nbl;
     1.6    ULONG packet_count;
     1.7 +  ULONG nbl_count;
     1.8  } rx_context_t;
     1.9  
    1.10  static BOOLEAN
    1.11 @@ -358,7 +359,6 @@ XenNet_MakePacket(struct xennet_info *xi
    1.12      NET_BUFFER_LIST_INFO(nbl, TcpIpChecksumNetBufferListInfo) = csum_info.Value;
    1.13    }
    1.14    
    1.15 -  //packet_count += NBL_PACKET_COUNT(nbl);
    1.16    if (!rc->first_nbl)
    1.17    {
    1.18      rc->first_nbl = nbl;
    1.19 @@ -369,6 +369,7 @@ XenNet_MakePacket(struct xennet_info *xi
    1.20    }
    1.21    rc->last_nbl = nbl;
    1.22    NET_BUFFER_LIST_NEXT_NBL(nbl) = NULL;
    1.23 +  rc->nbl_count++;
    1.24    InterlockedIncrement(&xi->rx_outstanding);
    1.25    if (pi->is_multicast)
    1.26    {
    1.27 @@ -712,7 +713,7 @@ XenNet_RxBufferCheck(struct xennet_info 
    1.28    shared_buffer_t *page_buf;
    1.29    //LIST_ENTRY rx_header_only_packet_list;
    1.30    //PLIST_ENTRY entry;
    1.31 -  ULONG nbl_count = 0;
    1.32 +  //ULONG nbl_count = 0;
    1.33    ULONG interim_packet_data = 0;
    1.34    struct netif_extra_info *ei;
    1.35    rx_context_t rc;
    1.36 @@ -731,6 +732,7 @@ XenNet_RxBufferCheck(struct xennet_info 
    1.37    rc.first_nbl = NULL;
    1.38    rc.last_nbl = NULL;
    1.39    rc.packet_count = 0;
    1.40 +  rc.nbl_count = 0;
    1.41    
    1.42    /* get all the buffers off the ring as quickly as possible so the lock is held for a minimum amount of time */
    1.43    KeAcquireSpinLockAtDpcLevel(&xi->rx_lock);
    1.44 @@ -945,7 +947,8 @@ XenNet_RxBufferCheck(struct xennet_info 
    1.45  
    1.46    if (rc.first_nbl)
    1.47    {
    1.48 -    NdisMIndicateReceiveNetBufferLists(xi->adapter_handle, rc.first_nbl, NDIS_DEFAULT_PORT_NUMBER, nbl_count,
    1.49 +    NdisMIndicateReceiveNetBufferLists(xi->adapter_handle, rc.first_nbl,
    1.50 +      NDIS_DEFAULT_PORT_NUMBER, rc.nbl_count,
    1.51        NDIS_RECEIVE_FLAGS_DISPATCH_LEVEL
    1.52        //| NDIS_RECEIVE_FLAGS_SINGLE_ETHER_TYPE 
    1.53        | NDIS_RECEIVE_FLAGS_PERFECT_FILTERED);