From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from na01-bl2-obe.outbound.protection.outlook.com (mail-bl2on0093.outbound.protection.outlook.com [65.55.169.93]) by dpdk.org (Postfix) with ESMTP id 369E9C5D8 for ; Fri, 29 Jan 2016 08:46:37 +0100 (CET) Authentication-Results: dpdk.org; dkim=none (message not signed) header.d=none;dpdk.org; dmarc=none action=none header.from=caviumnetworks.com; Received: from localhost.localdomain.localdomain (122.167.54.52) by BY1PR0701MB1723.namprd07.prod.outlook.com (10.162.111.142) with Microsoft SMTP Server (TLS) id 15.1.390.13; Fri, 29 Jan 2016 07:46:33 +0000 From: Jerin Jacob To: Date: Fri, 29 Jan 2016 13:15:53 +0530 Message-ID: <1454053555-28850-3-git-send-email-jerin.jacob@caviumnetworks.com> X-Mailer: git-send-email 2.1.0 In-Reply-To: <1454053555-28850-1-git-send-email-jerin.jacob@caviumnetworks.com> References: <1450067576-18803-1-git-send-email-jerin.jacob@caviumnetworks.com> <1454053555-28850-1-git-send-email-jerin.jacob@caviumnetworks.com> MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [122.167.54.52] X-ClientProxiedBy: BM1PR01CA0030.INDPRD01.PROD.OUTLOOK.COM (25.163.198.165) To BY1PR0701MB1723.namprd07.prod.outlook.com (25.162.111.142) X-Microsoft-Exchange-Diagnostics: 1; BY1PR0701MB1723; 2:D8+4x7P05D9MdNrJnGR29VrjRgfkXNyB+t6BSbWANC/O49CN+D1ItqgwRQU6HmEs9kvr7toqHi7dI0LK0ZgAXD+wJ1CfIO8VCpydq4FMJY8HsmcpEPz31yPAIeSsqQa+2TNRoRDr4lkkVp1dDnxWQw==; 3:4SkYfxJpLD/WDXB0BZ7fTIHM6C4kirDjAA+b28qLG3rd4uAmHxIoIwcfkB5LV3g4eYDeH/lSqqpsJUK37biXxLOg+5P4wWSp2HOt5EY4435lLcz+OMtPgypSpVLO/31T; 25:SVtNwdMUYLk/8/qFW1klZr87qWhAm5kWa5Yxl6KhO+FqF6is0hAiwXNccNUAxre0CQGy589p8ttmaVd8H6qyaZuG6s2jJw+Z5356o0D0xCFNOw+lBnit1N7p4r14BQBlbOfTLhIOHYu2lYw0QGZERwtFB7hEeiaQx4EqWygKnNes97CEIRoLmDeposLiUFoIr8wJjBjEx77seavnPudyO8uH26zXq1chuQZ/MKpJ7v+t3AL6wh90QRjEJCqX0pFG X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:;SRVR:BY1PR0701MB1723; X-MS-Office365-Filtering-Correlation-Id: b53136c6-9b03-4b19-e2ff-08d32880506e X-Microsoft-Exchange-Diagnostics: 1; BY1PR0701MB1723; 20:ptdLr2/6SL1C20hBUtnY0C+a7C1k/hzIM9rp4JB+pc/Z5f6vpVA1v7ra9R7WFUFlMJnWa+K3JVeaGJb3UHvv3762Jz+EKMpSa80SBZQtomXfl0vvnruL3yyjKYouwi4eSTFirI5qO9yCV818uTU6Xm0z69YY0Rui5QB20zlpAGEl/4bldb0CjRplcp2BPEJfV1PG1sStvtE1jdgmvfw42yjd4YjUSSfBdaTMbEx8PAXs1qq38g812nDiIN6maHjwYQWIs9RFLCUdontQUDEWwfpulf7Nt+MXwL2bb2C272VuTf1l4W3EhGYp1AyM2lT5yqA9gE6PUOwOIaHin/AY7Ek8QI8Q/2nLgQIfZBMfgQEgMf2ERJ/gKexainH9UPmyDkhQGa9qNCJpbTs+P7OFdQzCYLBF2LU31cSL5WE+T5BHDApzB5CyFh61dkOritrF+tN5kDfo2jC5u18Xl9HXpM3IzfdwYkNf4hyeHHtMt4HtwsKc+6+niHtx3u4r6kc5OtNok0O+lFBlqcCBap/lEarhmSVdu4rxNXcbFY8pyRQp7G9xc0YTGglr85VExEv+KOWzG4ceEHyDig/ULawkP3nPcLJFu2CATc5apJ/SwJc= X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:; X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(601004)(2401047)(8121501046)(5005006)(3002001)(10201501046); SRVR:BY1PR0701MB1723; BCL:0; PCL:0; RULEID:; SRVR:BY1PR0701MB1723; X-Microsoft-Exchange-Diagnostics: 1; BY1PR0701MB1723; 4:2L3j2su89Ab+8HUXumNx7g81uCVw5HexnqvqnOag7sgw9OqLnw/V+jKkdjPiCDIYsfAEYufjTs3bWNuWEb7cp7Ca1c1qtOsE0/Gaxu+DyhM7ZGn3E5ONwDADcau2ShQlv/wMsxWK5Qg37DvxSCKczQxx4Mjp5XZXu7qNY5wpMUDLGTB0cttkvJgLLqxfSwX8ofJVeHFFgqlcx2D0YEz66yCaVRPHzGEAW5uXOjLD7ddb4JEAgpurbTKNWOhNweAGZKeKCRihcR7vza+wtV8iIoTHP1s0TZfJICLlsigTBKwQ8cA9j7U//REoLiHWOUrZAwAZoVu4VSdriUusS+9mXPKXN5kBqouejslqGSxmLSFf+FDH+MkFZgPV0FsZPs6X X-Forefront-PRVS: 083691450C X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(6069001)(6009001)(50226001)(5008740100001)(122386002)(40100003)(1096002)(3470700001)(92566002)(33646002)(3846002)(586003)(48376002)(4326007)(6116002)(42186005)(2906002)(76176999)(19580405001)(107886002)(19580395003)(4001430100002)(110136002)(36756003)(47776003)(2351001)(87976001)(50466002)(5001960100002)(5003940100001)(189998001)(229853001)(2950100001)(77096005)(66066001)(5004730100002)(50986999)(86362001)(7099028); DIR:OUT; SFP:1101; SCL:1; SRVR:BY1PR0701MB1723; H:localhost.localdomain.localdomain; FPR:; SPF:None; MLV:sfv; LANG:en; X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; BY1PR0701MB1723; 23:XzI5EOdzKT6fqdPs0KgkqoDFzn4wNNo7BJlBN8W?= =?us-ascii?Q?AVvQAaoEE8jCNVdqE8UNtmTn39JNCNGxqFsx+SIKWiE6qK8vfnwJa8bLzRJe?= =?us-ascii?Q?3Ac8gK5xnXdKfsB+adQf3zJCM3XdZef600PEOY5z3Xv5980yaNYYwmMx745r?= =?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tTYfDk3+M?= =?us-ascii?Q?+7se3vak=3D?= X-Microsoft-Exchange-Diagnostics: 1; BY1PR0701MB1723; 5:o3ATftyZloVGL4e10BFbmvO+JkFe3a/+8/PMWyiKCbumxj8314lf2n+1ApBhTvlJDX45Lexvu3FKYm3mdamZWkWOSFBOpB8zfuA6MCbhVf0FtGO+EqYN60izqSvJHsH2riM0Af4Konp4RSbFsE6+dw==; 24:ccrciAfXPgX6LeM8EmQmemsd5XyN8sf1LxV/6UTWoV+RHWkWuue+fxbvHcl3BMGlHqsyTN3/mUx6eEL3HT3je0fpPTmiN54kF0/1Wf6SX9o= SpamDiagnosticOutput: 1:23 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: caviumnetworks.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 29 Jan 2016 07:46:33.4896 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-Transport-CrossTenantHeadersStamped: BY1PR0701MB1723 Cc: viktorin@rehivetech.com Subject: [dpdk-dev] [PATCH v4 2/4] mbuf: fix performance/cache resource issue with 128-byte cache line targets X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches and discussions about DPDK List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 29 Jan 2016 07:46:37 -0000 No need to split mbuf structure to two cache lines for 128-byte cache line size targets as it can fit on a single 128-byte cache line. Signed-off-by: Jerin Jacob --- app/test/test_mbuf.c | 2 +- lib/librte_eal/linuxapp/eal/include/exec-env/rte_kni_common.h | 4 +++- lib/librte_mbuf/rte_mbuf.h | 2 +- 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/app/test/test_mbuf.c b/app/test/test_mbuf.c index b32bef6..c24cbe0 100644 --- a/app/test/test_mbuf.c +++ b/app/test/test_mbuf.c @@ -930,7 +930,7 @@ test_failing_mbuf_sanity_check(void) static int test_mbuf(void) { - RTE_BUILD_BUG_ON(sizeof(struct rte_mbuf) != RTE_CACHE_LINE_SIZE * 2); + RTE_BUILD_BUG_ON(sizeof(struct rte_mbuf) != RTE_CACHE_LINE_MIN_SIZE * 2); /* create pktmbuf pool if it does not exist */ if (pktmbuf_pool == NULL) { diff --git a/lib/librte_eal/linuxapp/eal/include/exec-env/rte_kni_common.h b/lib/librte_eal/linuxapp/eal/include/exec-env/rte_kni_common.h index 815abd6..fef914f 100644 --- a/lib/librte_eal/linuxapp/eal/include/exec-env/rte_kni_common.h +++ b/lib/librte_eal/linuxapp/eal/include/exec-env/rte_kni_common.h @@ -68,6 +68,8 @@ */ #define RTE_KNI_NAMESIZE 32 +#define RTE_CACHE_LINE_MIN_SIZE 64 + /* * Request id. */ @@ -118,7 +120,7 @@ struct rte_kni_mbuf { uint16_t data_len; /**< Amount of data in segment buffer. */ /* fields on second cache line */ - char pad3[8] __attribute__((__aligned__(RTE_CACHE_LINE_SIZE))); + char pad3[8] __attribute__((__aligned__(RTE_CACHE_LINE_MIN_SIZE))); void *pool; void *next; }; diff --git a/lib/librte_mbuf/rte_mbuf.h b/lib/librte_mbuf/rte_mbuf.h index f234ac9..c973e9b 100644 --- a/lib/librte_mbuf/rte_mbuf.h +++ b/lib/librte_mbuf/rte_mbuf.h @@ -814,7 +814,7 @@ struct rte_mbuf { uint16_t vlan_tci_outer; /**< Outer VLAN Tag Control Identifier (CPU order) */ /* second cache line - fields only used in slow path or on TX */ - MARKER cacheline1 __rte_cache_aligned; + MARKER cacheline1 __rte_cache_min_aligned; union { void *userdata; /**< Can be used for external metadata */ -- 2.1.0