From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from NAM02-SN1-obe.outbound.protection.outlook.com (mail-sn1nam02on0076.outbound.protection.outlook.com [104.47.36.76]) by dpdk.org (Postfix) with ESMTP id 4652C1B29F for ; Mon, 12 Feb 2018 11:21:05 +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=CeE2QPwKz3KTTIOTfbwY34pciup1pnHUY6G8hauyb+A=; b=cuJewnCsSdzgVufDWgniG8dnS9JGTzZ8emNrXAEFxcoda8hPovUowFjPM3gu6pOoScInnbsNB8CTjzLi6qj0HAdCAGpU3Y4mSKOZNuSsQTJ5sl8IMNp+SmByeY7k0Rp1WuqZN0DmgiOfZ3pME0+N+OGeVMDBjdQT4GRbfm0CrF4= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=Jerin.JacobKollanukkaran@cavium.com; Received: from jerin (115.113.156.3) by CO2PR07MB2519.namprd07.prod.outlook.com (10.166.201.6) 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 10:21:00 +0000 Date: Mon, 12 Feb 2018 15:50:42 +0530 From: Jerin Jacob To: Matan Azrad Cc: "dev@dpdk.org" , "ferruh.yigit@intel.com" , Thomas Monjalon , Konstantin Ananyev , Pavan Nikhilesh Message-ID: <20180212102041.GA29193@jerin> References: <20180210094220.16201-1-jerin.jacob@caviumnetworks.com> <20180212055439.6462-1-jerin.jacob@caviumnetworks.com> <20180212092544.GA24831@jerin> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.9.3 (2018-01-21) X-Originating-IP: [115.113.156.3] X-ClientProxiedBy: MAXPR0101CA0035.INDPRD01.PROD.OUTLOOK.COM (10.174.62.149) To CO2PR07MB2519.namprd07.prod.outlook.com (10.166.201.6) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 892d79bb-fbfb-44c6-be69-08d5720251b3 X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(7020095)(4652020)(4534165)(7168020)(4627221)(201703031133081)(201702281549075)(5600026)(4604075)(2017052603307)(7153060)(7193020); SRVR:CO2PR07MB2519; X-Microsoft-Exchange-Diagnostics: 1; CO2PR07MB2519; 3:W/XSRYBp4K3jrHdMJb0NcXQsacSEbeRPDoUd5Dp4dcTPSLV/r1X5cH9iSW1iXlLkoh9xK2lR0uiWy3WST2xtT1sDTPRsre2PWQDXy9AN51gvkM80mGxPG2vufdZN+DoL2ZjYe17L9p7jCztncUfpGvCSdPAHns5JuU6Lci44JhBN0b4t5sJpskJpOUbDDilzysSDeYTQWVk4da1SjuRP/OmJoMqSMtvG1RyKC9gwyHAiwAjKDHeNefesU7AUZq5Q; 25:Wqgb/N5b6yvE29911l/9X2grftWShk9cz9u1e/e6r0QKL0zjOlu7XplMwdig0QAc+j0xl9UnbMtmiwuDKhpHNpwAkdFAb0ljMyO6Yumc/NQiRLIi/gzYorN+5z5/+Q7pftZ0zArswH/gUAADq9MdtG7heWzxNjUlhl+AuvUPmsKCNJ6yHGKLnXC+xSVf1oiNS3AT9eWEx+ravuXSlDeHUQpFLQOpf5xN3DavAD6+PEK+x7Y08AIBqorVFOvZbpk7tyldaIALy3fRccZN1SqARiLCO2e7/vydZHgckHDWm/dqbXaVdM8nBfTWpBlDOAvjLcXTKtvY449GwBT85Evbwg==; 31:GyUCuYbfnXn/ADA6Ee8zV4UI03Ltqag9CwHZe3392Vj+nAMiUcOl/iDov3AP4NA7Q/AQkFR4YvYSJD9YTZ2B/XJw17wZnVdxOWYCyhPPqjuA62J/bL49u2f4ayOA/AnviRS5aJ0Z3iWACPJMlQ4RAGmoMtqjdZLRJcDhP+djbwGJd+6qI9j8E1qpiIbRphFaaVipUUbuJU7wcp8h0OmkNDsrOQ1VvdeSF0eI6ohzZ8Q= X-MS-TrafficTypeDiagnostic: CO2PR07MB2519: X-Microsoft-Exchange-Diagnostics: 1; CO2PR07MB2519; 20:VG1AeP40feqXKWTzy10tCu2DXJmKXaEzL05Mmb/HM3YqdRd9a94W02Kg9/JEKW58c4yTZ4NE53g7+vDceXLoj0isDoh9GMKjzp27vL34gHpGx+WLah6BP1kAMMswZvmeKOBYCjmTLcVHyzewCPkGPiR+A/V57sbptqmm1iXGnpHPin9umDRyJlmFkk72KT3wwpAXumg7knGjhYEOAD7OQqgCigQWiuGiYPpP3Tg7tUntOvKg9kMKn1Qql6GMyqFq0vsb0A/1H57tA4SAklqK8Rnp/SS64fl5tnIO7QYiGKlP+8Wrbh/G7ipwR14CV1FoK/QoX2rSPOe1KwMxN3KGEwFuCTsGlxpsO0z4USZg+RiHnnZDpxOHaGclF7RcId/2OkjCsPlrEhp0UQG+njXh1FUDoVYgA4ATFJiyr8iIE7haS278j5+QmpL3DaZ0f9zSBP9ZrEHLLCzEWTzx1jHJzWeofgg28OHBuq4OKlEFjFl3q65S72JzXlWSIMEJgDZQoPFxfSIxrGJoXLxBEBlS4CGODe8v8mT4Gy4UmJ+Ffegk3GoZwsMq4tDsQ38Iv0BmngtnZHyIgUeB2gb934qZBuYRdTmnfpOW8Lu6k4igz7I= 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)(8121501046)(5005006)(93006095)(3002001)(10201501046)(3231101)(2400082)(944501161)(6041288)(20161123564045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123558120)(20161123560045)(20161123562045)(6072148)(201708071742011); SRVR:CO2PR07MB2519; BCL:0; PCL:0; RULEID:; SRVR:CO2PR07MB2519; X-Microsoft-Exchange-Diagnostics: 1; CO2PR07MB2519; 4:IsMYh15JEz0nlOUIBJvEkQorhgwX+bZ0cZkx3qXECo35WhzHYzENz8NcxZaq/JDMQIM6L64zKwCJY0g8GFN35xte7PeJJpiGEBDScD8ciB5BQeI+xPWVSfK9O4hUPNxRl6JsOi15q50tsa81fVj0RUBT9yJA/XrBRA2Ay3Cn1kFGN8QdbOFWC6sieoLcWs4sbO8BeE5vjLibqGAjBsFREK3CDAsn4O+wuw5QhpsDuKBDZpyA2TO835JWvE1mY1O0SEOBuBt4iCJh+KZVBgULZ9I7UL8GKTSZzYiHns4nShxh0GyA4eJUp/4DnkBVER1sdqtszzvYuz884cIlb9hlGC0S/qXDHG8KnMdvtPAF4gojIau6aqcCE8a7AmtJKhREfpIidNS/QeEzhUrwBl1PhacLjU6B6SirFaeF+v97KxQqmeyDq3qaG6YAmaHX/PQoIKLqWExV5gD8O+W8OOee6g== X-Forefront-PRVS: 0581B5AB35 X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(366004)(376002)(39850400004)(396003)(346002)(39380400002)(189003)(199004)(51444003)(13464003)(9686003)(33896004)(55016002)(6666003)(6306002)(386003)(76176011)(2906002)(6916009)(42882006)(53936002)(55236004)(2950100002)(106356001)(68736007)(5660300001)(59450400001)(26005)(305945005)(8936002)(25786009)(33656002)(47776003)(72206003)(8676002)(6246003)(93886005)(7736002)(107886003)(66066001)(4326008)(45080400002)(81166006)(52116002)(6116002)(23726003)(3846002)(105586002)(1076002)(33716001)(316002)(966005)(54906003)(50466002)(58126008)(97736004)(83506002)(16586007)(16526019)(575784001)(478600001)(81156014)(186003)(6496006)(229853002)(18370500001); DIR:OUT; SFP:1101; SCL:1; SRVR:CO2PR07MB2519; H:jerin; FPR:; SPF:None; PTR:InfoNoRecords; MX:1; A: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; CO2PR07MB2519; 23:sOHY4LvqH9iOuOJYI7j4Y6fxtmpmkzqSt9u2q9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Ge9xHJRzWFfFar6SmUaej2Dv5kGmOlkyd/hpIMtwUBtSUKYew6LonD/2Mz2rmrC1/6pLc=; 5:31STRGuOfPlnVJw6rrfjpq6UzJ7yWskSnYQ/lFWw6CjtFtHZf7mZauAElK4ZtYS/Sa8WqvHBekZ3x0Ceo/KxCVWo+yCRSqfJjLbIDniFibvhb/OsDijRPRxLOVp+tMHCIpY+9+b6ZzTf2VrYrrkJJNnhJFwtb74YFDsQ845GGuA=; 24:hBI9qXH9k1uaMsaNiL/fpaT+eMjX1TQK7Yz9DVbcwslAuyhsEBKUGNK2D0DYRVRK97SWEuhvew3W/RkDFjTG3M/5iTWzrHa/4XqIWwQGioo=; 7:7jnMfe8UkN5s2zpORBF3NGTfd04d9fnQAJTUsiPZPj/fYrXOcLKsTDTVpjR8ZSvn258iJ6dsZKyBhbshSKZRdvg45l26b4MSqgfRn2Yk38RWaJyXWIrvI3HVhj1unb4DbXRcaoI5+iFXZk/qB98Qjr9TueB7+P33fpWkmeJbpUv0FO7hrC1T4rZriZhxQgxDKEDXe6BYtuTTaBjuMwuhvRhzmRLeO++Ag+A1Pl3qamQ9d54PsQL39Veag5hNjmgD SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: caviumnetworks.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 12 Feb 2018 10:21:00.3872 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 892d79bb-fbfb-44c6-be69-08d5720251b3 X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 711e4ccf-2e9b-4bcf-a551-4094005b6194 X-MS-Exchange-Transport-CrossTenantHeadersStamped: CO2PR07MB2519 Subject: Re: [dpdk-dev] [PATCH v2] ethdev: make ethdev data cache aligned 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 10:21:05 -0000 -----Original Message----- > Date: Mon, 12 Feb 2018 09:49:55 +0000 > From: Matan Azrad > To: Jerin Jacob > CC: "dev@dpdk.org" , "ferruh.yigit@intel.com" > , Thomas Monjalon , > Konstantin Ananyev , Pavan Nikhilesh > > Subject: RE: [dpdk-dev] [PATCH v2] ethdev: make ethdev data cache aligned > > Hi Jerin > > From: Jerin Jacob, Sent: Monday, February 12, 2018 11:26 AM > > -----Original Message----- > > > Date: Mon, 12 Feb 2018 09:04:07 +0000 > > > From: Matan Azrad > > > To: Jerin Jacob , "dev@dpdk.org" > > > > > > CC: "ferruh.yigit@intel.com" , Thomas Monjalon > > > , Konstantin Ananyev > > > , Pavan Nikhilesh > > > > > > Subject: RE: [dpdk-dev] [PATCH v2] ethdev: make ethdev data cache > > > aligned > > > > > > Hi Jerin > > > > > > From: Jerin Jacob [mailto:jerin.jacob@caviumnetworks.com] > > > > Since struct rte_eth_dev_data used in the fast path, making it as > > > > cache aligned. > > > > > > > > Fixes: af75078fece3 ("first public release") > > > > Fixes: 5b7ba31148a8 ("ethdev: add port ownership") > > > > > > Looks like it is just improvement. > > > No need the above "fixes" lines (also fix title is not needed as you did). > > > > I think, It varies the way we look at it. I don't think, either way it matters in > > the commit log. > > I think this commit improves " af75078fece3 ("first public release")" since there was no intention to aligned rte_eth_dev_data in the first commit created it, > The relevant fields in the first port probably was aligned without any intention(if no , what's about the other ports?). In my view it is a bug as it missed to align to cache line from the first release. and before adding struct rte_vlan_filter_conf vlan_filter_conf and struct rte_eth_dev_owner owner; it was 128B aligned just by luck for all the ports. and further ("ethdev: add port ownership") changes the complete alignment by introducing a container type on top of it. Do you think, any reason why this fastpath structure SHOULD NOT BE cache aligned ? > > My suggestion is to just explain why the rte_eth_dev_data structure should be aligned and to align it as improvement, even to backport it to stable branch to improve the early LTS versions for all the ports. I don't think, There is a VERY specific reason for rte_eth_dev_data to cache aligned. it applies to all fastpath functions. IMO, We are making fastpath structure cache aligned due to, 1) Avoid sharing the element with another cache line 2) Compiler/CPU can access the elements in natural alignment if the top most element is aligned. > > > > See below, > > > > > > > > I think that performance improvement results should be added to the > > commit log. > > > > I added following under comment section. Do you this want to move git > > commit message ? If so, I can send the v3. > > > > - Some platform like thunderx + l3fwd showed 1% regression in the > > performance with 5b7ba31148a8 ("ethdev: add port ownership") in one port > > setup. > > I think it should report the improvement of the new commit you want to add now(not the degradation of the previous commits). > Also to details more (number of ports, number of queues per port, the forward mode, etc). In my setup the degradation(("ethdev: add port ownership") is fixing with this patch. So I can make it improvement of 1%. It simple, 1 port, 1 queue l3fwd setup. sudo ./examples/l3fwd/build/l3fwd -c 0xff00 -- -p 0x1 --config="(0,0,9)" It is not black and white. it will vary based on global variable alignment etc in the binary. i.e if apply this patch on any RANDOM change set you will not get a fixed improvement. Hope this clarifies. > > > > > > > Moreover, Did you investigate which fields in rte_eth_dev_data structures > > are important for performance and should not be in a different cache lines? > > > > No. That can be separate patch. > > I think it will be nice(not must :)), even in this commit, to explain the root cause of the performance improvement you saw by the alignment. > > > > Maybe alternative order of the fields in the structure may improve the > > performance more... > > > > Maybe. > > > > > > > > > Cc: Matan Azrad > > > > Cc: Thomas Monjalon > > > > Cc: Konstantin Ananyev > > > > > > > > Signed-off-by: Jerin Jacob > > > > Signed-off-by: Pavan Nikhilesh > > > > --- > > > > v2: > > > > - Change the git comments based on Matan's feedback > > > > > > https://emea01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fd > > > > p > > dk.org%2Fdev%2Fpatchwork%2Fpatch%2F35104%2F&data=02%7C01%7Cmat > > > > > > an%40mellanox.com%7C5c2537b12e6d4e51f12a08d571dd33a2%7Ca652971c7 > > > > > > d2e4d9ba6a4d149256f461b%7C0%7C0%7C636540117238324576&sdata=8OOg > > > > Zb0KzDbBce9xPVywV8ynmiKP9B%2BbYsQxgE5VlX0%3D&reserved=0 > > > > > > > > - Some platform like thunderx + l3fwd showed 1% regression in the > > > > performance with 5b7ba31148a8 ("ethdev: add port ownership") in one > > > > port setup. > > > > > > > > - If there are no objection for this change then request to take it > > > > for v18.02 release. > > > > --- > > > > 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 > > >