[ovs-dev] [PATCH 2/5] dpif-netdev: Reorder elements in dp_netdev structure.
Bhanuprakash Bodireddy
bhanuprakash.bodireddy at intel.com
Sun Mar 12 17:33:25 UTC 2017
'emc_insert_min' variable is made to align on a 64-byte boundary and this
introduces a 24 byte hole.
This patch moves the emc_insert_min member variable slightly higher in
the order to remove the hole and thus saves a cache line with the new
ordering.
Signed-off-by: Bhanuprakash Bodireddy <bhanuprakash.bodireddy at intel.com>
CC: Ciara Loftus <ciara.loftus at intel.com>
CC: Georg Schmuecking <georg.schmuecking at ericsson.com>
---
lib/dpif-netdev.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/lib/dpif-netdev.c b/lib/dpif-netdev.c
index faadedb..006cea6 100644
--- a/lib/dpif-netdev.c
+++ b/lib/dpif-netdev.c
@@ -261,6 +261,9 @@ struct dp_netdev {
struct dp_meter *meters[MAX_METERS]; /* Meter bands. */
uint32_t meter_free; /* Next free meter. */
+ /* Probability of EMC insertions is a factor of 'emc_insert_min'.*/
+ OVS_ALIGNED_VAR(CACHE_LINE_SIZE) atomic_uint32_t emc_insert_min;
+
/* Protects access to ofproto-dpif-upcall interface during revalidator
* thread synchronization. */
struct fat_rwlock upcall_rwlock;
@@ -292,9 +295,6 @@ struct dp_netdev {
uint64_t last_tnl_conf_seq;
struct conntrack conntrack;
-
- /* Probability of EMC insertions is a factor of 'emc_insert_min'.*/
- OVS_ALIGNED_VAR(CACHE_LINE_SIZE) atomic_uint32_t emc_insert_min;
};
static void meter_lock(const struct dp_netdev *dp, uint32_t meter_id)
--
2.4.11
More information about the dev
mailing list