Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 28 Oct 2016 12:36:59 +0000 (UTC)
From:      Hans Petter Selasky <hselasky@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r308031 - head/sys/dev/mlx4/mlx4_en
Message-ID:  <201610281236.u9SCaxiv027814@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: hselasky
Date: Fri Oct 28 12:36:59 2016
New Revision: 308031
URL: https://svnweb.freebsd.org/changeset/base/308031

Log:
  Fix indentation and remove duplicate queue stopped stats increment.
  
  Found by:	Ryan Stone <rysto32@gmail.com>
  Sponsored by:	Mellanox Technologies
  MFC after:	1 week

Modified:
  head/sys/dev/mlx4/mlx4_en/mlx4_en_tx.c

Modified: head/sys/dev/mlx4/mlx4_en/mlx4_en_tx.c
==============================================================================
--- head/sys/dev/mlx4/mlx4_en/mlx4_en_tx.c	Fri Oct 28 12:27:05 2016	(r308030)
+++ head/sys/dev/mlx4/mlx4_en/mlx4_en_tx.c	Fri Oct 28 12:36:59 2016	(r308031)
@@ -707,20 +707,19 @@ static int mlx4_en_xmit(struct mlx4_en_p
 
 	/* check if TX ring is full */
 	if (unlikely(mlx4_en_tx_ring_is_full(ring))) {
-			/* every full native Tx ring stops queue */
-			if (ring->blocked == 0)
-				atomic_add_int(&priv->blocked, 1);
-			/* Set HW-queue-is-full flag */
-			atomic_set_int(&ifp->if_drv_flags, IFF_DRV_OACTIVE);
-			priv->port_stats.queue_stopped++;
-		ring->blocked = 1;
+		/* every full native Tx ring stops queue */
+		if (ring->blocked == 0)
+			atomic_add_int(&priv->blocked, 1);
+		/* Set HW-queue-is-full flag */
+		atomic_set_int(&ifp->if_drv_flags, IFF_DRV_OACTIVE);
 		priv->port_stats.queue_stopped++;
+		ring->blocked = 1;
 		ring->queue_stopped++;
 
 		/* Use interrupts to find out when queue opened */
 		mlx4_en_arm_cq(priv, priv->tx_cq[tx_ind]);
 		return (ENOBUFS);
-        }
+	}
 
 	/* sanity check we are not wrapping around */
 	KASSERT(((~ring->prod) & ring->size_mask) >=



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