[ovs-dev,01/13] bond: Reorder elements in bond_slave structure.

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

Commit Message

Bodireddy, Bhanuprakash Sept. 8, 2017, 5:59 p.m.
By reordering elements in bond_slave structure, holes can be removed and
saves a cache line.

Before: structure size: 136, sum holes: 10, cachelines:3
After : structure size: 128, sum holes:  2, cachelines:2

Signed-off-by: Bhanuprakash Bodireddy <bhanuprakash.bodireddy@intel.com>
---
 ofproto/bond.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

Patch

diff --git a/ofproto/bond.c b/ofproto/bond.c
index 365a3ca..a656226 100644
--- a/ofproto/bond.c
+++ b/ofproto/bond.c
@@ -88,13 +88,13 @@  struct bond_slave {
 
     struct netdev *netdev;      /* Network device, owned by the client. */
     uint64_t change_seq;        /* Tracks changes in 'netdev'. */
-    ofp_port_t  ofp_port;       /* OpenFlow port number. */
     char *name;                 /* Name (a copy of netdev_get_name(netdev)). */
+    ofp_port_t  ofp_port;       /* OpenFlow port number. */
 
     /* Link status. */
-    long long delay_expires;    /* Time after which 'enabled' may change. */
     bool enabled;               /* May be chosen for flows? */
     bool may_enable;            /* Client considers this slave bondable. */
+    long long delay_expires;    /* Time after which 'enabled' may change. */
 
     /* Rebalancing info.  Used only by bond_rebalance(). */
     struct ovs_list bal_node;   /* In bond_rebalance()'s 'bals' list. */