diff mbox

[ovs-dev,9/9] datapath-windows: Post Conntrack delete and new events

Message ID 20160713233838.47648-10-vsairam@vmware.com
State Superseded
Delegated to: Guru Shetty
Headers show

Commit Message

Sairam Venugopal July 13, 2016, 11:38 p.m. UTC
Post Conntrack delete and create events when entries are deleted or
created.

Signed-off-by: Sairam Venugopal <vsairam@vmware.com>
---
 datapath-windows/ovsext/Conntrack.c | 12 ++++++++++++
 1 file changed, 12 insertions(+)

Comments

Paul Boca July 22, 2016, 11:03 a.m. UTC | #1
Acked-by: Paul Boca <pboca@cloudbasesolutions.com>  


> -----Original Message-----

> From: dev [mailto:dev-bounces@openvswitch.org] On Behalf Of Sairam

> Venugopal

> Sent: Thursday, July 14, 2016 2:39 AM

> To: dev@openvswitch.org

> Subject: [ovs-dev] [PATCH 9/9] datapath-windows: Post Conntrack delete and

> new events

> 

> Post Conntrack delete and create events when entries are deleted or

> created.

> 

> Signed-off-by: Sairam Venugopal <vsairam@vmware.com>

> ---

>  datapath-windows/ovsext/Conntrack.c | 12 ++++++++++++

>  1 file changed, 12 insertions(+)

> 

> diff --git a/datapath-windows/ovsext/Conntrack.c b/datapath-

> windows/ovsext/Conntrack.c

> index 382c13d..af3d966 100644

> --- a/datapath-windows/ovsext/Conntrack.c

> +++ b/datapath-windows/ovsext/Conntrack.c

> @@ -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

> @@ -154,6 +155,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)

>  {

>      NdisMoveMemory(&entry->key, &ctx->key, sizeof (OVS_CT_KEY));

> @@ -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++;

>  }

> 

> @@ -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--;

> --

> 2.9.0.windows.1

> 

> _______________________________________________

> dev mailing list

> dev@openvswitch.org

> http://openvswitch.org/mailman/listinfo/dev
Alin Serdean July 23, 2016, 1:21 a.m. UTC | #2
Acked-by: Alin Gabriel Serdean <aserdean@cloudbasesolutions.com>



> -----Mesaj original-----

> De la: dev [mailto:dev-bounces@openvswitch.org] În numele Sairam

> Venugopal

> Trimis: Thursday, July 14, 2016 2:39 AM

> Către: dev@openvswitch.org

> Subiect: [ovs-dev] [PATCH 9/9] datapath-windows: Post Conntrack delete

> and new events

> 

> Post Conntrack delete and create events when entries are deleted or

> created.

> 

> Signed-off-by: Sairam Venugopal <vsairam@vmware.com>

> ---

>  datapath-windows/ovsext/Conntrack.c | 12 ++++++++++++

>  1 file changed, 12 insertions(+)

> 

> diff --git a/datapath-windows/ovsext/Conntrack.c b/datapath-

> windows/ovsext/Conntrack.c

> index 382c13d..af3d966 100644

> --- a/datapath-windows/ovsext/Conntrack.c

> +++ b/datapath-windows/ovsext/Conntrack.c

> @@ -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 @@ -154,6 +155,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)  {

>      NdisMoveMemory(&entry->key, &ctx->key, sizeof (OVS_CT_KEY)); @@ -

> 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++;

>  }

> 

> @@ -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--;

> --

> 2.9.0.windows.1

> 

> _______________________________________________

> dev mailing list

> dev@openvswitch.org

> http://openvswitch.org/mailman/listinfo/dev
diff mbox

Patch

diff --git a/datapath-windows/ovsext/Conntrack.c b/datapath-windows/ovsext/Conntrack.c
index 382c13d..af3d966 100644
--- a/datapath-windows/ovsext/Conntrack.c
+++ b/datapath-windows/ovsext/Conntrack.c
@@ -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
@@ -154,6 +155,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)
 {
     NdisMoveMemory(&entry->key, &ctx->key, sizeof (OVS_CT_KEY));
@@ -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++;
 }
 
@@ -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--;