From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: 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 Content-Type: text/plain 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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EYTWkr4p8N/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?= =?us-ascii?Q?Tg0T+JcFwJ34EHVokYkdsKCVHqGKKhPuBvexGasyWv/I+GsRWtp/tg5qallK?= =?us-ascii?Q?o3YcCAhAkH68pVgLeYox9xyjAs9KSwD0EakSZu4yJqeiFGwksNG7w3pH5qyP?= =?us-ascii?Q?j9NwT+JZjgJtE15mozL6k/1xnh42jdSZb7hWzpJQfKuN6ZpxJ9gNxxDCzX9p?= =?us-ascii?Q?vyThnKRgqJNDoUDjJdO48WIDJG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ascii?Q?FLZ+MlmwMeXAFLUPzleaE43XW9ZaQzB?= X-Microsoft-Exchange-Diagnostics: 1; CY4PR03MB3319; 6:ElMflPQl2qgP4jq3zs9Eqm3bImVgOhW/hnKG2xMUemtRkEWynyVvU5Svn/xMJRWg2dvDxojNn/4nH7uHfnrrRa9eYqTlOLPFLGg7glFASkIVM60O89F5P/v4XpWgFUniq2kTych2Th2I2GeIC9I8uf/B3cKSmxnr7W3tKaM3RWn9pzdsfaK8wjK5WSmdGOX8ZNa/z097yFNTT1H0qqDnhDB3nJoWxnRa82GBz0moLi8Zufb3/1U89HGc0ssnplAxCZ1g93l5WWPw9DTKypHTWpdhvgqZhh2lkTNClwtyZF3oRtQIBDHg7nQJTFzb99blawv4jCAd8hr2Bm4H6VYKPA==; 5:J7/hImAyvPP1yLzVsBRsYj6q21r1XiAt0zdSfvFGllvRvd5ZOAxYBLv7z4qCttrJepQmo9G2ELqwY2n3LHDIaLFuc4onuwVLTzn7B2UTiTxsTL4u57viVstALxWhr1uf2S6LuuochkDCm6Dsr7t5PA==; 24:AgaX7BZwzUAiC3EF1hmT3x4KYdI/PwOjB7hAszcS6n9DEFnbdSgM3c0AhJCgAf5SI+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: , X-List-Received-Date: Wed, 23 Aug 2017 14:03:46 -0000 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(+) 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) -- 2.9.3