From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from smtp1.osuosl.org (smtp1.osuosl.org [140.211.166.138]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 554E3EE14C3 for ; Thu, 7 Sep 2023 00:30:37 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by smtp1.osuosl.org (Postfix) with ESMTP id EB8D882205; Thu, 7 Sep 2023 00:30:36 +0000 (UTC) DKIM-Filter: OpenDKIM Filter v2.11.0 smtp1.osuosl.org EB8D882205 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=osuosl.org; s=default; t=1694046637; bh=STwziiJznueefJXamaQIgVd/MW2DoYAS5R9sgmpmTQ0=; h=From:To:Date:Subject:List-Id:List-Unsubscribe:List-Archive: List-Post:List-Help:List-Subscribe:Cc:From; b=qNEegOiZoj+0LWAGQsK92QZ11KDlv0w4rg4qL+FLFegLPqH6n4Sq1uvRdWcGJs2r+ xWeaO68/5CQT3Lc6EZfrCOfmwtTPhpHAydySB1orvADb43c+iISFKpQtr1Onz2regJ WBNKzk0JmP/EptFlJR2d3L9XRgGWb+jkfPcQrtNjD4Ji85JZyUgdgDkJLj/g+8wBWw h7a34Bv/s4tc4uHmdd7+zawo6AJ8BetmaBL3YEfZXqWa2ONBdu/0EDUCR8dboa2xmS iJNWOl13wX2x184ZNhaYMraZL9JI0iLjzUoJ7FtDfT+LRwBJYFMkEdbr4pP47zuNcv /GunzC5RfXRmg== X-Virus-Scanned: amavisd-new at osuosl.org Received: from smtp1.osuosl.org ([127.0.0.1]) by localhost (smtp1.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id Gts40psEzb5k; Thu, 7 Sep 2023 00:30:36 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by smtp1.osuosl.org (Postfix) with ESMTP id 0292582233; Thu, 7 Sep 2023 00:30:36 +0000 (UTC) DKIM-Filter: OpenDKIM Filter v2.11.0 smtp1.osuosl.org 0292582233 Received: from smtp4.osuosl.org (smtp4.osuosl.org [140.211.166.137]) by ash.osuosl.org (Postfix) with ESMTP id 370711BF983 for ; Thu, 7 Sep 2023 00:30:34 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by smtp4.osuosl.org (Postfix) with ESMTP id 0D031417B9 for ; Thu, 7 Sep 2023 00:30:34 +0000 (UTC) DKIM-Filter: OpenDKIM Filter v2.11.0 smtp4.osuosl.org 0D031417B9 X-Virus-Scanned: amavisd-new at osuosl.org Received: from smtp4.osuosl.org ([127.0.0.1]) by localhost (smtp4.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id WiqfTJg-WyLJ for ; Thu, 7 Sep 2023 00:30:32 +0000 (UTC) Received: from mgamail.intel.com (mgamail.intel.com [134.134.136.20]) by smtp4.osuosl.org (Postfix) with ESMTPS id 8F08A417AD for ; Thu, 7 Sep 2023 00:30:32 +0000 (UTC) DKIM-Filter: OpenDKIM Filter v2.11.0 smtp4.osuosl.org 8F08A417AD X-IronPort-AV: E=McAfee;i="6600,9927,10825"; a="367443780" X-IronPort-AV: E=Sophos;i="6.02,233,1688454000"; d="scan'208";a="367443780" Received: from orsmga003.jf.intel.com ([10.7.209.27]) by orsmga101.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 06 Sep 2023 17:30:23 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10825"; a="691539433" X-IronPort-AV: E=Sophos;i="6.02,233,1688454000"; d="scan'208";a="691539433" Received: from mcewe-mobl1.amr.corp.intel.com (HELO vcostago-mobl3.intel.com) ([10.251.10.12]) by orsmga003-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 06 Sep 2023 17:30:22 -0700 From: Vinicius Costa Gomes To: intel-wired-lan@lists.osuosl.org Date: Wed, 6 Sep 2023 17:30:05 -0700 Message-ID: <20230907003005.99481-1-vinicius.gomes@intel.com> X-Mailer: git-send-email 2.41.0 MIME-Version: 1.0 X-Mailman-Original-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1694046632; x=1725582632; h=from:to:cc:subject:date:message-id:mime-version: content-transfer-encoding; bh=ZBbr3uJJ8GvXoyhicrV/I194s5KUyoTJx2VEg0uWzZc=; b=aDcVaGRRjiscKQzdE2aViT9dTUIfoAfodI9nfZ2JpAA+QS2yBi11cdQX vPLsobRJHy8J5XZ3LV3wOFXP7IFW3WwVXS7OXpqHPHXO5VKC5AWrx+uEk nwOMClzfLrnQkI9RPkiJs8PUJEqxHh7JPtao+B6MM5kcFwTaDspz8HODG jMiQ05KJao3zGYrEAxiZ/8ruoLmH+ErUIEkV2NwnRmxLAE8LxiBEnbMqV TRBY5RjymjeJaWbHwgZgWlWL83yWQjeI6gPrj6Y2JuDXGfcXBjIU6g0cy uHPpE4SXx7q0jKFH9jA4EPQpmK+ltInO/iasF2EL2iKT0LTQUPt7zLgIF Q==; X-Mailman-Original-Authentication-Results: smtp4.osuosl.org; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.a=rsa-sha256 header.s=Intel header.b=aDcVaGRR Subject: [Intel-wired-lan] [PATCH iwl-net v2] igc: Fix infinite initialization loop with early XDP redirect X-BeenThere: intel-wired-lan@osuosl.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Intel Wired Ethernet Linux Kernel Driver Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Andre Guedes , netdev@vger.kernel.org, Jesse Brandeburg , Jithu Joseph , linux-kernel@vger.kernel.org, Ferenc Fejes , Eric Dumazet , Tony Nguyen , Jakub Kicinski , Paolo Abeni , "David S. Miller" , Vedang Patel Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: intel-wired-lan-bounces@osuosl.org Sender: "Intel-wired-lan" When a XDP redirect happens before the link is ready, that transmission will not finish and will timeout, causing an adapter reset. If the redirects do not stop, the adapter will not stop resetting. Wait for the driver to signal that there's a carrier before allowing transmissions to proceed. Previous code was relying that when __IGC_DOWN is cleared, the NIC is ready to transmit as all the queues are ready, what happens is that the carrier presence will only be signaled later, after the watchdog workqueue has a chance to run. And during this interval (between clearing __IGC_DOWN and the watchdog running) if any transmission happens the timeout is emitted (detected by igc_tx_timeout()) which causes the reset, with the potential for the inifite loop. Fixes: 4ff320361092 ("igc: Add support for XDP_REDIRECT action") Reported-by: Ferenc Fejes Closes: https://lore.kernel.org/netdev/0caf33cf6adb3a5bf137eeaa20e89b167c9986d5.camel@ericsson.com/ Signed-off-by: Vinicius Costa Gomes Tested-by: Ferenc Fejes Reviewed-by: Maciej Fijalkowski --- v1 -> v2: - Added more information to the commit message (Maciej Fijalkowski) drivers/net/ethernet/intel/igc/igc_main.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/net/ethernet/intel/igc/igc_main.c b/drivers/net/ethernet/intel/igc/igc_main.c index 293b45717683..98de34d0ce07 100644 --- a/drivers/net/ethernet/intel/igc/igc_main.c +++ b/drivers/net/ethernet/intel/igc/igc_main.c @@ -6491,7 +6491,7 @@ static int igc_xdp_xmit(struct net_device *dev, int num_frames, struct igc_ring *ring; int i, drops; - if (unlikely(test_bit(__IGC_DOWN, &adapter->state))) + if (unlikely(!netif_carrier_ok(dev))) return -ENETDOWN; if (unlikely(flags & ~XDP_XMIT_FLAGS_MASK)) -- 2.41.0 _______________________________________________ Intel-wired-lan mailing list Intel-wired-lan@osuosl.org https://lists.osuosl.org/mailman/listinfo/intel-wired-lan