summaryrefslogtreecommitdiff
path: root/datapath-windows/ovsext/Conntrack.h
diff options
context:
space:
mode:
authorAnand Kumar <kumaranand@vmware.com>2018-01-29 10:28:01 -0800
committerAlin Gabriel Serdean <aserdean@ovn.org>2018-02-02 22:46:32 +0200
commitb0b5ab8bbac73d1f430405c0a76cbc05f619f15a (patch)
treec99a8f59017ee5d8d7b6002bfb80e6300f0fba94 /datapath-windows/ovsext/Conntrack.h
parentdea3880466200603cfe64ad21ab6a9d4687c505d (diff)
downloadopenvswitch-b0b5ab8bbac73d1f430405c0a76cbc05f619f15a.tar.gz
datapath-windows: Optimize conntrack lock implementation.
Currently, there is one global lock for conntrack module, which protects conntrack entries and conntrack table. All the NAT operations are performed holding this lock. This becomes inefficient, as the number of conntrack entries grow. With new implementation, we will have two PNDIS_RW_LOCK_EX locks in conntrack. 1. ovsCtBucketLock - one rw lock per bucket of the conntrack table, which is shared by all the ct entries that belong to the same bucket. 2. lock - a rw lock in OVS_CT_ENTRY structure that protects the members of conntrack entry. Also, OVS_CT_ENTRY structure will have a lock reference(bucketLockRef) to the corresponding OvsCtBucketLock of conntrack table. We need this reference to retrieve ovsCtBucketLock from ct entry for delete operation. Signed-off-by: Anand Kumar <kumaranand@vmware.com> Acked-by: Alin Gabriel Serdean <aserdean@ovn.org> Signed-off-by: Alin Gabriel Serdean <aserdean@ovn.org>
Diffstat (limited to 'datapath-windows/ovsext/Conntrack.h')
-rw-r--r--datapath-windows/ovsext/Conntrack.h3
1 files changed, 3 insertions, 0 deletions
diff --git a/datapath-windows/ovsext/Conntrack.h b/datapath-windows/ovsext/Conntrack.h
index 35075db4d..3be309efd 100644
--- a/datapath-windows/ovsext/Conntrack.h
+++ b/datapath-windows/ovsext/Conntrack.h
@@ -99,6 +99,9 @@ typedef struct _NAT_ACTION_INFO {
} NAT_ACTION_INFO, *PNAT_ACTION_INFO;
typedef struct OVS_CT_ENTRY {
+ /* Reference to ovsCtBucketLock of ovsConntrackTable.*/
+ PNDIS_RW_LOCK_EX bucketLockRef;
+ PNDIS_RW_LOCK_EX lock; /* Protects OVS_CT_ENTRY. */
OVS_CT_KEY key;
OVS_CT_KEY rev_key;
UINT64 expiration;