Skip to content

Commit

Permalink
bond: Reorder elements in bond_slave structure.
Browse files Browse the repository at this point in the history
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 <[email protected]>
Signed-off-by: Ben Pfaff <[email protected]>
  • Loading branch information
Bhanuprakash Bodireddy authored and blp committed Nov 3, 2017
1 parent afea2e8 commit abec922
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions ofproto/bond.c
Original file line number Diff line number Diff line change
Expand Up @@ -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. */
Expand Down

0 comments on commit abec922

Please sign in to comment.