[ovs-dev,07/13] netdev-provider: Reorder elements in netdev structure.

Message ID 1504893565-110166-8-git-send-email-bhanuprakash.bodireddy@intel.com
State New
Headers show
Series
  • Rearrange structure members for memory efficiency.
Related show

Commit Message

Bhanuprakash Bodireddy Sept. 8, 2017, 5:59 p.m.
By reordering elements in netdev structure, holes can be removed.

Before: structure size: 88, sum holes: 10, cachelines:2
After : structure size: 80, sum holes:  2, cachelines:2

Signed-off-by: Bhanuprakash Bodireddy <bhanuprakash.bodireddy@intel.com>
---
 lib/netdev-provider.h | 11 ++++++-----
 1 file changed, 6 insertions(+), 5 deletions(-)

Patch

diff --git a/lib/netdev-provider.h b/lib/netdev-provider.h
index 5d7bd4f..1720deb 100644
--- a/lib/netdev-provider.h
+++ b/lib/netdev-provider.h
@@ -49,6 +49,12 @@  struct netdev {
      * opening this device, and therefore got assigned to the "system" class */
     bool auto_classified;
 
+    /* If this is 'true', the user explicitly specified an MTU for this
+     * netdev.  Otherwise, Open vSwitch is allowed to override it. */
+    bool mtu_user_config;
+
+    int ref_cnt;                        /* Times this devices was opened. */
+
     /* A sequence number which indicates changes in one of 'netdev''s
      * properties.   It must be nonzero so that users have a value which
      * they may use as a reset when tracking 'netdev'.
@@ -67,16 +73,11 @@  struct netdev {
     struct seq *reconfigure_seq;
     uint64_t last_reconfigure_seq;
 
-    /* If this is 'true', the user explicitly specified an MTU for this
-     * netdev.  Otherwise, Open vSwitch is allowed to override it. */
-    bool mtu_user_config;
-
     /* The core netdev code initializes these at netdev construction and only
      * provide read-only access to its client.  Netdev implementations may
      * modify them. */
     int n_txq;
     int n_rxq;
-    int ref_cnt;                        /* Times this devices was opened. */
     struct shash_node *node;            /* Pointer to element in global map. */
     struct ovs_list saved_flags_list; /* Contains "struct netdev_saved_flags". */
 };