From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from NAM01-BN3-obe.outbound.protection.outlook.com (mail-bn3nam01on0040.outbound.protection.outlook.com [104.47.33.40]) by dpdk.org (Postfix) with ESMTP id 4A4691B1A3; Wed, 10 Jan 2018 11:47:57 +0100 (CET) Received: from BN3PR03CA0094.namprd03.prod.outlook.com (2603:10b6:400:4::12) by SN2PR03MB2365.namprd03.prod.outlook.com (2603:10b6:804:e::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.386.5; Wed, 10 Jan 2018 10:47:56 +0000 Received: from BL2FFO11FD055.protection.gbl (2a01:111:f400:7c09::166) by BN3PR03CA0094.outlook.office365.com (2603:10b6:400:4::12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.407.7 via Frontend Transport; Wed, 10 Jan 2018 10:47:56 +0000 Authentication-Results: spf=fail (sender IP is 192.88.168.50) smtp.mailfrom=nxp.com; NXP1.onmicrosoft.com; dkim=none (message not signed) header.d=none;NXP1.onmicrosoft.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 BL2FFO11FD055.mail.protection.outlook.com (10.173.161.183) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_RSA_WITH_AES_256_CBC_SHA) id 15.20.345.12 via Frontend Transport; Wed, 10 Jan 2018 10:47:24 +0000 Received: from bf-netperf1.ap.freescale.net (bf-netperf1.ap.freescale.net [10.232.134.28]) by tx30smr01.am.freescale.net (8.14.3/8.14.0) with ESMTP id w0AAljSL007124; Wed, 10 Jan 2018 03:47:53 -0700 From: Hemant Agrawal To: CC: , , Date: Wed, 10 Jan 2018 16:16:25 +0530 Message-ID: <1515581201-29784-4-git-send-email-hemant.agrawal@nxp.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1515581201-29784-1-git-send-email-hemant.agrawal@nxp.com> References: <1515504186-13587-1-git-send-email-hemant.agrawal@nxp.com> <1515581201-29784-1-git-send-email-hemant.agrawal@nxp.com> X-EOPAttributedMessage: 0 X-Matching-Connectors: 131600548451462659; (91ab9b29-cfa4-454e-5278-08d120cd25b8); () X-Forefront-Antispam-Report: CIP:192.88.168.50; IPV:NLI; CTRY:US; EFV:NLI; SFV:NSPM; SFS:(10009020)(396003)(376002)(346002)(39860400002)(39380400002)(2980300002)(1110001)(1109001)(339900001)(189003)(199004)(86362001)(575784001)(6916009)(5660300001)(2950100002)(6666003)(81166006)(97736004)(36756003)(85426001)(8676002)(498600001)(81156014)(48376002)(76176011)(51416003)(4326008)(53936002)(106466001)(104016004)(8936002)(77096006)(47776003)(2351001)(54906003)(50466002)(16586007)(305945005)(50226002)(8656006)(356003)(2906002)(105606002)(68736007)(316002)(296002); DIR:OUT; SFP:1101; SCL:1; SRVR:SN2PR03MB2365; H:tx30smr01.am.freescale.net; FPR:; SPF:Fail; PTR:InfoDomainNonexistent; MX:1; A:1; LANG:en; X-Microsoft-Exchange-Diagnostics: 1; BL2FFO11FD055; 1:3TkbxQS8JTOEa5Bne977mrBn7B/8vvDNc9EFqGIJvxbP2G34gOEpU3k5aNd0HP/T1sZsGqfWFbv1I0hXzLCc5M4eNz+23DmcIs53KDaqQcT4qYO8MN4426uPcqaUECas MIME-Version: 1.0 Content-Type: text/plain X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 9d95e142-f6fd-48f0-2e03-08d558178929 X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(5600026)(4604075)(4534020)(4628075)(201703131517081)(2017052603307); SRVR:SN2PR03MB2365; X-Microsoft-Exchange-Diagnostics: 1; SN2PR03MB2365; 3:Sg5LQOxspTA+7IqjgnDxdY1YvtoE8f9mZSV0KsQ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iKZ9QqgoUGiW6j6voA5FBv+L4Mqdi47MFe2JLzmu6z7Eb9cXpCaGGxakhwRNWPr7ZJEgMxL2fCDpBaZico7J8/UZaAqyN6U4C5yVSF+QzJWR7iAzpD116+q2xcV1HGUra0ZWBzlbuWzclMHokZazRYaGfWvQV9UWi0EtuvKbkyxwkxBLySC0q6VDljjM/J/5UsPPRpQZr9wxk4Ydj9w6cIp+2YwL/ X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(185117386973197); X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(6095135)(2401047)(5005006)(8121501046)(3002001)(93006095)(93001095)(3231023)(944510075)(944921075)(946801075)(946901075)(10201501046)(6055026)(6096035)(20161123559100)(201703131430075)(201703131520075)(201703131433075)(201703131448075)(201703161259150)(201703151042153)(20161123563025)(20161123565025)(20161123556025)(20161123561025)(201708071742011); SRVR:SN2PR03MB2365; BCL:0; PCL:0; RULEID:(100000803101)(100110400095)(400006); SRVR:SN2PR03MB2365; X-Forefront-PRVS: 0548586081 X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; SN2PR03MB2365; 23:+Sqjwa0cA95iq1Jc/BJHUamjeq5Kfy0IOFpNrqFqX?= =?us-ascii?Q?zeWu6W8kn8oBRaZilj+nqQhznwiYPrUPzcqV/86hDYE2pJUfkrSNv2N7JD9v?= =?us-ascii?Q?d2lwsUF1MmEcajUSzgy/ba2mmD4noObqeh+x+ST4qX8+XQY94zzB+480jZnu?= =?us-ascii?Q?bBjgJtzuf1YIL2/5KgF5Xe+XBsHZDoMfs9rZtqHC0pB7tHLetCx5gAyac/gp?= =?us-ascii?Q?nYCGYV5CmoyTKNQqnQEkEvTL/Xw+CJ7mtDYVExXTjME9ye3GAMvtC6c5qKp3?= =?us-ascii?Q?NmrCs8uwcF3ioIa3SlQgdgEEi3IRQ87SVM+FIXgjC7qOmeu9aB4GFbf7NqSD?= =?us-ascii?Q?+XXzdOklvg9mOsJpI7UccVW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pM8+KAls9sHLQPysJBsDJWb5L/V7gFwUPhvam16UhVE9qfgSbhA4DFej7x1V1CaduOYa9pZFpnG7oMDUrhLrEvfC+OCNjVvHgBouhY6rcUsb9gQtzAUm1fk6+W4XdsFC6fl5miGb+4r4ZVFZ5shxwBZaNAFo378Z4wIWXhPQxyt/vM1V3toKeyW/VAt/1nyKgsIfl0bCs3ssB/R73nQwKERkV/BvNm0fmqN7upoVjmbPUDVZSVs0s=; 5:vQhTbyLq29xdMZUTESQv9Iz9PqIVc7adPc46YxdST90N695DSyBRNJj3a+/PoxzMVb6cIkYancNAQaCDZFw20oqAXfBtCmkAF59uXKy5qNuujAttAxkyknFdWeyMExau5A4sDcdKtbLBYVE0KOmmGWj48QlQxLy2I6ZBykr+FsI=; 24:Ec5X4mQRv4VdR+6fQDExN8fL1Bz8j8FBkyqed5C0GUZdHzidmnwb/teFQvjV3unUwP+a01O5pc+chjssPdVq4whtqldILM1FRIGHpJIvzXk=; 7:snwsEGOCSryThz0xpNNsWV8Pq63SCMYotAiM+2dsMfeO6bdDta7Xr9cFC/cGrCFSRUI9NUtrmR1nxUApWKjX1qIKvRAxtIkuF1ZLE/WZWqnHE5mfO0SRrV6izXTIstFwf9vCg1arMgVq3nxLMlJ/roDR7ucO0bcO4dYDlfayj4Cd9rXZtR59efsiDFs67sDu+4coaiPMhU4Y0Yhn5uTnRiK5e6mv7GybRxx0/fUF1D7Dhq0PRwLN5JSRnycUTNC5 SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-MS-Exchange-CrossTenant-OriginalArrivalTime: 10 Jan 2018 10:47:24.9434 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 9d95e142-f6fd-48f0-2e03-08d558178929 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: SN2PR03MB2365 Subject: [dpdk-dev] [PATCH v3 03/19] net/dpaa: fix FW version code 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: Wed, 10 Jan 2018 10:47:57 -0000 fix the soc id path and missing fclose Fixes: cf0fab1d2ca5 ("net/dpaa: support firmware version get API") Cc: stable@dpdk.org Signed-off-by: Hemant Agrawal --- drivers/net/dpaa/dpaa_ethdev.c | 14 +++++--------- drivers/net/dpaa/dpaa_ethdev.h | 2 +- 2 files changed, 6 insertions(+), 10 deletions(-) diff --git a/drivers/net/dpaa/dpaa_ethdev.c b/drivers/net/dpaa/dpaa_ethdev.c index 7b4a6f1..db6574f 100644 --- a/drivers/net/dpaa/dpaa_ethdev.c +++ b/drivers/net/dpaa/dpaa_ethdev.c @@ -186,19 +186,15 @@ dpaa_fw_version_get(struct rte_eth_dev *dev __rte_unused, 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) { + if (fscanf(svr_file, "svr:%x", &svr_ver) <= 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); + fclose(svr_file); + 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 diff --git a/drivers/net/dpaa/dpaa_ethdev.h b/drivers/net/dpaa/dpaa_ethdev.h index bd63ee0..254fca2 100644 --- a/drivers/net/dpaa/dpaa_ethdev.h +++ b/drivers/net/dpaa/dpaa_ethdev.h @@ -20,7 +20,7 @@ /* DPAA SoC identifier; If this is not available, it can be concluded * that board is non-DPAA. Single slot is currently supported. */ -#define DPAA_SOC_ID_FILE "sys/devices/soc0/soc_id" +#define DPAA_SOC_ID_FILE "/sys/devices/soc0/soc_id" #define DPAA_MBUF_HW_ANNOTATION 64 #define DPAA_FD_PTA_SIZE 64 -- 2.7.4