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 <rasesh.mody@cavium.com>
This commit is contained in:
parent
98abf84ee0
commit
803a4cf0e0
@ -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 {
|
||||
|
@ -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,
|
||||
|
Loading…
Reference in New Issue
Block a user