From: Rasesh Mody Date: Mon, 9 Apr 2018 04:48:06 +0000 (-0700) Subject: net/qede/base: add stats counter for link state X-Git-Url: http://git.droids-corp.org/?a=commitdiff_plain;h=803a4cf0e05207b3cccb4699b8ef09df1a673cd3;p=dpdk.git net/qede/base: add stats counter for link state Add link_change_count counter to track number of link state transitions Signed-off-by: Rasesh Mody --- diff --git a/drivers/net/qede/base/ecore_dev_api.h b/drivers/net/qede/base/ecore_dev_api.h index aee11c03bf..f619683fc9 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 bbcbbd028c..0883fd3213 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,