win-pvdrivers

changeset 215:e12cad680f3c

xennet: indent commented-out code so I can start to get a handle on what's going on in SendQueuedPackets
author Andy Grover <andy.grover@oracle.com>
date Thu Mar 20 16:58:34 2008 -0700 (2008-03-20)
parents b400fd002071
children 90fcd61a9cbb
files xennet/xennet_tx.c
line diff
     1.1 --- a/xennet/xennet_tx.c	Thu Mar 20 16:39:32 2008 -0700
     1.2 +++ b/xennet/xennet_tx.c	Thu Mar 20 16:58:34 2008 -0700
     1.3 @@ -146,16 +146,11 @@ XenNet_SendQueuedPackets(struct xennet_i
     1.4    while (entry != &xi->tx_waiting_pkt_list)
     1.5    {
     1.6      ASSERT(cycles++ < 256);
     1.7 -//KdPrint((__DRIVER_NAME "     Packet ready to send\n"));
     1.8 +    //KdPrint((__DRIVER_NAME "     Packet ready to send\n"));
     1.9      packet = CONTAINING_RECORD(entry, NDIS_PACKET, MiniportReservedEx[sizeof(PVOID)]);
    1.10      NdisQueryPacket(packet, NULL, NULL, &first_buffer, &total_packet_length);
    1.11      sg_list = NDIS_PER_PACKET_INFO_FROM_PACKET(packet, ScatterGatherListPacketInfo);
    1.12 -/*
    1.13 -    for (i = 0; i < sg_list->NumberOfElements; i++)
    1.14 -    {
    1.15 -      KdPrint((__DRIVER_NAME "     sg entry %d - start = %08x, length = %d\n", i, sg_list->Elements[i].Address.LowPart, sg_list->Elements[i].Length));
    1.16 -    }
    1.17 -*/
    1.18 +
    1.19      i = 0;
    1.20      sg_num = 0;
    1.21      remaining = 0;
    1.22 @@ -165,36 +160,38 @@ XenNet_SendQueuedPackets(struct xennet_i
    1.23      offset = 0;
    1.24      while (sg_num < sg_list->NumberOfElements || remaining || (i == 1 && mss))
    1.25      {
    1.26 -//KdPrint((__DRIVER_NAME "     i = %d\n", i));
    1.27 +      //KdPrint((__DRIVER_NAME "     i = %d\n", i));
    1.28        ASSERT(cycles++ < 256);
    1.29        if (i == 1 && mss)
    1.30        {
    1.31 -//KdPrint((__DRIVER_NAME "     Start of loop - Large Send...\n"));
    1.32 +        //KdPrint((__DRIVER_NAME "     Start of loop - Large Send...\n"));
    1.33          length = 0;
    1.34        }
    1.35        else if (remaining == 0)
    1.36        {
    1.37          mss = PtrToUlong(NDIS_PER_PACKET_INFO_FROM_PACKET(packet, TcpLargeSendPacketInfo));
    1.38          if (total_packet_length <= mss)
    1.39 +        {
    1.40            mss = 0;
    1.41 -//if (mss)
    1.42 -//KdPrint((__DRIVER_NAME "     Start of loop - First Frag in sg...\n"));
    1.43 +        }
    1.44 +        //if (mss)
    1.45 +        //KdPrint((__DRIVER_NAME "     Start of loop - First Frag in sg...\n"));
    1.46          curr_addr = sg_list->Elements[sg_num].Address.QuadPart;
    1.47          offset = (USHORT)(sg_list->Elements[sg_num].Address.QuadPart & (PAGE_SIZE - 1));
    1.48          remaining = (USHORT)sg_list->Elements[sg_num].Length;
    1.49          length = min(remaining, PAGE_SIZE - offset);
    1.50 -//if (mss)
    1.51 -//KdPrint((__DRIVER_NAME "     sg entry %d - start = %08x, length = %d\n", sg_num, (ULONG)curr_addr, length));
    1.52 +        //if (mss)
    1.53 +        //KdPrint((__DRIVER_NAME "     sg entry %d - start = %08x, length = %d\n", sg_num, (ULONG)curr_addr, length));
    1.54          sg_num++;
    1.55        }
    1.56        else
    1.57        {
    1.58 -//if (mss)
    1.59 -//KdPrint((__DRIVER_NAME "     Start of loop - Subsequent Frag in sg...\n"));
    1.60 +        //if (mss)
    1.61 +        //KdPrint((__DRIVER_NAME "     Start of loop - Subsequent Frag in sg...\n"));
    1.62          offset = 0;
    1.63          length = min(remaining, PAGE_SIZE);
    1.64 -//if (mss)
    1.65 -//KdPrint((__DRIVER_NAME "     sg entry %d - start = %08x, length = %d\n", sg_num, (ULONG)curr_addr, length));
    1.66 +        //if (mss)
    1.67 +        //KdPrint((__DRIVER_NAME "     sg entry %d - start = %08x, length = %d\n", sg_num, (ULONG)curr_addr, length));
    1.68        }
    1.69        remaining = remaining - length;
    1.70        pfn = (ULONG)(curr_addr >> PAGE_SHIFT);
    1.71 @@ -207,7 +204,7 @@ XenNet_SendQueuedPackets(struct xennet_i
    1.72          id = get_id_from_freelist(xi);
    1.73          if (id == 0xFFFF)
    1.74          {
    1.75 -KdPrint((__DRIVER_NAME "     Out of space...\n"));
    1.76 +          KdPrint((__DRIVER_NAME "     Out of space...\n"));
    1.77            /* whups, out of space on the ring. requeue and get out */
    1.78            InsertHeadList(&xi->tx_waiting_pkt_list, entry);
    1.79            break;
    1.80 @@ -229,8 +226,8 @@ KdPrint((__DRIVER_NAME "     Out of spac
    1.81          tx->flags = 0;
    1.82          if (i == 1) // we have already incremented i!!!
    1.83          {
    1.84 -//if (mss)
    1.85 -//KdPrint((__DRIVER_NAME "     First Frag in packet...\n"));
    1.86 +          //if (mss)
    1.87 +          //KdPrint((__DRIVER_NAME "     First Frag in packet...\n"));
    1.88            tx->size = (USHORT)total_packet_length;
    1.89  #if defined(XEN_PROFILE)
    1.90            ProfCount_TxPacketsTotal++;
    1.91 @@ -246,7 +243,7 @@ KdPrint((__DRIVER_NAME "     Out of spac
    1.92            if (mss)
    1.93            {
    1.94              XenNet_SumHeader(first_buffer);
    1.95 -//KdPrint((__DRIVER_NAME "     Large Send Offload - mss = %d, length = %d\n", mss, total_packet_length));
    1.96 +            //KdPrint((__DRIVER_NAME "     Large Send Offload - mss = %d, length = %d\n", mss, total_packet_length));
    1.97              tx->flags |= NETTXF_extra_info|NETTXF_csum_blank|NETTXF_data_validated;
    1.98  #if defined(XEN_PROFILE)
    1.99              ProfCount_TxPacketsLargeOffload++;
   1.100 @@ -255,20 +252,20 @@ KdPrint((__DRIVER_NAME "     Out of spac
   1.101          }
   1.102          else
   1.103          {
   1.104 -//if (mss)
   1.105 -//KdPrint((__DRIVER_NAME "     Subsequent Frag in packet...\n"));
   1.106 +          //if (mss)
   1.107 +          //KdPrint((__DRIVER_NAME "     Subsequent Frag in packet...\n"));
   1.108            tx->size = length;
   1.109          }
   1.110          if (sg_num == sg_list->NumberOfElements && remaining == 0)
   1.111          {
   1.112 -//if (mss)
   1.113 -//KdPrint((__DRIVER_NAME "     No more frags\n"));
   1.114 +          //if (mss)
   1.115 +          //KdPrint((__DRIVER_NAME "     No more frags\n"));
   1.116            xi->tx_pkts[id] = packet; /* only set the packet on the last buffer */
   1.117          }
   1.118          else
   1.119          {
   1.120 -//if (mss)
   1.121 -//KdPrint((__DRIVER_NAME "     More frags\n"));
   1.122 +          //if (mss)
   1.123 +          //KdPrint((__DRIVER_NAME "     More frags\n"));
   1.124            tx->flags |= NETTXF_more_data;
   1.125          }
   1.126        }
   1.127 @@ -277,13 +274,13 @@ KdPrint((__DRIVER_NAME "     Out of spac
   1.128          id = get_no_id_from_freelist(xi);
   1.129          if (id == 0xFFFF)
   1.130          {
   1.131 -KdPrint((__DRIVER_NAME "     Out of space...\n"));
   1.132 +          KdPrint((__DRIVER_NAME "     Out of space...\n"));
   1.133            /* whups, out of space on the ring. requeue and get out */
   1.134            InsertHeadList(&xi->tx_waiting_pkt_list, entry);
   1.135            break;
   1.136          }
   1.137 -//if (mss)
   1.138 -//KdPrint((__DRIVER_NAME "     Extra Info...\n"));
   1.139 +        //if (mss)
   1.140 +        //KdPrint((__DRIVER_NAME "     Extra Info...\n"));
   1.141          (*(ULONG *)&packet->MiniportReservedEx)++;
   1.142          ei = (struct netif_extra_info *)RING_GET_REQUEST(&xi->tx, xi->tx.req_prod_pvt);
   1.143          ei->type = XEN_NETIF_EXTRA_TYPE_GSO;