mirror of
				git://git.openwrt.org/openwrt/openwrt.git
				synced 2025-11-04 06:54:27 -05:00 
			
		
		
		
	Deleted (upstreamed): ath79/patches-5.10/921-serial-core-add-support-for-boot-console-with-arbitr.patch [1] bcm53xx/patches-5.10/033-v5.15-0012-ARM-dts-BCM5301X-Fix-memory-nodes-names.patch [2] lantiq/patches-5.10/0016-mtd-rawnand-xway-Keep-the-driver-compatible-with-on-.patch [3] lantiq/patches-5.10/0110-MIPS-lantiq-dma-add-small-delay-after-reset.patch [4] lantiq/patches-5.10/0111-MIPS-lantiq-dma-reset-correct-number-of-channel.patch [5] lantiq/patches-5.10/0112-MIPS-lantiq-dma-fix-burst-length-for-DEU.patch [6] Manually rebased: ipq806x/patches-5.10/0065-arm-override-compiler-flags.patch [1] https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?h=v5.10.80&id=47462c5e600fbaffd755cd13dedd80d04e41ff83 [2] https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?h=v5.10.80&id=2fde76df1885a6bec04317e457121326070450eb [3] https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?h=v5.10.80&id=9b366f5221d8aa64b22f35be137a5749326444ce [4] https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?h=v5.10.80&id=5af57ce8a6155fe3e4270d28d171abf8903bebc0 [5] https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?h=v5.10.80&id=b92a5df2c7adc79a57481445f67de0c1c716581f [6] https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?h=v5.10.80&id=6b72caabc47011d03f44064452b2c65e8ed18326 Signed-off-by: Rui Salvaterra <rsalvaterra@gmail.com>
		
			
				
	
	
		
			54 lines
		
	
	
		
			2.0 KiB
		
	
	
	
		
			Diff
		
	
	
	
	
	
			
		
		
	
	
			54 lines
		
	
	
		
			2.0 KiB
		
	
	
	
		
			Diff
		
	
	
	
	
	
From: Paolo Abeni <pabeni@redhat.com>
 | 
						|
Date: Fri, 9 Apr 2021 17:24:17 +0200
 | 
						|
Subject: [PATCH] net: fix hangup on napi_disable for threaded napi
 | 
						|
 | 
						|
napi_disable() is subject to an hangup, when the threaded
 | 
						|
mode is enabled and the napi is under heavy traffic.
 | 
						|
 | 
						|
If the relevant napi has been scheduled and the napi_disable()
 | 
						|
kicks in before the next napi_threaded_wait() completes - so
 | 
						|
that the latter quits due to the napi_disable_pending() condition,
 | 
						|
the existing code leaves the NAPI_STATE_SCHED bit set and the
 | 
						|
napi_disable() loop waiting for such bit will hang.
 | 
						|
 | 
						|
This patch addresses the issue by dropping the NAPI_STATE_DISABLE
 | 
						|
bit test in napi_thread_wait(). The later napi_threaded_poll()
 | 
						|
iteration will take care of clearing the NAPI_STATE_SCHED.
 | 
						|
 | 
						|
This also addresses a related problem reported by Jakub:
 | 
						|
before this patch a napi_disable()/napi_enable() pair killed
 | 
						|
the napi thread, effectively disabling the threaded mode.
 | 
						|
On the patched kernel napi_disable() simply stops scheduling
 | 
						|
the relevant thread.
 | 
						|
 | 
						|
v1 -> v2:
 | 
						|
  - let the main napi_thread_poll() loop clear the SCHED bit
 | 
						|
 | 
						|
Reported-by: Jakub Kicinski <kuba@kernel.org>
 | 
						|
Fixes: 29863d41bb6e ("net: implement threaded-able napi poll loop support")
 | 
						|
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
 | 
						|
Reviewed-by: Eric Dumazet <edumazet@google.com>
 | 
						|
Link: https://lore.kernel.org/r/883923fa22745a9589e8610962b7dc59df09fb1f.1617981844.git.pabeni@redhat.com
 | 
						|
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
 | 
						|
---
 | 
						|
 | 
						|
--- a/net/core/dev.c
 | 
						|
+++ b/net/core/dev.c
 | 
						|
@@ -7000,7 +7000,7 @@ static int napi_thread_wait(struct napi_
 | 
						|
 
 | 
						|
 	set_current_state(TASK_INTERRUPTIBLE);
 | 
						|
 
 | 
						|
-	while (!kthread_should_stop() && !napi_disable_pending(napi)) {
 | 
						|
+	while (!kthread_should_stop()) {
 | 
						|
 		/* Testing SCHED_THREADED bit here to make sure the current
 | 
						|
 		 * kthread owns this napi and could poll on this napi.
 | 
						|
 		 * Testing SCHED bit is not enough because SCHED bit might be
 | 
						|
@@ -7018,6 +7018,7 @@ static int napi_thread_wait(struct napi_
 | 
						|
 		set_current_state(TASK_INTERRUPTIBLE);
 | 
						|
 	}
 | 
						|
 	__set_current_state(TASK_RUNNING);
 | 
						|
+
 | 
						|
 	return -1;
 | 
						|
 }
 | 
						|
 
 |