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

Bhanuprakash Bodireddy bhanuprakash.bodireddy at intel.com
Fri Oct 7 16:17:38 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:1, sum padbytes:7, cachelines:2

Signed-off-by: Bhanuprakash Bodireddy <bhanuprakash.bodireddy 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 dfc9cbd..262f4de 100644
--- a/lib/dpif-netdev.c
+++ b/lib/dpif-netdev.c
@@ -284,10 +284,10 @@ struct dp_netdev_rxq {
 /* A port in a netdev-based datapath. */
 struct dp_netdev_port {
     odp_port_t port_no;
+    unsigned n_rxq;             /* Number of elements in 'rxq' */
     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;
     bool dynamic_txqs;          /* If true XPS will be used. */
     unsigned *txq_used;         /* Number of threads that uses each tx queue. */
-- 
2.4.11




More information about the dev mailing list