summaryrefslogtreecommitdiff
path: root/datapath-windows/ovsext/Offload.h
diff options
context:
space:
mode:
authorAlin Serdean <aserdean@cloudbasesolutions.com>2016-02-11 01:38:54 +0000
committerBen Pfaff <blp@ovn.org>2016-02-10 20:34:50 -0800
commit7b383a56a76e2496f630bcfbc8f9b46f82c62081 (patch)
tree578bc659fcc8851672bc028c0650b0dfba9938b4 /datapath-windows/ovsext/Offload.h
parent4b7396908d07a1a3576aad8b7ea2602e8fd072b5 (diff)
downloadopenvswitch-7b383a56a76e2496f630bcfbc8f9b46f82c62081.tar.gz
datapath-windows: Refactor sofware offloads and mss
The purpose of this patch is to refactor the software offloads found in the VXLAN and GRE code and also to refactor how the maximmum segment size for a given NBL is obtained. This patch introduces two functions OvsApplySWChecksumOnNB and OVSGetTcpMSS. OVSGetTcpMSS - will return the mss found in a given NBL. OvsApplySWChecksumOnNB - will compute and set software offloads for a given NBL. Signed-off-by: Alin Gabriel Serdean <aserdean@cloudbasesolutions.com> Acked-by: Sorin Vinturis <svinturis at cloudbasesolutions.com> Acked-by: Nithin Raju <nithin@vmware.com> Signed-off-by: Ben Pfaff <blp@ovn.org>
Diffstat (limited to 'datapath-windows/ovsext/Offload.h')
-rw-r--r--datapath-windows/ovsext/Offload.h47
1 files changed, 47 insertions, 0 deletions
diff --git a/datapath-windows/ovsext/Offload.h b/datapath-windows/ovsext/Offload.h
new file mode 100644
index 000000000..b5cae2f2c
--- /dev/null
+++ b/datapath-windows/ovsext/Offload.h
@@ -0,0 +1,47 @@
+/*
+ * Copyright (c) 2014, 2016 VMware, Inc.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at:
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#ifndef __OFFLOAD_H_
+#define __OFFLOAD_H_ 1
+
+typedef union _OVS_PACKET_HDR_INFO *POVS_PACKET_HDR_INFO;
+
+UINT16 CalculateChecksum(UINT8 *ptr, UINT16 length, UINT16 initial);
+UINT16 CopyAndCalculateChecksum(UINT8 *dst, UINT8 *src, UINT16 length,
+ UINT16 initial);
+UINT16 IPChecksum(UINT8 *ipHdr, UINT16 length, UINT16 initial);
+UINT16 IPPseudoChecksum(UINT32 *src, UINT32 *dst, UINT8 protocol,
+ UINT16 totalLength);
+UINT16 IPv6PseudoChecksum(UINT32 *src, UINT32 *dst, UINT8 protocol,
+ UINT16 totalLength);
+UINT16 ChecksumUpdate32(UINT16 oldSum, UINT32 prev, UINT32 newValue);
+UINT16 ChecksumUpdate16(UINT16 oldSum, UINT16 prev, UINT16 newValue);
+UINT16 CalculateChecksumNB(const PNET_BUFFER nb, UINT16 csumDataLen,
+ UINT32 offset);
+NDIS_STATUS OvsValidateIPChecksum(PNET_BUFFER_LIST curNbl,
+ POVS_PACKET_HDR_INFO hdrInfo);
+NDIS_STATUS OvsValidateUDPChecksum(PNET_BUFFER_LIST curNbl,
+ BOOLEAN udpCsumZero);
+
+
+ULONG OVSGetTcpMSS(PNET_BUFFER_LIST nbl);
+
+NDIS_STATUS OvsApplySWChecksumOnNB(POVS_PACKET_HDR_INFO layers,
+ PNET_BUFFER_LIST nbl,
+ PNDIS_TCP_IP_CHECKSUM_NET_BUFFER_LIST_INFO
+ csumInfo);
+
+#endif /* __OFFLOAD_H_ */