From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from NAM02-CY1-obe.outbound.protection.outlook.com (mail-cys01nam02on0041.outbound.protection.outlook.com [104.47.37.41]) by dpdk.org (Postfix) with ESMTP id F36B1293C for ; Thu, 1 Sep 2016 11:01:33 +0200 (CEST) Received: from DM2PR03CA0022.namprd03.prod.outlook.com (10.141.96.21) by BY2PR0301MB2006.namprd03.prod.outlook.com (10.163.196.28) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA_P384) id 15.1.587.9; Thu, 1 Sep 2016 09:01:32 +0000 Received: from BL2FFO11FD057.protection.gbl (2a01:111:f400:7c09::125) by DM2PR03CA0022.outlook.office365.com (2a01:111:e400:2428::21) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA_P384) id 15.1.609.9 via Frontend Transport; Thu, 1 Sep 2016 09:01:31 +0000 Authentication-Results: spf=fail (sender IP is 192.88.168.50) smtp.mailfrom=nxp.com; networkplumber.org; dkim=none (message not signed) header.d=none; networkplumber.org; dmarc=fail action=none header.from=nxp.com; Received-SPF: Fail (protection.outlook.com: domain of nxp.com does not designate 192.88.168.50 as permitted sender) receiver=protection.outlook.com; client-ip=192.88.168.50; helo=tx30smr01.am.freescale.net; Received: from tx30smr01.am.freescale.net (192.88.168.50) by BL2FFO11FD057.mail.protection.outlook.com (10.173.161.125) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_RSA_WITH_AES_256_CBC_SHA) id 15.1.587.6 via Frontend Transport; Thu, 1 Sep 2016 09:01:31 +0000 Received: from [10.232.14.87] ([10.232.14.87]) by tx30smr01.am.freescale.net (8.14.3/8.14.0) with ESMTP id u8191Rg2017904; Thu, 1 Sep 2016 02:01:28 -0700 To: Stephen Hemminger References: <1472704915-13112-1-git-send-email-shreyansh.jain@nxp.com> <1472704915-13112-3-git-send-email-shreyansh.jain@nxp.com> <20160831233010.5d78d262@xeon-e3> CC: , , From: Shreyansh Jain Message-ID: <7511d94b-fae6-c9e8-d6ac-67e67956d8f1@nxp.com> Date: Thu, 1 Sep 2016 14:31:27 +0530 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.2.0 MIME-Version: 1.0 In-Reply-To: <20160831233010.5d78d262@xeon-e3> Content-Type: text/plain; charset="windows-1252"; format=flowed Content-Transfer-Encoding: 7bit X-EOPAttributedMessage: 0 X-Matching-Connectors: 131171940912256360; (91ab9b29-cfa4-454e-5278-08d120cd25b8); () X-Forefront-Antispam-Report: CIP:192.88.168.50; IPV:NLI; CTRY:US; EFV:NLI; SFV:NSPM; SFS:(10009020)(6009001)(7916002)(2980300002)(1110001)(1109001)(339900001)(189002)(24454002)(377454003)(199003)(19580395003)(76176999)(65956001)(97736004)(54356999)(65806001)(50986999)(83506001)(586003)(85426001)(2906002)(4001350100001)(33646002)(47776003)(50466002)(4326007)(110136002)(626004)(189998001)(105606002)(31686004)(86362001)(87936001)(106466001)(68736007)(31696002)(104016004)(7846002)(356003)(8676002)(2950100001)(81156014)(5660300001)(230700001)(23746002)(64126003)(19580405001)(77096005)(8936002)(92566002)(81166006)(65826007)(11100500001)(305945005)(36756003); DIR:OUT; SFP:1101; SCL:1; SRVR:BY2PR0301MB2006; H:tx30smr01.am.freescale.net; FPR:; SPF:Fail; PTR:InfoDomainNonexistent; MX:1; A:1; LANG:en; X-Microsoft-Exchange-Diagnostics: 1; BL2FFO11FD057; 1:c4+xgzaNmwIR8l4d+TYtsMMuNySctuIaGzk7KsHP4JxB7nDz/rKMVitRk6iLK+J5s5eK/sL6Z5XVnsVhnsfJEUneL7PQpwTiSJXVAb5nUASkBBht6ltVLUTu5vWMhxZsIrGvJLhB+rKaurH3uYqdR4zaVYeNlpt8h+KA2o/CxOBGf31P9S0L+s38Qd6MWWF8jFu0WgVASZ19EWIGiS2QXLCg6E2m5HCyKbTV7LpykpK3+LlP88ZJ739pECPqZO5/MzEtR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DroZWORjo6Co1pb5AQ= X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(185117386973197); X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(6040176)(601004)(2401047)(8121501046)(5005006)(13015025)(13017025)(13024025)(13023025)(13018025)(10201501046)(3002001)(6055026); SRVR:BY2PR0301MB2006; BCL:0; PCL:0; RULEID:(400006); SRVR:BY2PR0301MB2006; X-Forefront-PRVS: 0052308DC6 X-Microsoft-Exchange-Diagnostics: =?Windows-1252?Q?1; BY2PR0301MB2006; 23:8Q+YUdhCwOmXEpMfK9suYA0xEBlz+GzAIhn?= =?Windows-1252?Q?glmPeMMHp0G2JvEneKw7hlxL46MRPHNgQAwG19JVQbj69lRA+3OqOk8D?= =?Windows-1252?Q?ajqcnVn8SuGWSTlPMNFQIJi4pgedejrJDq2gGr/EakvqEz4oCx3sxC9y?= =?Windows-1252?Q?UMjO66WcleHS5a90ujQiGQpB7dpv1Q+niYZi7SynqIopiiI1QefkZfyE?= =?Windows-1252?Q?0mvPloE9mMV2MseJ47WvlZZHVukRXLbs1hlHKb23ZVTEogUS46+i7ScB?= =?Windows-1252?Q?E02+0FwyoM+eGNqUEB0BNGa7UtIQWt+SOsfCfyVBRT/EpWIaz3zEojVM?= =?Windows-1252?Q?4b3jTM49KfhaSYwKWpIMYPNfFugkZzVbi1JtPa21s41IX1ErtkTJJsQe?= =?Windows-1252?Q?jPxF/Z2kEipBI86XzFXW/WjBwYLjfjDdoWoO9lJK0q85horapwr1EDI/?= =?Windows-1252?Q?eOAzOKiN1WPtbItOj9s5dIfxoMbXa9B3lIPYEV0XCGyq00p6kCfQlCDn?= =?Windows-1252?Q?rokR2tJDtn2kFSL9evpgjuaKd3BQCw2vXYcJJ/4o1nkjkFxLRHfDA+t4?= =?Windows-1252?Q?6veoPo8IAAj+8KB0Xnb8ieWf2KdmC8yCtwT2/St2LfDznze8w/6xpF2Z?= =?Windows-1252?Q?/38wasWNmd8//WShsEMx7mviMANT06m81fw8x4XRiItF9P/vl95RoyOt?= =?Windows-1252?Q?E+1vh0dodUuOZ25s6YqmHkgE4GDMtie3G/9Kr8IRP5wEiUMJLxs8T9AK?= =?Windows-1252?Q?MW/Gp7Drns/0u3qA6eS7B8g5nej1gBoerNl30VheIvlv9EKkwApH4JWB?= =?Windows-1252?Q?p4Q03/lZ7BdxiXD+bk5Z7U9NJn4CJb9fgHO9/EHtVyag4pfnzbU2k+Cv?= =?Windows-1252?Q?jpaAie1biA3qzn8/1MKVWcYQFE9yUvKW2Rhk4FEAwsekXiKq5jwG1SVz?= =?Windows-1252?Q?y44y4rkRxtW8kcB89k95tCXHcsGoxYUgUDF73BoSX2sVlFcAaApVaWB4?= =?Windows-1252?Q?vBmJExT/tC+SOgTRnUE6o7UzSirGMbobCumc7FxQ+GWwNVnCcnhtUNIY?= =?Windows-1252?Q?Fj0kuT7rwGrwQq7mowksFts9bNQMXUYfVYFNviKasv2gpmvbborWWcEH?= =?Windows-1252?Q?Cz7t+7cYUAbbV+qmlZwdVXFKXOCN+2U7TMg6/Raemp5XTrQu+h3lhMnR?= =?Windows-1252?Q?NnblRwpuugA6u+YbCKUOjtPLOYhCX6+PX4KqDJkE+tveyDnWKbV2XgHd?= =?Windows-1252?Q?PNGaBvZwEbkL+ajWGUnlnU8FAWhi4Yvu4S1gdVvbu7TKul+q3G8X6GyW?= =?Windows-1252?Q?Q83O3XRE6NDOBaduf6BW52fIu3UsrGeIm9Nr0RHGerlFVNXE5c9FTFnX?= =?Windows-1252?Q?+3KjIdWPy1i2bHj4lTKlkJMkwGAyd5X2fntTdOZObhb0WtlTwkpkDFVo?= =?Windows-1252?Q?=3D?= X-Microsoft-Exchange-Diagnostics: 1; BY2PR0301MB2006; 6:sBNPlwznZChVbmYzIwwEmREBh9k4yZewxVwhfi359YvcvYsIlCVviOzfoT6XLWe7yU6NWEQSfBriOT14yFJ9WG27LDpbu/OFemLYau7h9sZNrYnVxbI5jdzOHRn3MSr0bTzyw2GJpN1oxrZN9dj7juuxOfeG8XnYur0gdh0o+wKoKxIcVF4pmkAVOmFe32MvnyawP3/ppnNA3qROnWjXhsaqDJKvrcxrQMQs/bueo5FxwG6guX5bhBAYKUkdHHLKWOMTuU+vLxRXOpYEwGgoejNNgvbREZdtqmgVXic8+bk=; 5:maiCJ0Jf+IAMoXPn9Sv/Kv2AyvmaOcQQqa7B5EtRlRzTMJkBAEkHsw92I8ju09OHNlmeanRk+BeLiOJ3QSLJenZbe9X8N0990cTLUFWFx/OierAfsl+gluh6cWnUanLHbhCMu7gTcGsuqyX56HM6I3Jrxe54rQIaoDBnRiTBUJ4=; 24:+CRKcvp78Y1rZ/bzh6r5jgylUgsE+M1zyufiGHTyEEqJvVe/2AZd4xKphSVdetnIU4hSv2gBI3iG1x2TB8tmKH7X5V2v6VCevuNmFpt0Ipc=; 7:0AbAyLcxTqS9JaPDumY4dmzHTDmHfGmJigbIFZR1GS9cl+h+i93Arblpf/fWJvKxk16Dh4MVmFORLGtKGfy/GMbQ2xCiHrtl68542QKPdmy4evx+gmD8S2IeyinI9Hmy9ycHMxIap3vvaE4gT682+5zBZx4Ge916aPJYIYhLqn6kmVDyLzM/4tFuBu4vNblgTq2abvTJyWhYVSmpFWjgXgonSXeygl/GkbeC8ZiGmlwd30ZDjJuTROcfP4nKEH8N SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-MS-Exchange-CrossTenant-OriginalArrivalTime: 01 Sep 2016 09:01:31.0384 (UTC) X-MS-Exchange-CrossTenant-Id: 5afe0b00-7697-4969-b663-5eab37d5f47e X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=5afe0b00-7697-4969-b663-5eab37d5f47e; Ip=[192.88.168.50]; Helo=[tx30smr01.am.freescale.net] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: BY2PR0301MB2006 Subject: Re: [dpdk-dev] [PATCH 2/5] eal: extract function eal_parse_sysfs_valuef 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: Thu, 01 Sep 2016 09:01:34 -0000 Hi Stephen, On Thursday 01 September 2016 12:00 PM, Stephen Hemminger wrote: > On Thu, 1 Sep 2016 10:11:52 +0530 > Shreyansh Jain wrote: > >> From: Jan Viktorin >> >> From: Jan Viktorin >> >> The eal_parse_sysfs_value function accepts a filename however, such >> interface introduces race-conditions to the code. Introduce the >> variant of this function that accepts an already opened file instead of >> a filename. >> >> Signed-off-by: Jan Viktorin >> Signed-off-by: Shreyansh Jain >> --- > > You introduce new API, but don't use it in your other patches. Indeed - I have not used this API anywhere in my patches. As highlighted in the covering letter, these are some proposed changes which *might* help in future (for e.g., introducing new SoC infra). Patches don't depend on each other. > I don't see where passing filename is racy. sysfs files only get created/destroyed > when device is added/removed. > Agree that 'race-condition' is not the right word. parse_sysfs_value reads a single integer from a given sysfs file and is a useful helper for EAL layer, specifically for non-PCI infra as and when it is introduced (reading through custom sysfs files). At that time, it may be possible that caller keeps the context of the call rather than open the file every time - for reading more than an integer, for example. - Shreyansh