From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from EUR02-VE1-obe.outbound.protection.outlook.com (mail-eopbgr20078.outbound.protection.outlook.com [40.107.2.78]) by dpdk.org (Postfix) with ESMTP id D7E491B323 for ; Sat, 10 Feb 2018 19:23:43 +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=fKpZ7hkXKZGnCVw6bjQ5D5oFo27GUuSg9sQRvliTXCQ=; b=Aep9S5IGURxnwAlAtcbkUvWy611JzV3tnV8WTH8mS8pxlnY8OeS2zIdXk5UyefdckL+FqFwuRftn6IHVEVC4hM7nkhcFzOucWfQjNqJvKS/guEWVPat3iB9of3w0+PeJz8irao/OLfA6Fi9pFwb3iOqnzvR2E/Ia25gx5ZUkssE= Received: from AM4PR0501MB2657.eurprd05.prod.outlook.com (10.172.215.19) by AM4PR0501MB2851.eurprd05.prod.outlook.com (10.172.216.146) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.485.10; Sat, 10 Feb 2018 18:23:42 +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; Sat, 10 Feb 2018 18:23:42 +0000 From: Matan Azrad To: Jerin Jacob , "dev@dpdk.org" CC: Thomas Monjalon , Konstantin Ananyev , Pavan Nikhilesh Thread-Topic: [dpdk-dev] [PATCH] ethdev: fix a regression due to cache alignment issue Thread-Index: AQHTolOUM5O2JdoUsEK6LSYLxdPjfKOd7gBg Date: Sat, 10 Feb 2018 18:23:42 +0000 Message-ID: References: <20180210094220.16201-1-jerin.jacob@caviumnetworks.com> In-Reply-To: <20180210094220.16201-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: [85.64.136.190] x-ms-publictraffictype: Email x-microsoft-exchange-diagnostics: 1; AM4PR0501MB2851; 7:gPC6d7VToc8zZA+XICu7krK4wYRx/kDaT1zuxRqh1N/n5EKWniiSOJsI/omyTRh7NghkCtpe3eDHoe8cqyeeZRPDb5ZXqeEQHd2LYsGOGvTXsv8hDOhBfzDpvFWuZX+7It6gqEF8af4P0ldP0EPnFlsWhhYpwbCXcPDq4N6gyC0kWStNF4ETYIRvtnb/UZaBYommq8XTA3SvhCQQRWZk1lOwsOYvR6h+MjzWDVTTTZo7cwrk0Q6EGjSHCemdZwxR x-ms-exchange-antispam-srfa-diagnostics: SSOS; x-ms-office365-filtering-ht: Tenant x-ms-office365-filtering-correlation-id: 826a3d5b-1945-482e-e058-08d570b36a0e x-microsoft-antispam: UriScan:; BCL:0; PCL:0; RULEID:(7020095)(4652020)(4534165)(4627221)(201703031133081)(201702281549075)(48565401081)(5600026)(4604075)(3008032)(2017052603307)(7153060)(7193020); SRVR:AM4PR0501MB2851; x-ms-traffictypediagnostic: AM4PR0501MB2851: x-ld-processed: a652971c-7d2e-4d9b-a6a4-d149256f461b,ExtAddr 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)(93006095)(93001095)(3231101)(2400082)(944501161)(10201501046)(3002001)(6055026)(6041288)(20161123558120)(20161123564045)(20161123560045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123562045)(6072148)(201708071742011); SRVR:AM4PR0501MB2851; BCL:0; PCL:0; RULEID:; SRVR:AM4PR0501MB2851; x-forefront-prvs: 057906460E x-forefront-antispam-report: SFV:NSPM; SFS:(10009020)(366004)(396003)(346002)(376002)(39380400002)(39860400002)(51444003)(199004)(189003)(81156014)(26005)(7696005)(4326008)(99286004)(8676002)(105586002)(110136005)(7736002)(3660700001)(5660300001)(74316002)(66066001)(2906002)(86362001)(25786009)(2950100002)(106356001)(97736004)(6246003)(316002)(229853002)(3280700002)(59450400001)(68736007)(305945005)(81166006)(3846002)(6436002)(2900100001)(6506007)(14454004)(5250100002)(76176011)(33656002)(55016002)(53936002)(8936002)(186003)(9686003)(2501003)(6116002)(102836004)(54906003)(478600001); DIR:OUT; SFP:1101; SCL:1; SRVR:AM4PR0501MB2851; H:AM4PR0501MB2657.eurprd05.prod.outlook.com; FPR:; SPF:None; PTR:InfoNoRecords; A:1; MX:1; LANG:en; received-spf: None (protection.outlook.com: mellanox.com does not designate permitted sender hosts) x-microsoft-antispam-message-info: abWSPcAtrf25JAFu27hJmBswlblwzEfub5TZusENHCu4dpr3cQGaJUK0AwYWgE5a6/ZAu4lZjLgjZwHd6ZJR2Q== 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: 826a3d5b-1945-482e-e058-08d570b36a0e X-MS-Exchange-CrossTenant-originalarrivaltime: 10 Feb 2018 18:23:42.1734 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: a652971c-7d2e-4d9b-a6a4-d149256f461b X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM4PR0501MB2851 Subject: Re: [dpdk-dev] [PATCH] ethdev: fix a regression due to cache alignment issue 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: Sat, 10 Feb 2018 18:23:44 -0000 Hi Jerin From: Jerin Jacob,Sent: Saturday, February 10, 2018 11:42 AM > Prior to "ethdev: add port ownership" change, the fast path structure str= uct > rte_eth_dev->data was cache aligned due to the fact that eth_dev_data was > allocated from rte_malloc with cache aligned attribute. > "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 as cache unaligned. > Added a compiler alignment attribute to make sure rte_eth_dev->data > always cache aligned and hence compiler can load/store the elements in > struct rte_eth_dev_data as naturally aligned. >=20 > Some platform like thunderx + l3fwd showed 1% regression in the > performance with the offending changeset. >=20 > Fixes: 5b7ba31148a8 ("ethdev: add port ownership") >=20 Are you sure the previous port data allocation(before port ownership) was c= ache aligned for all the ports for every system (cache line size 16\32\64\1= 28...) or maybe it was only aligned to the first port (port_id=3D0)? I think that if the answer is no, this fix fixes early patch, or just impro= vement.=20 > Cc: Matan Azrad > Cc: Thomas Monjalon > Cc: Konstantin Ananyev >=20 > Signed-off-by: Jerin Jacob > Signed-off-by: Pavan Nikhilesh > --- > 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