From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from NAM01-SN1-obe.outbound.protection.outlook.com (mail-sn1nam01on0072.outbound.protection.outlook.com [104.47.32.72]) by dpdk.org (Postfix) with ESMTP id 355281B218 for ; Thu, 28 Sep 2017 13:24:23 +0200 (CEST) Received: from BN3PR03CA0088.namprd03.prod.outlook.com (10.167.1.176) by MWHPR03MB2704.namprd03.prod.outlook.com (10.168.207.138) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.77.7; Thu, 28 Sep 2017 11:24:22 +0000 Received: from BY2FFO11OLC003.protection.gbl (2a01:111:f400:7c0c::130) by BN3PR03CA0088.outlook.office365.com (2a01:111:e400:7a4d::48) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.13.10 via Frontend Transport; Thu, 28 Sep 2017 11:24:22 +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 BY2FFO11OLC003.mail.protection.outlook.com (10.1.15.183) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_RSA_WITH_AES_256_CBC_SHA) id 15.20.56.11 via Frontend Transport; Thu, 28 Sep 2017 11:24:22 +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 v8SBMpGF016035; Thu, 28 Sep 2017 04:24:19 -0700 From: Shreyansh Jain To: CC: , Date: Thu, 28 Sep 2017 17:03:43 +0530 Message-ID: <20170928113344.12248-40-shreyansh.jain@nxp.com> X-Mailer: git-send-email 2.9.3 In-Reply-To: <20170928113344.12248-1-shreyansh.jain@nxp.com> References: <20170909112132.13936-1-shreyansh.jain@nxp.com> <20170928113344.12248-1-shreyansh.jain@nxp.com> X-EOPAttributedMessage: 0 X-Matching-Connectors: 131510714627838469; (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)(7966004)(336005)(39860400002)(346002)(376002)(39380400002)(2980300002)(1110001)(1109001)(339900001)(199003)(189002)(8936002)(1076002)(81166006)(305945005)(8676002)(50226002)(81156014)(53936002)(5660300001)(356003)(6916009)(2950100002)(316002)(8656003)(36756003)(86362001)(47776003)(5003940100001)(104016004)(2351001)(85426001)(50986999)(68736007)(106466001)(97736004)(105606002)(76176999)(498600001)(48376002)(33646002)(50466002)(54906003)(4326008)(16586007)(189998001)(2906002)(6666003)(77096006); DIR:OUT; SFP:1101; SCL:1; SRVR:MWHPR03MB2704; H:tx30smr01.am.freescale.net; FPR:; SPF:Fail; PTR:InfoDomainNonexistent; A:1; MX:1; LANG:en; X-Microsoft-Exchange-Diagnostics: 1; BY2FFO11OLC003; 1:lu7ouVRbKHSO/vOl3MUOAfZwsBTS2QwQ/6rUNoMjz8lhs4r0Q/rohjM8Cr2evAAvLiOY7wgjgIfkZUloO7yhXF6c29RDMYxCalZJf2D1aRmY0YraFXPfy1jA09Kql42p MIME-Version: 1.0 Content-Type: text/plain X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: df85570b-b679-44ea-65c0-08d5066377ee X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(22001)(2017052603199)(201703131430075)(201703131517081); SRVR:MWHPR03MB2704; X-Microsoft-Exchange-Diagnostics: 1; MWHPR03MB2704; 3:MLiArVjL1/aHouJ6hD1uuEpmUecxUYOTrKVZYCeC7aZW6fP6Be0eJsmkO4aHBV2wDESyJKrK2T9T6mcLF1eih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HUpurQnA/CZWvfFvsr0HXF9WSZU4rXGFEB+0F59dBQDULHPrEKY8621XchgHHuvCjwervkXwsFUo4uNNsA9hSOPxTyI1eiJtflaAa75jwQo1HnVafzekd1tNkibSZk82cZ6SkoFcZumNX+bt/AOvrbYfvF2mGRPQTQSmZV2A= 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)(2401047)(8121501046)(5005006)(93006095)(93001095)(3002001)(10201501046)(100000703101)(100105400095)(6055026)(6096035)(20161123556025)(20161123565025)(20161123559100)(20161123561025)(20161123563025)(201703131430075)(201703131441075)(201703131448075)(201703131433075)(201703161259150)(201708071742011)(100000704101)(100105200095)(100000705101)(100105500095); SRVR:MWHPR03MB2704; BCL:0; PCL:0; RULEID:(100000800101)(100110000095)(100000801101)(100110300095)(100000802101)(100110100095)(100000803101)(100110400095)(400006)(100000804101)(100110200095)(100000805101)(100110500095); SRVR:MWHPR03MB2704; X-Forefront-PRVS: 0444EB1997 X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; MWHPR03MB2704; 23:wLuaAxQmWJczpxCGAMLz/caFvpZ6wfoL4rKYcDAbw?= =?us-ascii?Q?A3c9vMbaNhz/z/f+QYMydXcf63+uS5O+0wOQel/clDGsnp6qbdzw+G5TAJva?= =?us-ascii?Q?UI9EK3XcPW6a5GMLK7gakRAVVXyo6nj+2gEfy0sD/TC0QVxb+GbfDUJPxf3v?= =?us-ascii?Q?ChTfrXFcUW8T7EH8hskEIFXgtTpAXGFZasBYYIHyQ2b6CTZozQnbP+0yBZnt?= =?us-ascii?Q?zVx7IieNU7rtoQH3CAHVUCxgub5eZqANLAJo4uagLpJyNVM6y8q9FWqROs8S?= =?us-ascii?Q?yJimahY7QgBK0Nt5EDi8LC+6WBHeVdyHFEEuHWwlcJU+puVpCccbHmaMdwLz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akwp?= X-Microsoft-Exchange-Diagnostics: 1; MWHPR03MB2704; 6:GQvUVOYHT3ItmsaV8l4YI8LUTVJQtNWWKyFQ4BL+tKUPSiXMOrvFvE3ugYiFccXgh3ltv6N58zfC6bRyZUXcBmeEPXNCQQjvGSOiuDIF8kxVzAvjORUfrZQ0CRAZD4T9w7Z/7R4wYU23HdOZpk+i+3bClA4VkyYL1DIUAF5iDA9IsgSdC2LQdxn/XGlsxH465rQ+icnhzmfLY0t9G5AZ24MAZeZdLKQybaxrCu6AhkRcCp08nCBS8ANvwHiTPvyS5ESYorYvoSAAUndcN7ol88DOxX01QOoQ+hlguZr0S63nvh95wDfjAeGshYZilo81CFRYZIClK9wBT4GEBpRYvw==; 5:GQT0vi0A6YlDoRLPnjVDR3i47XhC88pUlDtZTq/IQRYEJIPYpzfJaOoEbmkdTGGPSHwgpv3yQuuEVkKWJORXemxN1tJd+77Mn9X7iAH+ZbSke+NarkDf+Wmh4mqrZLclaS8covGCKrWGOfJC+40WcA==; 24:Vsy3xdGiDSEy//JB/g9R/rPS+Z6uCK2/17R1lM3TM3bsJWHpoRnQqsCI8zyPLUnQl6c/GccMg2LV2wFqs3OQBtsAmczP/ewZSa6FuRDPDTA=; 7:e3RIjQUYa/uCCLF/tLq1S+ScTReYu08UcDoF9SSozdBIUlNV/EEimTLRfVp9Wg2J2WthWm0eSKeJ0kxPyzwYC1bnjQ0iUuFP4uvi97yJlyv+NNk1GC0sapJwrQM3s9A0jg/OeOewR725MuYTu7vb0YiDoaHB2FXn1ClS8vEhhUG1DHAM4Qk2d06HXExVtRy4Tpv8nMbg8+jT0xXftczBxZ9b2fvF76ORNUZ+2zNKddE= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-MS-Exchange-CrossTenant-OriginalArrivalTime: 28 Sep 2017 11:24:22.4562 (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: MWHPR03MB2704 Subject: [dpdk-dev] [PATCH v5 39/40] net/dpaa: support 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: Thu, 28 Sep 2017 11:24:25 -0000 From: Hemant Agrawal Signed-off-by: Hemant Agrawal --- doc/guides/nics/features/dpaa.ini | 1 + drivers/net/dpaa/dpaa_ethdev.c | 36 ++++++++++++++++++++++++++++++++++++ drivers/net/dpaa/dpaa_ethdev.h | 5 +++++ 3 files changed, 42 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 ad9fea8..0002324 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(DPAA_SOC_ID_FILE, "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) { @@ -512,6 +547,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) diff --git a/drivers/net/dpaa/dpaa_ethdev.h b/drivers/net/dpaa/dpaa_ethdev.h index e1e062e..a980262 100644 --- a/drivers/net/dpaa/dpaa_ethdev.h +++ b/drivers/net/dpaa/dpaa_ethdev.h @@ -43,6 +43,11 @@ #include #include +/* 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_MBUF_HW_ANNOTATION 64 #define DPAA_FD_PTA_SIZE 64 -- 2.9.3