From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=100.103.45.18 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796389045; b=V0JPpD6VWM0d3CK4FTdFd1f14f5B0xL6MZUGCGOPbyB2TP26WxvXVbDGQzIp6VISpH+M Ji3dpgdrv2ZRCS8ogmuvPB2WIEa2W88KFxR9e3DuGuEzuEE6IN2FpiCa5vjfLEveJkoHc 5st1tKJtbOgM9LJPO82QxCAdsHSnllAauebTAHU+y93vwuACE/6+Cq//zBGlt87zXwS5V kSnsZiKrcC81dfkCW+iJSK3dL3Ykd+MyZ6h7rLLGA+U30M02/KzWmz0uLq4/4936JBq48 KbJ9OeqUU1cDLjTIwK/KL2b47p+t4tThLs3UJ9/3mhRAvOubEqJGArKlXCHKNRn+0rg== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796389045; h=Received:DKIM-Signature:From:To:Cc:Subject:Date:Message-ID:X-Mailer: In-Reply-To:References:User-Agent:X-stable:X-Patchwork-Hint: MIME-Version:Content-Transfer-Encoding; bh=ji8Ht8zsWu/mgLo5TeZk+EWQ2oH4LW12K9mD1Y3s+j8=; b=DZqPRl+Eku2IQ+lKRNZG4fBqLTL8psbrW8tZUwRJ7QWpTA8WbVA0RZPsi5EvCDZ3GjAs My/HW0tkjyyfVRjkzqObrtdWA1jhUi7qEgY1sb/Cm51VgG6+5C1vx3+eNrw6LfkSw4tGw SXWmelpR3kla2ilEZB5LgOzgpZ+MEi/MAmVbC1q/BRzwyfRoubb51HMut7kgHTuEtFjqG FgL+JxRCdEP9CXLQrrsenuxTquXFrCd6X/ruQJtnSNYNeyePY8OvkczCuUkQnYw3o8hV1 IeISSkzylMe8jE7SgXrF91zN9qdjc+rYF3pMMsElhSIbPeBtPs4gQJbO+9hteLzzjlw== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass header.d=linuxfoundation.org header.i=@linuxfoundation.org header.a=rsa-sha256 header.s=korg header.b=VOwZKK4s; arc=none smtp.remote-ip=100.103.45.18 Received: from smtp.kernel.org (quasi.space.kernel.org [100.103.45.18]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id C2D82606A322; Fri, 4 Dec 2026 12:57:25 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.a=rsa-sha256 header.s=korg header.b=VOwZKK4s Received: by smtp.kernel.org (Postfix) with ESMTPSA id C6DDF1F0092C; Fri, 4 Dec 2026 12:57:24 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=korg; t=1796389045; bh=ji8Ht8zsWu/mgLo5TeZk+EWQ2oH4LW12K9mD1Y3s+j8=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=VOwZKK4s364t4uvglSELYtSkkN3drTgR4zOzDfZuXTA/5rzU7OmUmUtyTUO74ZW9W 8vkV14O9A4gnUWwZBAUTb4jDVRlN599Hci4EXHtOpj+IjNDqdspCDOBlVUFbsFm9mH oKSHqGQpEcni396Mn8VyHFzqUYkPRwuVP0gCFCwQ= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Jakub Kicinski , Sasha Levin Subject: [PATCH 6.1 0806/1059] ixgbe: use new queue try_stop/try_wake macros Date: Fri, 4 Dec 2026 19:05:37 +0900 Message-ID: <20261204100704.906166366@linuxfoundation.org> X-Mailer: git-send-email 2.56.1 In-Reply-To: <20261204100643.980430235@linuxfoundation.org> References: <20261204100643.980430235@linuxfoundation.org> User-Agent: quilt/0.69 X-stable: review X-Patchwork-Hint: ignore X-Mailing-List: stable@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 6.1-stable review patch. If anyone has any objections, please let me know. ------------------ From: Jakub Kicinski [ Upstream commit 9ded5bc77fe5f396a58da95627695a89a427c962 ] Convert ixgbe to use the new macros, I think a lot of people copy the ixgbe code. The only functional change is that the unlikely() in ixgbe_clean_tx_irq() turns into a likely() inside the new macro and no longer includes total_packets && netif_carrier_ok(tx_ring->netdev) which is probably for the best, anyway. Signed-off-by: Jakub Kicinski Stable-dep-of: 4f8b1a7cf754 ("net: bcm4908_enet: fix the TX ring wrap") Signed-off-by: Sasha Levin --- drivers/net/ethernet/intel/ixgbe/ixgbe_main.c | 38 +++++-------------- 1 file changed, 10 insertions(+), 28 deletions(-) diff --git a/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c b/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c index acff872984d8e..694317bf48141 100644 --- a/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c +++ b/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c @@ -36,6 +36,7 @@ #include #include #include +#include #include #include @@ -1119,6 +1120,7 @@ static bool ixgbe_clean_tx_irq(struct ixgbe_q_vector *q_vector, unsigned int total_bytes = 0, total_packets = 0, total_ipsec = 0; unsigned int budget = q_vector->tx.work_limit; unsigned int i = tx_ring->next_to_clean; + struct netdev_queue *txq; if (test_bit(__IXGBE_DOWN, &adapter->state)) return true; @@ -1253,20 +1255,12 @@ static bool ixgbe_clean_tx_irq(struct ixgbe_q_vector *q_vector, total_packets, total_bytes); #define TX_WAKE_THRESHOLD (DESC_NEEDED * 2) - if (unlikely(total_packets && netif_carrier_ok(tx_ring->netdev) && - (ixgbe_desc_unused(tx_ring) >= TX_WAKE_THRESHOLD))) { - /* Make sure that anybody stopping the queue after this - * sees the new next_to_clean. - */ - smp_mb(); - if (__netif_subqueue_stopped(tx_ring->netdev, - tx_ring->queue_index) - && !test_bit(__IXGBE_DOWN, &adapter->state)) { - netif_wake_subqueue(tx_ring->netdev, - tx_ring->queue_index); - ++tx_ring->tx_stats.restart_queue; - } - } + txq = netdev_get_tx_queue(tx_ring->netdev, tx_ring->queue_index); + if (total_packets && netif_carrier_ok(tx_ring->netdev) && + !__netif_txq_maybe_wake(txq, ixgbe_desc_unused(tx_ring), + TX_WAKE_THRESHOLD, + test_bit(__IXGBE_DOWN, &adapter->state))) + ++tx_ring->tx_stats.restart_queue; return !!budget; } @@ -8271,22 +8265,10 @@ static void ixgbe_tx_olinfo_status(union ixgbe_adv_tx_desc *tx_desc, static int __ixgbe_maybe_stop_tx(struct ixgbe_ring *tx_ring, u16 size) { - netif_stop_subqueue(tx_ring->netdev, tx_ring->queue_index); - - /* Herbert's original patch had: - * smp_mb__after_netif_stop_queue(); - * but since that doesn't exist yet, just open code it. - */ - smp_mb(); - - /* We need to check again in a case another CPU has just - * made room available. - */ - if (likely(ixgbe_desc_unused(tx_ring) < size)) + if (!netif_subqueue_try_stop(tx_ring->netdev, tx_ring->queue_index, + ixgbe_desc_unused(tx_ring), size)) return -EBUSY; - /* A reprieve! - use start_queue because it doesn't call schedule */ - netif_start_subqueue(tx_ring->netdev, tx_ring->queue_index); ++tx_ring->tx_stats.restart_queue; return 0; } -- 2.53.0