Skip to content

Commit

Permalink
datapath-windows: Post Conntrack delete and new events
Browse files Browse the repository at this point in the history
Post Conntrack delete and create events when entries are deleted or
created.

Signed-off-by: Sairam Venugopal <[email protected]>
Acked-by: Paul Boca <[email protected]>
Acked-by: Alin Gabriel Serdean <[email protected]>
Acked-By: Yin Lin <[email protected]>
Signed-off-by: Gurucharan Shetty <[email protected]>
  • Loading branch information
Sairam Venugopal authored and shettyg committed Jul 29, 2016
1 parent 9c16b94 commit d7e6f8e
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions datapath-windows/ovsext/Conntrack.c
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
#include "Jhash.h"
#include "PacketParser.h"
#include "Debug.h"
#include "Event.h"

#define WINDOWS_TICK 10000000
#define SEC_TO_UNIX_EPOCH 11644473600LL
Expand Down Expand Up @@ -153,6 +154,15 @@ OvsCtUpdateFlowKey(struct OvsFlowKey *key,
}
}

static __inline VOID
OvsPostCtEventEntry(POVS_CT_ENTRY entry, UINT8 type)
{
OVS_CT_EVENT_ENTRY ctEventEntry = {0};
NdisMoveMemory(&ctEventEntry.entry, entry, sizeof(OVS_CT_ENTRY));
ctEventEntry.type = type;
OvsPostCtEvent(&ctEventEntry);
}

static __inline VOID
OvsCtAddEntry(POVS_CT_ENTRY entry, OvsConntrackKeyLookupCtx *ctx, UINT64 now)
{
Expand All @@ -162,6 +172,7 @@ OvsCtAddEntry(POVS_CT_ENTRY entry, OvsConntrackKeyLookupCtx *ctx, UINT64 now)
entry->timestampStart = now;
InsertHeadList(&ovsConntrackTable[ctx->hash & CT_HASH_TABLE_MASK],
&entry->link);
OvsPostCtEventEntry(entry, OVS_EVENT_CT_NEW);
ctTotalEntries++;
}

Expand Down Expand Up @@ -253,6 +264,7 @@ OvsCtUpdateEntry(OVS_CT_ENTRY* entry,
static __inline VOID
OvsCtEntryDelete(POVS_CT_ENTRY entry)
{
OvsPostCtEventEntry(entry, OVS_EVENT_CT_DELETE);
RemoveEntryList(&entry->link);
OvsFreeMemoryWithTag(entry, OVS_CT_POOL_TAG);
ctTotalEntries--;
Expand Down

0 comments on commit d7e6f8e

Please sign in to comment.