From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from na01-bn1-obe.outbound.protection.outlook.com (mail-bn1bon0093.outbound.protection.outlook.com [157.56.111.93]) by dpdk.org (Postfix) with ESMTP id E507A9AD6 for ; Tue, 7 Jun 2016 18:41:34 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=CAVIUMNETWORKS.onmicrosoft.com; s=selector1-cavium-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=SzYLZjOELdhdrqWC9ccVCE2ZtaARxigwq64JK0+6rk0=; b=BYo3/Uwkz290TW7CAzOckn2ig4Bo2TkGxQ6LuDqvpgnp/0lI3x04CspN5UcY1qEkvoSFMOXc7GmfcGtbn8Z1UCgOH77FpODy3EXfBTUqMlgPCaqXPXbp4zkJQfc71uYfsuxV73qjd7PEexWJ7br9ia0TONdHQuUJ5+qMyZ1NNN0= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=Jerin.Jacob@cavium.com; Received: from localhost.caveonetworks.com (111.93.218.67) by BN3PR0701MB1719.namprd07.prod.outlook.com (10.163.39.18) with Microsoft SMTP Server (TLS) id 15.1.511.8; Tue, 7 Jun 2016 16:41:30 +0000 From: Jerin Jacob To: CC: , , Jerin Jacob , Maciej Czekaj , Kamil Rytarowski , Zyta Szpak , Slawomir Rosek , Radoslaw Biernacki Date: Tue, 7 Jun 2016 22:10:16 +0530 Message-ID: <1465317632-11471-5-git-send-email-jerin.jacob@caviumnetworks.com> X-Mailer: git-send-email 2.5.5 In-Reply-To: <1465317632-11471-1-git-send-email-jerin.jacob@caviumnetworks.com> References: <1464540424-12631-1-git-send-email-jerin.jacob@caviumnetworks.com> <1465317632-11471-1-git-send-email-jerin.jacob@caviumnetworks.com> MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [111.93.218.67] X-ClientProxiedBy: MAXPR01CA0054.INDPRD01.PROD.OUTLOOK.COM (10.164.146.154) To BN3PR0701MB1719.namprd07.prod.outlook.com (10.163.39.18) X-MS-Office365-Filtering-Correlation-Id: 9829bbd4-2271-4795-610d-08d38ef295dc X-Microsoft-Exchange-Diagnostics: 1; BN3PR0701MB1719; 2:SDONn07Ucpzd1AGuMyMU63z+XyhxpTt/Ys19BqkBXJ/s9ltWs9RYukeIvUvMbGanifKLIIBURUrpJYHs+IDOqFnqDfFy6BCvdiXUYHG7kz3RrZ7xzpw2QZbi2z37NiNKxN3RfC0+HwN3bFMtOd8Hc0q6Y657+X9WljCPmYzDbiQrZoU6rswdhzdI/bzHqjIz; 3:Sc8KPsA8tLxRdLUvMHzLXS9ivRCJ+tsBOYIy5Y51dRey2twmJTFFQK3Qlu6FHcDiIcP2D2iBpgMF92s1+WIzQVT9tmKiYK7ecjxh7h0Tw+2m1Yq4K/92iVwNGXbvMEso; 25:yqYQ5vdocGRZKSwaZC9wTny956wgRFht4V6LaR8rpr/I7LdWD3lX9yZKbNohhY47MhY+LobTuMuNTEXjuU6nZlsVR6fyN2HS8AfkVAxcA7yUNMpL5MUmQiC+eDpCNtjwK+fb8FueueTW5lA71Y4RvxvGzV63HWb+hDKUA9cRh2mLgxi/LPm/BxwicxShTjkgHy1gil9VMs5cI9LXSkHH0NjJyGcD9eu3YABulKMuENE0yeMXjdQbzIOa8aKklsRMeCaKo754trlcs8x6IdvjtLdfMgqYlSdiAOetBTOd8f0D+Ycz3GaeweSxIGmoZrd1PxCLNzgd6bqGD9dKFpb2LNaXKWZwy/uZag0Ln87tMFy/8wXBf+JO8+Yiewq2DYfLyzA6uSOWt7V3aczcEX+hFnMyz3fkzSzaPVHZwiM3ru0= X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:;SRVR:BN3PR0701MB1719; X-Microsoft-Exchange-Diagnostics: 1; BN3PR0701MB1719; 20:X3wyDYRZrJCSUBd9A3JPiXrnvYBBgPPhSxBZWNoKZlGhWzyt0u5odSWAZwku7DxirIWesXYorroAwEUz36NEN2hBOCrZBpVrvCii96Ok+nJt8+/l4geaZxyEvuZtyPyRTwcMWg+5DtSPUvYxGHaDJIGuNbFcVZtRsAlh7yATDAnx0aK+WFY9Prr9rhAwPOH/CWAsq/xdZgYLWwdpNHKxw2h7+hICQlBBtp87m/2g8D1zRs2n2t9zE2fZ+QUDx1mPUd/DQyYRKvoiR4zz4/pdrtcHyRYSxNVxNaiJyWXj2YrPYh7kwLg8DAhQxZAgNlHqZPScXrj+TGfhEH7BPSnRNPlZgdG57jR91R5rFnAuu/qt/YR8YVwTjoYfof84HCrXFL7MtVqTiaHP8RoQl7JZLdhs6gkfh75G49x+rNVDVQE7ZuIK2Cp4EaVhg4tGJOzA25gDfDS5WJjIf0aqkjfYH7cHkvE/QUyRFc4wgxZKIsFgJIVyw/xX2sx+lSMiklo6VRUnz6j+3AYb5eZGSz39H/O3ffcmTZjGnsnAZUimDADQDZssm7moL+axjkq/f7opwH3W8rVxv18hQiQfX13SRhRfWSJjcT+PYuVN5cm4qtc= X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:; X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(601004)(2401047)(8121501046)(5005006)(3002001)(10201501046); SRVR:BN3PR0701MB1719; BCL:0; PCL:0; RULEID:; SRVR:BN3PR0701MB1719; X-Microsoft-Exchange-Diagnostics: 1; BN3PR0701MB1719; 4:gL6QgMSauEyMiu3SgrjDN/RBM/c9PFJ1qg13VfjLkYuk5gXwnnGuMG3vzoKmZVcbjXLQe8nmXF7K/SVpRFzbWx2Ats9RWJpKJ60ykFEutijK8a0hnZsTeTPj7vcjQZGP6h+5PQy/iR1awfA+GOqkNi+1lvXLLY5mNJImKXRAAYP/cb3TT96XXWUGTrwWVtHb4i1Ilh9sHvzSnqn6nOlObs9ExCc4UCmdj7qWRIjwRsmQL5u2nxJ7srBq3su1BsB7SXcA/NXI6NNTtrGDadFrUNXV8FrpuuMb6tvggaa6BUAjd5yrwnqBVsRMCuyH5JlKv2F9xuogEAoY+GLdf38c0tjr6YcuQK8hRTHXyNv2a0UPPn3QFSpvklN/sCT3K4z8 X-Forefront-PRVS: 09669DB681 X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(4630300001)(6069001)(6009001)(199003)(189002)(81166006)(8676002)(81156014)(47776003)(66066001)(36756003)(92566002)(2950100001)(586003)(2351001)(48376002)(76506005)(42186005)(50466002)(4326007)(77096005)(3846002)(6116002)(5003940100001)(53416004)(5004730100002)(105586002)(97736004)(2906002)(5008740100001)(106356001)(189998001)(19580395003)(69596002)(101416001)(110136002)(19580405001)(68736007)(33646002)(76176999)(50986999)(229853001)(50226002)(5009440100003)(7099028); DIR:OUT; SFP:1101; SCL:1; SRVR:BN3PR0701MB1719; H:localhost.caveonetworks.com; FPR:; SPF:None; PTR:InfoNoRecords; A:1; MX:1; LANG:en; Received-SPF: None (protection.outlook.com: cavium.com does not designate permitted sender hosts) X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; BN3PR0701MB1719; 23:qzzsQaYvMJLP/nl/tq5jZR7lidieKWB73/79CQl?= =?us-ascii?Q?iVl5P3dyYTcTrjt8Me5qMbeMMxw1l5nWMQA+GYAXJJYD4NzfPIJduu53C3gf?= =?us-ascii?Q?QrVeFXYWpdz6UAFsj7a07kuXHtyj8TYNzEK2PGAHgHtTXQpTDKN2TcD/M8Vg?= =?us-ascii?Q?+L9zvXhPBSDg8vAX1o05yKHSxxQkXDcFvfJ41Q52HweMfFUTtU7w4KmuS3ph?= =?us-ascii?Q?ver0If+2OqOQB58CPW0YAAhRmeV36BZHGn+aoIErvhTX/lUii57QvFeMWby+?= =?us-ascii?Q?zenc59XnHW0PI6yE224jleZyX3HcJEWJ6dlXY3dIKPmaykylpOx7b+ab389g?= =?us-ascii?Q?0uy+gbvsONqDlIREoEqQl6T2dN1xqV8KiDjiB2sftEqelpxCVIbCfbfWh1PG?= =?us-ascii?Q?FjcCaeXMFphhfCmDQVXKX0zl71wkGX6mushne5wRJa/ITL7ODvwc7FLGRZaR?= =?us-ascii?Q?e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vBfCJnjeo1g==; 24:ShuIg2/jIYYtjEhz1PH/Ix/v3d0vdWPoGEY397O+5hv5k5GY74c2aLLODoMkEwLXtu9jD3Ftnqg/ORGxfB2osCJCiEUJvWgif66knrR0Grs=; 7:5b4hMk1QU+zMwu2JvRjhBWyrfGRYH5bez/Z1DZtbA1TPpmtPTzSc9OP5HTp/kUu/QwTl0lB/48hkvT/s0U6ZFK5p+BuwYBNifl45KR/uHkmK8cVnv6GQahJisA5LMbsoG4fweUV6R2TLnas7kx/XZxgtOM+cHN6PIm7F3ijjc02KA3+aWHxVJ5BCq+hJqKryMNAwc4EDAKO4IHJjj0LVfFGrkiuQG/tdQwMhU7Q6Bzk= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: caviumnetworks.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 07 Jun 2016 16:41:30.8238 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-Transport-CrossTenantHeadersStamped: BN3PR0701MB1719 Subject: [dpdk-dev] [PATCH v3 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: Tue, 07 Jun 2016 16:41:35 -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 5d28eea..34b4735 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, @@ -145,9 +148,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