win-pvdrivers

changeset 97:104e88af0858

Started adding in checksum offloading to the rx code path
author James Harper <james.harper@bendigoit.com.au>
date Mon Jan 07 12:47:33 2008 +1100 (2008-01-07)
parents 652ccd25fc7e
children 7fa1d15f34bf
files xennet/sources xennet/xennet.c
line diff
     1.1 --- a/xennet/sources	Sat Jan 05 15:55:30 2008 +1100
     1.2 +++ b/xennet/sources	Mon Jan 07 12:47:33 2008 +1100
     1.3 @@ -1,7 +1,7 @@
     1.4  TARGETNAME=XENNET
     1.5  TARGETTYPE=DRIVER
     1.6  TARGETPATH=..\Target\$(DDK_TARGET_OS)
     1.7 -VERSION=0.5.0.44
     1.8 +VERSION=0.5.0.47
     1.9  KMDF_VERSION=1
    1.10  MSC_WARNING_LEVEL=/W4
    1.11  INF_NAME=xennet
     2.1 --- a/xennet/xennet.c	Sat Jan 05 15:55:30 2008 +1100
     2.2 +++ b/xennet/xennet.c	Mon Jan 07 12:47:33 2008 +1100
     2.3 @@ -319,6 +319,7 @@ XenNet_RxBufferCheck(struct xennet_info 
     2.4    UINT tot_buff_len;
     2.5    int moretodo;
     2.6    KIRQL OldIrql;
     2.7 +  PNDIS_TCP_IP_CHECKSUM_PACKET_INFO csum_info;
     2.8  
     2.9  //  KdPrint((__DRIVER_NAME " --> " __FUNCTION__ "\n"));
    2.10  
    2.11 @@ -351,6 +352,15 @@ XenNet_RxBufferCheck(struct xennet_info 
    2.12        ASSERT(rxrsp->status > 0);
    2.13        NdisAdjustBufferLength(buffer, rxrsp->status);
    2.14  
    2.15 +      csum_info = (PNDIS_TCP_IP_CHECKSUM_PACKET_INFO)NDIS_PER_PACKET_INFO_FROM_PACKET(pkt, TcpIpChecksumPacketInfo);
    2.16 +      if (csum_info != NULL)
    2.17 +      {
    2.18 +        KdPrint((__DRIVER_NAME "     Got NDIS_PER_PACKET_INFO_FROM_PACKET(pkt, TcpIpChecksumPacketInfo)\n"));
    2.19 +        csum_info->Receive.NdisPacketTcpChecksumSucceeded = 1;
    2.20 +      }
    2.21 +      else
    2.22 +        KdPrint((__DRIVER_NAME "     Could not get NDIS_PER_PACKET_INFO_FROM_PACKET(pkt, TcpIpChecksumPacketInfo)\n"));
    2.23 +
    2.24        xi->stat_rx_ok++;
    2.25        NDIS_SET_PACKET_STATUS(pkt, NDIS_STATUS_SUCCESS);
    2.26  
    2.27 @@ -423,12 +433,10 @@ XenNet_BackEndStateHandler(char *Path, P
    2.28      {"rx-ring-ref", 0},
    2.29      {"event-channel", 0},
    2.30      {"request-rx-copy", 1},
    2.31 -#if 0 // these seemed to cause kernel messages about checksums
    2.32      {"feature-rx-notify", 1},
    2.33      {"feature-no-csum-offload", 1},
    2.34      {"feature-sg", 1},
    2.35      {"feature-gso-tcpv4", 0},
    2.36 -#endif
    2.37      {NULL, 0},
    2.38    };
    2.39  
    2.40 @@ -851,6 +859,8 @@ NDIS_OID supported_oids[] =
    2.41    OID_802_3_CURRENT_ADDRESS,
    2.42    OID_802_3_MULTICAST_LIST,
    2.43    OID_802_3_MAXIMUM_LIST_SIZE,
    2.44 +  /* tcp offload */
    2.45 +  OID_TCP_TASK_OFFLOAD,
    2.46  };
    2.47  
    2.48  NDIS_STATUS 
    2.49 @@ -983,6 +993,9 @@ XenNet_QueryInformation(
    2.50      case OID_802_3_MAXIMUM_LIST_SIZE:
    2.51        temp_data = 0; /* no mcast support */
    2.52        break;
    2.53 +    case OID_TCP_TASK_OFFLOAD:
    2.54 +      KdPrint(("Get OID_TCP_TASK_OFFLOAD\n"));
    2.55 +      break;
    2.56      default:
    2.57        KdPrint(("Get Unknown OID 0x%x\n", Oid));
    2.58        status = NDIS_STATUS_NOT_SUPPORTED;
    2.59 @@ -1291,7 +1304,7 @@ XenNet_SendPackets(
    2.60      xi->grant_tx_ref[id] = tx->gref;
    2.61      tx->offset = (uint16_t)MmGetMdlByteOffset(pmdl);
    2.62      tx->size = (UINT16)pkt_size;
    2.63 -    // NETTXF_csum_blank should only be used for tcp and udp packets...
    2.64 +    // NETTXF_csum_blank should only be used for tcp and udp packets...    
    2.65      tx->flags = 0; //NETTXF_csum_blank;
    2.66  
    2.67      xi->tx.req_prod_pvt++;