From b61d473a52f8a8f04ec6759aacec78fb059cd5e4 Mon Sep 17 00:00:00 2001 From: hselasky Date: Mon, 7 Nov 2016 08:24:29 +0000 Subject: [PATCH] MFC r308031: Fix indentation and remove duplicate queue stopped stats increment. Found by: Ryan Stone Sponsored by: Mellanox Technologies git-svn-id: svn://svn.freebsd.org/base/stable/10@308399 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f --- sys/ofed/drivers/net/mlx4/en_tx.c | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/sys/ofed/drivers/net/mlx4/en_tx.c b/sys/ofed/drivers/net/mlx4/en_tx.c index e9526c4c5..55c636358 100644 --- a/sys/ofed/drivers/net/mlx4/en_tx.c +++ b/sys/ofed/drivers/net/mlx4/en_tx.c @@ -702,20 +702,19 @@ static int mlx4_en_xmit(struct mlx4_en_priv *priv, int tx_ind, struct mbuf **mbp /* 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) >= -- 2.45.0