Skip to content

Commit c2af034

Browse files
sb-ntnxYanVugenfirer
authored andcommitted
netkvm: set ipHeaderOffset to ETH_HEADER_SIZE
If Windows is configured to disable checksum offloading for IPv4 and IPv6, it does not use OID_OFFLOAD_ENCAPSULATION OID to set offload encapsulation. As the result, OnSetOffloadEncapsulation is not executed and it makes, ipHeaderOffset remain zero. It will break CNB::SetupCSO and it will set VirtioHeader->csum_start to the wrong value (not to the offset where IP header begins). Effectively, it will affect the checksum offloading resulting in packets being dropped somewhere on the path and network connectivity inside the guest will be affected. With the proposed change, we set ipHeaderOffset to ETH_HEADER_SIZE by default and it helps avoid the problem if/when OnSetOffloadEncapsulation is not called Signed-off-by: Sergey Bykov <sergey.bykov@nutanix.com>
1 parent 5b565d5 commit c2af034

1 file changed

Lines changed: 1 addition & 0 deletions

File tree

NetKVM/Common/ParaNdis_Common.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -298,6 +298,7 @@ static bool ReadNicConfiguration(PARANDIS_ADAPTER *pContext, PUCHAR pNewMACAddre
298298
pContext->uNumberOfHandledRXPacketsInDPC = pConfiguration->NumberOfHandledRXPacketsInDPC.ulValue;
299299
pContext->bDoSupportPriority = pConfiguration->PrioritySupport.ulValue != 0;
300300
pContext->Offload.flagsValue = 0;
301+
pContext->Offload.ipHeaderOffset = ETH_HEADER_SIZE;
301302
pContext->MinRxBufferPercent = pConfiguration->MinRxBufferPercent.ulValue;
302303
pContext->bRxSeparateTail = pConfiguration->RxSeparateTail.ulValue != 0;
303304
// TX caps: 1 - TCP, 2 - UDP, 4 - IP, 8 - TCPv6, 16 - UDPv6

0 commit comments

Comments
 (0)