From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from NAM01-BN3-obe.outbound.protection.outlook.com (mail-bn3nam01on0057.outbound.protection.outlook.com [104.47.33.57]) by dpdk.org (Postfix) with ESMTP id 09A647D4A; Wed, 13 Dec 2017 13:07:04 +0100 (CET) Received: from BLUPR0301CA0029.namprd03.prod.outlook.com (10.162.113.167) by MWHPR03MB2701.namprd03.prod.outlook.com (10.168.207.135) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.302.9; Wed, 13 Dec 2017 12:07:03 +0000 Received: from BY2FFO11OLC002.protection.gbl (2a01:111:f400:7c0c::116) by BLUPR0301CA0029.outlook.office365.com (2a01:111:e400:5259::39) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.302.9 via Frontend Transport; Wed, 13 Dec 2017 12:07:03 +0000 Authentication-Results: spf=fail (sender IP is 192.88.168.50) smtp.mailfrom=nxp.com; dpdk.org; dkim=none (message not signed) header.d=none;dpdk.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 BY2FFO11OLC002.mail.protection.outlook.com (10.1.15.178) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_RSA_WITH_AES_256_CBC_SHA) id 15.20.282.5 via Frontend Transport; Wed, 13 Dec 2017 12:06:56 +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 vBDC6t9N008652; Wed, 13 Dec 2017 05:07:01 -0700 From: Hemant Agrawal To: CC: , Date: Wed, 13 Dec 2017 17:35:44 +0530 Message-ID: <1513166759-13466-4-git-send-email-hemant.agrawal@nxp.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1513166759-13466-1-git-send-email-hemant.agrawal@nxp.com> References: <1513166759-13466-1-git-send-email-hemant.agrawal@nxp.com> X-EOPAttributedMessage: 0 X-Matching-Connectors: 131576404164736677; (91ab9b29-cfa4-454e-5278-08d120cd25b8); () X-Forefront-Antispam-Report: CIP:192.88.168.50; IPV:NLI; CTRY:US; EFV:NLI; SFV:NSPM; SFS:(10009020)(7966004)(336005)(376002)(346002)(39380400002)(39860400002)(2980300002)(1109001)(1110001)(339900001)(199004)(189003)(6916009)(6666003)(8676002)(316002)(77096006)(5660300001)(54906003)(81156014)(16586007)(575784001)(4326008)(81166006)(47776003)(305945005)(50466002)(86362001)(53936002)(2950100002)(48376002)(51416003)(50226002)(2906002)(498600001)(356003)(2351001)(85426001)(97736004)(105606002)(8936002)(76176011)(68736007)(36756003)(106466001)(104016004); DIR:OUT; SFP:1101; SCL:1; SRVR:MWHPR03MB2701; H:tx30smr01.am.freescale.net; FPR:; SPF:Fail; PTR:InfoDomainNonexistent; A:1; MX:1; LANG:en; X-Microsoft-Exchange-Diagnostics: 1; BY2FFO11OLC002; 1:sLZX0ojEkk0PWHUZarZedAy1Jsib7lbuGDnLQhq3lBshVUyUNtGRHytqWvVrO45JqOCn4BuTztNdeXGOxjj1EBFBTB8zQ0kHTLdUVX0HRhDN7gTQPfXCB55cHnts7Tdh MIME-Version: 1.0 Content-Type: text/plain X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 03a559d0-83f2-4d2c-9546-08d542220184 X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(4534020)(4628075)(201703131517081)(5600026)(4604075)(2017052603307); SRVR:MWHPR03MB2701; X-Microsoft-Exchange-Diagnostics: 1; MWHPR03MB2701; 3:HlyqdZ9cfSfah+3o8kyFVrd9v5+HlIHUWuR88f9NK+xac970Lp/R9witlBjV+8tK6RhgEznOqqIQnwvSeGV54PzYH6OtTSEGHLANUTe0Ih0oZErfriWe5oGE25Zw+moTooa1zARBwIh5IaArNwaZknLeNXtXBrMdaZae9iIBGGnX40jTHwRkf8Yzy0Din/bOKZz04Munr1wyKwGaCydm+MV/v1zV7dtybczeZ2N0GibhXnqADItGMTwQpZLBxs/jlyuvX0Ujg5evVqAM8DcCHtX0F51eQDPR9furhKG3buOvzVV38J4h3eFXmMqS6TJz1u4Khi+c6+iGRL3fsZIGEc65gGnVBx1qhsf4s4006TM=; 25:VT0Y0b2vabzaQpfUGDZI3nS3LHtaJg4V8gfZh3vgLC3aG84ZBz9PvxqEqDMFzGhxK4RK00iQQT0I3x7qbNburKMMOAjB9HoBcqClprf/KuanvqcFdMU24OynI2InYOf+DaV9TzZ4sZUZCu4ApzI46e1Hnzby9Epe4cH/Eq9IBaB7sVqZ5soWQXZsWZo//q5dBciz7aptERfyAjQ6zOZz4BZQucm0CxdBSYovJMHb2ePS0YZvvbOK8Ax6C4zCsD+XTsUKNEHGCiZeIVmPU5CEQVDg+sUaBhgpKcQnYq4X8St9Qc4fVYmBLpR5Pd0b7xcz7U6oabonYKgMekYPIz1Krg== X-MS-TrafficTypeDiagnostic: MWHPR03MB2701: X-Microsoft-Exchange-Diagnostics: 1; MWHPR03MB2701; 31:Ng013rck/4slQCvmp7p1NAK8ivan9EcsTD11mJHNQewPUpz6HDp31yc3GD769YEAh+MlzjmflWhP9hYbyx+pRwdEnj1THOboJ5nh6asTugcjqlr+G8Dik0fr8U5trn+YvhHi0UKHic7kxD2Kr6XXyGy3VbumdSqFThgM2xjHXJXUWfti+IfK118sfTCtqrjo3/yZ83eoLXgRiaKp4s47kB5QixHR26KeyH5FpXR2dJ8=; 4:R+eer19/vi9geZCxbgIARBAqRe4BfLlUZRIo+Sh/Ri7bhxdK8TDvISXUzyz9OGNtdBSGhUkqcBskRD+qjXu7PCzpVGqV/4CDwLiDO67/YzQy6Njo2Kpd+bJ9C5aZTVKytTa33ss/438NooNrBUhynIb5pYF1FHjI6d761l9VayWUZBD9LtK93PPaCUK2Ec69E9HfII1WtlEuoRuSo4VhSwqXwEQfvOck/aSSNDQM94VqcxW3aTu8CnvTXj/FtD91t6lHvH9vOm2nXJzXXCvjQ90SnFVsAaZUadT/pva6Q/3d1U0PO5xi4Rll/+L3GB6S X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(185117386973197); X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(6095135)(2401047)(8121501046)(5005006)(93006095)(93001095)(3231023)(3002001)(10201501046)(6055026)(6096035)(20161123559100)(20161123561025)(20161123563025)(201703131430075)(201703131433075)(201703131441075)(201703131448075)(201703161259150)(20161123565025)(20161123556025)(201708071742011); SRVR:MWHPR03MB2701; BCL:0; PCL:0; RULEID:(100000803101)(100110400095)(400006); SRVR:MWHPR03MB2701; X-Forefront-PRVS: 052017CAF1 X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; MWHPR03MB2701; 23:e+PAnDQcE8ftggw4fy73LS/o2COZ2XxbVY26eeGgR?= =?us-ascii?Q?lxgqphmzxlfPlwvXHXqtiTgY+mcWG3UM5i66ardJQ8hzWnC7rd14QJi5+2W5?= =?us-ascii?Q?CYyQ208oq9gDuWnGc8nMP5zQ546N8Wafd9Jnv3+tQ0AgL5JQB+nyRaxqfacq?= =?us-ascii?Q?Ui3i8CZOxFPTnEWy8qtNYhGInlb1D3ASkOtJs6OMSYTiB7lnql7H4cXion4A?= =?us-ascii?Q?DhHYKVqtFFO2uQNVrmfvTjdRhRUK4KEphd9GIUAbH+HsqWra56WrAQ9mzH1U?= =?us-ascii?Q?GwKUnePGFcMvDTXdCB69UQMYKjj7bLOhlJdP/vLQREmHvMGgkClP/cqGAG9f?= =?us-ascii?Q?LgeXgZtg+lfqRmxuzJc3gY6/iIfjVPxgXVVOFsp1trSAOHSE6upodsFXmcfL?= =?us-ascii?Q?Jkm7+DPiCv7+OAvtBIE9uakPotOI9tlw0CIS99cbUupWeJDO49PmCrSAe9MH?= =?us-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y3t1+h2hEqx4TlmXihlkPCBVxKTeyDQBV/aOPSE/HyoGxP1lJ6vhm/fHtBobTrfD0BvsvsQdqrQ84VpxdfQSHiKXW6TKJYGTwiEkDIDP8zHZPzjzjQ3zyy0=; 5:kCnXmlzHMgwcWFYNYSxDyNu78uEnkMCHvxg5lKwl5+NgR/QWvVq2mDPLQ+g9dniL0A8CnAH7uLErgyoB7MINpCEubZv+x5LAvQkBjwZ7fVCp8aPnrST2gD0FK6d3Z4GabArbtyhrgVFF7+y5+jkGhIWJTsT8GhVKC00ctTUGQRw=; 24:hunB/sax2r4mcEuo4xcrMGJWbVZkjak+wNUEXsIVa24xSGncalqaL5IZ4/H7c+dlXAp0q+tXM9/G9cZs2JijPIttJl91BiVXIezcHk9zJKc=; 7:5z5zVFKTDCsoaq27X4xn6EKaphCv+nid2h5fYrxpIcyBmt4PeyBReu+x6mqAkyliktMKXp//53/XzKhhXtZ9OMfvcgXxoNLUkggSxnNLTfzChGpRdG6wqOSRwZfe5tSWs1EvPQA8R5J1+8KF1T7rYifBG91w5l5NIQXnyQUEc6o0dRlGYSXTz1GD6Bt941hyXfn6tD5KWQctvTRJ7UzQ/MXPtMz3Rc69/ULlnEhxN3DLnNPtwOPn3VFpGUyVPfh5 SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-MS-Exchange-CrossTenant-OriginalArrivalTime: 13 Dec 2017 12:06:56.2708 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 03a559d0-83f2-4d2c-9546-08d542220184 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: MWHPR03MB2701 Subject: [dpdk-dev] [PATCH 03/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: , X-List-Received-Date: Wed, 13 Dec 2017 12:07:05 -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 3023302..29678c5 100644 --- a/drivers/net/dpaa/dpaa_ethdev.c +++ b/drivers/net/dpaa/dpaa_ethdev.c @@ -212,19 +212,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 5457d61..ec5ae13 100644 --- a/drivers/net/dpaa/dpaa_ethdev.h +++ b/drivers/net/dpaa/dpaa_ethdev.h @@ -46,7 +46,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