From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from na01-bn1-obe.outbound.protection.outlook.com (mail-bn1on0070.outbound.protection.outlook.com [157.56.110.70]) by dpdk.org (Postfix) with ESMTP id D13CB5A9B for ; Sun, 29 May 2016 18:48:28 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=CAVIUMNETWORKS.onmicrosoft.com; s=selector1-cavium-com; h=From:To:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=WdEtycTWLDFYSJ2alv8tuQxknW/15ZRuugiiWLMc2N4=; b=o9kAj1RjClbYlJ7GUGm+5Drkwkw1hpudaRfoXw+e2S+qvHF6FZuDczhv8nFvg5H+idFsoHAlDQid9bHHz1xAGysFZAKw5iIvBzPYQSV+21J234jbJ/H2BKmTgBsT3tcg4hT3+UyQOkohHBmYxAM93GVW4p2Tut1cbfE4WwT/Pqo= Authentication-Results: dpdk.org; dkim=none (message not signed) header.d=none;dpdk.org; dmarc=none action=none header.from=caviumnetworks.com; Received: from localhost.localdomain.localdomain (122.167.187.184) by CY1PR0701MB1725.namprd07.prod.outlook.com (10.163.21.14) with Microsoft SMTP Server (TLS) id 15.1.506.9; Sun, 29 May 2016 16:48:20 +0000 From: Jerin Jacob To: CC: , , , Jerin Jacob , Maciej Czekaj , Kamil Rytarowski , Zyta Szpak , Slawomir Rosek , Radoslaw Biernacki Date: Sun, 29 May 2016 22:16:48 +0530 Message-ID: <1464540424-12631-5-git-send-email-jerin.jacob@caviumnetworks.com> X-Mailer: git-send-email 2.5.5 In-Reply-To: <1464540424-12631-1-git-send-email-jerin.jacob@caviumnetworks.com> References: <1462634198-2289-1-git-send-email-jerin.jacob@caviumnetworks.com> <1464540424-12631-1-git-send-email-jerin.jacob@caviumnetworks.com> MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [122.167.187.184] X-ClientProxiedBy: BM1PR01CA0003.INDPRD01.PROD.OUTLOOK.COM (10.163.198.138) To CY1PR0701MB1725.namprd07.prod.outlook.com (10.163.21.14) X-MS-Office365-Filtering-Correlation-Id: 3753ee83-92bc-410a-2b0f-08d387e10cd3 X-Microsoft-Exchange-Diagnostics: 1; CY1PR0701MB1725; 2:Akks9+NesLxTzU6bwsEcef1/c2arFJ7fH11ZjGDBD6e7hL8NbMcqCWEIZiThZWt/qySsoz4kmwy99yOme6cK80Z0UNrbCTponZfko/BkY0ULyUBmIuoDCNLiQc+CZjvy++TDq29LEVRCH1PqC7vghWxZIyODalb8KZ9Uug7KPZ9NLc55uYdFhYnNk6E4UqXT; 3:r3rB+rsRRbNMvezJ3f3SYgI95KVelbIcPnQ0m0PksGML8vrlVa7s30YDdly5NWmXSQvnnvAN8GPyyVEg8885ZKMY4B1h/I0+onzLO+VbQMud6oH/digaPjbnvGINwGXc X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:;SRVR:CY1PR0701MB1725; X-Microsoft-Exchange-Diagnostics: 1; CY1PR0701MB1725; 25:kiDwxuCcY2Iky+zqMY3NdN1m7BfVmj209Br4N6KkN62UlC16Lw30xiNz4lMatfnwd1+ersYTKXOKV53r5kzVDRBkHPLl4faG37RHEGgf8FnyYXFN+e6GIMc2+9lKC8npHBdx4Wqzk5fYtRPeVBsM0sv7YVcvJY5CsDPmD/WRIfts+DR5Whtb1FaSBAXQwlN43eED0PNoKQPy5puM2kq93fPoGRCm8FsWRtNj4En13r2dvsSS+9D49gKsgg4vESEXZp8DUPklWJlbOD3SQ6o/uP2ZpATrYnPxo4uYDJDcwdsop4gBo4F1YTEfjbwOuULhyG299yqL+YF1F/BsqdLnYte/uD2By65zPFVWTy9AP7hDReZDiQQOqe296JvFtUEVtJmUMdbZ/d3TOEkXDqPyWXjpj4W3cfupJnyFxXUlXAwkq62ouva6bGgNzwYwkrCfyH+HgNZf9Sv5vRJdBqLXAHK4Dt9YjeMB9/NDabE7KO+MVKyg5+/XICD0X5Wk+Pzdozd+CzMNrlT3S56Dhh7JVTCLNl/dk2mgtFZPQudtYOTRKUPrnonSHaerpu8NRP3yck5+VGGnzTh0l8MF4AyUYVdCmMp32YS2I/+Oa1E0rPqBF6O0hTsRmpe9UcJm4OIXLqrzdW+PjuJ3smVIsRRe9RzuW0m26I7dJvm0nH3eacCgRTG6WghKdaHo/0gteBTTvnvZMW3qldijyBby5mFYWjVRegWSwfr1ULQuCIH0vgkX3C+Nr+oGRMict2QFTc48 X-Microsoft-Exchange-Diagnostics: 1; CY1PR0701MB1725; 20:BV+aBUvmZVxb9Err9wj/GXEMgzbGJxMnHvpeiIZ26HQCXlXGkFYDQd4bwhssBaSs8mJTw1llhiZWrdXIJN0oLZVuunHIoFl7UvCIR5DLCqiLy0s9CVqKGiIGzQX1si/8pGSFWndTKDbt7FNbygjK3AucNSlIByGZRTmAhRZzfQeR8387o2JHrVIMQq5ruEt7mnDTTuv7YyQHbzFQOCC3zhGz1ZStYDh6qN9ZydM1RVEQl020/33HTNsUQ873CtxkGJ0xN4zrkIKZ4MPxCOKV+8b4Pu7MVV45l3uImtKx3Nkc6LKsGZWvPaeZ3cXx+pNDuODMP42LjumPesMRAsjmy4PjVlbs2EP4FtRyAcJ8zM58+uKm6QfIpc/O7HphaionV1z1w0drUajWaB/qz0yuhKBFikg6i34zZurfKBJ5ER876oE6XpXwtqe597Lp6m5/eSgaxGRcqXzqeCOD2jZywkMnajn8SOwfCiGjME93DpEVITmRQOSHOEPdoKpQlvu12iTdbWF24hn9f0Z9U6A3PZVURypMaKg9Qnx1kxZhzZjKPiqPBYNN3jL+LfWir8ElVbKP/vTE3UEqPKSFoaKIy6Cp2DBeiTv1/ztBWJ1Gl0Q= X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:; X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(601004)(2401047)(5005006)(8121501046)(10201501046)(3002001); SRVR:CY1PR0701MB1725; BCL:0; PCL:0; RULEID:; SRVR:CY1PR0701MB1725; X-Microsoft-Exchange-Diagnostics: 1; CY1PR0701MB1725; 4:nq68P7Vgju4s4qEJ2sAr4MDi0pDoxKabBKEKYgBzIcLo/ajv5W8aJpb4SENAHTCGVTcwl1PyKl9cjbIWoEJCIjf8xAicpF9O2tf4h+8bOiMuKjY6a0HO1OIYw+6jpv809Nr3hdvKmh/BaLUWLteyBqAIBQ6mncWyr0tBL9u6gNFD/fT5v1pnBggpUWB+jXWUf//oTeisN53d9R9O4aMZjxJ6O5b+RrFPW/EEiCly5ph9NDdO0T1L7NfTcLqdkqlYxSmd4mruQBxzQ/8/bxPVTSc3uV+HlAAqrPAeppbuOQEMGe0IOEecaAdxq6zAHM5P9/Mn/LqklYZ+FAI6+g8OpUSlOG6z7aJNDiD7H/g8JCZxOO4/QThDSec0Gy3KZ2er X-Forefront-PRVS: 0957AD37A0 X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(6069001)(6009001)(4326007)(92566002)(189998001)(2351001)(81166006)(33646002)(76176999)(229853001)(2950100001)(50986999)(19580405001)(19580395003)(36756003)(50466002)(110136002)(8676002)(2906002)(586003)(3846002)(77096005)(5004730100002)(5003940100001)(50226002)(66066001)(47776003)(48376002)(42186005)(5008740100001)(6116002)(7099028); DIR:OUT; SFP:1101; SCL:1; SRVR:CY1PR0701MB1725; H:localhost.localdomain.localdomain; FPR:; SPF:None; MLV:sfv; LANG:en; X-Microsoft-Exchange-Diagnostics: 1; CY1PR0701MB1725; 23:f3UL0B+eNrrVQuY7/GMBoDwTB3b+J3jMjFatNX+hhlhd10yH5Bt5tVD5cINmne4YtrRURmaPSqpD5lROLLRnX8znVMesLd/H/slPx68AphknithztEMTypIpNmUm6xZxOyWXAGcSsylcFrFlOYpEpIqZPL0rmrxGihNam3kXh8xzLEPn0inwnRNcCjq8l8hJtu+9bI+zUmfooosEQoKgHkHCq5iMv6Yuw1XiEhs/rBlZyrHmH/B8lAgjHcqQD2K1eJCzH9F9rAwUbiL+IbrOv2yPSsqtFRqrNQimemy+M44mdSaOhYs4dS/8mnT80rDn3SWX7NrpY3d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: 1:23 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: caviumnetworks.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 29 May 2016 16:48:20.5834 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY1PR0701MB1725 Subject: [dpdk-dev] [PATCH v2 04/20] thunderx/nicvf: add get_reg and get_reg_length support X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches and discussions about DPDK List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 29 May 2016 16:48:29 -0000 Signed-off-by: Jerin Jacob Signed-off-by: Maciej Czekaj Signed-off-by: Kamil Rytarowski Signed-off-by: Zyta Szpak Signed-off-by: Slawomir Rosek Signed-off-by: Radoslaw Biernacki --- drivers/net/thunderx/nicvf_ethdev.c | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) diff --git a/drivers/net/thunderx/nicvf_ethdev.c b/drivers/net/thunderx/nicvf_ethdev.c index 9f4ca65..96ab1b6 100644 --- a/drivers/net/thunderx/nicvf_ethdev.c +++ b/drivers/net/thunderx/nicvf_ethdev.c @@ -70,6 +70,9 @@ #include "nicvf_logs.h" static int nicvf_dev_link_update(struct rte_eth_dev *dev, int wait_to_complete); +static int nicvf_dev_get_reg_length(struct rte_eth_dev *dev); +static int nicvf_dev_get_regs(struct rte_eth_dev *dev, + struct rte_dev_reg_info *regs); static inline int nicvf_atomic_write_link_status(struct rte_eth_dev *dev, @@ -167,9 +170,36 @@ nicvf_dev_link_update(struct rte_eth_dev *dev, return nicvf_atomic_write_link_status(dev, &link); } +static int +nicvf_dev_get_reg_length(struct rte_eth_dev *dev __rte_unused) +{ + return nicvf_reg_get_count(); +} + +static int +nicvf_dev_get_regs(struct rte_eth_dev *dev, struct rte_dev_reg_info *regs) +{ + uint64_t *data = regs->data; + struct nicvf *nic = nicvf_pmd_priv(dev); + + if (data == NULL) + return -EINVAL; + + /* Support only full register dump */ + if ((regs->length == 0) || + (regs->length == (uint32_t)nicvf_reg_get_count())) { + regs->version = nic->vendor_id << 16 | nic->device_id; + nicvf_reg_dump(nic, data); + return 0; + } + return -ENOTSUP; +} + /* Initialize and register driver with DPDK Application */ static const struct eth_dev_ops nicvf_eth_dev_ops = { .link_update = nicvf_dev_link_update, + .get_reg_length = nicvf_dev_get_reg_length, + .get_reg = nicvf_dev_get_regs, }; static int -- 2.5.5