[ovs-dev,08/13] dpif-netdev: Reorder elements in dp_netdev_rxq structure.

Message ID 1504893565-110166-9-git-send-email-bhanuprakash.bodireddy@intel.com
State New
Headers show
Series
  • Rearrange structure members for memory efficiency.
Related show

Commit Message

Bodireddy, Bhanuprakash Sept. 8, 2017, 5:59 p.m.
By reordering elements in dp_netdev_rxq structure, pad bytes and a hole
can be removed.

Before: structure size: 104, sum holes: 1, sum padbytes:4, cachelines:2
After : structure size:  96, sum holes: 0, sum padbytes:0, cachelines:2

Signed-off-by: Bhanuprakash Bodireddy <bhanuprakash.bodireddy@intel.com>
---
 lib/dpif-netdev.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Patch

diff --git a/lib/dpif-netdev.c b/lib/dpif-netdev.c
index 071ec14..b1ef0fb 100644
--- a/lib/dpif-netdev.c
+++ b/lib/dpif-netdev.c
@@ -366,6 +366,7 @@  struct dp_netdev_rxq {
                                           pinned. OVS_CORE_UNSPEC if the
                                           queue doesn't need to be pinned to a
                                           particular core. */
+    unsigned intrvl_idx;               /* Write index for 'cycles_intrvl'. */
     struct dp_netdev_pmd_thread *pmd;  /* pmd thread that polls this queue. */
 
     /* Counters of cycles spent successfully polling and processing pkts. */
@@ -373,7 +374,6 @@  struct dp_netdev_rxq {
     /* We store PMD_RXQ_INTERVAL_MAX intervals of data for an rxq and then
        sum them to yield the cycles used for an rxq. */
     atomic_ullong cycles_intrvl[PMD_RXQ_INTERVAL_MAX];
-    unsigned intrvl_idx;               /* Write index for 'cycles_intrvl'. */
 };
 
 /* A port in a netdev-based datapath. */