From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from NAM02-BL2-obe.outbound.protection.outlook.com (mail-bl2nam02on0081.outbound.protection.outlook.com [104.47.38.81]) by dpdk.org (Postfix) with ESMTP id 5C4CC1B1AF; Mon, 12 Feb 2018 14:14:11 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=CAVIUMNETWORKS.onmicrosoft.com; s=selector1-cavium-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=IO9bIaisYmJLafX5rGGJy0YF23sdunz6+bNiCbE9fhE=; b=lj59Ob3kIWAb2x0wTYUwBmTeQbrBkQYt6mBgNZc7l8V75ILPAHFQcPdBbo3KniOBeNhGyvXBjBJmYSodJL8hV2em53Uz3DdlzIOd0z/qNQBAWgkeOCCiZhJiAPp5ECILntkdwGgr52F4Jt7AUjoXicE2Pn/u3TFVtEJ6mQEVUFw= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=Jerin.JacobKollanukkaran@cavium.com; Received: from jerin.domain.name (115.113.156.3) by SN2PR07MB2527.namprd07.prod.outlook.com (2603:10b6:804:6::27) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.485.10; Mon, 12 Feb 2018 13:14:06 +0000 From: Jerin Jacob To: dev@dpdk.org Cc: ferruh.yigit@intel.com, Jerin Jacob , stable@dpdk.org, Matan Azrad , Thomas Monjalon , Konstantin Ananyev , Pavan Nikhilesh Date: Mon, 12 Feb 2018 18:43:43 +0530 Message-Id: <20180212131343.13555-1-jerin.jacob@caviumnetworks.com> X-Mailer: git-send-email 2.16.1 In-Reply-To: <20180212055439.6462-1-jerin.jacob@caviumnetworks.com> References: <20180212055439.6462-1-jerin.jacob@caviumnetworks.com> MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [115.113.156.3] X-ClientProxiedBy: BM1PR0101CA0014.INDPRD01.PROD.OUTLOOK.COM (2603:1096:b00:18::24) To SN2PR07MB2527.namprd07.prod.outlook.com (2603:10b6:804:6::27) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 2cf41e33-96da-4b5b-b973-08d5721a80d0 X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(7020095)(4652020)(4534165)(7168020)(4627221)(201703031133081)(201702281549075)(5600026)(4604075)(2017052603307)(7153060)(7193020); SRVR:SN2PR07MB2527; X-Microsoft-Exchange-Diagnostics: 1; SN2PR07MB2527; 3:98CO4/d0n38BTWH+NVPKxTpmPd7Juo8WtBGoGnCnMWkcnD2rEC87WWCmpwkDheaOax8nuvh20Wqd9puI9pK2xnTfNHqp2a7HbHx7+lmNTKjRmNiecPLFjuSBm68MxYPqqqjIrV4uUmMoqUkBZD/pUiba2vmym5ZkM7+xgpmdk9CzboRW5PfNTuRSx6CCbL8nPQ/+x00cP1a1w+4ZiFMh4OQEv97g2ZPVz75ggLAewNk9HEOKMHARSufUyuAu+12O; 25:Hr/lRj2orB3IezucS68h8f79wDnY9wDXdOlt14S8FFgNr89+9R2pUBu4Fm/a/s5CUYrwNfi6JsR2S3hLI82tXfL1rPChMeAbO/d6TRKbnZDyrkIcG/wnm4i/sJpYWrxPen87eoY3RUWrE9/Qoyq/fYhIfUvjBvBWVzgiptdmul+arxDKwBAv5WFhTvmfaUfT/D0pkoKOW0CUKLxVSVW1WINgNwlBR+GyQb/IMjEjlzhxeS7KtkZhoa/UM9zFRt6twub+1w+utnR+V/98ynvR1SfPU2SsL+95oPWnGvug5bEcFCTIPqmUcLWMcdaycfMpv6PQxvdaTGRsfaIHjBcEvA==; 31:vH0isqCr/Ek5cBp0gkiI+AQGx3h4PrzwGd6a8WWqpPVAszv7qLgMoGD5ZVVDSd8H16TsYcaB/DPt+PUgurHIWGAH8Ez+OxWTyKiBs5D+VMGnIrJkwyYN3mtQ4WOSsQXlQFrnO9DfneqC/lFOkJpy99LxjLv96c1F9dCr9i//zAniV3IJ7WykroahVIUQtYQXxtFPXQH8pgx6s0xNzBF8R0utSWAQXyoIrTzRgkdH6/Y= X-MS-TrafficTypeDiagnostic: SN2PR07MB2527: X-Microsoft-Exchange-Diagnostics: 1; SN2PR07MB2527; 20:B7qb+Geacw09VHh08T6rG6N6gVu0cgM08g4YtzfG8g8YyYgGEIlB00JP4yFbe5nUEIMn8Xw80t3aKGhAftgJSl4UGNOUlW4LNhTpsefyj2ykXDF8j5fSg8eTDU8ROBhXKZo2bAcnvqQ9g5sm3HgRo7NPj9LPfFaXhIFmUHPs6YsdosZf2hNsgCzMhxM7ful+WSGRaB76/dJ1g2tLzL5l4es/3Vn7qRgD8NvfYTaJWisKOAkFoSrGqEzjMdA5oQCQmQObrx1AjhP3E+3mWKavzgGC4CEbt0+w8spaNAyeaJi38IL1yZKw+9ngfmpuWIBmLb90v8FQF8b3TVwTQae14VtOVrh5bS5hoSRmdmjPZdYn+jdA/ZwDmAOMk1EI/KBIZd5IGPmSvN7z5IbnqXiB9PjcdTEvZtT3byGCrDdfBLVuoO3QFFLOow2eLfjo0DD7CXadhjcdMeCtLwQqJwf8oPrH4i1/WGkE2+DC9p9NRuOjtUADH8/os8XSsQAHBmLzYwk3OPaqhbm7VJbAugbruHDfW+BKqTQadukOSWuGgjiV9Cc01tmbo/Hj9dwV/uU4pEDAFkDYNE32I6pEOaac88KqrLhxU1EHXEYyN48iDKo= X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(60795455431006)(131327999870524)(228905959029699); X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(6040501)(2401047)(5005006)(8121501046)(3231101)(2400082)(944501161)(10201501046)(3002001)(93006095)(6041288)(20161123558120)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123562045)(20161123564045)(20161123560045)(6072148)(201708071742011); SRVR:SN2PR07MB2527; BCL:0; PCL:0; RULEID:; SRVR:SN2PR07MB2527; X-Microsoft-Exchange-Diagnostics: 1; SN2PR07MB2527; 4:O9fis1cS3LryD313fPfDCcSgf0wZqPQydFDUrkEFIRoyT3VpSNxM3LRBA7MpMbysQALx12nyJ7ZniPXaa1SOyrZfQRSvCgpxwS7dtTIZSDOlmaLBKvSvpztuppAwCI9UCe503CCYyExmgSDbdNPKKy7RlY+TxBzJxitlV84Gr5rUiIK9y49+pFToiFxIXSlSr1pV4iEwFsnhzFgAwv4U+bBLBHg2guPsoguZXvN/wbPHHIG/MNYju+BebCevcRPIoLRJMV5OK0OLAl7fMxIngqZRPAm5cqWex2Sw+/2UJEG57rFpqzegoGFzhJ2NQWZcFDjDATcC6cVDvgPrTOI0Dfk2ZtSsXXAVBDHcSa2RERA6WZncg3a799LDrn+LdSxq X-Forefront-PRVS: 0581B5AB35 X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(376002)(366004)(346002)(39850400004)(396003)(39380400002)(199004)(189003)(36756003)(966005)(42882006)(6916009)(16586007)(478600001)(5660300001)(51416003)(4326008)(6512007)(316002)(2950100002)(81166006)(81156014)(76176011)(72206003)(50226002)(1857600001)(68736007)(53936002)(6306002)(8936002)(52116002)(53376002)(8676002)(69596002)(186003)(25786009)(54906003)(16526019)(107886003)(26005)(6116002)(3846002)(7736002)(106356001)(66066001)(1076002)(2906002)(59450400001)(6666003)(55236004)(47776003)(305945005)(6506007)(97736004)(6486002)(386003)(50466002)(105586002)(53416004)(2361001)(48376002)(2351001); DIR:OUT; SFP:1101; SCL:1; SRVR:SN2PR07MB2527; H:jerin.domain.name; FPR:; SPF:None; PTR:InfoNoRecords; A:1; MX:1; LANG:en; Received-SPF: None (protection.outlook.com: cavium.com does not designate permitted sender hosts) X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; SN2PR07MB2527; 23:v3V31VwRWv2Gi2oa46IiA4U1H5ZKSJn7O058IKiJ4?= =?us-ascii?Q?+phPyG9JXBR45MNG7qMXzvD0nl4YWTNDEvmSSmCdyoDNWGYkLnL9EmZf0Wog?= =?us-ascii?Q?SBDCR40MR+8RFbs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F3lg+mYLQ1cnw57tF3/wkE=; 24:qU/yCtDBFIXYwJpvmVdsLfnKoEkayzfYxDf9B+7aPQtu9F1Kc0EI3TaRFA64pA20M5OqQt0rVPkqlBhh0dn1xMPk8JyOEe0/ttJO6UQEMEk=; 7:UwqRHK2NW+8XcdKpl+pV4VIW8Abv5XpKXbBFTeY+YMN9jeLRmkNn1ZbaRwml0KdmOsSMwPzpKpUIVvM7X4OFQ/T1Bnns360qga8dvrX5zjsYUyGPyqNWH8zIN6PgnIt9+UfrbchsQsZMSyyFh5HS4oXq6sUMaNaP+3bc0Ay4LOOVX3QjCM9+iJFVeqNRROY8lKyTQ5QzXeM+5NbDNM1hGiEc2js4xrmLtJa65Wv5TzA4FCeBb+EfQRXuBOkOH4fX SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: caviumnetworks.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 12 Feb 2018 13:14:06.9609 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 2cf41e33-96da-4b5b-b973-08d5721a80d0 X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 711e4ccf-2e9b-4bcf-a551-4094005b6194 X-MS-Exchange-Transport-CrossTenantHeadersStamped: SN2PR07MB2527 Subject: [dpdk-stable] [dpdk-dev] [PATCH v3] ethdev: fix ethdev data alignment X-BeenThere: stable@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches for DPDK stable branches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 12 Feb 2018 13:14:12 -0000 The struct rte_eth_dev_data is used in ethdev fastpath routines and it not aligned to cache line size. This patch fixes the ethdev data alignment. The alignment was broken from the "first public release" changeset where ethdev data address was aligned only to the first port. Remaining ports alignment was defined by the size of the struct (rte_eth_dev_data). This scheme is not guaranteed to be cache line aligned all the time. "ethdev: add port ownership" change set introduced a rte_eth_dev_shared_data container for port ownership change, This resulted in rte_eth_dev->data memory for the first port also as cache unaligned. Added a compiler alignment attribute to make sure rte_eth_dev->data always cache aligned so that CPU/compiler 1) Avoid sharing the element with another cache line 2) Can load/store the elements in struct rte_eth_dev_data as naturally aligned. Some platform like thunderX could see performance regression of 1% at "ethdev: add port ownership" change set with 1 port/1 queue l3fwd application and this patch fixes that regression. example command: sudo ./examples/l3fwd/build/l3fwd -c 0xff00 -- -p 0x1 --config="(0,0,9)" Fixes: af75078fece3 ("first public release") Fixes: 5b7ba31148a8 ("ethdev: add port ownership") Cc: stable@dpdk.org Cc: Matan Azrad Cc: Thomas Monjalon Cc: Konstantin Ananyev Signed-off-by: Jerin Jacob Signed-off-by: Pavan Nikhilesh --- v3: - added more history/data in the git log - added stable@dpdk.org in Cc v2: - Change the git comments based on Matan's feedback http://dpdk.org/dev/patchwork/patch/35104/ --- lib/librte_ether/rte_ethdev_core.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/librte_ether/rte_ethdev_core.h b/lib/librte_ether/rte_ethdev_core.h index 315b31723..e5681e466 100644 --- a/lib/librte_ether/rte_ethdev_core.h +++ b/lib/librte_ether/rte_ethdev_core.h @@ -601,7 +601,7 @@ struct rte_eth_dev_data { struct rte_vlan_filter_conf vlan_filter_conf; /**< VLAN filter configuration. */ struct rte_eth_dev_owner owner; /**< The port owner. */ -}; +} __rte_cache_aligned; /** * @internal -- 2.16.1