summaryrefslogtreecommitdiff
path: root/datapath-windows/ovsext/Stt.h
diff options
context:
space:
mode:
authorEitan Eliahu <eliahue@vmware.com>2015-06-11 06:35:54 -0700
committerBen Pfaff <blp@nicira.com>2015-06-11 10:45:53 -0700
commit022c20408192a6c35f8f629411b07c13250e9682 (patch)
treece61a299f4ae06634f0d72e5b4fd856101a8fee8 /datapath-windows/ovsext/Stt.h
parent21f217884710019b337c35ec434ae75689044340 (diff)
downloadopenvswitch-022c20408192a6c35f8f629411b07c13250e9682.tar.gz
datapath-windows: Stateless TCP Tunnelling protocol - Initial implementation
This change include an initial implementable of STT. The following should be added: [1] Checksum offload (SW and HW) [2] LSO (SW and HW) [3] IP layer WFP callout for IP segments Added support for multiple (per TCP port) STT ports Testing: link layer connection through ping works. File transfer. Signed-off-by: Eitan Eliahu <eliahue@vmware.com> Co-authored-by: Saurabh Shah <ssaurabh@vmware.com> Signed-off-by: Saurabh Shah <ssaurabh@vmware.com> Acked-by: Nithin Raju <nithin@vmware.com> Signed-off-by: Ben Pfaff <blp@nicira.com>
Diffstat (limited to 'datapath-windows/ovsext/Stt.h')
-rw-r--r--datapath-windows/ovsext/Stt.h89
1 files changed, 89 insertions, 0 deletions
diff --git a/datapath-windows/ovsext/Stt.h b/datapath-windows/ovsext/Stt.h
new file mode 100644
index 000000000..38d721c49
--- /dev/null
+++ b/datapath-windows/ovsext/Stt.h
@@ -0,0 +1,89 @@
+/*
+ * Copyright (c) 2015 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 __OVS_STT_H_
+#define __OVS_STT_H_ 1
+
+#define STT_TCP_PORT 7471
+#define STT_TCP_PORT_NBO 0x2f1d
+
+#define MAX_IP_TOTAL_LEN 65535
+
+// STT defines.
+#define STT_SEQ_LEN_SHIFT 16
+#define STT_SEQ_OFFSET_MASK ((1 << STT_SEQ_LEN_SHIFT) - 1)
+#define STT_FRAME_LEN(seq) ((seq) >> STT_SEQ_LEN_SHIFT)
+#define STT_SEGMENT_OFF(seq) ((seq) & STT_SEQ_OFFSET_MASK)
+
+#define STT_CSUM_VERIFIED (1 << 0)
+#define STT_CSUM_PARTIAL (1 << 1)
+#define STT_PROTO_IPV4 (1 << 2)
+#define STT_PROTO_TCP (1 << 3)
+#define STT_PROTO_TYPES (STT_PROTO_IPV4 | STT_PROTO_TCP)
+
+#define STT_ETH_PAD 2
+typedef struct SttHdr {
+ UINT8 version;
+ UINT8 flags;
+ UINT8 l4Offset;
+ UINT8 reserved;
+ UINT16 mss;
+ UINT16 vlanTCI;
+ UINT64 key;
+} SttHdr, *PSttHdr;
+
+#define STT_HDR_LEN (sizeof(SttHdr) + STT_ETH_PAD)
+
+typedef struct _OVS_STT_VPORT {
+ UINT16 dstPort;
+ UINT64 ackNo;
+ UINT64 ipId;
+
+ UINT64 inPkts;
+ UINT64 outPkts;
+ UINT64 slowInPkts;
+ UINT64 slowOutPkts;
+} OVS_STT_VPORT, *POVS_STT_VPORT;
+
+NTSTATUS OvsInitSttTunnel(POVS_VPORT_ENTRY vport,
+ UINT16 udpDestPort);
+
+VOID OvsCleanupSttTunnel(POVS_VPORT_ENTRY vport);
+
+
+void OvsCleanupSttTunnel(POVS_VPORT_ENTRY vport);
+
+NDIS_STATUS OvsEncapStt(POVS_VPORT_ENTRY vport,
+ PNET_BUFFER_LIST curNbl,
+ OvsIPv4TunnelKey *tunKey,
+ POVS_SWITCH_CONTEXT switchContext,
+ POVS_PACKET_HDR_INFO layers,
+ PNET_BUFFER_LIST *newNbl);
+
+
+NDIS_STATUS OvsDecapStt(POVS_SWITCH_CONTEXT switchContext,
+ PNET_BUFFER_LIST curNbl,
+ OvsIPv4TunnelKey *tunKey,
+ PNET_BUFFER_LIST *newNbl);
+
+static __inline UINT32
+OvsGetSttTunHdrSize(VOID)
+{
+ return sizeof (EthHdr) + sizeof(IPHdr) + sizeof(TCPHdr) +
+ STT_HDR_LEN;
+}
+
+#endif /*__OVS_STT_H_ */