This reverts commit
a26b2023ce33fed1ef962012dc2c03765d2e92cb.
This patch punishes performance without the implementation of
megaflows on Windows.
Once megaflows is implemented in the flow logic this patch will be
revisited.
Signed-off-by: Alin Gabriel Serdean <aserdean@cloudbasesolutions.com>
Acked-by: Sairam Venugopal <vsairam@vmware.com>
Signed-off-by: Gurucharan Shetty <gshetty@nicira.com>
typedef struct L4Key {
ovs_be16 tpSrc; /* TCP/UDP/SCTP source port. */
ovs_be16 tpDst; /* TCP/UDP/SCTP destination port. */
typedef struct L4Key {
ovs_be16 tpSrc; /* TCP/UDP/SCTP source port. */
ovs_be16 tpDst; /* TCP/UDP/SCTP destination port. */
- ovs_be16 flags; /* TCP flags */
- uint8_t pad[2];
} L4Key;
typedef struct Ipkey {
} L4Key;
typedef struct Ipkey {
uint8_t nwTtl; /* IP TTL/Hop Limit. */
uint8_t nwFrag; /* FLOW_FRAG_* flags. */
L4Key l4;
uint8_t nwTtl; /* IP TTL/Hop Limit. */
uint8_t nwFrag; /* FLOW_FRAG_* flags. */
L4Key l4;
-} IpKey; /* Size of 20 byte. */
+} IpKey; /* Size of 16 byte. */
typedef struct ArpKey {
ovs_be32 nwSrc; /* IPv4 source address. */
typedef struct ArpKey {
ovs_be32 nwSrc; /* IPv4 source address. */
uint8_t nwTtl; /* IP TTL/Hop Limit. */
uint8_t nwFrag; /* FLOW_FRAG_* flags. */
L4Key l4;
uint8_t nwTtl; /* IP TTL/Hop Limit. */
uint8_t nwFrag; /* FLOW_FRAG_* flags. */
L4Key l4;
} Ipv6Key; /* Size of 48 byte. */
typedef struct Icmp6Key {
} Ipv6Key; /* Size of 48 byte. */
typedef struct Icmp6Key {
uint8_t arpSha[6]; /* ARP/ND source hardware address. */
uint8_t arpTha[6]; /* ARP/ND target hardware address. */
struct in6_addr ndTarget; /* IPv6 neighbor discovery (ND) target. */
uint8_t arpSha[6]; /* ARP/ND source hardware address. */
uint8_t arpTha[6]; /* ARP/ND target hardware address. */
struct in6_addr ndTarget; /* IPv6 neighbor discovery (ND) target. */
-} Icmp6Key; /* Size of 76 byte. */
+} Icmp6Key; /* Size of 72 byte. */
typedef struct L2Key {
uint32_t inPort; /* Port number of input port. */
typedef struct L2Key {
uint32_t inPort; /* Port number of input port. */
switch (ipv4Key.ipv4_proto) {
case IPPROTO_TCP: {
struct ovs_key_tcp tcpKey;
switch (ipv4Key.ipv4_proto) {
case IPPROTO_TCP: {
struct ovs_key_tcp tcpKey;
tcpKey.tcp_src = ipv4FlowPutKey->l4.tpSrc;
tcpKey.tcp_dst = ipv4FlowPutKey->l4.tpDst;
if (!NlMsgPutTailUnspec(nlBuf, OVS_KEY_ATTR_TCP,
tcpKey.tcp_src = ipv4FlowPutKey->l4.tpSrc;
tcpKey.tcp_dst = ipv4FlowPutKey->l4.tpDst;
if (!NlMsgPutTailUnspec(nlBuf, OVS_KEY_ATTR_TCP,
rc = STATUS_UNSUCCESSFUL;
goto done;
}
rc = STATUS_UNSUCCESSFUL;
goto done;
}
- tcpFlags = ipv4FlowPutKey->l4.flags;
- if (!NlMsgPutTailUnspec(nlBuf, OVS_KEY_ATTR_TCP_FLAGS,
- (PCHAR)(&tcpFlags),
- sizeof(tcpFlags))) {
- rc = STATUS_UNSUCCESSFUL;
- goto done;
- }
switch (ipv6Key.ipv6_proto) {
case IPPROTO_TCP: {
struct ovs_key_tcp tcpKey;
switch (ipv6Key.ipv6_proto) {
case IPPROTO_TCP: {
struct ovs_key_tcp tcpKey;
tcpKey.tcp_src = ipv6FlowPutKey->l4.tpSrc;
tcpKey.tcp_dst = ipv6FlowPutKey->l4.tpDst;
if (!NlMsgPutTailUnspec(nlBuf, OVS_KEY_ATTR_TCP,
tcpKey.tcp_src = ipv6FlowPutKey->l4.tpSrc;
tcpKey.tcp_dst = ipv6FlowPutKey->l4.tpDst;
if (!NlMsgPutTailUnspec(nlBuf, OVS_KEY_ATTR_TCP,
rc = STATUS_UNSUCCESSFUL;
goto done;
}
rc = STATUS_UNSUCCESSFUL;
goto done;
}
- tcpFlags = ipv6FlowPutKey->l4.flags;
- if (!NlMsgPutTailUnspec(nlBuf, OVS_KEY_ATTR_TCP_FLAGS,
- (PCHAR)(&tcpFlags),
- sizeof(tcpFlags))) {
- rc = STATUS_UNSUCCESSFUL;
- goto done;
- }
ipv4FlowPutKey->l4.tpDst = tcpKey->tcp_dst;
}
ipv4FlowPutKey->l4.tpDst = tcpKey->tcp_dst;
}
- if (keyAttrs[OVS_KEY_ATTR_TCP_FLAGS]) {
- const UINT16 *flags;
- flags = NlAttrGet(keyAttrs[OVS_KEY_ATTR_TCP_FLAGS]);
- ipv4FlowPutKey->l4.flags = *flags;
- }
-
if (keyAttrs[OVS_KEY_ATTR_UDP]) {
const struct ovs_key_udp *udpKey;
udpKey = NlAttrGet(keyAttrs[OVS_KEY_ATTR_UDP]);
if (keyAttrs[OVS_KEY_ATTR_UDP]) {
const struct ovs_key_udp *udpKey;
udpKey = NlAttrGet(keyAttrs[OVS_KEY_ATTR_UDP]);
ipv6FlowPutKey->l4.tpDst = tcpKey->tcp_dst;
}
ipv6FlowPutKey->l4.tpDst = tcpKey->tcp_dst;
}
- if (keyAttrs[OVS_KEY_ATTR_TCP_FLAGS]) {
- const UINT16 *flags;
- flags = NlAttrGet(keyAttrs[OVS_KEY_ATTR_TCP_FLAGS]);
- ipv6FlowPutKey->l4.flags = *flags;
- }
-
if (keyAttrs[OVS_KEY_ATTR_UDP]) {
const struct ovs_key_udp *udpKey;
udpKey = NlAttrGet(keyAttrs[OVS_KEY_ATTR_UDP]);
if (keyAttrs[OVS_KEY_ATTR_UDP]) {
const struct ovs_key_udp *udpKey;
udpKey = NlAttrGet(keyAttrs[OVS_KEY_ATTR_UDP]);
destKey->l2.keyLen += OVS_IPV6_KEY_SIZE;
}
destKey->l2.keyLen += OVS_IPV6_KEY_SIZE;
}
+
+ ipv6FlowPutKey->pad = 0;
/* Kernel datapath assumes 'arpFlowPutKey->nwProto' to be in host
* order. */
arpFlowPutKey->nwProto = (UINT8)ntohs((arpKey->arp_op));
/* Kernel datapath assumes 'arpFlowPutKey->nwProto' to be in host
* order. */
arpFlowPutKey->nwProto = (UINT8)ntohs((arpKey->arp_op));
+ arpFlowPutKey->pad[0] = 0;
+ arpFlowPutKey->pad[1] = 0;
+ arpFlowPutKey->pad[2] = 0;
destKey->l2.keyLen += OVS_ARP_KEY_SIZE;
break;
}
destKey->l2.keyLen += OVS_ARP_KEY_SIZE;
break;
}
flow->used = tickCount.QuadPart * ovsTimeIncrementPerTick;
flow->packetCount++;
flow->byteCount += OvsPacketLenNBL(packet);
flow->used = tickCount.QuadPart * ovsTimeIncrementPerTick;
flow->packetCount++;
flow->byteCount += OvsPacketLenNBL(packet);
- flow->tcpFlags |= OvsGetTcpFlags(packet, layers);
+ flow->tcpFlags |= OvsGetTcpFlags(packet, &flow->key, layers);
ipKey->nwTtl = nh->ttl;
ipKey->l4.tpSrc = 0;
ipKey->l4.tpDst = 0;
ipKey->nwTtl = nh->ttl;
ipKey->l4.tpSrc = 0;
ipKey->l4.tpDst = 0;
if (!(nh->frag_off & htons(IP_OFFSET))) {
if (ipKey->nwProto == SOCKET_IPPROTO_TCP) {
if (!(nh->frag_off & htons(IP_OFFSET))) {
if (ipKey->nwProto == SOCKET_IPPROTO_TCP) {
layers->isIPv6 = 1;
flow->ipv6Key.l4.tpSrc = 0;
flow->ipv6Key.l4.tpDst = 0;
layers->isIPv6 = 1;
flow->ipv6Key.l4.tpSrc = 0;
flow->ipv6Key.l4.tpDst = 0;
- flow->ipv6Key.l4.flags = 0;
if (flow->ipv6Key.nwProto == SOCKET_IPPROTO_TCP) {
OvsParseTcp(packet, &(flow->ipv6Key.l4), layers);
if (flow->ipv6Key.nwProto == SOCKET_IPPROTO_TCP) {
OvsParseTcp(packet, &(flow->ipv6Key.l4), layers);
+ //KeAcquireSpinLock(&FilterDeviceExtension->NblQueueLock, &oldIrql);
InsertTailList(head, &flow->ListEntry);
InsertTailList(head, &flow->ListEntry);
+ //KeReleaseSpinLock(&FilterDeviceExtension->NblQueueLock, oldIrql);
OvsFlowKey key;
UINT64 hash;
UINT32 actionsLen;
OvsFlowKey key;
UINT64 hash;
UINT32 actionsLen;
UINT64 used;
UINT64 packetCount;
UINT64 byteCount;
UINT64 used;
UINT64 packetCount;
UINT64 byteCount;
if (tcp) {
flow->tpSrc = tcp->source;
flow->tpDst = tcp->dest;
if (tcp) {
flow->tpSrc = tcp->source;
flow->tpDst = tcp->dest;
- flow->flags = OvsGetTcpFlags(packet, layers);
layers->isTcp = 1;
layers->l7Offset = layers->l4Offset + 4 * tcp->doff;
}
layers->isTcp = 1;
layers->l7Offset = layers->l4Offset + 4 * tcp->doff;
}
static UINT8
OvsGetTcpFlags(const NET_BUFFER_LIST *packet, // IN
static UINT8
OvsGetTcpFlags(const NET_BUFFER_LIST *packet, // IN
+ const OvsFlowKey *key, // IN
const POVS_PACKET_HDR_INFO layers) // IN
{
const POVS_PACKET_HDR_INFO layers) // IN
{
+ UNREFERENCED_PARAMETER(key); // should be removed later
+
if (layers->isTcp) {
return TCP_FLAGS(OvsGetTcpCtl(packet, layers));
} else {
if (layers->isTcp) {
return TCP_FLAGS(OvsGetTcpCtl(packet, layers));
} else {