From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from NAM04-BN3-obe.outbound.protection.outlook.com (mail-eopbgr680046.outbound.protection.outlook.com [40.107.68.46]) by dpdk.org (Postfix) with ESMTP id D78F81B4D5 for ; Thu, 11 Oct 2018 12:35:48 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=AQUANTIA1COM.onmicrosoft.com; s=selector1-aquantia-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=z8XpuSy+l59rjvRTH9EhxrPPD7bDVpg35fcNufOduDU=; b=PYXEnndHjWMMFJC0ESvEa2j60/Kyx3KmqaIul5nhNE/M6kx2cjkXgQztkefpl+/na2X/7iYOfyWr9xzk9gQe+D83PvvLSW++PXdhO5q3PEdkvFfm8DuWqQ90eLbQXinLK7+4ZJULp0ojBehyPA2XSD5Kcy09NzN5BJQ0cRrg0+c= Received: from BY1PR0701MB1660.namprd07.prod.outlook.com (10.162.110.22) by BY1PR0701MB1208.namprd07.prod.outlook.com (10.160.105.151) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1207.27; Thu, 11 Oct 2018 10:35:47 +0000 Received: from BY1PR0701MB1660.namprd07.prod.outlook.com ([fe80::346d:e756:e70e:17]) by BY1PR0701MB1660.namprd07.prod.outlook.com ([fe80::346d:e756:e70e:17%3]) with mapi id 15.20.1228.020; Thu, 11 Oct 2018 10:35:47 +0000 From: Igor Russkikh To: "dev@dpdk.org" CC: Pavel Belous , Igor Russkikh , "ferruh.yigit@intel.com" Thread-Topic: [PATCH v5 22/23] net/atlantic: read MAC registers for debug purposes Thread-Index: AQHUYU4stl5q7JUPp0GDZcaj2KkrbA== Date: Thu, 11 Oct 2018 10:35:47 +0000 Message-ID: <99ce340e663d9171a376573b0a4894aea61da07c.1539249721.git.igor.russkikh@aquantia.com> References: In-Reply-To: Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-clientproxiedby: VI1PR04CA0088.eurprd04.prod.outlook.com (2603:10a6:803:64::23) To BY1PR0701MB1660.namprd07.prod.outlook.com (2a01:111:e400:522a::22) authentication-results: spf=none (sender IP is ) smtp.mailfrom=Igor.Russkikh@aquantia.com; x-ms-exchange-messagesentrepresentingtype: 1 x-originating-ip: [95.79.108.179] x-ms-publictraffictype: Email x-microsoft-exchange-diagnostics: 1; BY1PR0701MB1208; 6:o23yXqoofLw1Pi8HxCMvZMGM5lZcsFstvDPrwwujmLGBFS2sVdWL5gcYiNkSTQDRDMM1PcgyHk3szw/cO7eltBmc/BdbYe2lP+ze7E7lWI4B8+TsdBL3Lr0Qv0rWfZWKs6cGFWG1YnYU7AxoiWMtK+N9uLtPHU8uwxWfJcqtPRkrXY4CEcfQ5ImizzVgwuPAFR2MsUHVfSX6ef3pQmpBKQJh8U3dO54VeD6FHk7961knQ+WNG6TbQg/KdCgvYmYUbOmrLmbR2eJED5OVfWpKWhA5LWGwlyrpoI6bQ0upHDxTnamY4buO5Jet0R1FWcXG4b6rou9FweQ5SjHT9QaL6nwKIrfy4rhHLXhIIR3+5x0NpyKfZS3zshLbG1nTWA0exuleN2Z2p8PdB/DxHybfhzsAo4XhYi/TWdrqjGD3BO/BOhuK6vXvHPoeb9iuk9kbxYmiLD0BQc9bWEzw28uN6b8JJIjXrt25xBtuW4+cgY8=; 5:X+MOBaidirQEaOOWmFabytS1XMt0CyI5j+nrlKKmtlcIHR6K43ErxHE89y9SzZ1zBYOyOYiLxkjLuWlSpRJtxcs6AUW/q8WV1mADoQloUcPlbEHS9VOFxDkca0pIyt5R0P4Xr1a/sfh1cB7ofm69L805C+VR21vC+4rTWZgyNmY=; 7:UWZgas5T5+umecwr8PxZdskND4dZHwe/EOX+/M/1lpVkL5qScEypO6USgPRmlXjMKKVRetxJdkWhuz2N8/c3QIYInRU52DzHjSPMCckABeoR+c7F+xVehZO8uKK0DHOGMwNghxv0HTMv1J56e0IHz8rdGbdvgQjiz1By0yf9np4hC8ZmfrprlODgOZ34XwduTcYaD3rQ1T3KfnJWrh9mHjJFDAzH4LgqjmTuy/5Bhk7ZphU5EeEXiNfGyMtOWC+a x-ms-office365-filtering-correlation-id: 2499a3b4-d52a-487e-595b-08d62f654e48 x-microsoft-antispam: BCL:0; PCL:0; RULEID:(7020095)(4652040)(8989299)(4534185)(4627221)(201703031133081)(201702281549075)(8990200)(5600074)(711020)(2017052603328)(7153060)(7193020); SRVR:BY1PR0701MB1208; x-ms-traffictypediagnostic: BY1PR0701MB1208: x-microsoft-antispam-prvs: x-exchange-antispam-report-test: UriScan:; x-ms-exchange-senderadcheck: 1 x-exchange-antispam-report-cfa-test: BCL:0; PCL:0; RULEID:(6040522)(2401047)(5005006)(8121501046)(93006095)(93001095)(10201501046)(3002001)(3231355)(944501410)(52105095)(149066)(150057)(6041310)(20161123562045)(20161123560045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123558120)(20161123564045)(201708071742011)(7699051); SRVR:BY1PR0701MB1208; BCL:0; PCL:0; RULEID:; SRVR:BY1PR0701MB1208; x-forefront-prvs: 08220FA8D6 x-forefront-antispam-report: SFV:NSPM; SFS:(10009020)(376002)(39840400004)(346002)(396003)(136003)(366004)(199004)(189003)(26005)(99286004)(72206003)(478600001)(76176011)(14454004)(486006)(256004)(97736004)(14444005)(8676002)(316002)(5660300001)(8936002)(476003)(66066001)(4326008)(305945005)(11346002)(2616005)(71190400001)(6116002)(2351001)(54906003)(575784001)(86362001)(446003)(6506007)(6916009)(7736002)(386003)(25786009)(105586002)(106356001)(6512007)(2906002)(36756003)(3846002)(71200400001)(102836004)(68736007)(186003)(118296001)(5250100002)(44832011)(2501003)(81166006)(1730700003)(2900100001)(52116002)(53936002)(6486002)(6436002)(81156014)(5640700003); DIR:OUT; SFP:1101; SCL:1; SRVR:BY1PR0701MB1208; H:BY1PR0701MB1660.namprd07.prod.outlook.com; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; A:1; MX:1; received-spf: None (protection.outlook.com: aquantia.com does not designate permitted sender hosts) x-microsoft-antispam-message-info: UKdiQjWQLmK805HSh1bBsdd1UQq04FPE3Hw+fJpu8mIPrb5xnrVBYATJ5eLUHVq7c4+AEEN/+Z05y1bL0WxnZ1ld/WtpTvhyR6rvRWNFpuexulV0KsYSyfZFwoL4LulmzBLsmmtuiHknmpCWoXwluAcXiqj6Q78ABuUzLWATaVcr+y+bqfhSX0JXufpJrBjQ/pY7iqCTcxsH8X8xJxeW2xJdCu5zOtCtBcnmquzXNwELvmfplfuvvDWhzfbYixWHorbPFsEaEBNzLHXslhXHPeKup272nUoeRnHekdDv4+rl+IbBaQfBWeQa4KhEGQZp2fY3zvoqrUC7dSosnEJs9CbxcE0LWBHO2NGcX75by8c= spamdiagnosticoutput: 1:99 spamdiagnosticmetadata: NSPM Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-OriginatorOrg: aquantia.com X-MS-Exchange-CrossTenant-Network-Message-Id: 2499a3b4-d52a-487e-595b-08d62f654e48 X-MS-Exchange-CrossTenant-originalarrivaltime: 11 Oct 2018 10:35:47.6585 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 83e2e134-991c-4ede-8ced-34d47e38e6b1 X-MS-Exchange-Transport-CrossTenantHeadersStamped: BY1PR0701MB1208 Subject: [dpdk-dev] [PATCH v5 22/23] net/atlantic: read MAC registers for debug purposes 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, 11 Oct 2018 10:35:49 -0000 From: Pavel Belous This patch add support for dumping MAC registers. Signed-off-by: Igor Russkikh Signed-off-by: Pavel Belous --- doc/guides/nics/features/atlantic.ini | 1 + drivers/net/atlantic/atl_ethdev.c | 32 +++++++++++++++++++++++++++++++= + 2 files changed, 33 insertions(+) diff --git a/doc/guides/nics/features/atlantic.ini b/doc/guides/nics/featur= es/atlantic.ini index e8ddaf0a6477..479a0134ff6e 100644 --- a/doc/guides/nics/features/atlantic.ini +++ b/doc/guides/nics/features/atlantic.ini @@ -30,6 +30,7 @@ Extended stats =3D Y Stats per queue =3D Y FW version =3D Y EEPROM dump =3D Y +Registers dump =3D Y Linux UIO =3D Y x86-32 =3D Y x86-64 =3D Y diff --git a/drivers/net/atlantic/atl_ethdev.c b/drivers/net/atlantic/atl_e= thdev.c index aef3db5533dd..7bd3fab8e015 100644 --- a/drivers/net/atlantic/atl_ethdev.c +++ b/drivers/net/atlantic/atl_ethdev.c @@ -69,6 +69,10 @@ static int atl_dev_get_eeprom(struct rte_eth_dev *dev, static int atl_dev_set_eeprom(struct rte_eth_dev *dev, struct rte_dev_eeprom_info *eeprom); =20 +/* Regs */ +static int atl_dev_get_regs(struct rte_eth_dev *dev, + struct rte_dev_reg_info *regs); + /* Flow control */ static int atl_flow_ctrl_get(struct rte_eth_dev *dev, struct rte_eth_fc_conf *fc_conf); @@ -229,6 +233,8 @@ static const struct eth_dev_ops atl_eth_dev_ops =3D { /* Link */ .link_update =3D atl_dev_link_update, =20 + .get_reg =3D atl_dev_get_regs, + /* Stats */ .stats_get =3D atl_dev_stats_get, .xstats_get =3D atl_dev_xstats_get, @@ -1126,6 +1132,32 @@ atl_dev_set_eeprom(struct rte_eth_dev *dev, struct r= te_dev_eeprom_info *eeprom) } =20 static int +atl_dev_get_regs(struct rte_eth_dev *dev, struct rte_dev_reg_info *regs) +{ + struct aq_hw_s *hw =3D ATL_DEV_PRIVATE_TO_HW(dev->data->dev_private); + u32 mif_id; + int err; + + if (regs->data =3D=3D NULL) { + regs->length =3D hw_atl_utils_hw_get_reg_length(); + regs->width =3D sizeof(u32); + return 0; + } + + /* Only full register dump is supported */ + if (regs->length && regs->length !=3D hw_atl_utils_hw_get_reg_length()) + return -ENOTSUP; + + err =3D hw_atl_utils_hw_get_regs(hw, regs->data); + + /* Device version */ + mif_id =3D hw_atl_reg_glb_mif_id_get(hw); + regs->version =3D mif_id & 0xFFU; + + return err; +} + +static int atl_flow_ctrl_get(struct rte_eth_dev *dev, struct rte_eth_fc_conf *fc_conf= ) { struct aq_hw_s *hw =3D ATL_DEV_PRIVATE_TO_HW(dev->data->dev_private); --=20 2.7.4