aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/ethernet/intel/ice/ice_dcb_lib.c
diff options
context:
space:
mode:
authorAnirudh Venkataramanan <anirudh.venkataramanan@intel.com>2019-02-28 18:24:29 -0500
committerJeff Kirsher <jeffrey.t.kirsher@intel.com>2019-04-18 11:38:47 -0400
commit4b0fdceb81ba60a8caea1993f0951a91de7a6f52 (patch)
tree53ef636dbae04e68f02390dbbad4cadc954f16ee /drivers/net/ethernet/intel/ice/ice_dcb_lib.c
parent5f6aa50e4ece6b9464130d819a2caa75c783c603 (diff)
ice: Add code to get DCB related statistics
This patch adds a new function ice_update_dcb_stats to get DCB stats from the hardware and ethtool support for displaying these stats. Signed-off-by: Anirudh Venkataramanan <anirudh.venkataramanan@intel.com> Tested-by: Andrew Bowers <andrewx.bowers@intel.com> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Diffstat (limited to 'drivers/net/ethernet/intel/ice/ice_dcb_lib.c')
-rw-r--r--drivers/net/ethernet/intel/ice/ice_dcb_lib.c38
1 files changed, 38 insertions, 0 deletions
diff --git a/drivers/net/ethernet/intel/ice/ice_dcb_lib.c b/drivers/net/ethernet/intel/ice/ice_dcb_lib.c
index de1e33db761a..51f90696de56 100644
--- a/drivers/net/ethernet/intel/ice/ice_dcb_lib.c
+++ b/drivers/net/ethernet/intel/ice/ice_dcb_lib.c
@@ -360,6 +360,44 @@ dcb_init_err:
360} 360}
361 361
362/** 362/**
363 * ice_update_dcb_stats - Update DCB stats counters
364 * @pf: PF whose stats needs to be updated
365 */
366void ice_update_dcb_stats(struct ice_pf *pf)
367{
368 struct ice_hw_port_stats *prev_ps, *cur_ps;
369 struct ice_hw *hw = &pf->hw;
370 u8 pf_id = hw->pf_id;
371 int i;
372
373 prev_ps = &pf->stats_prev;
374 cur_ps = &pf->stats;
375
376 for (i = 0; i < 8; i++) {
377 ice_stat_update32(hw, GLPRT_PXOFFRXC(pf_id, i),
378 pf->stat_prev_loaded,
379 &prev_ps->priority_xoff_rx[i],
380 &cur_ps->priority_xoff_rx[i]);
381 ice_stat_update32(hw, GLPRT_PXONRXC(pf_id, i),
382 pf->stat_prev_loaded,
383 &prev_ps->priority_xon_rx[i],
384 &cur_ps->priority_xon_rx[i]);
385 ice_stat_update32(hw, GLPRT_PXONTXC(pf_id, i),
386 pf->stat_prev_loaded,
387 &prev_ps->priority_xon_tx[i],
388 &cur_ps->priority_xon_tx[i]);
389 ice_stat_update32(hw, GLPRT_PXOFFTXC(pf_id, i),
390 pf->stat_prev_loaded,
391 &prev_ps->priority_xoff_tx[i],
392 &cur_ps->priority_xoff_tx[i]);
393 ice_stat_update32(hw, GLPRT_RXON2OFFCNT(pf_id, i),
394 pf->stat_prev_loaded,
395 &prev_ps->priority_xon_2_xoff[i],
396 &cur_ps->priority_xon_2_xoff[i]);
397 }
398}
399
400/**
363 * ice_tx_prepare_vlan_flags_dcb - prepare VLAN tagging for DCB 401 * ice_tx_prepare_vlan_flags_dcb - prepare VLAN tagging for DCB
364 * @tx_ring: ring to send buffer on 402 * @tx_ring: ring to send buffer on
365 * @first: pointer to struct ice_tx_buf 403 * @first: pointer to struct ice_tx_buf