From patchwork Wed Aug 23 14:12:13 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Shreyansh Jain X-Patchwork-Id: 110843 Delivered-To: patch@linaro.org Received: by 10.140.95.78 with SMTP id h72csp4187073qge; Wed, 23 Aug 2017 07:12:51 -0700 (PDT) X-Received: by 10.28.174.7 with SMTP id x7mr2404321wme.43.1503497571357; Wed, 23 Aug 2017 07:12:51 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1503497571; cv=none; d=google.com; s=arc-20160816; b=xl8rRzZgqxXPZ0w58sDdb5VUrDTC/dxYd7pcY40JqpAFhNraAjaF1ToKAOnM5ieL/r veQ6ToWe2eRrr5bKoJ1ds3lAQJ03+Usedr6RuGYJz0U3Y9N1rMvEG5ThMLnbjdB2zI+b EIziBbg6bod+2SafUxKGp9MYdxwadl595WoLxnNhqTu/Ni2u1hPK6J9vN4JrF+8NMlQM 0f/+ZWb+PY/aZqTv5q7h6teeLS5Al0NBLNBdxGisyl8x50WLc2p5ebCBmp+Tv4Pmlq+O EtleOxAJCl+KiU5imLiNcSvv0ltLsxkiKZs+prkser6keTzVbl1Po3qoWV1/aavQUtzs OzVQ== 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=3ixSMw29+LPAA7adTwuWTxH+HGDrDxw7FJvT198AZEI=; b=oW9r1ynAfEC287Z/JTYo1InbsKR+3CAI0EPaOJZdgA7M4a/tM6kza2ql6XPHWMq6mN eXXz9WTq1FFfkHKlSb/em/7hMJKI3nELMHde2253axU6U/GZuP2GHIyg7ANGg7wYkvGq QtXwlImunl+weVK8Y5K5+c769dY5B+j1t3LZMK6NjF7c8IM5nZOn0MKR0ohpN64ETSIW hFuWQik3DTSeKxq5zpOr1yW7dFwP5EqZRFlAUcVijFzOav1qHMU9tMULqX3M/xA9Ew89 edc2Zy82H14kVkmk+N+KN92wxyne0BdeqRxeScuPveZPpXSZDp8UVgdil9X8FA2+Md/P VNPQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of dev-bounces@dpdk.org designates 2001:4b98:dc0:41:216:3eff:fe72:dd13 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 ([2001:4b98:dc0:41:216:3eff:fe72:dd13]) by mx.google.com with ESMTP id k12si1451245wmc.229.2017.08.23.07.12.51; Wed, 23 Aug 2017 07:12:51 -0700 (PDT) Received-SPF: pass (google.com: domain of dev-bounces@dpdk.org designates 2001:4b98:dc0:41:216:3eff:fe72:dd13 as permitted sender) client-ip=2001:4b98:dc0:41:216:3eff:fe72:dd13; Authentication-Results: mx.google.com; spf=pass (google.com: domain of dev-bounces@dpdk.org designates 2001:4b98:dc0:41:216:3eff:fe72:dd13 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 [IPv6:::1]) by dpdk.org (Postfix) with ESMTP id AA1749B5F; Wed, 23 Aug 2017 16:03:48 +0200 (CEST) Received: from NAM02-BL2-obe.outbound.protection.outlook.com (mail-bl2nam02on0047.outbound.protection.outlook.com [104.47.38.47]) by dpdk.org (Postfix) with ESMTP id 8EFC27D5E for ; Wed, 23 Aug 2017 16:03:45 +0200 (CEST) Received: from MWHPR03CA0030.namprd03.prod.outlook.com (10.174.173.147) by CY4PR03MB3319.namprd03.prod.outlook.com (10.171.247.10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.1.1362.18; Wed, 23 Aug 2017 14:03:44 +0000 Received: from BY2FFO11FD005.protection.gbl (2a01:111:f400:7c0c::151) by MWHPR03CA0030.outlook.office365.com (2603:10b6:301:3b::19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.1.1385.9 via Frontend Transport; Wed, 23 Aug 2017 14:03:44 +0000 Authentication-Results: spf=fail (sender IP is 192.88.168.50) smtp.mailfrom=nxp.com; nxp.com; dkim=none (message not signed) header.d=none;nxp.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 BY2FFO11FD005.mail.protection.outlook.com (10.1.14.126) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_RSA_WITH_AES_256_CBC_SHA) id 15.1.1341.15 via Frontend Transport; Wed, 23 Aug 2017 14:03:43 +0000 Received: from Tophie.ap.freescale.net ([10.232.14.39]) by tx30smr01.am.freescale.net (8.14.3/8.14.0) with ESMTP id v7NE2Q3Q004389; Wed, 23 Aug 2017 07:03:42 -0700 From: Shreyansh Jain To: CC: , Date: Wed, 23 Aug 2017 19:42:13 +0530 Message-ID: <20170823141213.25476-41-shreyansh.jain@nxp.com> X-Mailer: git-send-email 2.9.3 In-Reply-To: <20170823141213.25476-1-shreyansh.jain@nxp.com> References: <1499179471-19145-1-git-send-email-shreyansh.jain@nxp.com> <20170823141213.25476-1-shreyansh.jain@nxp.com> X-EOPAttributedMessage: 0 X-Matching-Connectors: 131479706242059791; (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)(336005)(39380400002)(39860400002)(2980300002)(1110001)(1109001)(339900001)(199003)(189002)(5660300001)(33646002)(76176999)(2351001)(2950100002)(106466001)(6916009)(5003940100001)(77096006)(6666003)(8936002)(54906002)(50226002)(50986999)(81166006)(8676002)(8656003)(105606002)(48376002)(50466002)(305945005)(53936002)(356003)(104016004)(81156014)(68736007)(85426001)(47776003)(498600001)(1076002)(2906002)(189998001)(86362001)(36756003)(110136004)(626005)(4326008)(97736004); DIR:OUT; SFP:1101; SCL:1; SRVR:CY4PR03MB3319; H:tx30smr01.am.freescale.net; FPR:; SPF:Fail; PTR:InfoDomainNonexistent; A:1; MX:1; LANG:en; X-Microsoft-Exchange-Diagnostics: 1; BY2FFO11FD005; 1:Oh5vAOMDgnEUuFMb3UtwFhTb5vjSviasRT+BYAjgTY1FUmryBAc80oTeQEPolaoJ6MYUbP/hVc+J1fAKqE4JbZ4hhYtcBUGUItufHl+CB08XbVmL6KeFibTGlW4ZHaw0 MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 4dd869ad-deba-4016-acb0-08d4ea2fc42f X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(300000500095)(300135000095)(300000501095)(300135300095)(22001)(300000502095)(300135100095)(300000503095)(300135400095)(2017052603185)(201703131430075)(201703131517081)(300000504095)(300135200095)(300000505095)(300135600095)(300000506095)(300135500095); SRVR:CY4PR03MB3319; X-Microsoft-Exchange-Diagnostics: 1; CY4PR03MB3319; 3:lolcRmsOjvNmVAfsRm1XugxgHoAyM1aTIZZa+CkzC32xeaDisCg/KLqEkFIQ7wgDPajAj72tRKPei+9mD9q1X2sTFHnyrrAQQCzw2X2zP1s1w7wgAnJjqQYm/Epk07krOi0Zajv0mDv3CIV7xXfEZkQGaocJQTIIGk/3HqLRjWFxjrQihHQSmM9uFELjfsOS78HJAw6KjOxzAU6/8Vhmq1g+a9N+P+YeycLbK0zT6Mw0/vWJFZ0XlPNQ97R4+y1qPvmwpXEU/jxA5BIw/dmAke+jf/tzs/p24lNHtMzynkL7X59Zz2W/3rARc7qt1WKChqwG9vpmFbcJpGxS+KT1kZ11fusyJdLIF0eZ7bSu+rU=; 25:4HfHhni7ydrQXggdbIUKWYS703+mlkYESolr2wcbWiZ18Kx33mxYTlsH9E17jVpuY4xIRzn5UK07Zr1aO98zidoJx650jh/plKy4aHUuKf8E9W1JuSlpPu92XGX22hFE8wc4GppZ4es3L9t7CercDF0lzkP/nKHBQhZ+HxzWOXndHQ0QPoDVbAq1adAk34PktVSUeeG9Mv98Hswl8Xq8mk0U8S5P3LozjezKphRa3VpzrbqSgcgi/r/7+W7OI8/lPikpuMRu7Q/T0fU7Z4H7YSHmCeZR7dq1Mzlq0gdf0qzMI9V5/mGf5ejM3ZMQ1ACbyj/S2jd5y+1i6IuOIVYKpA== X-MS-TrafficTypeDiagnostic: CY4PR03MB3319: X-Microsoft-Exchange-Diagnostics: 1; CY4PR03MB3319; 31:EmIghvoJqOCyvOhGiHYPYfmuJmx7giaU5NG6jKq5w/sTDSP5Z35YKojETBvZA4DEaKca3IpDJtlgmDuVbS43O7nUGvEMYAA1cUFHlH9WhU4wjsW1TShB0Mt+DHvpqoODg9DranHKUkZFO9tvkBi9+IWrz7uxPEw+Sb0MBxCT3MWLLjxNQYpw2MUKiABP/Lizd6Yt80bmPUGLWn+zUvXWKsnGqfqYsqNAWHwiGMgNLGA=; 4:FNG+jJC7sPZ0AC2KDTTPjmttsU+NWgwWEk56jxFMk+488kEYTWkr4p8N/I+U7Z4C0RsMve+tXr++mx/p2dbMfgZMCeGWKeKG25R7zi2X+vBiuuvmBlouO1Qi9WI/53m4vp3eTTdrwGJl6FBK9Z+NxGunqnuXHco6UXY8LwG/AsSC7/P6f+5Tdsw5oKfvsJRaIVQqXdJSOf7AQJztHrmGK4thlA5IK7p7YtwFCEQfF+yfgDft49JcUKZTS3Gf/S+xhLgC4Lyww6+8Iwxo4wYU2XZk9WD9gPMdSY0RPijK/MA= 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)(601004)(2401047)(13018025)(8121501046)(13016025)(5005006)(10201501046)(100000703101)(100105400095)(93006095)(93001095)(3002001)(6055026)(6096035)(201703131430075)(201703131433075)(201703131441075)(201703131448075)(201703161259150)(20161123565025)(20161123561025)(20161123563025)(20161123556025)(20161123559100)(201708071742011)(100000704101)(100105200095)(100000705101)(100105500095); SRVR:CY4PR03MB3319; BCL:0; PCL:0; RULEID:(100000800101)(100110000095)(100000801101)(100110300095)(100000802101)(100110100095)(100000803101)(100110400095)(400006)(100000804101)(100110200095)(100000805101)(100110500095); SRVR:CY4PR03MB3319; X-Forefront-PRVS: 040866B734 X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; CY4PR03MB3319; 23:u3GdXFF+fbK/jUh1spNKcopkUPPppGrUrSkSQvCod?= Tg0T+JcFwJ34EHVokYkdsKCVHqGKKhPuBvexGasyWv/I+GsRWtp/tg5qallKo3YcCAhAkH68pVgLeYox9xyjAs9KSwD0EakSZu4yJqeiFGwksNG7w3pH5qyPj9NwT+JZjgJtE15mozL6k/1xnh42jdSZb7hWzpJQfKuN6ZpxJ9gNxxDCzX9pvyThnKRgqJNDoUDjJdO48WIDJGwj5DqnTnB4mVrHSmdx7tdqumFJdHiPG1Ycpm6wIbku2ZKvduU/Unnw3rZZzJ+AIg7x5KZxUiu29FNc6dJNxX4VEcU+F45geJBJzvajbI9r3Oetd1RGIqvR666alVDx10WvEIubbEHgyg55rAwKjQw28FwoRDpMkxub7g60zuZxsXIlmT87VUS4uV89Ld3y4NObdn9BWXkfVDxmC5ZkbWIuIavN/KNbkfrhrpLGim3sjHFOrbfoeI4Z1IFl50q1mysNiFk8/VSQk0EbBMcXGuCQJEo3OpG4nXfDEcnk6QpdfvgOc7FOnrL8mUc7A8h7lo/Wv2MZ92IYswakki5D6sTY3f2KCfQ9fEsh5upLbIe1UaH4Fyz7W/xInvT29j13ezm090UA1Yh/zo4KQa81z5bkaz4zm0qaSCXAuFkcf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3c0AhJCgAf5SI+Z/jo9WHbsf0+UW7rAb76OdU2H98KdZUKQHQl3WX8Q=; 7:vKxNPHn5AWiQ1497Zjh6hloIF3zU6cw4HYJk0L2X+L9g/VJk/7EFc54ToYTaZi3FigzqAVCTh33aUtre8rSzYixB9fifj6/nERlIz+ySCeGjxVPqCv4Gzf5fUYhctxOTXGWcBB6uxV/unbIao94ihaLqJGRSwAsWbznVaiwRw6Yq7caaw+gXBD2XKQBlaesBQNehYjSsq4jpsU4bB0mqohbjH5RElwCIFqdzpwWxFHA= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-MS-Exchange-CrossTenant-OriginalArrivalTime: 23 Aug 2017 14:03:43.9875 (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: CY4PR03MB3319 Subject: [dpdk-dev] [PATCH v3 40/40] 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: , Errors-To: dev-bounces@dpdk.org Sender: "dev" From: Hemant Agrawal Signed-off-by: Hemant Agrawal --- doc/guides/nics/features/dpaa.ini | 1 + drivers/net/dpaa/dpaa_ethdev.c | 36 ++++++++++++++++++++++++++++++++++++ 2 files changed, 37 insertions(+) -- 2.9.3 diff --git a/doc/guides/nics/features/dpaa.ini b/doc/guides/nics/features/dpaa.ini index 0e7956c..09b9bd9 100644 --- a/doc/guides/nics/features/dpaa.ini +++ b/doc/guides/nics/features/dpaa.ini @@ -18,5 +18,6 @@ L3 checksum offload = Y L4 checksum offload = Y Packet type parsing = Y Basic stats = Y +FW version = Y ARMv8 = Y Usage doc = Y diff --git a/drivers/net/dpaa/dpaa_ethdev.c b/drivers/net/dpaa/dpaa_ethdev.c index 4c543ee..8028651 100644 --- a/drivers/net/dpaa/dpaa_ethdev.c +++ b/drivers/net/dpaa/dpaa_ethdev.c @@ -164,6 +164,41 @@ static void dpaa_eth_dev_close(struct rte_eth_dev *dev) dpaa_eth_dev_stop(dev); } +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"); + 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; +} + static void dpaa_eth_dev_info(struct rte_eth_dev *dev, struct rte_eth_dev_info *dev_info) { @@ -519,6 +554,7 @@ static struct eth_dev_ops dpaa_devops = { .mac_addr_remove = dpaa_dev_remove_mac_addr, .mac_addr_set = dpaa_dev_set_mac_addr, + .fw_version_get = dpaa_fw_version_get, }; static int dpaa_fc_set_default(struct dpaa_if *dpaa_intf)