提交 31b6298f 编写于 作者: P Paul Greenwalt 提交者: Tony Nguyen

ice: fix possible under reporting of ethtool Tx and Rx statistics

The hardware statistics counters are not cleared during resets so the
drivers first access is to initialize the baseline and then subsequent
reads are for reporting the counters. The statistics counters are read
during the watchdog subtask when the interface is up. If the baseline
is not initialized before the interface is up, then there can be a brief
window in which some traffic can be transmitted/received before the
initial baseline reading takes place.

Directly initialize ethtool statistics in driver open so the baseline will
be initialized when the interface is up, and any dropped packets
incremented before the interface is up won't be reported.

Fixes: 28dc1b86 ("ice: ignore dropped packets during init")
Signed-off-by: NPaul Greenwalt <paul.greenwalt@intel.com>
Tested-by: Gurucharan <gurucharanx.g@intel.com> (A Contingent worker at Intel)
Signed-off-by: NTony Nguyen <anthony.l.nguyen@intel.com>
上级 4503cc7f
...@@ -6172,9 +6172,10 @@ static int ice_up_complete(struct ice_vsi *vsi) ...@@ -6172,9 +6172,10 @@ static int ice_up_complete(struct ice_vsi *vsi)
ice_ptp_link_change(pf, pf->hw.pf_id, true); ice_ptp_link_change(pf, pf->hw.pf_id, true);
} }
/* clear this now, and the first stats read will be used as baseline */ /* Perform an initial read of the statistics registers now to
vsi->stat_offsets_loaded = false; * set the baseline so counters are ready when interface is up
*/
ice_update_eth_stats(vsi);
ice_service_task_schedule(pf); ice_service_task_schedule(pf);
return 0; return 0;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册