[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [win-pv-devel] [PATCH] Drop all pre-8.2 revisions
Version 9.0 drivers only need to be backwards compatible as far as 8.2, so we can drop any interface versions that pre-date the 8.2 branch. Signed-off-by: Paul Durrant <paul.durrant@xxxxxxxxxx> --- include/revision.h | 9 - include/vif_interface.h | 194 +--------------- src/xenvif/vif.c | 582 +----------------------------------------------- src/xenvif/vif.h | 12 - 4 files changed, 5 insertions(+), 792 deletions(-) diff --git a/include/revision.h b/include/revision.h index d8c1cd9..9382e43 100644 --- a/include/revision.h +++ b/include/revision.h @@ -40,15 +40,6 @@ // REVISION C V ST SU #define DEFINE_REVISION_TABLE \ - DEFINE_REVISION(0x08000002, 1, 2, 0, 0), \ - DEFINE_REVISION(0x08000003, 1, 3, 0, 0), \ - DEFINE_REVISION(0x08000004, 1, 3, 2, 1), \ - DEFINE_REVISION(0x08000005, 1, 2, 1, 1), \ - DEFINE_REVISION(0x08000006, 1, 4, 2, 1), \ - DEFINE_REVISION(0x08000007, 1, 3, 1, 1), \ - DEFINE_REVISION(0x08000008, 1, 4, 1, 1), \ - DEFINE_REVISION(0x08000009, 1, 5, 2, 1), \ - DEFINE_REVISION(0x0800000A, 1, 5, 1, 1), \ DEFINE_REVISION(0x0800000B, 1, 6, 2, 1), \ DEFINE_REVISION(0x0800000C, 1, 7, 2, 1), \ DEFINE_REVISION(0x0800000D, 1, 8, 2, 1), \ diff --git a/include/vif_interface.h b/include/vif_interface.h index 02d9549..20de314 100644 --- a/include/vif_interface.h +++ b/include/vif_interface.h @@ -68,13 +68,6 @@ typedef enum _XENVIF_PACKET_HASH_TYPE { XENVIF_PACKET_HASH_TYPE_IPV6_TCP } XENVIF_PACKET_HASH_TYPE, *PXENVIF_PACKET_HASH_TYPE; -struct _XENVIF_PACKET_HASH_V1 { - /*! Hash algorithm used to calculate value */ - XENVIF_PACKET_HASH_ALGORITHM Algorithm; - /*! Calculated value */ - ULONG Value; -}; - /*! \struct _XENVIF_PACKET_HASH_V2 \brief Hash information */ @@ -99,19 +92,6 @@ struct _XENVIF_PACKET_HEADER_V1 { ULONG Length; }; -struct _XENVIF_PACKET_INFO_V1 { - ULONG Length; - USHORT TagControlInformation; - BOOLEAN IsAFragment; - struct _XENVIF_PACKET_HEADER_V1 EthernetHeader; - struct _XENVIF_PACKET_HEADER_V1 LLCSnapHeader; - struct _XENVIF_PACKET_HEADER_V1 IpHeader; - struct _XENVIF_PACKET_HEADER_V1 IpOptions; - struct _XENVIF_PACKET_HEADER_V1 TcpHeader; - struct _XENVIF_PACKET_HEADER_V1 TcpOptions; - struct _XENVIF_PACKET_HEADER_V1 UdpHeader; -}; - /*! \struct _XENVIF_PACKET_INFO_V2 \brief Packet information */ @@ -175,24 +155,6 @@ struct _XENVIF_PACKET_CHECKSUM_FLAGS_V1 { typedef struct _XENVIF_PACKET_CHECKSUM_FLAGS_V1 XENVIF_PACKET_CHECKSUM_FLAGS, *PXENVIF_PACKET_CHECKSUM_FLAGS; -#pragma warning(pop) - -struct _XENVIF_RECEIVER_PACKET_V1 { - LIST_ENTRY ListEntry; - struct _XENVIF_PACKET_INFO_V1 *Info; - ULONG Offset; - ULONG Length; - struct _XENVIF_PACKET_CHECKSUM_FLAGS_V1 Flags; - USHORT MaximumSegmentSize; - PVOID Cookie; - MDL Mdl; - PFN_NUMBER __Pfn; -}; - -#pragma warning(push) -#pragma warning(disable:4214) // nonstandard extension used : bit field types other than int -#pragma warning(disable:4201) // nonstandard extension used : nameless struct/union - /*! \struct _XENVIF_VIF_OFFLOAD_OPTIONS_V1 \brief Offload options */ @@ -558,12 +520,6 @@ typedef NTSTATUS IN ULONG Size ); -typedef VOID -(*XENVIF_VIF_RECEIVER_RETURN_PACKETS_V1)( - IN PINTERFACE Interface, - IN PLIST_ENTRY List - ); - /*! \typedef XENVIF_VIF_RECEIVER_RETURN_PACKET \brief Return packets queued for receive by \ref XENVIF_VIF_CALLBACK (Type = \ref XENVIF_RECEIVER_QUEUE_PACKET) @@ -578,34 +534,7 @@ typedef VOID ); typedef NTSTATUS -(*XENVIF_VIF_TRANSMITTER_GET_PACKET_HEADERS_V2)( - IN PINTERFACE Interface, - IN struct _XENVIF_TRANSMITTER_PACKET_V2 *Packet, - OUT PVOID Headers, - OUT PXENVIF_PACKET_INFO Info - ); - -typedef NTSTATUS -(*XENVIF_VIF_TRANSMITTER_QUEUE_PACKETS_V2)( - IN PINTERFACE Interface, - IN PLIST_ENTRY List - ); - -typedef VOID -(*XENVIF_VIF_TRANSMITTER_QUEUE_PACKET_V4)( - IN PINTERFACE Interface, - IN PMDL Mdl, - IN ULONG Offset, - IN ULONG Length, - IN XENVIF_VIF_OFFLOAD_OPTIONS OffloadOptions, - IN USHORT MaximumSegmentSize, - IN USHORT TagControlInformation, - IN PXENVIF_PACKET_HASH Hash, - IN PVOID Cookie - ); - -typedef NTSTATUS -(*XENVIF_VIF_TRANSMITTER_QUEUE_PACKET_V5)( +(*XENVIF_VIF_TRANSMITTER_QUEUE_PACKET_V6)( IN PINTERFACE Interface, IN PMDL Mdl, IN ULONG Offset, @@ -897,123 +826,6 @@ typedef NTSTATUS DEFINE_GUID(GUID_XENVIF_VIF_INTERFACE, 0x76f279cd, 0xca11, 0x418b, 0x92, 0xe8, 0xc5, 0x7f, 0x77, 0xde, 0xe, 0x2e); -/*! \struct _XENVIF_VIF_INTERFACE_V2 - \brief VIF interface version 2 - \ingroup interfaces -*/ -struct _XENVIF_VIF_INTERFACE_V2 { - INTERFACE Interface; - XENVIF_VIF_ACQUIRE Acquire; - XENVIF_VIF_RELEASE Release; - XENVIF_VIF_ENABLE Enable; - XENVIF_VIF_DISABLE Disable; - XENVIF_VIF_QUERY_STATISTIC QueryStatistic; - XENVIF_VIF_RECEIVER_RETURN_PACKETS_V1 ReceiverReturnPacketsVersion1; - XENVIF_VIF_RECEIVER_SET_OFFLOAD_OPTIONS ReceiverSetOffloadOptions; - XENVIF_VIF_RECEIVER_QUERY_RING_SIZE ReceiverQueryRingSize; - XENVIF_VIF_TRANSMITTER_GET_PACKET_HEADERS_V2 TransmitterGetPacketHeadersVersion2; - XENVIF_VIF_TRANSMITTER_QUEUE_PACKETS_V2 TransmitterQueuePacketsVersion2; - XENVIF_VIF_TRANSMITTER_QUERY_OFFLOAD_OPTIONS TransmitterQueryOffloadOptions; - XENVIF_VIF_TRANSMITTER_QUERY_LARGE_PACKET_SIZE TransmitterQueryLargePacketSize; - XENVIF_VIF_TRANSMITTER_QUERY_RING_SIZE TransmitterQueryRingSize; - XENVIF_VIF_MAC_QUERY_STATE MacQueryState; - XENVIF_VIF_MAC_QUERY_MAXIMUM_FRAME_SIZE MacQueryMaximumFrameSize; - XENVIF_VIF_MAC_QUERY_PERMANENT_ADDRESS MacQueryPermanentAddress; - XENVIF_VIF_MAC_QUERY_CURRENT_ADDRESS MacQueryCurrentAddress; - XENVIF_VIF_MAC_QUERY_MULTICAST_ADDRESSES MacQueryMulticastAddresses; - XENVIF_VIF_MAC_SET_MULTICAST_ADDRESSES MacSetMulticastAddresses; - XENVIF_VIF_MAC_SET_FILTER_LEVEL MacSetFilterLevel; - XENVIF_VIF_MAC_QUERY_FILTER_LEVEL MacQueryFilterLevel; -}; - -/*! \struct _XENVIF_VIF_INTERFACE_V3 - \brief VIF interface version 3 - \ingroup interfaces -*/ -struct _XENVIF_VIF_INTERFACE_V3 { - INTERFACE Interface; - XENVIF_VIF_ACQUIRE Acquire; - XENVIF_VIF_RELEASE Release; - XENVIF_VIF_ENABLE Enable; - XENVIF_VIF_DISABLE Disable; - XENVIF_VIF_QUERY_STATISTIC QueryStatistic; - XENVIF_VIF_RECEIVER_RETURN_PACKETS_V1 ReceiverReturnPacketsVersion1; - XENVIF_VIF_RECEIVER_SET_OFFLOAD_OPTIONS ReceiverSetOffloadOptions; - XENVIF_VIF_RECEIVER_SET_BACKFILL_SIZE ReceiverSetBackfillSize; - XENVIF_VIF_RECEIVER_QUERY_RING_SIZE ReceiverQueryRingSize; - XENVIF_VIF_TRANSMITTER_GET_PACKET_HEADERS_V2 TransmitterGetPacketHeadersVersion2; - XENVIF_VIF_TRANSMITTER_QUEUE_PACKETS_V2 TransmitterQueuePacketsVersion2; - XENVIF_VIF_TRANSMITTER_QUERY_OFFLOAD_OPTIONS TransmitterQueryOffloadOptions; - XENVIF_VIF_TRANSMITTER_QUERY_LARGE_PACKET_SIZE TransmitterQueryLargePacketSize; - XENVIF_VIF_TRANSMITTER_QUERY_RING_SIZE TransmitterQueryRingSize; - XENVIF_VIF_MAC_QUERY_STATE MacQueryState; - XENVIF_VIF_MAC_QUERY_MAXIMUM_FRAME_SIZE MacQueryMaximumFrameSize; - XENVIF_VIF_MAC_QUERY_PERMANENT_ADDRESS MacQueryPermanentAddress; - XENVIF_VIF_MAC_QUERY_CURRENT_ADDRESS MacQueryCurrentAddress; - XENVIF_VIF_MAC_QUERY_MULTICAST_ADDRESSES MacQueryMulticastAddresses; - XENVIF_VIF_MAC_SET_MULTICAST_ADDRESSES MacSetMulticastAddresses; - XENVIF_VIF_MAC_SET_FILTER_LEVEL MacSetFilterLevel; - XENVIF_VIF_MAC_QUERY_FILTER_LEVEL MacQueryFilterLevel; -}; - -/*! \struct _XENVIF_VIF_INTERFACE_V4 - \brief VIF interface version 4 - \ingroup interfaces -*/ -struct _XENVIF_VIF_INTERFACE_V4 { - INTERFACE Interface; - XENVIF_VIF_ACQUIRE Acquire; - XENVIF_VIF_RELEASE Release; - XENVIF_VIF_ENABLE Enable; - XENVIF_VIF_DISABLE Disable; - XENVIF_VIF_QUERY_STATISTIC QueryStatistic; - XENVIF_VIF_RECEIVER_RETURN_PACKET ReceiverReturnPacket; - XENVIF_VIF_RECEIVER_SET_OFFLOAD_OPTIONS ReceiverSetOffloadOptions; - XENVIF_VIF_RECEIVER_SET_BACKFILL_SIZE ReceiverSetBackfillSize; - XENVIF_VIF_RECEIVER_QUERY_RING_SIZE ReceiverQueryRingSize; - XENVIF_VIF_TRANSMITTER_QUEUE_PACKET_V4 TransmitterQueuePacketVersion4; - XENVIF_VIF_TRANSMITTER_QUERY_OFFLOAD_OPTIONS TransmitterQueryOffloadOptions; - XENVIF_VIF_TRANSMITTER_QUERY_LARGE_PACKET_SIZE TransmitterQueryLargePacketSize; - XENVIF_VIF_TRANSMITTER_QUERY_RING_SIZE TransmitterQueryRingSize; - XENVIF_VIF_MAC_QUERY_STATE MacQueryState; - XENVIF_VIF_MAC_QUERY_MAXIMUM_FRAME_SIZE MacQueryMaximumFrameSize; - XENVIF_VIF_MAC_QUERY_PERMANENT_ADDRESS MacQueryPermanentAddress; - XENVIF_VIF_MAC_QUERY_CURRENT_ADDRESS MacQueryCurrentAddress; - XENVIF_VIF_MAC_QUERY_MULTICAST_ADDRESSES MacQueryMulticastAddresses; - XENVIF_VIF_MAC_SET_MULTICAST_ADDRESSES MacSetMulticastAddresses; - XENVIF_VIF_MAC_SET_FILTER_LEVEL MacSetFilterLevel; - XENVIF_VIF_MAC_QUERY_FILTER_LEVEL MacQueryFilterLevel; -}; - -/*! \struct _XENVIF_VIF_INTERFACE_V5 - \brief VIF interface version 5 - \ingroup interfaces -*/ -struct _XENVIF_VIF_INTERFACE_V5 { - INTERFACE Interface; - XENVIF_VIF_ACQUIRE Acquire; - XENVIF_VIF_RELEASE Release; - XENVIF_VIF_ENABLE Enable; - XENVIF_VIF_DISABLE Disable; - XENVIF_VIF_QUERY_STATISTIC QueryStatistic; - XENVIF_VIF_RECEIVER_RETURN_PACKET ReceiverReturnPacket; - XENVIF_VIF_RECEIVER_SET_OFFLOAD_OPTIONS ReceiverSetOffloadOptions; - XENVIF_VIF_RECEIVER_SET_BACKFILL_SIZE ReceiverSetBackfillSize; - XENVIF_VIF_RECEIVER_QUERY_RING_SIZE ReceiverQueryRingSize; - XENVIF_VIF_TRANSMITTER_QUEUE_PACKET_V5 TransmitterQueuePacket; - XENVIF_VIF_TRANSMITTER_QUERY_OFFLOAD_OPTIONS TransmitterQueryOffloadOptions; - XENVIF_VIF_TRANSMITTER_QUERY_LARGE_PACKET_SIZE TransmitterQueryLargePacketSize; - XENVIF_VIF_TRANSMITTER_QUERY_RING_SIZE TransmitterQueryRingSize; - XENVIF_VIF_MAC_QUERY_STATE MacQueryState; - XENVIF_VIF_MAC_QUERY_MAXIMUM_FRAME_SIZE MacQueryMaximumFrameSize; - XENVIF_VIF_MAC_QUERY_PERMANENT_ADDRESS MacQueryPermanentAddress; - XENVIF_VIF_MAC_QUERY_CURRENT_ADDRESS MacQueryCurrentAddress; - XENVIF_VIF_MAC_QUERY_MULTICAST_ADDRESSES MacQueryMulticastAddresses; - XENVIF_VIF_MAC_SET_MULTICAST_ADDRESSES MacSetMulticastAddresses; - XENVIF_VIF_MAC_SET_FILTER_LEVEL MacSetFilterLevel; - XENVIF_VIF_MAC_QUERY_FILTER_LEVEL MacQueryFilterLevel; -}; - /*! \struct _XENVIF_VIF_INTERFACE_V6 \brief VIF interface version 6 \ingroup interfaces @@ -1034,7 +846,7 @@ struct _XENVIF_VIF_INTERFACE_V6 { XENVIF_VIF_RECEIVER_SET_HASH_ALGORITHM ReceiverSetHashAlgorithm; XENVIF_VIF_RECEIVER_QUERY_HASH_CAPABILITIES ReceiverQueryHashCapabilities; XENVIF_VIF_RECEIVER_UPDATE_HASH_PARAMETERS ReceiverUpdateHashParameters; - XENVIF_VIF_TRANSMITTER_QUEUE_PACKET_V5 TransmitterQueuePacket; + XENVIF_VIF_TRANSMITTER_QUEUE_PACKET_V6 TransmitterQueuePacket; XENVIF_VIF_TRANSMITTER_QUERY_OFFLOAD_OPTIONS TransmitterQueryOffloadOptions; XENVIF_VIF_TRANSMITTER_QUERY_LARGE_PACKET_SIZE TransmitterQueryLargePacketSize; XENVIF_VIF_TRANSMITTER_QUERY_RING_SIZE TransmitterQueryRingSize; @@ -1126,7 +938,7 @@ typedef struct _XENVIF_VIF_INTERFACE_V8 XENVIF_VIF_INTERFACE, *PXENVIF_VIF_INTER #endif // _WINDLL -#define XENVIF_VIF_INTERFACE_VERSION_MIN 2 +#define XENVIF_VIF_INTERFACE_VERSION_MIN 6 #define XENVIF_VIF_INTERFACE_VERSION_MAX 8 #endif // _XENVIF_INTERFACE_H diff --git a/src/xenvif/vif.c b/src/xenvif/vif.c index 84da068..ffdec50 100644 --- a/src/xenvif/vif.c +++ b/src/xenvif/vif.c @@ -355,39 +355,6 @@ VifUpdateHashMapping( } static VOID -VifReceiverReturnPacketsVersion1( - IN PINTERFACE Interface, - IN PLIST_ENTRY List - ) -{ - PXENVIF_VIF_CONTEXT Context = Interface->Context; - - AcquireMrswLockShared(&Context->Lock); - - while (!IsListEmpty(List)) { - PLIST_ENTRY ListEntry; - struct _XENVIF_RECEIVER_PACKET_V1 *PacketVersion1; - - ListEntry = RemoveHeadList(List); - ASSERT3P(ListEntry, !=, List); - - RtlZeroMemory(ListEntry, sizeof (LIST_ENTRY)); - - PacketVersion1 = CONTAINING_RECORD(ListEntry, - struct _XENVIF_RECEIVER_PACKET_V1, - ListEntry); - - ReceiverReturnPacket(FrontendGetReceiver(Context->Frontend), - PacketVersion1->Cookie); - - __VifFree(PacketVersion1->Info); - __VifFree(PacketVersion1); - } - - ReleaseMrswLockShared(&Context->Lock); -} - -static VOID VifReceiverReturnPacket( IN PINTERFACE Interface, IN PVOID Cookie @@ -403,210 +370,8 @@ VifReceiverReturnPacket( ReleaseMrswLockShared(&Context->Lock); } -static BOOLEAN -VifTransmitterGetPacketHeadersVersion2Pullup( - IN PVOID Argument, - IN PUCHAR DestinationVa, - IN OUT PXENVIF_PACKET_PAYLOAD Payload, - IN ULONG Length - ) -{ - PMDL Mdl; - ULONG Offset; - - UNREFERENCED_PARAMETER(Argument); - - Mdl = Payload->Mdl; - Offset = Payload->Offset; - - if (Payload->Length < Length) - goto fail1; - - Payload->Length -= Length; - - while (Length != 0) { - PUCHAR MdlMappedSystemVa; - ULONG MdlByteCount; - ULONG CopyLength; - - ASSERT(Mdl != NULL); - - MdlMappedSystemVa = MmGetSystemAddressForMdlSafe(Mdl, NormalPagePriority); - ASSERT(MdlMappedSystemVa != NULL); - - MdlMappedSystemVa += Offset; - - MdlByteCount = Mdl->ByteCount - Offset; - - CopyLength = __min(MdlByteCount, Length); - - RtlCopyMemory(DestinationVa, MdlMappedSystemVa, CopyLength); - DestinationVa += CopyLength; - - Offset += CopyLength; - Length -= CopyLength; - - MdlByteCount -= CopyLength; - if (MdlByteCount == 0) { - Mdl = Mdl->Next; - Offset = 0; - } - } - - Payload->Mdl = Mdl; - Payload->Offset = Offset; - - return TRUE; - -fail1: - Error("fail1\n"); - - return FALSE; -} - -static NTSTATUS -VifTransmitterGetPacketHeadersVersion2( - IN PINTERFACE Interface, - IN struct _XENVIF_TRANSMITTER_PACKET_V2 *Packet, - OUT PVOID Headers, - OUT PXENVIF_PACKET_INFO Info - ) -{ - PXENVIF_VIF_CONTEXT Context = Interface->Context; - XENVIF_PACKET_PAYLOAD Payload; - NTSTATUS status; - - AcquireMrswLockShared(&Context->Lock); - - Payload.Mdl = Packet->Mdl; - Payload.Offset = Packet->Offset; - Payload.Length = Packet->Length; - - status = ParsePacket(Headers, - VifTransmitterGetPacketHeadersVersion2Pullup, - Context, - &Payload, - Info); - - ReleaseMrswLockShared(&Context->Lock); - - return status; -} - -static NTSTATUS -VifTransmitterQueuePacketsVersion2( - IN PINTERFACE Interface, - IN PLIST_ENTRY List - ) -{ - PXENVIF_VIF_CONTEXT Context = Interface->Context; - LIST_ENTRY Reject; - - AcquireMrswLockShared(&Context->Lock); - - if (!Context->Enabled) - goto done; - - InitializeListHead(&Reject); - - while (!IsListEmpty(List)) { - PLIST_ENTRY ListEntry; - struct _XENVIF_TRANSMITTER_PACKET_V2 *PacketVersion2; - XENVIF_PACKET_HASH Hash; - NTSTATUS status; - - ListEntry = RemoveHeadList(List); - ASSERT3P(ListEntry, !=, List); - - RtlZeroMemory(ListEntry, sizeof (LIST_ENTRY)); - - PacketVersion2 = CONTAINING_RECORD(ListEntry, - struct _XENVIF_TRANSMITTER_PACKET_V2, - ListEntry); - - Hash.Algorithm = XENVIF_PACKET_HASH_ALGORITHM_UNSPECIFIED; - Hash.Value = PacketVersion2->Value; - - status = TransmitterQueuePacket(FrontendGetTransmitter(Context->Frontend), - PacketVersion2->Mdl, - PacketVersion2->Offset, - PacketVersion2->Length, - PacketVersion2->Send.OffloadOptions, - PacketVersion2->Send.MaximumSegmentSize, - PacketVersion2->Send.TagControlInformation, - &Hash, - FALSE, - PacketVersion2); - if (!NT_SUCCESS(status)) - InsertTailList(&Reject, &PacketVersion2->ListEntry); - } - - ASSERT(IsListEmpty(List)); - - if (!IsListEmpty(&Reject)) { - PLIST_ENTRY ListEntry = Reject.Flink; - - RemoveEntryList(&Reject); - AppendTailList(List, ListEntry); - } - -done: - ReleaseMrswLockShared(&Context->Lock); - - return (IsListEmpty(List)) ? STATUS_SUCCESS : STATUS_UNSUCCESSFUL; -} - -static VOID -VifTransmitterQueuePacketVersion4( - IN PINTERFACE Interface, - IN PMDL Mdl, - IN ULONG Offset, - IN ULONG Length, - IN XENVIF_VIF_OFFLOAD_OPTIONS OffloadOptions, - IN USHORT MaximumSegmentSize, - IN USHORT TagControlInformation, - IN PXENVIF_PACKET_HASH Hash, - IN PVOID Cookie - ) -{ - PXENVIF_VIF_CONTEXT Context = Interface->Context; - NTSTATUS status; - - AcquireMrswLockShared(&Context->Lock); - - status = STATUS_UNSUCCESSFUL; - if (!Context->Enabled) - goto done; - - status = TransmitterQueuePacket(FrontendGetTransmitter(Context->Frontend), - Mdl, - Offset, - Length, - OffloadOptions, - MaximumSegmentSize, - TagControlInformation, - Hash, - FALSE, - Cookie); - -done: - ReleaseMrswLockShared(&Context->Lock); - - if (!NT_SUCCESS(status)) { - XENVIF_TRANSMITTER_PACKET_COMPLETION_INFO Completion; - - RtlZeroMemory(&Completion, sizeof (XENVIF_TRANSMITTER_PACKET_COMPLETION_INFO)); - - Completion.Status = XENVIF_TRANSMITTER_PACKET_DROPPED; - - VifTransmitterReturnPacket(Context, - Cookie, - &Completion); - } -} - static NTSTATUS -VifTransmitterQueuePacketVersion5( +VifTransmitterQueuePacketVersion6( IN PINTERFACE Interface, IN PMDL Mdl, IN ULONG Offset, @@ -1063,107 +828,6 @@ done: ReleaseMrswLockExclusive(&Context->Lock, Irql, FALSE); } -static struct _XENVIF_VIF_INTERFACE_V2 VifInterfaceVersion2 = { - { sizeof (struct _XENVIF_VIF_INTERFACE_V2), 2, NULL, NULL, NULL }, - VifAcquire, - VifRelease, - VifEnable, - VifDisable, - VifQueryStatistic, - VifReceiverReturnPacketsVersion1, - VifReceiverSetOffloadOptions, - VifReceiverQueryRingSize, - VifTransmitterGetPacketHeadersVersion2, - VifTransmitterQueuePacketsVersion2, - VifTransmitterQueryOffloadOptions, - VifTransmitterQueryLargePacketSize, - VifTransmitterQueryRingSize, - VifMacQueryState, - VifMacQueryMaximumFrameSize, - VifMacQueryPermanentAddress, - VifMacQueryCurrentAddress, - VifMacQueryMulticastAddresses, - VifMacSetMulticastAddresses, - VifMacSetFilterLevel, - VifMacQueryFilterLevel -}; - -static struct _XENVIF_VIF_INTERFACE_V3 VifInterfaceVersion3 = { - { sizeof (struct _XENVIF_VIF_INTERFACE_V3), 3, NULL, NULL, NULL }, - VifAcquire, - VifRelease, - VifEnable, - VifDisable, - VifQueryStatistic, - VifReceiverReturnPacketsVersion1, - VifReceiverSetOffloadOptions, - VifReceiverSetBackfillSize, - VifReceiverQueryRingSize, - VifTransmitterGetPacketHeadersVersion2, - VifTransmitterQueuePacketsVersion2, - VifTransmitterQueryOffloadOptions, - VifTransmitterQueryLargePacketSize, - VifTransmitterQueryRingSize, - VifMacQueryState, - VifMacQueryMaximumFrameSize, - VifMacQueryPermanentAddress, - VifMacQueryCurrentAddress, - VifMacQueryMulticastAddresses, - VifMacSetMulticastAddresses, - VifMacSetFilterLevel, - VifMacQueryFilterLevel -}; - -static struct _XENVIF_VIF_INTERFACE_V4 VifInterfaceVersion4 = { - { sizeof (struct _XENVIF_VIF_INTERFACE_V4), 4, NULL, NULL, NULL }, - VifAcquire, - VifRelease, - VifEnable, - VifDisable, - VifQueryStatistic, - VifReceiverReturnPacket, - VifReceiverSetOffloadOptions, - VifReceiverSetBackfillSize, - VifReceiverQueryRingSize, - VifTransmitterQueuePacketVersion4, - VifTransmitterQueryOffloadOptions, - VifTransmitterQueryLargePacketSize, - VifTransmitterQueryRingSize, - VifMacQueryState, - VifMacQueryMaximumFrameSize, - VifMacQueryPermanentAddress, - VifMacQueryCurrentAddress, - VifMacQueryMulticastAddresses, - VifMacSetMulticastAddresses, - VifMacSetFilterLevel, - VifMacQueryFilterLevel -}; - -static struct _XENVIF_VIF_INTERFACE_V5 VifInterfaceVersion5 = { - { sizeof (struct _XENVIF_VIF_INTERFACE_V5), 5, NULL, NULL, NULL }, - VifAcquire, - VifRelease, - VifEnable, - VifDisable, - VifQueryStatistic, - VifReceiverReturnPacket, - VifReceiverSetOffloadOptions, - VifReceiverSetBackfillSize, - VifReceiverQueryRingSize, - VifTransmitterQueuePacketVersion5, - VifTransmitterQueryOffloadOptions, - VifTransmitterQueryLargePacketSize, - VifTransmitterQueryRingSize, - VifMacQueryState, - VifMacQueryMaximumFrameSize, - VifMacQueryPermanentAddress, - VifMacQueryCurrentAddress, - VifMacQueryMulticastAddresses, - VifMacSetMulticastAddresses, - VifMacSetFilterLevel, - VifMacQueryFilterLevel -}; - static struct _XENVIF_VIF_INTERFACE_V6 VifInterfaceVersion6 = { { sizeof (struct _XENVIF_VIF_INTERFACE_V6), 6, NULL, NULL, NULL }, VifAcquire, @@ -1180,7 +844,7 @@ static struct _XENVIF_VIF_INTERFACE_V6 VifInterfaceVersion6 = { VifReceiverSetHashAlgorithm, VifReceiverQueryHashCapabilities, VifReceiverUpdateHashParameters, - VifTransmitterQueuePacketVersion5, + VifTransmitterQueuePacketVersion6, VifTransmitterQueryOffloadOptions, VifTransmitterQueryLargePacketSize, VifTransmitterQueryRingSize, @@ -1318,74 +982,6 @@ VifGetInterface( NTSTATUS status; switch (Version) { - case 2: { - struct _XENVIF_VIF_INTERFACE_V2 *VifInterface; - - VifInterface = (struct _XENVIF_VIF_INTERFACE_V2 *)Interface; - - status = STATUS_BUFFER_OVERFLOW; - if (Size < sizeof (struct _XENVIF_VIF_INTERFACE_V2)) - break; - - *VifInterface = VifInterfaceVersion2; - - ASSERT3U(Interface->Version, ==, Version); - Interface->Context = Context; - - status = STATUS_SUCCESS; - break; - } - case 3: { - struct _XENVIF_VIF_INTERFACE_V3 *VifInterface; - - VifInterface = (struct _XENVIF_VIF_INTERFACE_V3 *)Interface; - - status = STATUS_BUFFER_OVERFLOW; - if (Size < sizeof (struct _XENVIF_VIF_INTERFACE_V3)) - break; - - *VifInterface = VifInterfaceVersion3; - - ASSERT3U(Interface->Version, ==, Version); - Interface->Context = Context; - - status = STATUS_SUCCESS; - break; - } - case 4: { - struct _XENVIF_VIF_INTERFACE_V4 *VifInterface; - - VifInterface = (struct _XENVIF_VIF_INTERFACE_V4 *)Interface; - - status = STATUS_BUFFER_OVERFLOW; - if (Size < sizeof (struct _XENVIF_VIF_INTERFACE_V4)) - break; - - *VifInterface = VifInterfaceVersion4; - - ASSERT3U(Interface->Version, ==, Version); - Interface->Context = Context; - - status = STATUS_SUCCESS; - break; - } - case 5: { - struct _XENVIF_VIF_INTERFACE_V5 *VifInterface; - - VifInterface = (struct _XENVIF_VIF_INTERFACE_V5 *)Interface; - - status = STATUS_BUFFER_OVERFLOW; - if (Size < sizeof (struct _XENVIF_VIF_INTERFACE_V5)) - break; - - *VifInterface = VifInterfaceVersion5; - - ASSERT3U(Interface->Version, ==, Version); - Interface->Context = Context; - - status = STATUS_SUCCESS; - break; - } case 6: { struct _XENVIF_VIF_INTERFACE_V6 *VifInterface; @@ -1473,116 +1069,6 @@ VifTeardown( } static FORCEINLINE VOID -__VifReceiverQueuePacketVersion1( - IN PXENVIF_VIF_CONTEXT Context, - IN ULONG Index, - IN PMDL Mdl, - IN ULONG Offset, - IN ULONG Length, - IN XENVIF_PACKET_CHECKSUM_FLAGS Flags, - IN USHORT MaximumSegmentSize, - IN USHORT TagControlInformation, - IN PXENVIF_PACKET_INFO Info, - IN PXENVIF_PACKET_HASH Hash, - IN BOOLEAN More, - IN PVOID Cookie - ) -{ - struct _XENVIF_PACKET_INFO_V1 *InfoVersion1; - struct _XENVIF_RECEIVER_PACKET_V1 *PacketVersion1; - LIST_ENTRY List; - NTSTATUS status; - - UNREFERENCED_PARAMETER(Index); - UNREFERENCED_PARAMETER(Hash); - UNREFERENCED_PARAMETER(More); - - InfoVersion1 = __VifAllocate(sizeof (struct _XENVIF_PACKET_INFO_V1)); - - status = STATUS_NO_MEMORY; - if (InfoVersion1 == NULL) - goto fail1; - - InfoVersion1->Length = Info->Length; - InfoVersion1->TagControlInformation = TagControlInformation; - InfoVersion1->IsAFragment = Info->IsAFragment; - InfoVersion1->EthernetHeader = Info->EthernetHeader; - InfoVersion1->LLCSnapHeader = Info->LLCSnapHeader; - InfoVersion1->IpHeader = Info->IpHeader; - InfoVersion1->IpOptions = Info->IpOptions; - InfoVersion1->TcpHeader = Info->TcpHeader; - InfoVersion1->TcpOptions = Info->TcpOptions; - InfoVersion1->UdpHeader = Info->UdpHeader; - - PacketVersion1 = __VifAllocate(sizeof (struct _XENVIF_RECEIVER_PACKET_V1)); - - status = STATUS_NO_MEMORY; - if (PacketVersion1 == NULL) - goto fail2; - - PacketVersion1->Info = InfoVersion1; - PacketVersion1->Offset = Offset; - PacketVersion1->Length = Length; - PacketVersion1->Flags = Flags; - PacketVersion1->MaximumSegmentSize = MaximumSegmentSize; - PacketVersion1->Cookie = Cookie; - PacketVersion1->Mdl = *Mdl; - PacketVersion1->__Pfn = MmGetMdlPfnArray(Mdl)[0]; - - InitializeListHead(&List); - InsertTailList(&List, &PacketVersion1->ListEntry); - - Context->Callback(Context->Argument, - XENVIF_RECEIVER_QUEUE_PACKET, - &List); - - ASSERT(IsListEmpty(&List)); - - return; - -fail2: - Error("fail2\n"); - -fail1: - Error("fail1 (%08x)\n", status); - - ReceiverReturnPacket(FrontendGetReceiver(Context->Frontend), - Cookie); -} - -static FORCEINLINE VOID -__VifReceiverQueuePacketVersion4( - IN PXENVIF_VIF_CONTEXT Context, - IN ULONG Index, - IN PMDL Mdl, - IN ULONG Offset, - IN ULONG Length, - IN XENVIF_PACKET_CHECKSUM_FLAGS Flags, - IN USHORT MaximumSegmentSize, - IN USHORT TagControlInformation, - IN PXENVIF_PACKET_INFO Info, - IN PXENVIF_PACKET_HASH Hash, - IN BOOLEAN More, - IN PVOID Cookie - ) -{ - UNREFERENCED_PARAMETER(Index); - UNREFERENCED_PARAMETER(Hash); - UNREFERENCED_PARAMETER(More); - - Context->Callback(Context->Argument, - XENVIF_RECEIVER_QUEUE_PACKET, - Mdl, - Offset, - Length, - Flags, - MaximumSegmentSize, - TagControlInformation, - Info, - Cookie); -} - -static FORCEINLINE VOID __VifReceiverQueuePacketVersion6( IN PXENVIF_VIF_CONTEXT Context, IN ULONG Index, @@ -1694,38 +1180,6 @@ VifReceiverQueuePacket( ) { switch (Context->Version) { - case 2: - case 3: - __VifReceiverQueuePacketVersion1(Context, - Index, - Mdl, - Offset, - Length, - Flags, - MaximumSegmentSize, - TagControlInformation, - Info, - Hash, - More, - Cookie); - break; - - case 4: - case 5: - __VifReceiverQueuePacketVersion4(Context, - Index, - Mdl, - Offset, - Length, - Flags, - MaximumSegmentSize, - TagControlInformation, - Info, - Hash, - More, - Cookie); - break; - case 6: __VifReceiverQueuePacketVersion6(Context, Index, @@ -1777,29 +1231,6 @@ VifReceiverQueuePacket( } } -static FORCEINLINE VOID -__VifTransmitterReturnPacketVersion2( - IN PXENVIF_VIF_CONTEXT Context, - IN PVOID Cookie, - IN PXENVIF_TRANSMITTER_PACKET_COMPLETION_INFO Completion - ) -{ - struct _XENVIF_TRANSMITTER_PACKET_V2 *PacketVersion2; - LIST_ENTRY List; - - PacketVersion2 = Cookie; - PacketVersion2->Completion = *Completion; - - InitializeListHead(&List); - InsertTailList(&List, &PacketVersion2->ListEntry); - - Context->Callback(Context->Argument, - XENVIF_TRANSMITTER_RETURN_PACKET, - &List); - - ASSERT(IsListEmpty(&List)); -} - VOID VifTransmitterReturnPacket( IN PXENVIF_VIF_CONTEXT Context, @@ -1808,15 +1239,6 @@ VifTransmitterReturnPacket( ) { switch (Context->Version) { - case 2: - case 3: - __VifTransmitterReturnPacketVersion2(Context, - Cookie, - Completion); - break; - - case 4: - case 5: case 6: case 7: case 8: diff --git a/src/xenvif/vif.h b/src/xenvif/vif.h index a2fd613..b83a767 100644 --- a/src/xenvif/vif.h +++ b/src/xenvif/vif.h @@ -63,12 +63,6 @@ VifTeardown( // CALLBACKS extern VOID -VifReceiverQueuePacketsVersion1( - IN PXENVIF_VIF_CONTEXT Context, - IN PLIST_ENTRY List - ); - -extern VOID VifReceiverQueuePacket( IN PXENVIF_VIF_CONTEXT Context, IN ULONG Index, @@ -85,12 +79,6 @@ VifReceiverQueuePacket( ); extern VOID -VifTransmitterReturnPacketsVersion2( - IN PXENVIF_VIF_CONTEXT Context, - IN PLIST_ENTRY List - ); - -extern VOID VifTransmitterReturnPacket( IN PXENVIF_VIF_CONTEXT Context, IN PVOID Cookie, -- 2.5.3 _______________________________________________ win-pv-devel mailing list win-pv-devel@xxxxxxxxxxxxxxxxxxxx https://lists.xenproject.org/cgi-bin/mailman/listinfo/win-pv-devel
|
Lists.xenproject.org is hosted with RackSpace, monitoring our |