diff options
author | Alin Gabriel Serdean <aserdean@cloudbasesolutions.com> | 2017-06-09 15:16:07 -0700 |
---|---|---|
committer | Gurucharan Shetty <guru@ovn.org> | 2017-06-12 12:08:07 -0700 |
commit | 75e55899022c87b1fc1d964217a6e88b99b9534d (patch) | |
tree | f192a663f0a1d4c36987824fa88b4a12931e9205 /datapath-windows/ovsext | |
parent | b7a6b3a76be7227a4cdaa5610553aa84f34d88fb (diff) | |
download | openvswitch-75e55899022c87b1fc1d964217a6e88b99b9534d.tar.gz |
windows-datapath: Temporary workaround checksum issue with NAT
There is a known bug with NAT where checksum computation is wrong on
the RX path if offload is enabled. This patch works around the problem
by always computing a software checksum and should be reverted once
we figure out the root cause of checksum error.
Signed-off-by: Alin Gabriel Serdean <aserdean@cloudbasesolutions.com>
Signed-off-by: Gurucharan Shetty <guru@ovn.org>
Diffstat (limited to 'datapath-windows/ovsext')
-rw-r--r-- | datapath-windows/ovsext/Actions.c | 38 |
1 files changed, 38 insertions, 0 deletions
diff --git a/datapath-windows/ovsext/Actions.c b/datapath-windows/ovsext/Actions.c index 668825bbf..3ea066b85 100644 --- a/datapath-windows/ovsext/Actions.c +++ b/datapath-windows/ovsext/Actions.c @@ -1573,6 +1573,44 @@ OvsUpdateAddressAndPort(OvsForwardingContext *ovsFwdCtx, } *portField = newPort; } + PNET_BUFFER_LIST curNbl = ovsFwdCtx->curNbl; + PNET_BUFFER_LIST newNbl = NULL; + if (layers->isTcp) { + UINT32 mss = OVSGetTcpMSS(curNbl); + if (mss) { + OVS_LOG_TRACE("l4Offset %d", layers->l4Offset); + newNbl = OvsTcpSegmentNBL(ovsFwdCtx->switchContext, curNbl, layers, + mss, 0, FALSE); + if (newNbl == NULL) { + OVS_LOG_ERROR("Unable to segment NBL"); + return NDIS_STATUS_FAILURE; + } + /* Clear out LSO flags after this point */ + NET_BUFFER_LIST_INFO(newNbl, TcpLargeSendNetBufferListInfo) = 0; + } + } + /* If we didn't split the packet above, make a copy now */ + if (newNbl == NULL) { + csumInfo.Value = NET_BUFFER_LIST_INFO(curNbl, + TcpIpChecksumNetBufferListInfo); + OvsApplySWChecksumOnNB(layers, curNbl, &csumInfo); + } + + if (newNbl) { + curNbl = newNbl; + OvsCompleteNBLForwardingCtx(ovsFwdCtx, + L"Complete after cloning NBL for encapsulation"); + OvsInitForwardingCtx(ovsFwdCtx, ovsFwdCtx->switchContext, + newNbl, ovsFwdCtx->srcVportNo, 0, + NET_BUFFER_LIST_SWITCH_FORWARDING_DETAIL(newNbl), + ovsFwdCtx->completionList, + &ovsFwdCtx->layers, FALSE); + ovsFwdCtx->curNbl = newNbl; + } + + NET_BUFFER_LIST_INFO(curNbl, + TcpIpChecksumNetBufferListInfo) = 0; + return NDIS_STATUS_SUCCESS; } |