Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 16 May 2019 16:05:07 +0000 (UTC)
From:      Hans Petter Selasky <hselasky@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org
Subject:   svn commit: r347743 - stable/12/sys/dev/mlx5/mlx5_en
Message-ID:  <201905161605.x4GG579q058644@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: hselasky
Date: Thu May 16 16:05:07 2019
New Revision: 347743
URL: https://svnweb.freebsd.org/changeset/base/347743

Log:
  MFC r347279:
  Fix netstat counters mapping in mlx5en(4).
  
  The current mapping of driver counters to netstat counters is wrong.
  For example, a single jabber packet, will cause the Ierrs counter to
  count three times.
  
  The work for mapping the hardware and software counters to their right
  place in netstat counters were already done in Linux, take that as is
  to the FreeBSD driver.
  
  Submitted by:	slavash@
  Sponsored by:	Mellanox Technologies

Modified:
  stable/12/sys/dev/mlx5/mlx5_en/mlx5_en_main.c
Directory Properties:
  stable/12/   (props changed)

Modified: stable/12/sys/dev/mlx5/mlx5_en/mlx5_en_main.c
==============================================================================
--- stable/12/sys/dev/mlx5/mlx5_en/mlx5_en_main.c	Thu May 16 16:04:23 2019	(r347742)
+++ stable/12/sys/dev/mlx5/mlx5_en/mlx5_en_main.c	Thu May 16 16:05:07 2019	(r347743)
@@ -637,22 +637,14 @@ mlx5e_update_stats_locked(struct mlx5e_priv *priv)
 #if (__FreeBSD_version < 1100000)
 	/* no get_counters interface in fbsd 10 */
 	ifp->if_ipackets = s->rx_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.in_range_len_errors +
-	    priv->stats.pport.jabbers +
+	ifp->if_ierrors = priv->stats.pport.in_range_len_errors +
 	    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 +
-	    priv->stats.pport.drop_events;
+	    priv->stats.pport.check_seq_err +
+	    priv->stats.pport.alignment_err;
+	ifp->if_iqdrops = s->rx_out_of_buffer;
 	ifp->if_opackets = s->tx_packets;
-	ifp->if_oerrors = s->tx_error_packets;
+	ifp->if_oerrors = priv->stats.port_stats_debug.out_discards;
 	ifp->if_snd.ifq_drops = s->tx_queue_dropped;
 	ifp->if_ibytes = s->rx_bytes;
 	ifp->if_obytes = s->tx_bytes;
@@ -2769,28 +2761,20 @@ mlx5e_get_counter(struct ifnet *ifp, ift_counter cnt)
 		retval = priv->stats.vport.rx_packets;
 		break;
 	case IFCOUNTER_IERRORS:
-		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.in_range_len_errors +
-		    priv->stats.pport.jabbers +
+		retval = priv->stats.pport.in_range_len_errors +
 		    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;
+		    priv->stats.pport.check_seq_err +
+		    priv->stats.pport.alignment_err;
 		break;
 	case IFCOUNTER_IQDROPS:
-		retval = priv->stats.vport.rx_out_of_buffer +
-		    priv->stats.pport.drop_events;
+		retval = priv->stats.vport.rx_out_of_buffer;
 		break;
 	case IFCOUNTER_OPACKETS:
 		retval = priv->stats.vport.tx_packets;
 		break;
 	case IFCOUNTER_OERRORS:
-		retval = priv->stats.vport.tx_error_packets;
+		retval = priv->stats.port_stats_debug.out_discards;
 		break;
 	case IFCOUNTER_IBYTES:
 		retval = priv->stats.vport.rx_bytes;



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201905161605.x4GG579q058644>