summaryrefslogtreecommitdiff
path: root/datapath-windows/ovsext/DpInternal.h
diff options
context:
space:
mode:
authorYin Lin <linyi@vmware.com>2016-06-24 14:44:30 -0700
committerGurucharan Shetty <guru@ovn.org>2016-06-24 14:47:15 -0700
commit47c3123da2d0140299e4f1d9fe4a2922a072ec1b (patch)
tree2eabe610529dc85263142387dc1dc89e25e5084a /datapath-windows/ovsext/DpInternal.h
parent1f5b157ece72c6ed346a48309b29ea0a2e1c0c63 (diff)
downloadopenvswitch-47c3123da2d0140299e4f1d9fe4a2922a072ec1b.tar.gz
datapath-windows: Add Geneve support
Signed-off-by: Yin Lin <linyi@vmware.com> Acked-by: Nithin Raju <nithin@vmware.com> Signed-off-by: Gurucharan Shetty <guru@ovn.org>
Diffstat (limited to 'datapath-windows/ovsext/DpInternal.h')
-rw-r--r--datapath-windows/ovsext/DpInternal.h29
1 files changed, 26 insertions, 3 deletions
diff --git a/datapath-windows/ovsext/DpInternal.h b/datapath-windows/ovsext/DpInternal.h
index 07bc1804b..42b5ec942 100644
--- a/datapath-windows/ovsext/DpInternal.h
+++ b/datapath-windows/ovsext/DpInternal.h
@@ -128,10 +128,18 @@ typedef struct L2Key {
} L2Key; /* Size of 24 byte. */
/* Number of packet attributes required to store OVS tunnel key. */
-#define NUM_PKT_ATTR_REQUIRED 3
+#define NUM_PKT_ATTR_REQUIRED 35
+#define TUN_OPT_MAX_LEN 255
typedef union OvsIPv4TunnelKey {
+ /* Options should always be the first member of tunnel key.
+ * They are stored at the end of the array if they are less than the
+ * maximum size. This allows us to get the benefits of variable length
+ * matching for small options.
+ */
struct {
+ UINT8 tunOpts[TUN_OPT_MAX_LEN]; /* Tunnel options. */
+ UINT8 tunOptLen; /* Tunnel option length in byte. */
ovs_be32 dst;
ovs_be32 src;
ovs_be64 tunnelId;
@@ -147,7 +155,22 @@ typedef union OvsIPv4TunnelKey {
};
};
uint64_t attr[NUM_PKT_ATTR_REQUIRED];
-} OvsIPv4TunnelKey; /* Size of 24 byte. */
+} OvsIPv4TunnelKey; /* Size of 280 byte. */
+
+__inline uint8_t TunnelKeyGetOptionsOffset(const OvsIPv4TunnelKey *key)
+{
+ return TUN_OPT_MAX_LEN - key->tunOptLen;
+}
+
+__inline uint8_t* TunnelKeyGetOptions(OvsIPv4TunnelKey *key)
+{
+ return key->tunOpts + TunnelKeyGetOptionsOffset(key);
+}
+
+__inline uint16_t TunnelKeyGetRealSize(OvsIPv4TunnelKey *key)
+{
+ return sizeof(OvsIPv4TunnelKey) - TunnelKeyGetOptionsOffset(key);
+}
typedef struct MplsKey {
ovs_be32 lse; /* MPLS topmost label stack entry. */
@@ -155,7 +178,7 @@ typedef struct MplsKey {
} MplsKey; /* Size of 8 bytes. */
typedef __declspec(align(8)) struct OvsFlowKey {
- OvsIPv4TunnelKey tunKey; /* 24 bytes */
+ OvsIPv4TunnelKey tunKey; /* 280 bytes */
L2Key l2; /* 24 bytes */
union {
/* These headers are mutually exclusive. */