From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from na01-by2-obe.outbound.protection.outlook.com (mail-by2on0077.outbound.protection.outlook.com [207.46.100.77]) by dpdk.org (Postfix) with ESMTP id 26D399252 for ; Sun, 6 Dec 2015 17:00:15 +0100 (CET) Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=Jerin.Jacob@caviumnetworks.com; Received: from localhost.localdomain.localdomain (122.167.201.216) by BLUPR0701MB1714.namprd07.prod.outlook.com (10.163.85.140) with Microsoft SMTP Server (TLS) id 15.1.331.20; Sun, 6 Dec 2015 16:00:10 +0000 From: Jerin Jacob To: Date: Sun, 6 Dec 2015 21:29:23 +0530 Message-ID: <1449417564-29600-2-git-send-email-jerin.jacob@caviumnetworks.com> X-Mailer: git-send-email 2.1.0 In-Reply-To: <1449417564-29600-1-git-send-email-jerin.jacob@caviumnetworks.com> References: <1449417564-29600-1-git-send-email-jerin.jacob@caviumnetworks.com> MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [122.167.201.216] X-ClientProxiedBy: PN1PR01CA0038.INDPRD01.PROD.OUTLOOK.COM (25.164.136.138) To BLUPR0701MB1714.namprd07.prod.outlook.com (25.163.85.140) X-Microsoft-Exchange-Diagnostics: 1; BLUPR0701MB1714; 2:OxAywCfK+eeFGhBe0KWIYM3UNzpQbtZbwgEhC4MOP2jNdHxieh+j8ERmVKOhxQ7JZzArG+szzKhSNq2IDv8uQ2Q2sDN7MS3FKu1+PrdEEaVsFzc7r/nXmxJBs04JA/9odueiDfEtaqTTq0D9SABdpA==; 3:gyKFCWulqCGVqYczuoUFkv1TmRY4x3zYauETbAxpMWTMeIueMy9Vb2U23UC618eytOSGhu9JBdLEIuob1KZAhKzNE4Gkt5k+LR7r6EYsJ3RmwGb+wUh9oE1lVDg4sxw2; 25:UN68m7SQtNu77p28hvw608wklwys6XmRnQ4k03FQb35uGxD6OSr7kMGrKLdK8/Io92bGQPwYAPya8Ky1MTyCk/ZFOKA2WoyGyNP/L5VqWeiy7Ax+MvfFzahuZPcmi0/VjZMG4P0G9hRNwmyQM/wU7oNzh/svzo79/T1jqAa11K/o3biPdWUbhCuUZ1lD+MggppWLpuEsWbrHdIAeSymvsPvUqF1qx18MoqYKgGpH5Qr8js/2FRcuyjTy8WCu2wHqYunBwUScRW6/fuoi2A7FQw== X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:;SRVR:BLUPR0701MB1714; X-Microsoft-Exchange-Diagnostics: 1; BLUPR0701MB1714; 20:VxVOV3nNnvaqVjVYdbyj+zTTZmcRN2eI/VhIk5f7sYMNL9Tn2zIPAy0XySH2x3w7ylmQeMe+7iaaJXYQryy0cGQd0AIt8AhpQqyBLvnzDzFPggVHLMUEL5XNK3RTSFF99RgVmifQaNbCMQ7lVO3sIMajI+PrVW6QO3ltF94PxFYAdYeyeVb7HMHDCE+NyDsY5mv6eJEEBBSWhcHsieLEfwyUGN9i5dgCNWC8FHAzAiSknk5LPa5kUmVj4CwvnqXINRLwvKfYtbzsPRfmiAbL1V9gwK6lro+1c997R47juG/9lUj/in9oOyn/nRyLcTmh7DUU1Qi4MErvIo4it1oTKgwilrUwTUv+vTEeMb/zePWFRzMRjf8DlSCLNy9mvCSe+HuF2HF+6gNkwp1FnGFaWhLuxpc0L1HDP/CmlMsKvQKU3QVLVSbnYmro5LD82IR1z/RA9WOh7y9BrauVd/qGIKr8YwR01frQV+Gvf6TIfb67WNXrn+3lkxFPDmd1lVudZqtGBt8wlXG2H7VpaYv1Ad6BGzjwEJrVS89NO61Z4TG0Dj6/sXnejCFOTYoSxQMYTpMsUAY0ZGprdM+NLfEe4lAjGm2GVdQ8rtIBoqvNhVU= X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(236414709691187); X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(601004)(2401047)(5005006)(520078)(8121501046)(3002001)(10201501046); SRVR:BLUPR0701MB1714; BCL:0; PCL:0; RULEID:; SRVR:BLUPR0701MB1714; X-Microsoft-Exchange-Diagnostics: 1; BLUPR0701MB1714; 4:/Lokj8w0uqN5D+YOl1UHaIEZxyzhxrJxgfE8V9a8kQhIuRuVml8pdADHQWvHy3uPINJU0GDXACPVPAWHBgP92ZuNDO+ZtWiw8xByYSZ/POPAz2vAkEU1KME5e0SM5oGP7blE9rx0jv3QLp3wDPdEtSyAzdZ24dkbIfrnfNejRON1x3PJvkoa7WrHvp6gFJNZcSMMkDUhhG9FZdY/+FUy3fSnO9jCpUlftC1mxytJFBL/tzsRUtCzoJS/l1EeaqQr8IykAFjSw7J4DSfnArvQ04t3k5sg7dbOPHPNhsfk8ZZr69johRqS2+GoZffrhVYkY+Z01WFGC1SEUS7yx67YSj1DPtqt4LWhiCSkDnB2DAuAuLfXr3OAAl/FqFqDgNbJm2vXTDGwy/LoZzfbgRRkS2oLNyWSlM9ZM6KFHKLupYznIIDhFOvvZpFMdXCkOCba X-Forefront-PRVS: 0782EC617F X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(6009001)(6069001)(199003)(189002)(50466002)(2351001)(40100003)(92566002)(86362001)(5004730100002)(586003)(1096002)(4001430100002)(6116002)(3846002)(110136002)(5008740100001)(105586002)(97736004)(107886002)(5001960100002)(87976001)(81156007)(101416001)(106356001)(33646002)(189998001)(50226001)(76176999)(66066001)(77096005)(122386002)(2950100001)(5003940100001)(229853001)(50986999)(48376002)(42186005)(47776003)(19580405001)(19580395003)(36756003)(7099028); DIR:OUT; SFP:1101; SCL:1; SRVR:BLUPR0701MB1714; H:localhost.localdomain.localdomain; FPR:; SPF:None; PTR:InfoNoRecords; A:1; MX:1; LANG:en; Received-SPF: None (protection.outlook.com: caviumnetworks.com does not designate permitted sender hosts) X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; BLUPR0701MB1714; 23:0UA+P9cJbc+inYUUFoRnwXQBqGUp6yM/255ZxRv?= =?us-ascii?Q?Z+cFzm88ZW+zfZqLxlvvIRQFA16bQWx+rLEjLTh0xD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JXIDm0J+hhPm3N+47YWiUTjJoIXSk8eacKt2XNRbncgMqP?= =?us-ascii?Q?WZUI0b7AIVNrYYQGNFhRKrhJwkw1mRves0+eeT0KZgC0loAlvdfLP4H+gqA1?= =?us-ascii?Q?bMv+dOsF5oF+NL7bcxt8TIjGku02rHfR/qGGjoJ1eAZjZS7utTjDKrOsoug3?= =?us-ascii?Q?UEXQyd2wpfd/osu39W3GGANE3eLTFqQBW?= X-Microsoft-Exchange-Diagnostics: 1; BLUPR0701MB1714; 5:8Ub1Ot38q4ogDsIdtXh0TvoHfjdSZ23gOYPqqOJjoiv9IMoYrPMcxSQraKuv1sGBtVZITmJQJnx/LDhLml/iFH3ZFhD/6Rw6srcvOZs9q1FCENJZJP4Q2mNFvCGPVkWkWDmAjGmOaFULeCrtyHQBJg==; 24:dvOaAtrKohB+ttFrbu27+Qk8CqZ5nXIbQ0C1rgXxlOhgjX+4zx1hTl9nrH77k+lYJWAzR2hkq655b16nV7s15/oKx/FkNASit90i32PwF2A= SpamDiagnosticOutput: 1:23 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: caviumnetworks.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 06 Dec 2015 16:00:10.3345 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-Transport-CrossTenantHeadersStamped: BLUPR0701MB1714 Subject: [dpdk-dev] [PATCH 1/2] 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: Sun, 06 Dec 2015 16:00:15 -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 | 4 ++++ lib/librte_eal/linuxapp/eal/include/exec-env/rte_kni_common.h | 4 ++++ lib/librte_mbuf/rte_mbuf.h | 2 ++ 3 files changed, 10 insertions(+) diff --git a/app/test/test_mbuf.c b/app/test/test_mbuf.c index b32bef6..5e21075 100644 --- a/app/test/test_mbuf.c +++ b/app/test/test_mbuf.c @@ -930,7 +930,11 @@ test_failing_mbuf_sanity_check(void) static int test_mbuf(void) { +#if RTE_CACHE_LINE_SIZE == 64 RTE_BUILD_BUG_ON(sizeof(struct rte_mbuf) != RTE_CACHE_LINE_SIZE * 2); +#elif RTE_CACHE_LINE_SIZE == 128 + RTE_BUILD_BUG_ON(sizeof(struct rte_mbuf) != RTE_CACHE_LINE_SIZE); +#endif /* 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 bd1cc09..e724af7 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 @@ -121,8 +121,12 @@ struct rte_kni_mbuf { uint32_t pkt_len; /**< Total pkt len: sum of all segment data_len. */ uint16_t data_len; /**< Amount of data in segment buffer. */ +#if RTE_CACHE_LINE_SIZE == 64 /* fields on second cache line */ char pad3[8] __attribute__((__aligned__(RTE_CACHE_LINE_SIZE))); +#elif RTE_CACHE_LINE_SIZE == 128 + char pad3[24]; +#endif void *pool; void *next; }; diff --git a/lib/librte_mbuf/rte_mbuf.h b/lib/librte_mbuf/rte_mbuf.h index f234ac9..0bf55e0 100644 --- a/lib/librte_mbuf/rte_mbuf.h +++ b/lib/librte_mbuf/rte_mbuf.h @@ -813,8 +813,10 @@ struct rte_mbuf { uint16_t vlan_tci_outer; /**< Outer VLAN Tag Control Identifier (CPU order) */ +#if RTE_CACHE_LINE_SIZE == 64 /* second cache line - fields only used in slow path or on TX */ MARKER cacheline1 __rte_cache_aligned; +#endif union { void *userdata; /**< Can be used for external metadata */ -- 2.1.0