From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mgamail.intel.com (mgamail.intel.com [192.198.163.13]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id CDD6238C2BE; Mon, 6 Apr 2026 21:30:47 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=192.198.163.13 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1775511049; cv=none; b=IdS/e2vbaRKJU/XR0cLP40kJVXNrXZ3A8hzAKM+GPAXKSUKmhV8j+xEU2Oe0qF1m0YYbUotpEzUq38pg0LWX9Sn9V/p7PZ3VDwQ6oXAdFfnZKF8CnkmGwBCCDNc/0niOdTzn4w/DbuvLc/r7xqJrCwc2E2y0/5asfy/AgIBX1DI= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1775511049; c=relaxed/simple; bh=oiYwxhECjz3AIHcUgobFSs0e+AuAlRnHRi4XWl6bYz0=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=DFb8tf8Zs2totGaIRmgxMUg1l1g6LaApz1PeHk2EhVgEFTDNkP1Nvnjwf0xuNzDq0XpkhEyQDFM4Xrshqe8AGXXdyiMevJNcb6uzpZLSgYwJ0Kw4SG6RBaDdyqtg+xGmYUVwlM+kr8/lOogCSvav57r9n/wqQCrVfIijArtYX+8= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=intel.com; spf=pass smtp.mailfrom=intel.com; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b=OT/ZHl+c; arc=none smtp.client-ip=192.198.163.13 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=intel.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=intel.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b="OT/ZHl+c" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1775511048; x=1807047048; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=oiYwxhECjz3AIHcUgobFSs0e+AuAlRnHRi4XWl6bYz0=; b=OT/ZHl+cw4Mt6zwwhysYL6tZ/LAMYzePe5mqLDR9gOPwkxql4cqGe64+ YoKbWHwMeymxvM0JrMvDFrRzU08E6N5zAfuew+kjwuC8igCZo8s1ELZEo 1S6S5vp9O00u3Lb0KkRByzaZSAC0HLkuAcFBcLN/JgioryBhSU6B9a79M 4+Q/1QX1seZcKy8L8huOw0VuWBouz4lCBYnmtH0Lm0ziZMcb5ityjrPLx Atp6+c+blSHFdl+TwpEFX0juRY4yV/zUf1yMBY3yzL0CkNN8xKyTmo+Gu 8KpshgrpyOxnGaONZ7UScTeFYyJc/Xdc0M6IbgXrS9xvWWJAt72mw2dS+ w==; X-CSE-ConnectionGUID: ZAAe3ZkmTmqccdtYBM092g== X-CSE-MsgGUID: kS7Czz1aSCCSRtu4QYyaCA== X-IronPort-AV: E=McAfee;i="6800,10657,11751"; a="79057433" X-IronPort-AV: E=Sophos;i="6.23,164,1770624000"; d="scan'208";a="79057433" Received: from orviesa007.jf.intel.com ([10.64.159.147]) by fmvoesa107.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 06 Apr 2026 14:30:42 -0700 X-CSE-ConnectionGUID: 59RiAQ1ZS2CkLg09NEkGzQ== X-CSE-MsgGUID: 7psJ9mzjQDyLh8OjTffVeg== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.23,164,1770624000"; d="scan'208";a="228248123" Received: from anguy11-upstream.jf.intel.com ([10.166.9.133]) by orviesa007.jf.intel.com with ESMTP; 06 Apr 2026 14:30:41 -0700 From: Tony Nguyen To: davem@davemloft.net, kuba@kernel.org, pabeni@redhat.com, edumazet@google.com, andrew+netdev@lunn.ch, netdev@vger.kernel.org Cc: Alex Dvoretsky , anthony.l.nguyen@intel.com, kurt@linutronix.de, sriram.yagnaraman@ericsson.com, maciej.fijalkowski@intel.com, magnus.karlsson@intel.com, ast@kernel.org, daniel@iogearbox.net, hawk@kernel.org, john.fastabend@gmail.com, sdf@fomichev.me, bpf@vger.kernel.org, stable@vger.kernel.org, Aleksandr Loktionov , Patryk Holda Subject: [PATCH net 8/9] igb: remove napi_synchronize() in igb_down() Date: Mon, 6 Apr 2026 14:30:35 -0700 Message-ID: <20260406213038.444732-9-anthony.l.nguyen@intel.com> X-Mailer: git-send-email 2.47.1 In-Reply-To: <20260406213038.444732-1-anthony.l.nguyen@intel.com> References: <20260406213038.444732-1-anthony.l.nguyen@intel.com> Precedence: bulk X-Mailing-List: netdev@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit From: Alex Dvoretsky When an AF_XDP zero-copy application terminates abruptly (e.g., kill -9), the XSK buffer pool is destroyed but NAPI polling continues. igb_clean_rx_irq_zc() repeatedly returns the full budget, preventing napi_complete_done() from clearing NAPI_STATE_SCHED. igb_down() calls napi_synchronize() before napi_disable() for each queue vector. napi_synchronize() spins waiting for NAPI_STATE_SCHED to clear, which never happens. igb_down() blocks indefinitely, the TX watchdog fires, and the TX queue remains permanently stalled. napi_disable() already handles this correctly: it sets NAPI_STATE_DISABLE. After a full-budget poll, __napi_poll() checks napi_disable_pending(). If set, it forces completion and clears NAPI_STATE_SCHED, breaking the loop that napi_synchronize() cannot. napi_synchronize() was added in commit 41f149a285da ("igb: Fix possible panic caused by Rx traffic arrival while interface is down"). napi_disable() provides stronger guarantees: it prevents further scheduling and waits for any active poll to exit. Other Intel drivers (ixgbe, ice, i40e) use napi_disable() without a preceding napi_synchronize() in their down paths. Remove redundant napi_synchronize() call and reorder napi_disable() before igb_set_queue_napi() so the queue-to-NAPI mapping is only cleared after polling has fully stopped. Fixes: 2c6196013f84 ("igb: Add AF_XDP zero-copy Rx support") Cc: stable@vger.kernel.org Suggested-by: Maciej Fijalkowski Reviewed-by: Aleksandr Loktionov Signed-off-by: Alex Dvoretsky Reviewed-by: Maciej Fijalkowski Tested-by: Patryk Holda Signed-off-by: Tony Nguyen --- drivers/net/ethernet/intel/igb/igb_main.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/drivers/net/ethernet/intel/igb/igb_main.c b/drivers/net/ethernet/intel/igb/igb_main.c index ee99fd8fd513..ce91dda00ec0 100644 --- a/drivers/net/ethernet/intel/igb/igb_main.c +++ b/drivers/net/ethernet/intel/igb/igb_main.c @@ -2203,9 +2203,8 @@ void igb_down(struct igb_adapter *adapter) for (i = 0; i < adapter->num_q_vectors; i++) { if (adapter->q_vector[i]) { - napi_synchronize(&adapter->q_vector[i]->napi); - igb_set_queue_napi(adapter, i, NULL); napi_disable(&adapter->q_vector[i]->napi); + igb_set_queue_napi(adapter, i, NULL); } } -- 2.47.1