From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from EUR01-HE1-obe.outbound.protection.outlook.com (mail-he1eur01on0052.outbound.protection.outlook.com [104.47.0.52]) by dpdk.org (Postfix) with ESMTP id B04721B335; Mon, 12 Feb 2018 14:44:56 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=Mellanox.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=12ND40BSvqsKefAyttcRdo8pfxUfJHfxGI6Rdqa4/a8=; b=B7Z0pdFLZj5ZS94V57uztwnsd1oq6ER3ONDPFYw1c9h9xc3KJecWA8tXDnwlVkhGuiEq0j7aQ3X7RGLK8gWJ9pK+cuhmVXJRwAOJzeT3zsHnSVMaN/J7+6LQJu9lyNJirf41c7leicI0jTfMYObdMOUJ7qm+1j1k2jsWqscTIHI= Received: from AM4PR0501MB2657.eurprd05.prod.outlook.com (10.172.215.19) by AM4PR0501MB2673.eurprd05.prod.outlook.com (10.172.215.23) 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:44:54 +0000 Received: from AM4PR0501MB2657.eurprd05.prod.outlook.com ([fe80::80c6:df5:b1b0:ff05]) by AM4PR0501MB2657.eurprd05.prod.outlook.com ([fe80::80c6:df5:b1b0:ff05%17]) with mapi id 15.20.0485.013; Mon, 12 Feb 2018 13:44:54 +0000 From: Matan Azrad To: Jerin Jacob , "dev@dpdk.org" CC: "ferruh.yigit@intel.com" , "stable@dpdk.org" , Thomas Monjalon , Konstantin Ananyev , Pavan Nikhilesh Thread-Topic: [dpdk-dev] [PATCH v3] ethdev: fix ethdev data alignment Thread-Index: AQHTpANiaq5Rw6GqmU+oCLerB77OcKOgxa8A Date: Mon, 12 Feb 2018 13:44:54 +0000 Message-ID: References: <20180212055439.6462-1-jerin.jacob@caviumnetworks.com> <20180212131343.13555-1-jerin.jacob@caviumnetworks.com> In-Reply-To: <20180212131343.13555-1-jerin.jacob@caviumnetworks.com> Accept-Language: en-US, he-IL Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: authentication-results: spf=none (sender IP is ) smtp.mailfrom=matan@mellanox.com; x-originating-ip: [193.47.165.251] x-ms-publictraffictype: Email x-microsoft-exchange-diagnostics: 1; AM4PR0501MB2673; 6:CUPa229OIHH//YJYXCtpZ8muVnDZ7s/qhnA48Wg80Yb39uxbV6IzdYoezJx8RwlE/yrsNfJ8jQ61nqnYcaOrAs4+cAs6+fYVEwu+CJQjkuKOT0JLhqY1cl9KtdMtsPexfRT9K1YxW+PybzWH23lOst34rkjZlagWHZe3Pp2OS9YgxkHFdc5scy5uRHFVCfOqzHbnQm/ScZQSH/eQoeKKCLtZwTnXwyCaTuMFFGM+jgM3yPtHbnnlbIvxUQe9hxbZyVIbHU8mmVzoQ3IS06J7YdObmETeTnqYCGPAw/+tj/Z80eo1QkPPwDFOCau7XarzTlSHM05Boxw19lf8p6126NNus3W67zIGOTtkzccQeuuchOtrNsJSc8UDsyChO4rG; 5:CBIKLMUjIpq7C0Ug1UM+OsycTsmfo7W9/ebtW2qVkfMuKJzyAhdprVKiRkaCnIx+8DLwWutif+vJE8ytIhKQ9ckFx2D+cDh+N42VoBvMoS1bOX+sYMO+xoeDAHw7Hy6fM1B7xW5n3MGiaPdrQFI/Iyed8E6XeOTm6Ksz3eX9EWc=; 24:+GJGJ7z1nbV6+nPC6q0qK2o7nQWhwQPHs4oRCORHvMEeqvuNrz8uq1YVzKTXif0e+0XO7Deboi4flKQRSDMMRrj5h/K3oWSmJZI8wNTqmDY=; 7:1rsVNb+pMKsSLRDpXccysYlAcDAn9pClOAJcW8bi4uDg0VM0caZ4S5JhxoJsTnVjY3UWUp6RbxwF2qninQVWMGojqqofoBscBIRhn665pHpSsE1XW4+HLL90TNfIQr4U2M55nDlVfP8tzCEH9dQ/vp4DVdFPUvu+s/on2RNUvet3LLA2LudkYLMyN23pht//9oULWFbmV4bU0ah8ryBEpJMyVG3KCulPFFq6h2PcjhDmprjVkEmgI6ZLhVq1fyiS x-ms-exchange-antispam-srfa-diagnostics: SSOS; x-ms-office365-filtering-ht: Tenant x-ms-office365-filtering-correlation-id: 06509d38-94dc-4f16-76e8-08d5721ecc4c x-microsoft-antispam: UriScan:; BCL:0; PCL:0; RULEID:(7020095)(4652020)(48565401081)(4534165)(4627221)(201703031133081)(201702281549075)(5600026)(4604075)(3008032)(2017052603307)(7153060)(7193020); SRVR:AM4PR0501MB2673; x-ms-traffictypediagnostic: AM4PR0501MB2673: x-ld-processed: a652971c-7d2e-4d9b-a6a4-d149256f461b,ExtAddr x-microsoft-antispam-prvs: x-exchange-antispam-report-test: UriScan:(60795455431006)(189930954265078)(131327999870524)(45079756050767)(228905959029699); x-exchange-antispam-report-cfa-test: BCL:0; PCL:0; RULEID:(6040501)(2401047)(5005006)(8121501046)(93006095)(93001095)(10201501046)(3231101)(2400082)(944501161)(3002001)(6055026)(6041288)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123560045)(20161123562045)(20161123564045)(20161123558120)(6072148)(201708071742011); SRVR:AM4PR0501MB2673; BCL:0; PCL:0; RULEID:; SRVR:AM4PR0501MB2673; x-forefront-prvs: 0581B5AB35 x-forefront-antispam-report: SFV:NSPM; SFS:(10009020)(376002)(396003)(366004)(39860400002)(39380400002)(346002)(189003)(199004)(51444003)(25786009)(53936002)(26005)(4326008)(6436002)(6306002)(55016002)(9686003)(86362001)(66066001)(186003)(6246003)(6506007)(76176011)(54906003)(110136005)(102836004)(575784001)(2501003)(81156014)(81166006)(5250100002)(316002)(8936002)(8676002)(3660700001)(3280700002)(59450400001)(68736007)(105586002)(7696005)(7736002)(229853002)(33656002)(305945005)(74316002)(5660300001)(45080400002)(2950100002)(966005)(3846002)(478600001)(106356001)(14454004)(97736004)(99286004)(2906002)(2900100001)(6116002); DIR:OUT; SFP:1101; SCL:1; SRVR:AM4PR0501MB2673; H:AM4PR0501MB2657.eurprd05.prod.outlook.com; FPR:; SPF:None; PTR:InfoNoRecords; MX:1; A:1; LANG:en; received-spf: None (protection.outlook.com: mellanox.com does not designate permitted sender hosts) x-microsoft-antispam-message-info: kDzyIYsLAagPMSepgUQGumkaTDauDpqoE4xOg5dSESfBsYjGpFU+DCjsA76XwoBTO0MUcI5GNrvJ2i1QJ//u6w== spamdiagnosticoutput: 1:99 spamdiagnosticmetadata: NSPM Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-OriginatorOrg: Mellanox.com X-MS-Exchange-CrossTenant-Network-Message-Id: 06509d38-94dc-4f16-76e8-08d5721ecc4c X-MS-Exchange-CrossTenant-originalarrivaltime: 12 Feb 2018 13:44:54.4004 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: a652971c-7d2e-4d9b-a6a4-d149256f461b X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM4PR0501MB2673 Subject: Re: [dpdk-dev] [PATCH v3] ethdev: fix ethdev data alignment X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 12 Feb 2018 13:44:57 -0000 Hi Jerin From: Jerin Jacob [mailto:jerin.jacob@caviumnetworks.com] > The struct rte_eth_dev_data is used in ethdev fastpath routines and it no= t > aligned to cache line size. This patch fixes the ethdev data alignment. >=20 > 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 aligne= d > all the time. >=20 > "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. >=20 > 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. >=20 > 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. >=20 > example command: > sudo ./examples/l3fwd/build/l3fwd -c 0xff00 -- -p 0x1 --config=3D"(0,0,9)= " >=20 > Fixes: af75078fece3 ("first public release") > Fixes: 5b7ba31148a8 ("ethdev: add port ownership") I don't think you need the add the 5b7ba31148a8 fix line. Maybe think about it in the next way: Is your fix can stay as a same fix before the port ownership feature additi= on? If yes, You are not fixing it. I think that the port ownership just exposed the issue, did not initiated i= t. > Cc: stable@dpdk.org >=20 > Cc: Matan Azrad > Cc: Thomas Monjalon > Cc: Konstantin Ananyev >=20 > Signed-off-by: Jerin Jacob > Signed-off-by: Pavan Nikhilesh > --- >=20 > v3: > - added more history/data in the git log > - added stable@dpdk.org in Cc >=20 > v2: > - Change the git comments based on Matan's feedback > https://emea01.safelinks.protection.outlook.com/?url=3Dhttp%3A%2F%2Fdpd > k.org%2Fdev%2Fpatchwork%2Fpatch%2F35104%2F&data=3D02%7C01%7Cmata > n%40mellanox.com%7Cd491698ead5f48626c1408d5721a8331%7C8c5c71989d > be4cf9a2099e499881116c%7C0%7C0%7C636540380570748030&sdata=3Dif8cCrk3 > U0XqWp8NE%2BEP1BjuPHX95HHN0f1yjk6krV0%3D&reserved=3D0 >=20 > --- > lib/librte_ether/rte_ethdev_core.h | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) >=20 > 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; >=20 > /** > * @internal > -- > 2.16.1