[ovs-dev] [PATCH v3 08/12] dpif-netdev: Reorder elements in dp_netdev_port structure.

Bhanuprakash Bodireddy bhanuprakash.bodireddy at intel.com
Fri Oct 14 14:37:11 UTC 2016


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 <bhanuprakash.bodireddy at intel.com>
Co-authored-by: Antonio Fischetti <antonio.fischetti at intel.com>
Signed-off-by: Antonio Fischetti <antonio.fischetti at intel.com>
---
 lib/dpif-netdev.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/lib/dpif-netdev.c b/lib/dpif-netdev.c
index b5efb45..a39e1de 100644
--- a/lib/dpif-netdev.c
+++ b/lib/dpif-netdev.c
@@ -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;
-- 
2.4.11




More information about the dev mailing list