From patchwork Tue Jan 9 13:22:50 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hemant Agrawal X-Patchwork-Id: 123955 Delivered-To: patch@linaro.org Received: by 10.140.22.227 with SMTP id 90csp4021938qgn; Tue, 9 Jan 2018 05:27:43 -0800 (PST) X-Google-Smtp-Source: ACJfBotMy9KxgP1JTb0L/k8uKB4ldSs8StjkTgK7F7obpLqhenwM56rwMSf9HaKwQpu1ix4M2riW X-Received: by 10.28.7.144 with SMTP id 138mr10936573wmh.128.1515504463283; Tue, 09 Jan 2018 05:27:43 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1515504463; cv=none; d=google.com; s=arc-20160816; b=eneba5bN6i/z/KMrjhZQ4t88qogeVM15/PnPw7WdHcGkpLc4BPNhs7kxAUlrWrxanh 0CIsfqXSdYPVtZ8lAGbz2NcP2PkHPQCIGrSc2wh2geWHnlKhRZ8CnMbQdh4RaGe4E6vu cG0roswB9dlcDqwddraUTwMvTZZ6i9APzTztm+vi8YqTZ3eB5IXEIcS/FRYYUACT6dqL 7PJw/1Jtu2b4/l342Y067mplk2tvabVvAq6g80qVuPJG82A8hj/0MtuwKuobQahYeFiW eozqGevokFxQIPL6l59EnRaxfHtj/a1dae2YJCaLkLmj1ZJ7kQZAjiNMJb8lkVb83S0s +uFg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:subject:spamdiagnosticmetadata :spamdiagnosticoutput:mime-version:references:in-reply-to:message-id :date:cc:to:from:arc-authentication-results; bh=Jwr26lLFblI0f3M1bBrEH3DyhmqIKFiczEXpJ+STi2s=; b=Wxh4+HLRIc48nMCmZPp68n8h8TmK3VFLznCFR+cf1J9YOfO/u5V0UvtD3iWud6f/Ng 2e/PJflFLfh4TlCfe1eCLJT1o+s1mo6ukYcFg3b1eWNj94sjgZllYR1AzEzjvoFTMT0Y 52vbqUXDLmnwMAjBwlg9KzAf923hNJGbOi8hofNDCJFzjk5ru8A7A1rWoQhNZhgnS1Z9 jDtFoZLHljTXslJxpHzG0ItboYhELJYhrb+HkDkURJK4Qwdii/H2VeSmknKy+WmBa2QO w81jkYo8ct7FP0B4zb1A29ToePJK4lwKmcYDE65Kzn/4b+WoYEs3ve3Ak4XvDY4sOj4s XCDQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of dev-bounces@dpdk.org designates 92.243.14.124 as permitted sender) smtp.mailfrom=dev-bounces@dpdk.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=nxp.com Return-Path: Received: from dpdk.org (dpdk.org. [92.243.14.124]) by mx.google.com with ESMTP id 52si10830694wrt.460.2018.01.09.05.27.43; Tue, 09 Jan 2018 05:27:43 -0800 (PST) Received-SPF: pass (google.com: domain of dev-bounces@dpdk.org designates 92.243.14.124 as permitted sender) client-ip=92.243.14.124; Authentication-Results: mx.google.com; spf=pass (google.com: domain of dev-bounces@dpdk.org designates 92.243.14.124 as permitted sender) smtp.mailfrom=dev-bounces@dpdk.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=nxp.com Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 4BD701B23B; Tue, 9 Jan 2018 14:24:54 +0100 (CET) Received: from NAM03-BY2-obe.outbound.protection.outlook.com (mail-by2nam03on0044.outbound.protection.outlook.com [104.47.42.44]) by dpdk.org (Postfix) with ESMTP id 3162A1B235; Tue, 9 Jan 2018 14:24:51 +0100 (CET) Received: from MWHPR03CA0012.namprd03.prod.outlook.com (10.175.133.150) by BY2PR0301MB0727.namprd03.prod.outlook.com (10.160.63.17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.386.5; Tue, 9 Jan 2018 13:24:18 +0000 Received: from BY2FFO11FD042.protection.gbl (2a01:111:f400:7c0c::169) by MWHPR03CA0012.outlook.office365.com (2603:10b6:300:117::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.407.7 via Frontend Transport; Tue, 9 Jan 2018 13:24:18 +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 BY2FFO11FD042.mail.protection.outlook.com (10.1.14.227) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_RSA_WITH_AES_256_CBC_SHA) id 15.20.345.12 via Frontend Transport; Tue, 9 Jan 2018 13:23:47 +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 w09DOAVk017638; Tue, 9 Jan 2018 06:24:15 -0700 From: Hemant Agrawal To: CC: , , Date: Tue, 9 Jan 2018 18:52:50 +0530 Message-ID: <1515504186-13587-3-git-send-email-hemant.agrawal@nxp.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1515504186-13587-1-git-send-email-hemant.agrawal@nxp.com> References: <1513166759-13466-1-git-send-email-hemant.agrawal@nxp.com> <1515504186-13587-1-git-send-email-hemant.agrawal@nxp.com> X-EOPAttributedMessage: 0 X-Matching-Connectors: 131599778279230706; (91ab9b29-cfa4-454e-5278-08d120cd25b8); () X-Forefront-Antispam-Report: CIP:192.88.168.50; IPV:NLI; CTRY:US; EFV:NLI; SFV:NSPM; SFS:(10009020)(39380400002)(376002)(396003)(346002)(39860400002)(2980300002)(1110001)(1109001)(339900001)(199004)(189003)(105606002)(106466001)(104016004)(50226002)(53936002)(8676002)(8936002)(5660300001)(4326008)(8656006)(2906002)(16586007)(54906003)(2351001)(51416003)(76176011)(97736004)(86362001)(305945005)(50466002)(81166006)(36756003)(356003)(81156014)(68736007)(316002)(575784001)(2950100002)(296002)(498600001)(6916009)(48376002)(77096006)(85426001)(47776003)(6666003); DIR:OUT; SFP:1101; SCL:1; SRVR:BY2PR0301MB0727; H:tx30smr01.am.freescale.net; FPR:; SPF:Fail; PTR:InfoDomainNonexistent; A:1; MX:1; LANG:en; X-Microsoft-Exchange-Diagnostics: 1; BY2FFO11FD042; 1:23myyHaIgL3R3V8l5pqg6VQtsSjO5BAcKeBKL7RryrvxbMzutu+3O3uzUqJQlcvuAvYUIbK3CJG3cugpOtJcYrx9sK14Smijoc7ZNSq2WAxKKVtBqvxs5Fz871SdkODD MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 30e51908-7327-40c6-8cf2-08d557643751 X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(4534020)(4628075)(201703131517081)(5600026)(4604075)(2017052603307); SRVR:BY2PR0301MB0727; X-Microsoft-Exchange-Diagnostics: 1; BY2PR0301MB0727; 3:H8J4o+t4bGzeVhyqBDJKMgrj7CaIaCWSIi9c51Tk8z7SF3frSA5viA4wfmEFqP1zYjhYCLVno4xs+M1VxQ8in729y2aQI8QLCuRXzMCH/Zx2WGr/BplBgZWW5WPwtkRCgKbrgCZvZhGKV9xDgL/M1w8zjbFtb+oHUUiP6klp3rIO81yc/cA2c1USTByCh4nEUrzLPH28heqcBg0GZNiA53foE58XHSZJniXVPwLAyMtWngf/dDRd14Ax+tSc94cf3+Em/xScXVLr8ns7G60+s27gcs+p/MiVIL8SErGOU9by10akriGUfq+OMACXB0DJto40JfdIoKJ05N8uDj2FCOni98L2NU5Koy8de1ocJd4=; 25:LRsD+SrA/j3OInYCkGld7BQApa299z7g2Q1UIoZIp14m4hd91qRPTquwrZVQ1hR/k8xHRDKMGcjRpj/E/fTviFzifhJ0bPxaV36zbT/rYtI59dWldZh4bJYJSjiSHhqK5N6Wr0Ff50MmlmlwUPMgDM6mo/KzfEMNCLARpZAFtqqZidXpJZKiXZQvFXXVj4WxiVjWp8p7s36qkjYiRQm3hYX+mWfGOOF46Wn2ZUmBs+ajOB4HCmPTAH8LMs9qFNc1Coagms5gCglUSTQTs9B2lj2lYazESPOZxHFZZzxcEfGA4hFKJ6lTHW3J93m+/a+6n7NlEPGnZH1XCezePxoUgQ== X-MS-TrafficTypeDiagnostic: BY2PR0301MB0727: X-Microsoft-Exchange-Diagnostics: 1; BY2PR0301MB0727; 31:B9LMiEL9YfJpnUMV/GbJ92PrCAKxmH+U5YDhhK5Y834+wehr+Rjacr5WX3/V8WlY/uFrQnykYOOb7AXkhNFseLFN/ffXpkI/TTc2UPoHwkaz8maBdetRy97SD56WhtD2N4V6wdknd5u2XJGWzBBEUQXZ0tA9E1pN/pUGSblrHyrxXpJYtD0fch7nvmYTiHYWe2TD4HJPpMPXKzt7osxk525i+ojNRg9vQFhkw48OPtw=; 4:6/1/p+pP6KUEaTrea2haMq+iQHzx8o2g0Ggk/wEUWWRKgmM9LhEpi8AsACl0i/A+0I6Y1wlY41UzLt2FQyQVsGiS+uO6SWjlJoGzBCQKHuTuijEpqTkUix3BrpBnQKJyCbZH3du6yvHl9ES1S1a+bAeGW31D4Rx+Xa61kfoxxPhszB6MXLTA9WizaMYAAbDjQ1ZrDiecXTS9xa03MHzHGJMHWKUBPVALsLiE1D3yCZ6QTSiP1N+W0SUTdSt3XHpXvv7EdQLLATXdI3gN05De+sZf3bI/qWpLV44mVgdscgHhnbRIC45v5HJbAf6HTdfb 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)(93006095)(93001095)(10201501046)(3002001)(3231023)(944510075)(944921075)(946801075)(946901075)(6055026)(6096035)(20161123561025)(20161123556025)(201703131430075)(201703131520075)(201703131448075)(201703131433075)(201703161259150)(201703151042153)(20161123563025)(20161123565025)(20161123559100)(201708071742011); SRVR:BY2PR0301MB0727; BCL:0; PCL:0; RULEID:(100000803101)(100110400095)(400006); SRVR:BY2PR0301MB0727; X-Forefront-PRVS: 0547116B72 X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; BY2PR0301MB0727; 23:Un1NXE6eO+4QmydQDs+XqC1vGd3+tMTeF9FDkig?= uUUF/9z4p9GbrAAQBMEl1qZjMvCPwYqlOgOoJZrKqzIV2GdoNTD6ZiX7dEwxYGXhFZ3rlYWf/+hLCFXxFEJ5pC/wpmSEgUU2Zq2gpDZEpYeO1rU9IjnqVLzvQvWaqS/8x3+tEonN4kMeaO6qIbZWW+zA765LajGlUJql4JXienGNpRPjgjtEjo4sS8bGmUauMmq5N4YfoJgerHGyojOLS5ebICdqZQdf0iQSAgTlMJk/qAD6F+sz3WimTqxRw0zRBYQhryEklCfrEgcM/PxfHJc7oEd3iGNNOQWIjBlqLtD+rl1SQnPd6LZldlgtukhEFwa5mPOMxt9EZYOatsjlDIpOEl1lOkA991JYhjRT7TbFpInIgsn50yjyLwPVJ15u6S6uRQP3AFvTbbD47Czgwkef4X2mPqkipejAJ0a4XdUXhhMsIusatvSA/h07PbPwykhRSLTSRPWLU2WRtDRJr26t2TDDffQvSF1/CkYdXfX6TDWi9AKf/K6seBkuZHOvKx4f+YAqQ9Qzxdlv8kMfUKwWWwlCZabJB4tDVHykekTVuHXZoB+hu14f04RQCChhNkuH5GFTJg1UvtZkHtjUURiYwzodKcnb1rVJ9ix4s8uwFydWLCkFDGs4MihiNxXUb8ZzfyluZqEeKQ2W1kiSoi40LL7YsueAL4e40E0JHBhsfplEKTbjSjdJ8+0puaUdA0sKNIIMA36Vnn1E85Jxb8w4WGFuwrkJITwNTEZ18STWNB/Dnpej9vMezWbrI8gNAk5lCww3VvwtmDs2VyteFDLicxxBUyhRgMt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NDhRboXPkl3IEJ3VQpIhQ8i2ncwqQLyY0aKNYhoNlyn2MjP7ckJ8wvZPRQN2LgaOmoku1GH3nzygllviMeZY98DWylne09NJntJRnjf4E7FqZ69mZfaDpioEnlm2GlTFPbhyI6JIVXrHQWfDMDoFY SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-MS-Exchange-CrossTenant-OriginalArrivalTime: 09 Jan 2018 13:23:47.7358 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 30e51908-7327-40c6-8cf2-08d557643751 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: BY2PR0301MB0727 Subject: [dpdk-dev] [PATCH v2 02/18] 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: , Errors-To: dev-bounces@dpdk.org Sender: "dev" 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(-) -- 2.7.4 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