From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from NAM01-SN1-obe.outbound.protection.outlook.com (mail-sn1nam01on0087.outbound.protection.outlook.com [104.47.32.87]) by dpdk.org (Postfix) with ESMTP id 5A5D61B675 for ; Fri, 12 Oct 2018 13:09:55 +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=nFbkojfIySDUywBx1q865OZMD5aDus3ffv/sJ1mjuCM=; b=NeXxu3NG/pQ0/bAwSswLMhgtBjMcrIdligrGeotJOQS3A5rT/YRVmxq4E4dr+KVYdx4Z5lG8pCjEB8v4/B4oj5OeQl62o/LtA+3fS46li+5JSq6QczNEFRqmoqilHpRdM2dGhhX3XZ/vTEHN/Wpja6k5yZJkkcT68Ub8/ZHfRJw= Received: from BY1PR0701MB1660.namprd07.prod.outlook.com (10.162.110.22) by BY1PR0701MB1627.namprd07.prod.outlook.com (10.162.110.156) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1228.22; Fri, 12 Oct 2018 11:09:53 +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; Fri, 12 Oct 2018 11:09:53 +0000 From: Igor Russkikh To: "dev@dpdk.org" CC: Pavel Belous , Igor Russkikh , "ferruh.yigit@intel.com" Thread-Topic: [PATCH v6 21/22] net/atlantic: read MAC registers for debug purposes Thread-Index: AQHUYhwZt4mRmK9TXESss4oaOE62Jg== Date: Fri, 12 Oct 2018 11:09:53 +0000 Message-ID: References: In-Reply-To: Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-clientproxiedby: AM5PR0701CA0008.eurprd07.prod.outlook.com (2603:10a6:203:51::18) 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; BY1PR0701MB1627; 6:n3nvwKsMgrDaKiMbLl0eW3GU32mELF8q2oz/GQPDDhyk+3030h76H8oyeZS+rtzKQ+LUodwgRGFJ+tpcOqUkdlWnVIXtkcNptwvhO5MSVUWH+m2bOK6dJYKa0UKLVN13wnTkCasp/A4hKV6483B6ghQ4XLdwRGus4D1jiag6a5wXzCIyy1hac3t+oWimYYsH+Yhx/M4soTRHQgh1YZ9ILgAQBxfELcov3MT3m5FMforYTag5r1LIAukSSDY4aQDlDxGpSxq2js3aWtfBHx8EOey80MSlff+EgF3chrppai/xa5BjttLk75LXb138f0MMAFkrOZnpcW+2sd8fFrsNkA9dHi+4X6qNfV5bCINlq7TgT21iEUPLvEtKlWLd5RrBD7I2jI5DYZL8F/x9OWWPaE0ibaXLoxBpxAEnnOgPMVI9k96HzT/WDMWe8OYjmnTpRYbtSY086dvhA6f3Y/54dmK4Gtg02D74PilS5doRy08=; 5:9WqbIdZwQAiwzYbi+q0n9XU7WpeJpfa0HCxqSHTfXOR7KTf9vlQmF92gDK5rAvTk3/2gOJCM/ZH0+2YRLLe0bCcegnXQJ9+BNs1H4DFjykVKYbgFaDIVoj72/rJQqRJ4zLf+ynZajDhiCr32iNSuhjngguWQzkMJUVjFAf1xw0o=; 7:Rp2v1Y9+cxBRewJdr2gX9jE7FIRq0K8nOjVTvqZi0A/pHIhPrgheyaC1JsApHSjDvU2bKd99ZtOtRofTgqlgqWZzds5hGrbjCMdQfYuQK1oD4S531L4UVVyikbigHrxP4N/5+fpdr04q+fzl7Q2NOEK1FBfb/LxbohAOhVMoBwmk54Dkl2/tRa8zxQX5WTdT4U1lDtTuv7yGRh4TkJsrFlrM3BUNXf/qGMk+aGgqgd9scV3knvfT/WgsPlVdkyAC x-ms-office365-filtering-correlation-id: bb578d9b-3b4e-4de2-e169-08d630333c34 x-microsoft-antispam: BCL:0; PCL:0; RULEID:(7020095)(4652040)(8989299)(4534185)(4627221)(201703031133081)(201702281549075)(8990200)(5600074)(711020)(2017052603328)(7153060)(7193020); SRVR:BY1PR0701MB1627; x-ms-traffictypediagnostic: BY1PR0701MB1627: 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)(8121501046)(5005006)(3231355)(944501410)(52105095)(3002001)(93006095)(93001095)(10201501046)(149066)(150057)(6041310)(20161123560045)(20161123562045)(20161123564045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123558120)(201708071742011)(7699051)(76991067); SRVR:BY1PR0701MB1627; BCL:0; PCL:0; RULEID:; SRVR:BY1PR0701MB1627; x-forefront-prvs: 0823A5777B x-forefront-antispam-report: SFV:NSPM; SFS:(10009020)(346002)(366004)(376002)(136003)(39850400004)(396003)(189003)(199004)(186003)(6116002)(486006)(5640700003)(446003)(6436002)(6512007)(53936002)(71200400001)(71190400001)(14454004)(72206003)(316002)(2351001)(44832011)(3846002)(7736002)(305945005)(2906002)(4326008)(6486002)(97736004)(26005)(2501003)(102836004)(5250100002)(11346002)(86362001)(25786009)(476003)(2616005)(106356001)(54906003)(105586002)(256004)(14444005)(5660300001)(66066001)(81166006)(81156014)(1730700003)(8676002)(478600001)(36756003)(68736007)(6916009)(8936002)(99286004)(386003)(6506007)(118296001)(2900100001)(52116002)(76176011); DIR:OUT; SFP:1101; SCL:1; SRVR:BY1PR0701MB1627; H:BY1PR0701MB1660.namprd07.prod.outlook.com; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; MX:1; A:1; received-spf: None (protection.outlook.com: aquantia.com does not designate permitted sender hosts) x-microsoft-antispam-message-info: 4nT8kSx+VAL4HjGsLWKVmHojeo2gQsbfYJxzgq3EOg9f5iIcnXzeQu/tpT8kPWbrDoPUNxQYR3FMRwyt3ZboZQb5GS2GLD9D/7C2Jfig7FQ8EmSk/9xYwyBPLb4l+/lJqp5ny2/2GQZY8VZX4PoqKRf8g7LiMcscNSTiKvWMXsw5ZbcMniu2ifywdLYljPvrypBsc2+Uhs9ks7fc2Uq/zxeOd30qsJs6lq+i8C3hIO38FfrZoy5w3nRKUXLTG5yXU2/BDq03LHNe8yesJddtIWXbeA160PR9VbBZ72Fuf2tN4JRdkIgcbL7IS2ZncY9l4E3ojQnaFetlU9CIVgYB31IzR/GIrzTv2kpf2ZJSEF4= 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: bb578d9b-3b4e-4de2-e169-08d630333c34 X-MS-Exchange-CrossTenant-originalarrivaltime: 12 Oct 2018 11:09:53.6241 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 83e2e134-991c-4ede-8ced-34d47e38e6b1 X-MS-Exchange-Transport-CrossTenantHeadersStamped: BY1PR0701MB1627 Subject: [dpdk-dev] [PATCH v6 21/22] 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: Fri, 12 Oct 2018 11:09:56 -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 f09a75691a28..5ed095b14323 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 ARMv8 =3D Y x86-32 =3D Y diff --git a/drivers/net/atlantic/atl_ethdev.c b/drivers/net/atlantic/atl_e= thdev.c index 824e624dd772..5bc04f55cc21 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, @@ -1125,6 +1131,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