Improve sysadmin visibility of physical port error counters in the
mlx5en driver. MFC after: 1 week Sponsored by: Mellanox Technologies
This commit is contained in:
parent
2f88ac47eb
commit
18ee93d3bc
@ -542,19 +542,33 @@ mlx5e_update_stats_work(struct work_struct *work)
|
|||||||
s->tx_csum_offload = s->tx_packets - tx_offload_none;
|
s->tx_csum_offload = s->tx_packets - tx_offload_none;
|
||||||
s->rx_csum_good = s->rx_packets - s->rx_csum_none;
|
s->rx_csum_good = s->rx_packets - s->rx_csum_none;
|
||||||
|
|
||||||
/* Update per port counters */
|
/* Get physical port counters */
|
||||||
mlx5e_update_pport_counters(priv);
|
mlx5e_update_pport_counters(priv);
|
||||||
|
|
||||||
#if (__FreeBSD_version < 1100000)
|
#if (__FreeBSD_version < 1100000)
|
||||||
/* no get_counters interface in fbsd 10 */
|
/* no get_counters interface in fbsd 10 */
|
||||||
ifp->if_ipackets = s->rx_packets;
|
ifp->if_ipackets = s->rx_packets;
|
||||||
ifp->if_ierrors = s->rx_error_packets;
|
ifp->if_ierrors = s->rx_error_packets +
|
||||||
|
priv->stats.pport.alignment_err +
|
||||||
|
priv->stats.pport.check_seq_err +
|
||||||
|
priv->stats.pport.crc_align_errors +
|
||||||
|
priv->stats.pport.drop_events +
|
||||||
|
priv->stats.pport.in_range_len_errors +
|
||||||
|
priv->stats.pport.jabbers +
|
||||||
|
priv->stats.pport.out_of_range_len +
|
||||||
|
priv->stats.pport.oversize_pkts +
|
||||||
|
priv->stats.pport.symbol_err +
|
||||||
|
priv->stats.pport.too_long_errors +
|
||||||
|
priv->stats.pport.undersize_pkts +
|
||||||
|
priv->stats.pport.unsupported_op_rx;
|
||||||
ifp->if_iqdrops = s->rx_out_of_buffer;
|
ifp->if_iqdrops = s->rx_out_of_buffer;
|
||||||
ifp->if_opackets = s->tx_packets;
|
ifp->if_opackets = s->tx_packets;
|
||||||
ifp->if_oerrors = s->tx_error_packets;
|
ifp->if_oerrors = s->tx_error_packets;
|
||||||
ifp->if_snd.ifq_drops = s->tx_queue_dropped;
|
ifp->if_snd.ifq_drops = s->tx_queue_dropped;
|
||||||
ifp->if_ibytes = s->rx_bytes;
|
ifp->if_ibytes = s->rx_bytes;
|
||||||
ifp->if_obytes = s->tx_bytes;
|
ifp->if_obytes = s->tx_bytes;
|
||||||
|
ifp->if_collisions =
|
||||||
|
priv->stats.pport.collisions;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
free_out:
|
free_out:
|
||||||
@ -2449,7 +2463,19 @@ mlx5e_get_counter(struct ifnet *ifp, ift_counter cnt)
|
|||||||
retval = priv->stats.vport.rx_packets;
|
retval = priv->stats.vport.rx_packets;
|
||||||
break;
|
break;
|
||||||
case IFCOUNTER_IERRORS:
|
case IFCOUNTER_IERRORS:
|
||||||
retval = priv->stats.vport.rx_error_packets;
|
retval = priv->stats.vport.rx_error_packets +
|
||||||
|
priv->stats.pport.alignment_err +
|
||||||
|
priv->stats.pport.check_seq_err +
|
||||||
|
priv->stats.pport.crc_align_errors +
|
||||||
|
priv->stats.pport.drop_events +
|
||||||
|
priv->stats.pport.in_range_len_errors +
|
||||||
|
priv->stats.pport.jabbers +
|
||||||
|
priv->stats.pport.out_of_range_len +
|
||||||
|
priv->stats.pport.oversize_pkts +
|
||||||
|
priv->stats.pport.symbol_err +
|
||||||
|
priv->stats.pport.too_long_errors +
|
||||||
|
priv->stats.pport.undersize_pkts +
|
||||||
|
priv->stats.pport.unsupported_op_rx;
|
||||||
break;
|
break;
|
||||||
case IFCOUNTER_IQDROPS:
|
case IFCOUNTER_IQDROPS:
|
||||||
retval = priv->stats.vport.rx_out_of_buffer;
|
retval = priv->stats.vport.rx_out_of_buffer;
|
||||||
@ -2475,6 +2501,9 @@ mlx5e_get_counter(struct ifnet *ifp, ift_counter cnt)
|
|||||||
case IFCOUNTER_OQDROPS:
|
case IFCOUNTER_OQDROPS:
|
||||||
retval = priv->stats.vport.tx_queue_dropped;
|
retval = priv->stats.vport.tx_queue_dropped;
|
||||||
break;
|
break;
|
||||||
|
case IFCOUNTER_COLLISIONS:
|
||||||
|
retval = priv->stats.pport.collisions;
|
||||||
|
break;
|
||||||
default:
|
default:
|
||||||
retval = if_get_counter_default(ifp, cnt);
|
retval = if_get_counter_default(ifp, cnt);
|
||||||
break;
|
break;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user