From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from NAM01-BN3-obe.outbound.protection.outlook.com (mail-bn3nam01on0047.outbound.protection.outlook.com [104.47.33.47]) by dpdk.org (Postfix) with ESMTP id 8E94A7D4E for ; Thu, 21 Sep 2017 15:07:32 +0200 (CEST) Received: from MWHPR03CA0004.namprd03.prod.outlook.com (10.175.133.142) by CY1PR03MB2363.namprd03.prod.outlook.com (10.166.207.150) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.56.11; Thu, 21 Sep 2017 13:07:31 +0000 Received: from BY2FFO11FD036.protection.gbl (2a01:111:f400:7c0c::160) by MWHPR03CA0004.outlook.office365.com (2603:10b6:300:117::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.56.8 via Frontend Transport; Thu, 21 Sep 2017 13:07:31 +0000 Authentication-Results: spf=fail (sender IP is 192.88.168.50) smtp.mailfrom=nxp.com; intel.com; dkim=none (message not signed) header.d=none;intel.com; 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 BY2FFO11FD036.mail.protection.outlook.com (10.1.14.221) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_RSA_WITH_AES_256_CBC_SHA) id 15.20.35.14 via Frontend Transport; Thu, 21 Sep 2017 13:07:31 +0000 Received: from [10.232.14.39] ([10.232.14.39]) by tx30smr01.am.freescale.net (8.14.3/8.14.0) with ESMTP id v8LD7S6f016311; Thu, 21 Sep 2017 06:07:29 -0700 To: Ferruh Yigit CC: , References: <20170823141213.25476-1-shreyansh.jain@nxp.com> <20170909112132.13936-1-shreyansh.jain@nxp.com> <20170909112132.13936-41-shreyansh.jain@nxp.com> <1682977c-c5dd-939f-bc77-e18a6803de07@intel.com> From: Shreyansh Jain Message-ID: <49af3aff-7eaa-5317-3fe7-77c652873455@nxp.com> Date: Thu, 21 Sep 2017 18:48:25 +0530 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.3.0 MIME-Version: 1.0 In-Reply-To: <1682977c-c5dd-939f-bc77-e18a6803de07@intel.com> Content-Type: text/plain; charset="utf-8"; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-EOPAttributedMessage: 0 X-Matching-Connectors: 131504728514938989; (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)(7966004)(336005)(376002)(39860400002)(39380400002)(346002)(2980300002)(1110001)(1109001)(339900001)(3190300001)(189002)(199003)(24454002)(377454003)(104016004)(53936002)(5660300001)(105606002)(65806001)(65956001)(65826007)(83506001)(31686004)(6246003)(305945005)(8656003)(498600001)(54906003)(85426001)(6666003)(47776003)(33646002)(356003)(58126008)(93886005)(23676002)(106466001)(316002)(2950100002)(6916009)(81156014)(189998001)(64126003)(53546010)(68736007)(81166006)(4326008)(229853002)(86362001)(77096006)(8676002)(50466002)(50986999)(36756003)(2906002)(54356999)(230700001)(31696002)(76176999)(8936002)(97736004); DIR:OUT; SFP:1101; SCL:1; SRVR:CY1PR03MB2363; H:tx30smr01.am.freescale.net; FPR:; SPF:Fail; PTR:InfoDomainNonexistent; MX:1; A:1; LANG:en; X-Microsoft-Exchange-Diagnostics: 1; BY2FFO11FD036; 1:q0cRtoirFWX2BabbZLcx2/qpSaBwdO81h1rEfLDafzrKbY6Zqh4ffmsCgv2FNRE5I/Umu7MGP7EOAWOutFXAubnH+z1FCJbsVJQCUvU0WSI5RXTCD2UP+0emjgTyiSQt X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: dd788a56-c737-4fe8-c86d-08d500f1b7e1 X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(300000500095)(300135000095)(300000501095)(300135300095)(22001)(300000502095)(300135100095)(300000503095)(300135400095)(2017052603199)(201703131430075)(201703131517081)(300000504095)(300135200095)(300000505095)(300135600095)(300000506095)(300135500095); SRVR:CY1PR03MB2363; X-Microsoft-Exchange-Diagnostics: 1; CY1PR03MB2363; 3:/svxLUrnxe8uapyQnazFdZGe+4NK4EFg4VXdwwnGklXFkY6j/s+PKCeTs6wf68X7ikQsT1IYDVs0vEIL7p2GSOOPtBkq4AxYTWUHjqu157hG3lvF7wQFqEblGoi5PrNI4wb/lsF19VcV1SE5LNB30vC8anO4HpbZMuwf4kGoeVZWtjgqy8ZhRbFmqtKCufK7Ck4Eqoh6ZgdoVokZHBCrdYWVVllammugkQwSFS42o381YITD17Ae0ZEfixtZhKccuqr9c1e9sRxzMwwUAfXYex8lH9DlVdhYlxa0NxoZ0UTBnRdqqH9Z4CyfbWssiMpuE7s49aHpR79QsqxGGvINq5Au12N8zsgoMF2+eu6JJVU=; 25:ULDALwvU9Iqn4K8aQZMmmvVzP/xuPlr4UHYUBxmhf4c3/AWAc7MoUnjnvet6gKnIxNAVw/+bjz0/FbOBJG6UQegflwhV5103iY/CZwlh0tN6+APNoAZPAMuIceKMeF0V0LOTMUhFSF4qExYU5pbmImpmbDBulCdlauQr9UhyE2ghb/o5SKsrUFrcL6srFgid/Mf81Vp/mCmvsKTW1pQze/rBWi1FAxjmSVn3mvHaWnqNjyKRrfyGhY5UuNHsQ+OgrrfB1W1yEqHSyiZgUB06A5fv+k7hUDP6/wAlMuSpyprU+tMX7x7wr1HCmY8uizDpQsxtRxqCPeZZHsTRmrN1QQ== X-MS-TrafficTypeDiagnostic: CY1PR03MB2363: X-Microsoft-Exchange-Diagnostics: 1; CY1PR03MB2363; 31:qK1T0PXUuiFcWTrNgYj+Bje7mENIDOmUuPXTEWxv46GOa5TWF2IYFYzR0d2sg7s6MRUEqeMcynck1eHLJoyQGu4/bDVd15vHImUjX6Sj2ryGUkxtJZQF+255zzcXfbHTSxC5CepozTnedPikGmlBw+OQIVi1PVZJduJTDxjM9db+5xBXeUwBtUvoppLUdgoJ2uZGEbPOa/+dH6DIOczGf+B1j/5Q7W8g4dVCBGgnNaA=; 4:TwqUhUPngGFP5A5U7LpLI/MaQTlGgjRsb2/K9yDrpukPLwio/Cr4i9ZDe/MxWENVkTIqbD5VZijYM4MSl9iamIrXjrnVui5D+tNBg8uFP0AQgXT9smrKKHuvPomCTch4vNpchehAlStXrLnmJTRXT/Wc37mTFToXD6PPTGnHVxExW9MPoHB5p9l4d4gcd6O/grAZEGSCG0q4ovnJgevXJxB6DrM3DSbMXY6o27WB6FtV1BeOgQ45hAt4Ja1BDS+chwBN5pvxPABioMVbxI9MTmBh4LgA4HxSMuex35EbA/w= X-Exchange-Antispam-Report-Test: UriScan:(185117386973197); X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(100000700101)(100105000095)(100000701101)(100105300095)(100000702101)(100105100095)(6095135)(2401047)(5005006)(8121501046)(3002001)(10201501046)(100000703101)(100105400095)(93006095)(93001095)(6055026)(6096035)(20161123563025)(20161123556025)(201703131430075)(201703131441075)(201703131448075)(201703131433075)(201703161259150)(20161123559100)(20161123565025)(20161123561025)(201708071742011)(100000704101)(100105200095)(100000705101)(100105500095); SRVR:CY1PR03MB2363; BCL:0; PCL:0; RULEID:(100000800101)(100110000095)(100000801101)(100110300095)(100000802101)(100110100095)(100000803101)(100110400095)(400006)(100000804101)(100110200095)(100000805101)(100110500095); SRVR:CY1PR03MB2363; X-Forefront-PRVS: 04371797A5 X-Microsoft-Exchange-Diagnostics: =?utf-8?B?MTtDWTFQUjAzTUIyMzYzOzIzOkdiN3F1OG9MVW9aVUpTZ01sejkxejNPMTE2?= =?utf-8?B?N2VZa09yMmNBZm9xWE5NMkRhMnQxUTZWZmZKK0ZqZ2JjaVlCbjBUZjh2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-Exchange-CrossTenant-OriginalArrivalTime: 21 Sep 2017 13:07:31.3067 (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: CY1PR03MB2363 Subject: Re: [dpdk-dev] [PATCH v4 40/41] net/dpaa: support for firmware version get API 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: Thu, 21 Sep 2017 13:07:33 -0000 On Monday 18 September 2017 08:27 PM, Ferruh Yigit wrote: > On 9/9/2017 12:21 PM, Shreyansh Jain wrote: >> From: Hemant Agrawal >> >> Signed-off-by: Hemant Agrawal > > <...> > >> +static int >> +dpaa_fw_version_get(struct rte_eth_dev *dev __rte_unused, >> + char *fw_version, >> + size_t fw_size) >> +{ >> + int ret; >> + FILE *svr_file = NULL; >> + unsigned int svr_ver = 0; >> + >> + PMD_INIT_FUNC_TRACE(); >> + >> + svr_file = fopen("/sys/devices/soc0/soc_id", "r"); > > Is this sysfs file fixed, can it be enumerated as soc1 etc.. in some > systems? The first base SoC slot is assumed to be the one for DPDK DPAA driver. That is the reason this path is assumed to be fixed. I can move this into a macro though, for readability. > >> + if (!svr_file) { >> + DPAA_PMD_ERR("Unable to open SoC device"); >> + return -ENOTSUP; /* Not supported on this infra */ >> + } >> + >> + ret = fscanf(svr_file, "svr:%x", &svr_ver); >> + if (ret <= 0) { >> + DPAA_PMD_ERR("Unable to read SoC device"); >> + return -ENOTSUP; /* Not supported on this infra */ >> + } >> + >> + ret = snprintf(fw_version, fw_size, >> + "svr:%x-fman-v%x", >> + svr_ver, >> + fman_ip_rev); >> + >> + ret += 1; /* add the size of '\0' */ >> + if (fw_size < (uint32_t)ret) >> + return ret; >> + else >> + return 0; >> +} > > <...> > >