From patchwork Wed Dec 13 12:05:44 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hemant Agrawal X-Patchwork-Id: 121741 Delivered-To: patch@linaro.org Received: by 10.140.22.227 with SMTP id 90csp5382712qgn; Wed, 13 Dec 2017 04:07:31 -0800 (PST) X-Google-Smtp-Source: ACJfBotIqNgysRQcvumGy4Uyd9pscXyFd8cbjaHx9sKQbswEhRYQoqRIrERB5y47qpYdEuy7yVXt X-Received: by 10.28.215.71 with SMTP id o68mr1677919wmg.105.1513166851634; Wed, 13 Dec 2017 04:07:31 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1513166851; cv=none; d=google.com; s=arc-20160816; b=Mgm/UIk5NikHlxnEqnIg5ft3Zu4v+PhRvKGcXwiYKI+FfKH22RowFpKEPbY72WTQFY MTvC1RzHCJg1wiqyqWzOuUNgAgYB4GYAzaT4R/4+p0PN61AHwodPHR8ZgBfJyX68gBcs YINbZ21FPXfp63miQcymN6vvHvXHWdkL7Oe/89MLRwNNhYEgN5t+DH7mQcxSxGBelQz/ uF2nyegUSSvSbNlTktotVae79zvVmbN/LwOiKg8IUYqo4gaYLzDZW1Og3ZjjL3STbspZ FVvpXYv5IErsk2kW1BYyanhnKB8g2DQkgLmDMuicOcVKZXTA7mQo9exFsiZscZC2HLQv Bt2w== 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=/cIQnOzpL1Vk07NH31xxdlP41BYi9MiQhOSjIKva0Ro=; b=Ty9QCoZYlpLwdKsXH/USNaT86jDGV7WqVFSAC1agjLA+/v0gzp8jmhR0mUrQ9u85g/ fj0x9CO3i7QD0HH+UhTfscDRRySuKjoAC5VpaoiNERsNRfsDPWW1j7kop51VdRxb/fTg jM68qE7ZpslWQgj06wQz6ZxaO0OM2I56O/Uq9RtgC9VUZTxzQufOXmLCaE/gO81FxKm3 ViFZRVEV8ukHKc8AJk6bSjOHwlzthQBvm1xRpiQ+lPpf7eiAQr30IPHOFsF+wLkrNjvf 4ndXFUhuTBi4m+86PHrVSkxvT6JLV8F42q3jJVp+cBAOv56M2tvtJggLGoGDLD6gNmSI EN8A== 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 j29si1381067wre.435.2017.12.13.04.07.31; Wed, 13 Dec 2017 04:07:31 -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 0D074199B3; Wed, 13 Dec 2017 13:07:07 +0100 (CET) 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 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?= lxgqphmzxlfPlwvXHXqtiTgY+mcWG3UM5i66ardJQ8hzWnC7rd14QJi5+2W5CYyQ208oq9gDuWnGc8nMP5zQ546N8Wafd9Jnv3+tQ0AgL5JQB+nyRaxqfacqUi3i8CZOxFPTnEWy8qtNYhGInlb1D3ASkOtJs6OMSYTiB7lnql7H4cXion4ADhHYKVqtFFO2uQNVrmfvTjdRhRUK4KEphd9GIUAbH+HsqWra56WrAQ9mzH1UGwKUnePGFcMvDTXdCB69UQMYKjj7bLOhlJdP/vLQREmHvMGgkClP/cqGAG9fLgeXgZtg+lfqRmxuzJc3gY6/iIfjVPxgXVVOFsp1trSAOHSE6upodsFXmcfLJkm7+DPiCv7+OAvtBIE9uakPotOI9tlw0CIS99cbUupWeJDO49PmCrSAe9MHGz419WELsg5HgDaYeVYaQjz9neKLZTdbuZXQJNvxRpAakD0nps0cKpeMC4PnUXZBU+uAtM8EbDdelBn1sgeX54e1XF1oCkVj5/AdfbhzLphreY7cm5Z+bJEcWuaysH9z4hH4s5uYivizFs/OCx7Ir6p6u7IMXP2P+6cKSzeaRku/LhYPX+mP78RhxlWhwalZiU3Na6MLT4fCS+ZDlV76FClCIFXwNTPYoQdxFPqE65vMdtbtEJEf0ELENC26UWwpnAxk/Vs+19IUNUTYWuvNdBplhHrrdHwXHdOaWnBfBd1WsKWUEH2UKf5PiTti7tqVPpRzbrqLmTR/TiXLhSMDvwZE2aEtF/z7xbMj05wQfCyZ8juH1tuoBwMFvvzxA2MjeNcjjBoAfyM9rM+rpO2QTDs+TiO/quK8FHmNUWTw5H704I90WKVJPIAeTE5j7Rl4Mz9+fo6tOCGqAjynR4EYtDq1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zQ/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: , 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 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