From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from NAM01-BY2-obe.outbound.protection.outlook.com (mail-by2nam01on0081.outbound.protection.outlook.com [104.47.34.81]) by dpdk.org (Postfix) with ESMTP id 30E7F1B725 for ; Mon, 9 Apr 2018 06:49:10 +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=KYEWzZArL6FsDCBB3urXpLZqf5lPJsMWImYL6H9QvTQ=; b=EbfzS8uPxR/wHZRxYuXMkYBeR02quZupYNecFZWcvwdvdlZu8jbYsOgXsmikeoNhx/GOjVCLiX9rVu9rZNa8y9BHWK5Vbbv0qJKpU3myaW6HCXMZLmrXPJv8OUgiBrQIN+QY6XuUVdZMc1y0NVQbSMxDL/d7eRalpZ4BWTa+hJg= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=Rasesh.Mody@cavium.com; Received: from cavium.com (198.186.0.2) by MWHPR0701MB3675.namprd07.prod.outlook.com (2603:10b6:301:7e::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.653.12; Mon, 9 Apr 2018 04:49:07 +0000 From: Rasesh Mody To: dev@dpdk.org Cc: Rasesh Mody , ferruh.yigit@intel.com, Dept-EngDPDKDev@cavium.com Date: Sun, 8 Apr 2018 21:48:06 -0700 Message-Id: <1523249290-7444-11-git-send-email-rasesh.mody@cavium.com> X-Mailer: git-send-email 1.7.10.3 In-Reply-To: <1522561624-15817-1-git-send-email-rasesh.mody@cavium.com> References: <1522561624-15817-1-git-send-email-rasesh.mody@cavium.com> MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [198.186.0.2] X-ClientProxiedBy: BYAPR03CA0036.namprd03.prod.outlook.com (2603:10b6:a02:a8::49) To MWHPR0701MB3675.namprd07.prod.outlook.com (2603:10b6:301:7e::15) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: eaa6ecfd-da2d-4c45-c908-08d59dd53a4c X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(7020095)(4652020)(5600026)(4604075)(4534165)(4627221)(201703031133081)(201702281549075)(2017052603328)(7153060)(7193020); SRVR:MWHPR0701MB3675; X-Microsoft-Exchange-Diagnostics: 1; MWHPR0701MB3675; 3:TGJMi9oVMwRshvGglM4h+CjTaXciXT/6eA2WBIBLyho2wO/r8D0omvEDf63+ofLDKy8qFfUmglgsnTCUj0v8sicQo1qVh6qNV44bhbTjjihRCFpbgZNJutdbwJPX+V6a6ohsFN7lb17VTNbJQE6xSwCBjzSilPg6nLfItdQeHaVxmF51iGd0MdaU4fnZ9nhdtgT/viFivbZvzsEbZ+XJg+qj6bPAHLi6GnTHTgz16Qdn2cK0roGgYiVcr2jhI3SW; 25:NdBfr4s3XOMJ9JVOb+C//XjPolkftuqG6HAH0SjFosjyXk7J1GaYxQ9Pq0i/YbI0pS/ZLmYI351Itc0FUVkuFSM6XWpsKpGR/sG/wyqjJ85IdbPB2etvVeLNAbQ/zo7QUzHTsp6pIBAXCOVHK1pHHes3vCszU68sRBbsH8Eyi+3jmanE/ZDYiU5l5+wquz/VVLTxBcl9RPMOWhuPbRfTlYjkcs6D43u7QlnLZ9DyYfcoy4UfLV8xkoYb3+swEhip0sarfmC/oMZexgjdviJPTLXdYnXfFMKg80D9wbkANkslIWwSMW4PuhJLphOrksWdhzgFeKw1MGip7qnr7NePfA==; 31:rNSzdBQXxCoWr2QEKHX3efE/1xDVZMPK+wGxkxGFXKhwboNRsgEzO+0mKQb5pyZxtYIhkXK7JxaRi21ybaKozHdRgsevedcvijc5nD3nLtht7aGZoCDgsYK9gmEURB4BvJlcBjAi3FnG07sswa8daqTHb7P7ON6uERPx1sEBr70wtCSmgHC7tDFRnjYqzZAO/RjFfmQgYNgU/F10kzc6zf/xy+6efHEadwB9Y5ZSQ3U= X-MS-TrafficTypeDiagnostic: MWHPR0701MB3675: X-Microsoft-Exchange-Diagnostics: 1; MWHPR0701MB3675; 20:dIEN9FPOjav/8eXBeY7GWY6eF660ckD0MTxf9up1md2LbAuP46GBVGkleMhePe11k68g8gonJ2xuLlQEcTLe6l6C81oITpOFy7UKLftH8fOQ3q/5Z1ihXAVBL9vqRFYqI3STK3xbd0yPZjoga3342FpYS+lkb5Zb+8k+V4VIcBbYv0XJwyVJFdjJitHx+RcyfXLaC3kpNh+0A+Chj/sKOaSWT433/BjsX19MtZQfESS28wJ+n761oL4KUJU223hk6eEaTdjyhr9Jvad+H+0ZRlHkTz+sPo5QtlL7AUe6sJFJ7k+qsZOK+LWn22WZxrBsJg3jW/MGNa2Y929veIG5gHC20qPDIHWuJ2ys2it/eW+cxFIig9uF4AHL9OjGfNWb81u/UAiwNQAIJaSITrX1ZtW3YW10/+oT0BicfO1ObDDMMaj4iFWgX59U9ZRnIVUgAP9eshJXOpFLN7az1CmygdQyuBqbsDEMHnS2gc+IRp+79rpz0bTPghV3Xcbc3Wyg; 4:N4UUpazvB+L5jCCnDJhXadY9pZECb5nBN0sWA/XX9RWxk/vMJBcmb7yHhUROmuBZZ2DDY5SaDuf5Oj5Umg4K7bYtbJrFlJg8qDKBkQ0oxYjMYV52YEOoU+Twev1uLPf+2zORfXtWIjdnebfLaXoE4zd4VUKSng1zn7bduRp319duQkN2S2RmjKASUQRkA/QIqM58L9XKDYJqGmf6vMntgkfZo2eioGo+EIOlWYWB9nSiQedI5PoJMH+DP1cvrADx9Y3/rVQa7LsADz9wHVgHaQ== X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:; X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(8211001083)(6040522)(2401047)(5005006)(8121501046)(3002001)(3231221)(944501327)(52105095)(10201501046)(93006095)(93001095)(6041310)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123558120)(20161123562045)(20161123564045)(20161123560045)(6072148)(201708071742011); SRVR:MWHPR0701MB3675; BCL:0; PCL:0; RULEID:; SRVR:MWHPR0701MB3675; X-Forefront-PRVS: 0637FCE711 X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(366004)(396003)(346002)(39380400002)(39850400004)(376002)(189003)(199004)(105586002)(8936002)(316002)(7736002)(2351001)(72206003)(305945005)(186003)(21086003)(16526019)(486006)(2906002)(59450400001)(2361001)(386003)(55016002)(86362001)(3846002)(478600001)(6116002)(76176011)(50226002)(51416003)(52116002)(7696005)(4326008)(50466002)(48376002)(53936002)(16586007)(81166006)(66066001)(476003)(68736007)(2616005)(11346002)(69596002)(47776003)(26005)(956004)(8676002)(97736004)(4720700003)(25786009)(107886003)(81156014)(36756003)(446003)(106356001)(5660300001)(6916009); DIR:OUT; SFP:1101; SCL:1; SRVR:MWHPR0701MB3675; H:cavium.com; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; MX:1; A:1; Received-SPF: None (protection.outlook.com: cavium.com does not designate permitted sender hosts) X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; MWHPR0701MB3675; 23:OatoL2RP5KRoKCy0KTKubp7s/UePhDwheeKnlbX?= =?us-ascii?Q?pJndSBYTLtgY5nmvfLw7sigCGhTftkOib9I2KZ/Nql8oxV5wOkmYciqVsqnp?= =?us-ascii?Q?UpngsNyPLNyzNGR4andgUQUnW9mcZyG82/MIHj+m/uswkw+pANwSPB9Dcl3r?= =?us-ascii?Q?kvYZlyuEOxYML3zcEx1KdHO6P4XmASFnrOa/0i3NE32CxaloWz7CioytH2ax?= =?us-ascii?Q?zYMbMyUdknFgr2e64Mi2jwCV8W9fqPmT/OxYvW+9LN8rx35URbh94W4Xq1xA?= =?us-ascii?Q?7jtdKnOgsVl8Cs7nQosHYddLAdTYWh+5ey0dRNUGrn4jUswEbnoZVwliIQrM?= =?us-ascii?Q?OMgXeKmt+hb/TvC8JdAOvqSbrrGbuyt9VFbukcpavd5eobbUdUremKCXy/3t?= =?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Z7u0HRU0igNG07fCyo= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; MWHPR0701MB3675; 7:rfR5qsLJhdP9/iF3XMVCLd+MPTrDpg4/Cw5dQ20a1TLIm9sHgyRYEmWno51o6xEIl1Z0Ld0elLf38sH7p7E4IRh79NjaMDoy+I6E++w5TWdCn9MKHjKgtplii9dMZo/Z29/xKJA7pIAgpLA8l7/DSEpZ4S4rnXCax1HPbUVWxm/N4u5dxJf7wbRHQb7cZ4yjoiY4qM15/PkW8lv+fxPGA5dEK0mscyw68n8FnHbd84/ojXElrG3nrYit2iTSitqk X-OriginatorOrg: cavium.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 09 Apr 2018 04:49:07.2467 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: eaa6ecfd-da2d-4c45-c908-08d59dd53a4c X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 711e4ccf-2e9b-4bcf-a551-4094005b6194 X-MS-Exchange-Transport-CrossTenantHeadersStamped: MWHPR0701MB3675 Subject: [dpdk-dev] [PATCH v2 10/14] net/qede/base: add stats counter for link state 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: Mon, 09 Apr 2018 04:49:11 -0000 Add link_change_count counter to track number of link state transitions Signed-off-by: Rasesh Mody --- drivers/net/qede/base/ecore_dev_api.h | 1 + drivers/net/qede/base/ecore_l2.c | 10 +++++++++- 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/drivers/net/qede/base/ecore_dev_api.h b/drivers/net/qede/base/ecore_dev_api.h index aee11c0..f619683 100644 --- a/drivers/net/qede/base/ecore_dev_api.h +++ b/drivers/net/qede/base/ecore_dev_api.h @@ -377,6 +377,7 @@ struct ecore_eth_stats_common { u64 tx_mac_mc_packets; u64 tx_mac_bc_packets; u64 tx_mac_ctrl_frames; + u64 link_change_count; }; struct ecore_eth_stats_bb { diff --git a/drivers/net/qede/base/ecore_l2.c b/drivers/net/qede/base/ecore_l2.c index bbcbbd0..0883fd3 100644 --- a/drivers/net/qede/base/ecore_l2.c +++ b/drivers/net/qede/base/ecore_l2.c @@ -1948,6 +1948,11 @@ static void __ecore_get_vport_port_stats(struct ecore_hwfn *p_hwfn, p_ah->tx_1519_to_max_byte_packets = port_stats.eth.u1.ah1.t1519_to_max; } + + p_common->link_change_count = ecore_rd(p_hwfn, p_ptt, + p_hwfn->mcp_info->port_addr + + OFFSETOF(struct public_port, + link_change_count)); } void __ecore_get_vport_stats(struct ecore_hwfn *p_hwfn, @@ -2064,11 +2069,14 @@ void ecore_reset_vport_stats(struct ecore_dev *p_dev) /* PORT statistics are not necessarily reset, so we need to * read and create a baseline for future statistics. + * Link change stat is maintained by MFW, return its value as is. */ if (!p_dev->reset_stats) DP_INFO(p_dev, "Reset stats not allocated\n"); - else + else { _ecore_get_vport_stats(p_dev, p_dev->reset_stats); + p_dev->reset_stats->common.link_change_count = 0; + } } void ecore_arfs_mode_configure(struct ecore_hwfn *p_hwfn, -- 1.7.10.3