svn commit: r205948 - head/sys/dev/cxgb

Navdeep Parhar np at FreeBSD.org
Wed Mar 31 00:26:03 UTC 2010


Author: np
Date: Wed Mar 31 00:26:02 2010
New Revision: 205948
URL: http://svn.freebsd.org/changeset/base/205948

Log:
  Fix tx drop statistics.
  
  MFC after:	3 days

Modified:
  head/sys/dev/cxgb/cxgb_adapter.h
  head/sys/dev/cxgb/cxgb_main.c
  head/sys/dev/cxgb/cxgb_sge.c

Modified: head/sys/dev/cxgb/cxgb_adapter.h
==============================================================================
--- head/sys/dev/cxgb/cxgb_adapter.h	Wed Mar 31 00:24:44 2010	(r205947)
+++ head/sys/dev/cxgb/cxgb_adapter.h	Wed Mar 31 00:26:02 2010	(r205948)
@@ -248,7 +248,6 @@ struct sge_txq {
 	struct callout	txq_timer;
 	struct callout	txq_watchdog;
 	uint64_t        txq_coalesced;
-	uint32_t        txq_drops;
 	uint32_t        txq_skipped;
 	uint32_t        txq_enqueued;
 	uint32_t	txq_dump_start;

Modified: head/sys/dev/cxgb/cxgb_main.c
==============================================================================
--- head/sys/dev/cxgb/cxgb_main.c	Wed Mar 31 00:24:44 2010	(r205947)
+++ head/sys/dev/cxgb/cxgb_main.c	Wed Mar 31 00:26:02 2010	(r205948)
@@ -2423,6 +2423,7 @@ cxgb_tick_handler(void *arg, int count)
 		struct ifnet *ifp = pi->ifp;
 		struct cmac *mac = &pi->mac;
 		struct mac_stats *mstats = &mac->stats;
+		int drops, j;
 
 		if (!isset(&sc->open_device_map, pi->port_id))
 			continue;
@@ -2431,34 +2432,20 @@ cxgb_tick_handler(void *arg, int count)
 		t3_mac_update_stats(mac);
 		PORT_UNLOCK(pi);
 
-		ifp->if_opackets =
-		    mstats->tx_frames_64 +
-		    mstats->tx_frames_65_127 +
-		    mstats->tx_frames_128_255 +
-		    mstats->tx_frames_256_511 +
-		    mstats->tx_frames_512_1023 +
-		    mstats->tx_frames_1024_1518 +
-		    mstats->tx_frames_1519_max;
-		
-		ifp->if_ipackets =
-		    mstats->rx_frames_64 +
-		    mstats->rx_frames_65_127 +
-		    mstats->rx_frames_128_255 +
-		    mstats->rx_frames_256_511 +
-		    mstats->rx_frames_512_1023 +
-		    mstats->rx_frames_1024_1518 +
-		    mstats->rx_frames_1519_max;
-
+		ifp->if_opackets = mstats->tx_frames;
+		ifp->if_ipackets = mstats->rx_frames;
 		ifp->if_obytes = mstats->tx_octets;
 		ifp->if_ibytes = mstats->rx_octets;
 		ifp->if_omcasts = mstats->tx_mcast_frames;
 		ifp->if_imcasts = mstats->rx_mcast_frames;
-		
-		ifp->if_collisions =
-		    mstats->tx_total_collisions;
-
+		ifp->if_collisions = mstats->tx_total_collisions;
 		ifp->if_iqdrops = mstats->rx_cong_drops;
-		
+
+		drops = 0;
+		for (j = pi->first_qset; j < pi->first_qset + pi->nqsets; j++)
+			drops += sc->sge.qs[j].txq[TXQ_ETH].txq_mr->br_drops;
+		ifp->if_snd.ifq_drops = drops;
+
 		ifp->if_oerrors =
 		    mstats->tx_excess_collisions +
 		    mstats->tx_underrun +

Modified: head/sys/dev/cxgb/cxgb_sge.c
==============================================================================
--- head/sys/dev/cxgb/cxgb_sge.c	Wed Mar 31 00:24:44 2010	(r205947)
+++ head/sys/dev/cxgb/cxgb_sge.c	Wed Mar 31 00:26:02 2010	(r205948)
@@ -3599,10 +3599,9 @@ t3_add_configured_sysctls(adapter_t *sc)
 			    CTLTYPE_STRING | CTLFLAG_RD, &qs->rspq,
 			    0, t3_dump_rspq, "A", "dump of the response queue");
 
-
-			SYSCTL_ADD_INT(ctx, txqpoidlist, OID_AUTO, "dropped",
-			    CTLFLAG_RD, &qs->txq[TXQ_ETH].txq_drops,
-			    0, "#tunneled packets dropped");
+			SYSCTL_ADD_QUAD(ctx, txqpoidlist, OID_AUTO, "dropped",
+			    CTLFLAG_RD, &qs->txq[TXQ_ETH].txq_mr->br_drops,
+			    "#tunneled packets dropped");
 			SYSCTL_ADD_INT(ctx, txqpoidlist, OID_AUTO, "sendqlen",
 			    CTLFLAG_RD, &qs->txq[TXQ_ETH].sendq.qlen,
 			    0, "#tunneled packets waiting to be sent");


More information about the svn-src-all mailing list