From patchwork Thu Sep 28 12:29:59 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Shreyansh Jain X-Patchwork-Id: 114417 Delivered-To: patch@linaro.org Received: by 10.140.106.117 with SMTP id d108csp678740qgf; Thu, 28 Sep 2017 05:28:08 -0700 (PDT) X-Google-Smtp-Source: AOwi7QAs+vZWTCiXgU/pBfOvsNfYTnedHzteJfhIT1/hSXuqfTtbWs2lxkIcwx0ykkLVXWIEqhWv X-Received: by 10.28.232.80 with SMTP id f77mr1098559wmh.1.1506601688258; Thu, 28 Sep 2017 05:28:08 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1506601688; cv=none; d=google.com; s=arc-20160816; b=d4BUPEwoD+bINpmIo/0s/0uX7PD7xUvNvnr+UTKU2sVxCCX3ovb0TA2JYPBaNVRij/ 2KvWgr7c6TSmII7RtliWlcABXC5afVF2CqMTkR2I7iZTIgb7JeP9HwNyHotlC3Jf9/iu wOCZptt8W7wSLjN9nJ/KoFuMUgO72D1IdCq3sAHDkCeqy5jhItwQbJ2EU/plzNI546YN GAazuChkRwpx5LGUmOAkjJbagxSdfTcRZLH3eJtLCj5z1TQyUgsuHx40lRblFgA8KtSv TAMUdcTQTvFrumslOqfmqLr5RL3caJST1vXPiDOxScgfXI30MviWGW5rMKEiusxgP2h1 9+YA== 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=6jDtVsGhmrizWlTtpyiE2XHfH7tC/X3m1LhBV9GGubo=; b=sjIvxy+zdp6nYPWCLb+sNgkxmh6WRykQPktAvSqXigcIN+C+c4HsfP7lmL0H3QRZhY O0HcFs/7JsgJxHbph6x2dPPNQcetn5O0ciHH4DGM6iK9Jw1iFz6u63nzx7lM2Q7OZ47I noC0mVQ6+Xg9pMBGVziIl/5FlQo69Q7Qh98VRhJNCrBCNO4GSopIctNRpwNmEcSGPCnR d907V6niosA2JF2H+ssOJLVTY6jvwRIOoCKf7Jmt27gaO5YLqonfgci56Z9KbzwwfMos QnP/mvDkjIBQiK3nH5XHPMJu2B8apyix/zn/D9TAl98oixKkAYL/vPyXEVmkvVXMfawa /r/g== 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 a130si620684wme.99.2017.09.28.05.28.08; Thu, 28 Sep 2017 05:28:08 -0700 (PDT) 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 4DB811B2A2; Thu, 28 Sep 2017 14:20:59 +0200 (CEST) Received: from NAM03-BY2-obe.outbound.protection.outlook.com (mail-by2nam03on0067.outbound.protection.outlook.com [104.47.42.67]) by dpdk.org (Postfix) with ESMTP id 3EFC93195 for ; Thu, 28 Sep 2017 14:20:24 +0200 (CEST) Received: from CY4PR03CA0013.namprd03.prod.outlook.com (10.168.162.23) 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 12:20:23 +0000 Received: from BL2FFO11FD053.protection.gbl (2a01:111:f400:7c09::119) by CY4PR03CA0013.outlook.office365.com (2603:10b6:903:33::23) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.56.11 via Frontend Transport; Thu, 28 Sep 2017 12:20: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 BL2FFO11FD053.mail.protection.outlook.com (10.173.161.181) 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 12:20: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 v8SCJ72W008785; Thu, 28 Sep 2017 05:20:20 -0700 From: Shreyansh Jain To: CC: , Date: Thu, 28 Sep 2017 17:59:59 +0530 Message-ID: <20170928123000.1711-40-shreyansh.jain@nxp.com> X-Mailer: git-send-email 2.9.3 In-Reply-To: <20170928123000.1711-1-shreyansh.jain@nxp.com> References: <20170928113344.12248-1-shreyansh.jain@nxp.com> <20170928123000.1711-1-shreyansh.jain@nxp.com> X-EOPAttributedMessage: 0 X-Matching-Connectors: 131510748231428482; (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)(7966004)(376002)(39380400002)(39860400002)(346002)(2980300002)(1110001)(1109001)(339900001)(199003)(189002)(68736007)(50986999)(97736004)(105606002)(106466001)(104016004)(85426001)(2351001)(6666003)(2906002)(77096006)(498600001)(76176999)(189998001)(16586007)(50466002)(54906003)(33646002)(48376002)(4326008)(53936002)(81156014)(8676002)(50226002)(81166006)(305945005)(356003)(5660300001)(8936002)(1076002)(36756003)(8656003)(86362001)(47776003)(5003940100001)(6916009)(316002)(2950100002); 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; BL2FFO11FD053; 1:q+IgvEP9cWGCPyBpTwGzVMdTPOLUkxChryNAaBcGyqTHA30rxkoXJ/AexwIb2Di5nEgaioK6CXZ0x7VswFO8In6vliVsThg7Rp94f+QKJEG9s5yNCUjoFDEmk5aXCxX+ MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 1d230fa9-53a0-4c9c-8822-08d5066b4aef X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(22001)(2017052603199)(201703131430075)(201703131517081); SRVR:MWHPR03MB2704; X-Microsoft-Exchange-Diagnostics: 1; MWHPR03MB2704; 3:ikRZPOGZx/Zt6BhYYZDulIrSu7udT0sXkCGfJXZaskJdqvKribw3dyTkHplFlDrh0KPbLHchwUDwf+imJVY3NAyo/c9QuFVkHLOsm5cbdYQdgU+V1/eKCGzIkcJ8sIXUCsFi96D32ukUsknW1AQ2YRHloECmD6SS4ThItFgu65MELTk0rjRoWoh+dupnUHBmLezAJC3/tLeJ/YaWL4wzeOauAEuhneMg+rxUS6c9R+SpgtKrvFdjV7eF3S+Uy9plt4QskUfSSLI+aEb1qVHlSSUaWKY0vOO14VBQmtEiLWd8BJU+EBm4KijPDBluKLckWH3TQULnY5xbqhA5zWbGMf+RiF+fOG6a2cAs2A0Mk6c=; 25:cim7NjakRlPnvca1FgzrryfMGMLaWNyZNVJJhfdMJOT1OdIDEAnwSE1zyDpbwDfae1MzQWiQ1CVtJ668qOFG4TJVkScJKmY1IbpighASw1FoZQ81HH6PB5PPMOqUZ5B9nL5IRlDBofUafOsReBDkSMAMgwajIbgptq7YfC3oVJO9MKSs+DAX5CttWeD1uv1tgZAB/b5YRrvWX3wg04E5r5htSDeqN7M8JHYFwivtQIO8g9FicjeA+GN+BtH9HM1q5MANI44CgzX6ptqSiRGEQ1DqZh7w/iRcKHUnyGJYqMcLKVE9ugAkvcH6+pzTe3NLwb32rYbaZgp6ZWI4zrYpNw== X-MS-TrafficTypeDiagnostic: MWHPR03MB2704: X-Microsoft-Exchange-Diagnostics: 1; MWHPR03MB2704; 31:h2H4839bUJePYGrn70PUrotyenm1GB0toUtoBTu7vaR9IKgDo+fBImtnrvygOF2fXHWMpsK4oiGOKlKWX+AYncpD8iIwajcYQwgep5VlHIwxZJvlknZ5WSd1kN2fpIISm9OC8smsfOtAqzNrfDuZzFAuebPoQjC4ibUX1t6rri7ZUFq5BZhLlpqy+SDR8Zl7CaEyLtkeGWgrNFX7XEbRSyAHXhOoKOg9QWY+8waUb+0=; 4:EEO49cL0RvIjkdaG1gD+gz0jAXtaWmoMeVFfiWljTRwKu49k2VcKE8FfO8dVGanEu2yPx1iRFx9m7PnElLn0VPwgq0j+et+gOMAx8Bk3Yxz3H+kXHIm+sLsd1E0Nvhi5iOxu1zkinkkjFKp35wsl7hIqbO243tUZoen1FrXMX6MYUlUH3Zg0ufUyeEmU8Qc19j49o37hcJzr5fwhRiu9lTNuyib53LDghOLlL7Z0QcPj1rmUYn7S9Ik7qZaghFquj6WuTT/8F8g0lweCmnUX3+AhSFUgP0r3OtGCO/owgvQ= 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:mz74xg0reia66fbjQagaXi/7kn8FLhfDaAlk/vcST?= ekSILha2LTt7N4Vfo3hPnjJHFz2JGBEokCAdnHuvAoPe3YIxbVWFAPPsHFlgRKh+8AGi/Smu1R23fC8iB/Us/KFGKhlTb3yPrCucuirXk/gjtN4xBUhR+nhB1P0mhA52nXDHsw/utGlre068NMKcmaVagaqLg6Jts/6TPjD913nKFl23Oj0w5q1AtX7pP3Nqo40WPwQcRSdJidOsUt1ERucJ7R7IsLvgrhTvtc8sKzFt72oABEZeR9RCUOxgAtio5KcfWvhhAyJIDB94zAqEr+jbh6sY+0DXg3XIckZ82Mucn0ByLQFDra8DUBKfTaZT+SZbhLkLdLrcrqZZPfNHUgDS5/XSb7tCT+U8s/XlRg3Sk4uKMbFwyQ43e8WMD9RoZUhGWf57yeVQ0zRyIinjSsO1yW0R3/jkYWq9/dhuKZ2iq+Ebi1urOpLG5fRddsrLZ0rjbN0DeY7w1nss1V51DL7qg4IlhDIUyZt2RSunOORj4FNO7LP4sDw7DoP3A44iEtNlaOmCMBZ25qAkDlk5wE5clblWsNutvbNCf84DP0N+ZXTYr/a1moiJnRLjQc2+D/HdKnGjVAbWY+uvhmjv7PfkwyW8Nzub/nF2IbiXDGKS4BJLKLA6yrcJqXRxCggfVcfn0sQVqfYLZg/0z9E4FVD4K33KPrg/ShgxSGoKXI/XYrs8RkI5xUH9wNW+q5F6vQdAHbTDrw/+Bx5jH8yzajXj9xvxk7XWebEFgxfPUWR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7:DxmC5RFd2nJpH8rmsATH4Vf1G05GYQJcgE088/DYPyBUQ22BZiF0ON3tel5/4ViU08HiOfCkIGaVzF41aqS3mCbyXhxLGmQ3Q225OYAKpKX5Cza2qMsZvsK2f8+gCFb2Psc5omjnMxCaWxdFq1G9b89t6X6mKoSZ9cHKDv6BvZtbr760kPJuKriUJREFU6VzIZfEvfPw5dGE8hyqdyO1E38m01IIuLdZcSShlVvGdGc= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-MS-Exchange-CrossTenant-OriginalArrivalTime: 28 Sep 2017 12:20:22.9712 (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 v6 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: , 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 ++++++++++++++++++++++++++++++++++++ drivers/net/dpaa/dpaa_ethdev.h | 5 +++++ 3 files changed, 42 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 3d6ddae..8e51fe6 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