From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from na01-bl2-obe.outbound.protection.outlook.com (mail-bl2on0058.outbound.protection.outlook.com [65.55.169.58]) by dpdk.org (Postfix) with ESMTP id 36DC25A62 for ; Sat, 7 May 2016 17:18:00 +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=gPa6Y0GZHJT6/hskwI2L2RX9eGmpn+AWDz8kpIR/myE=; b=fY/Bgv9kpTBHdeP/6754XTegTgNV5NDvzssq0/IVVVMo2CC1OWthdPAy8N2ApV7S3mjU9gsFZNyR7NyiCQnKbtTV8oZjVTs+gyewtuAe1sGtiNtVX3GSqfYVCm9glar5ZhIAbl7zb+r2HWnbCfCoGFGGe8Fa6H52TGx6p5dNfxk= 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.10.92) by BN3PR0701MB1718.namprd07.prod.outlook.com (10.163.39.17) with Microsoft SMTP Server (TLS) id 15.1.492.11; Sat, 7 May 2016 15:17:54 +0000 From: Jerin Jacob To: CC: , , Jerin Jacob , Maciej Czekaj , Kamil Rytarowski , Zyta Szpak , Slawomir Rosek , Radoslaw Biernacki Date: Sat, 7 May 2016 20:46:22 +0530 Message-ID: <1462634198-2289-5-git-send-email-jerin.jacob@caviumnetworks.com> X-Mailer: git-send-email 2.1.0 In-Reply-To: <1462634198-2289-1-git-send-email-jerin.jacob@caviumnetworks.com> References: <1462634198-2289-1-git-send-email-jerin.jacob@caviumnetworks.com> MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [122.167.10.92] X-ClientProxiedBy: PN1PR01CA0050.INDPRD01.PROD.OUTLOOK.COM (10.164.136.150) To BN3PR0701MB1718.namprd07.prod.outlook.com (10.163.39.17) X-MS-Office365-Filtering-Correlation-Id: 070025f7-10cf-4996-4623-08d3768ac5fb X-Microsoft-Exchange-Diagnostics: 1; BN3PR0701MB1718; 2:i8yLK1DCLvHX2Fln8bFgG+fzZxqeyBMVjBOJ1EfmE2vmIcnRTA2PqRACb6p2yIUhHUkTGKqeJzof325999eM3501s2QZh3XdiNPb3fe6v5+rM9+7mDUnel0lkA49kMH0HNGIis/ftk9G2abtyf01GygVB+8j86TwSewffZB4ZooCsYHZs6ZsRiHJmD7AJNJ/; 3:0Gt9x92qI1mRuhoFwb9zgf9rgpRw5Aex7ZJKIh0iC3gFnu7iov6QsXLAZDU7NkwAIKPoFFRkX9EUNTj447B30kkujG5XZE92kRhAvjLSCfUu2wMO9PXZKnkO13w81MRD X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:;SRVR:BN3PR0701MB1718; X-Microsoft-Exchange-Diagnostics: 1; BN3PR0701MB1718; 25:ID32IMcvmj1+7MSOeO0O46SWLtPy6j6Dq1zoQ6hWarGhSEu/EcM0oyvWBwPg9UA/BPofy+mysNdDXxIOftUKusyUzCtLApU7Z2sR2WgWe+TygsN2AtUyoQ6hyLdOEZZQMaUYPtYV30UGml9bsDdCIFngGkeTZFrVmT2aiXU1gufkO8wWO5giw5AENWBv+GSmYnswyg0z1fei3NHuRB2MQHexVwH6q+0+c5nqDnbWGp5YKaiHUsFgiMX7Ar47FbCY8XmDCBYvMQ3BwWOAbaefjGU6vSCZmRtaS5gnbBBIkPqxgjwLswANRPnHPi9qNsvr8RnAuqdfYZan9w+IxmvJv/ssXlXTA6t7VotOt9HC9noyy5POZEybxHolHxlvKQXFtfViPrCCquelcwxr0D7425EVqcEe/+uofg2MzlJ8A02QU2zeqGliNhIXhcJeYyAVIO0KTvuck06SyWdFMX7xwvWHvGQvIvZmLQumaRaakboCJqkmRPTBH5a1m3eckmMCuiWOpxRENtX42PMRGcmj6iZZzgKUUojzgcNNnOzIraxlwYq6IiCA0bWs3af4zNcUCEFt25SHCyBefVlrH5cKSQ9vWFP9XwX0nbpOBWUKH1c1uegdfYi/syNJWXesjwi/LDm5yWahNasiEvpFWmq4M4+ExmWVlA9eQCZ3d2UXETAGg9/MlrMQ5LBIWEUrj7gPTawyN+l20XyTDo8jH52pD+nb6qIFYkgIDQhXr/9sSIU= X-Microsoft-Exchange-Diagnostics: 1; BN3PR0701MB1718; 20:vmccwwu0ySyOkYRtDrL8ywnzPaUyWolA4KqV/8CKnWV2kEMY1Kl1yOn3l5R8cXn2Q3EXSn8s1oOe6oXusYqpk9nva646hkfA09i0c1/XIkazOKYKIupFTYhV55d5DlwlkpS4LpZTdQnoSpZDIHLi5jkNLJ1pbdmKpYTkxpKMQz5sUL96SBeQz3wGi3ZmcHqoxjb+zdsUW//tJ9IBC15dp423gzYM5cXXyu9VrgUrlynZB16hproyIITr83P7sj0RtuIvSF5+1p4qcQ0P2jtx9GmGtO5yrA6TqjzgbLCHzwBJZFM2N3CLujCoh+2qRHv3oo4/88Fvls4OnOo1SMfJ2KqyqLg6Rmz1QZG+vKYZdxof/x6F1mF+xxZEHgam3igQXcblctCw3F42PoNaVGUMuY46WQNvq0lXNv0hpn8vA2SNiqGsLNQC/yrgto9tIhBhIvmuH3/Xfx6m0Mj6p06fLOmwJsbQwPxnu1VLAXJffGihT0d2YOiI6LQF6FoVeuK5I2OA8meMXtLUPVj0ZTpR0IL1Yp5GLDqrB3sSUtM67se0ZVaGOfQJA34ekWsgrtKoyjcyADmy+2UemfK9VYN/KWVXZGyAdXgHomIUSnXqgOI= 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)(3002001)(10201501046); SRVR:BN3PR0701MB1718; BCL:0; PCL:0; RULEID:; SRVR:BN3PR0701MB1718; X-Microsoft-Exchange-Diagnostics: 1; BN3PR0701MB1718; 4:6W3BWXAK/llfmW6GusbUrsEJVTtWFKWvfNing/pWxrKQdJBHy+Y1FhKK3hRAFVeGgOGj7eWZHBiZ2QRMRqguJhxtt4S0YYHHserOMhpH3kMZCqPAPUryIPV7j/l/NToxh8rp8h0BKd1FGkSGBkI2ZDyTJT+qgPK5l4QEUEmtcLLB7UK+6ar3xGJ9M2Nja89yt0erKSAF4lOdVdSsmYLD+ebGK29zlxPGavfA3UNzqtIvFesv/IdOZgeenpFienx5iTOnM/mdtIRIZvbgHiKEe2MS8jn3zfzJrVjWhoBeIHjGikmo9xB/2UXzRofg0BDjKIK8+b7uI/tcmtmFPJk9zikGwwzlB0B9k6pT/7cVXeEGzd5r8Fas6FhMbmPbG6pZ X-Forefront-PRVS: 09352FD734 X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(4630300001)(6009001)(6069001)(50226002)(77096005)(2950100001)(48376002)(81166005)(50466002)(66066001)(47776003)(92566002)(5003940100001)(4326007)(2906002)(110136002)(50986999)(2351001)(33646002)(586003)(3846002)(6116002)(229853001)(5004730100002)(76176999)(19580395003)(19580405001)(189998001)(5008740100001)(42186005)(36756003)(575784001)(7099028); DIR:OUT; SFP:1101; SCL:1; SRVR:BN3PR0701MB1718; H:localhost.localdomain.localdomain; FPR:; SPF:None; MLV:sfv; LANG:en; X-Microsoft-Exchange-Diagnostics: 1; BN3PR0701MB1718; 23:7N742Qg7bA7W+QBOgNPrMWLZBjn45dp8I1o87/UnGUECW59MW7lqYzWtDUCzKqmRgXmJQytwZDl8L+7THzNn+P6o8rRucz0GlZQEhe4gsDTBThA6OkSw5ajhqLl/+jC59hk0/S2U+hp+agbnZdJnlQ0D6/MsbTd7uAT8vclUMLL42POQ+4UUrGhWV9CAJEaiA7wzp6APlD1RvCn/p4swO6mWUCwrL7WhwxTQyrQxcTSb/xDiVwzi5j9bgq0EtfAGz0lRxsSwEKU+wSQhCRoi2csSbqI37vf2kLaUD7ehdP367CP93meCiTUi2MUUxNPIJqIyAuYy4bpC7GVd8Er5HS9cSaDi7bksmzgMqSzhv6xAsfrIOiX14tPQ/AwVATNP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orOrg: caviumnetworks.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 07 May 2016 15:17:54.2732 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-Transport-CrossTenantHeadersStamped: BN3PR0701MB1718 Subject: [dpdk-dev] [PATCH 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: Sat, 07 May 2016 15:18:00 -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 | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) diff --git a/drivers/net/thunderx/nicvf_ethdev.c b/drivers/net/thunderx/nicvf_ethdev.c index e6f0b3e..92b08a5 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,10 +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; +} /* Initialise 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.1.0