[ovs-dev] [PATCH 03/13] tun-metadata: Reorder elements in tun_meta_entry structure.

Bhanuprakash Bodireddy bhanuprakash.bodireddy at intel.com
Fri Sep 8 17:59:15 UTC 2017


By reordering elements in tun_meta_entry structure, sum holes and pad
bytes can be reduced there by reducing the tun_table size.

Before: structure size: 56, sum holes: 4, pad bytes: 7  cachelines:1
After : structure size: 48, sum holes: 0, pad bytes: 3, cachelines:1

Signed-off-by: Bhanuprakash Bodireddy <bhanuprakash.bodireddy at intel.com>
---
 lib/tun-metadata.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/lib/tun-metadata.c b/lib/tun-metadata.c
index 2fbd9b6..0cb2456 100644
--- a/lib/tun-metadata.c
+++ b/lib/tun-metadata.c
@@ -32,8 +32,8 @@
 
 struct tun_meta_entry {
     struct hmap_node node;      /* In struct tun_table's key_hmap. */
-    uint32_t key;               /* (class << 8) | type. */
     struct tun_metadata_loc loc;
+    uint32_t key;               /* (class << 8) | type. */
     bool valid;                 /* True if allocated to a class and type. */
 };
 
-- 
2.4.11



More information about the dev mailing list