Skip to content

Commit

Permalink
dpif-netdev: Reorder elements in dp_netdev_port structure.
Browse files Browse the repository at this point in the history
By reordering the data elements in dp_netdev_port structure, pad bytes
can be reduced and there by saving a cache line.

Before: structure size:136, holes:3, sum padbytes:15, cachelines:3
After: structure size:128, holes:2, sum padbytes:7, cachelines:2

Signed-off-by: Bhanuprakash Bodireddy <[email protected]>
Co-authored-by: Antonio Fischetti <[email protected]>
Signed-off-by: Antonio Fischetti <[email protected]>
Acked-by: Daniele Di Proietto <[email protected]>
  • Loading branch information
2 people authored and ddiproietto committed Oct 18, 2016
1 parent 38ee081 commit 2e4450a
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/dpif-netdev.c
Original file line number Diff line number Diff line change
Expand Up @@ -290,8 +290,8 @@ struct dp_netdev_port {
struct netdev *netdev;
struct hmap_node node; /* Node in dp_netdev's 'ports'. */
struct netdev_saved_flags *sf;
unsigned n_rxq; /* Number of elements in 'rxq' */
struct dp_netdev_rxq *rxqs;
unsigned n_rxq; /* Number of elements in 'rxq' */
bool dynamic_txqs; /* If true XPS will be used. */
unsigned *txq_used; /* Number of threads that uses each tx queue. */
struct ovs_mutex txq_used_mutex;
Expand Down

0 comments on commit 2e4450a

Please sign in to comment.