[ovs-dev,11/13] ofproto: Reorder elements in ofproto_bundle_settings structure.

Message ID 1504893565-110166-12-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 ofproto_bundle_settings structure, sum holes
and pad bytes can be reduced.

Before: structure size: 96, sum holes: 13, pad bytes: 7, cachelines:2
After : structure size: 80, sum holes:  4, pad bytes: 0, cachelines:2

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

Patch

diff --git a/ofproto/ofproto.h b/ofproto/ofproto.h
index 9e35327..2a7c1f3 100644
--- a/ofproto/ofproto.h
+++ b/ofproto/ofproto.h
@@ -403,18 +403,17 @@  struct ofproto_bundle_settings {
     size_t n_slaves;
 
     enum port_vlan_mode vlan_mode; /* Selects mode for vlan and trunks */
+    bool protected;             /* Protected port mode */
+    bool use_priority_tags;     /* Use 802.1p tag for frames in VLAN 0? */
     uint16_t qinq_ethtype;
     int vlan;                   /* VLAN VID, except for PORT_VLAN_TRUNK. */
     unsigned long *trunks;      /* vlan_bitmap, except for PORT_VLAN_ACCESS. */
     unsigned long *cvlans;
-    bool use_priority_tags;     /* Use 802.1p tag for frames in VLAN 0? */
 
     struct bond_settings *bond; /* Must be nonnull iff if n_slaves > 1. */
 
     struct lacp_settings *lacp;              /* Nonnull to enable LACP. */
     struct lacp_slave_settings *lacp_slaves; /* Array of n_slaves elements. */
-
-    bool protected;             /* Protected port mode */
 };
 
 int ofproto_bundle_register(struct ofproto *, void *aux,