From patchwork Thu Oct 13 09:58:31 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Bodireddy, Bhanuprakash" X-Patchwork-Id: 681718 X-Patchwork-Delegate: diproiettod@vmware.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from archives.nicira.com (archives.nicira.com [96.126.127.54]) by ozlabs.org (Postfix) with ESMTP id 3svmXW5ylGz9s9N for ; Thu, 13 Oct 2016 21:03:55 +1100 (AEDT) Received: from archives.nicira.com (localhost [127.0.0.1]) by archives.nicira.com (Postfix) with ESMTP id 0BDBB105FD; Thu, 13 Oct 2016 03:03:10 -0700 (PDT) X-Original-To: dev@openvswitch.org Delivered-To: dev@openvswitch.org Received: from mx3v3.cudamail.com (mx3.cudamail.com [64.34.241.5]) by archives.nicira.com (Postfix) with ESMTPS id 38306105FB for ; Thu, 13 Oct 2016 03:03:08 -0700 (PDT) Received: from bar6.cudamail.com (localhost [127.0.0.1]) by mx3v3.cudamail.com (Postfix) with ESMTPS id BFF6C1619F6 for ; Thu, 13 Oct 2016 04:03:07 -0600 (MDT) X-ASG-Debug-ID: 1476352987-0b3237430203a00001-byXFYA Received: from mx3-pf2.cudamail.com ([192.168.14.1]) by bar6.cudamail.com with ESMTP id 1NoEPnkHV8wpJ1eI (version=TLSv1 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO) for ; Thu, 13 Oct 2016 04:03:07 -0600 (MDT) X-Barracuda-Envelope-From: bhanuprakash.bodireddy@intel.com X-Barracuda-RBL-Trusted-Forwarder: 192.168.14.1 Received: from unknown (HELO mga06.intel.com) (134.134.136.31) by mx3-pf2.cudamail.com with ESMTPS (DHE-RSA-AES256-SHA encrypted); 13 Oct 2016 10:03:06 -0000 Received-SPF: pass (mx3-pf2.cudamail.com: SPF record at intel.com designates 134.134.136.31 as permitted sender) X-Barracuda-Apparent-Source-IP: 134.134.136.31 X-Barracuda-RBL-IP: 134.134.136.31 Received: from fmsmga004.fm.intel.com ([10.253.24.48]) by orsmga104.jf.intel.com with ESMTP; 13 Oct 2016 03:03:06 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.31,339,1473145200"; d="scan'208";a="179397933" Received: from silpixa00393942.ir.intel.com ([10.237.223.42]) by fmsmga004.fm.intel.com with ESMTP; 13 Oct 2016 03:03:05 -0700 X-CudaMail-Envelope-Sender: bhanuprakash.bodireddy@intel.com From: Bhanuprakash Bodireddy To: dev@openvswitch.org X-CudaMail-MID: CM-V2-1012002965 X-CudaMail-DTE: 101316 X-CudaMail-Originating-IP: 134.134.136.31 Date: Thu, 13 Oct 2016 10:58:31 +0100 X-ASG-Orig-Subj: [##CM-V2-1012002965##][PATCH v2 08/12] dpif-netdev: Reorder elements in dp_netdev_port structure. Message-Id: <1476352715-110467-9-git-send-email-bhanuprakash.bodireddy@intel.com> X-Mailer: git-send-email 2.4.11 In-Reply-To: <1476352715-110467-1-git-send-email-bhanuprakash.bodireddy@intel.com> References: <1476352715-110467-1-git-send-email-bhanuprakash.bodireddy@intel.com> X-GBUdb-Analysis: 0, 134.134.136.31, Ugly c=0.237282 p=-0.4 Source Normal X-MessageSniffer-Rules: 0-0-0-3655-c X-Barracuda-Connect: UNKNOWN[192.168.14.1] X-Barracuda-Start-Time: 1476352987 X-Barracuda-Encrypted: DHE-RSA-AES256-SHA X-Barracuda-URL: https://web.cudamail.com:443/cgi-mod/mark.cgi X-Virus-Scanned: by bsmtpd at cudamail.com X-Barracuda-BRTS-Status: 1 X-Barracuda-Spam-Score: 0.60 X-Barracuda-Spam-Status: No, SCORE=0.60 using global scores of TAG_LEVEL=3.5 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=4.0 tests=BSF_SC5_MJ1963, RDNS_NONE X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.3.33670 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- 0.10 RDNS_NONE Delivered to trusted network by a host with no rDNS 0.50 BSF_SC5_MJ1963 Custom Rule MJ1963 Subject: [ovs-dev] [PATCH v2 08/12] dpif-netdev: Reorder elements in dp_netdev_port structure. X-BeenThere: dev@openvswitch.org X-Mailman-Version: 2.1.16 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: dev-bounces@openvswitch.org Sender: "dev" 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 Co-authored-by: Antonio Fischetti --- 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 93ea49d..c079ab8 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;