Re: [PATCH] virtio-net: disable delayed refill when pausing rx

2025-04-10 Thread Bui Quang Minh
On 4/8/25 21:37, Jakub Kicinski wrote: On Tue, 8 Apr 2025 11:28:54 +0200 Paolo Abeni wrote: When napi_disable is called on an already disabled napi, it will sleep in napi_disable_locked while still holding the netdev_lock. As a result, later napi_enable gets stuck too as it cannot acquire the ne

Re: [PATCH] virtio-net: disable delayed refill when pausing rx

2025-04-10 Thread Bui Quang Minh
On 4/9/25 13:44, Bui Quang Minh wrote: On 4/8/25 14:34, Jason Wang wrote: On Mon, Apr 7, 2025 at 10:27 AM Bui Quang Minh wrote: On 4/7/25 08:03, Xuan Zhuo wrote: On Fri,  4 Apr 2025 16:39:03 +0700, Bui Quang Minh wrote: When pausing rx (e.g. set up xdp, xsk pool, rx resize), we call napi_di

Re: [PATCH] virtio-net: disable delayed refill when pausing rx

2025-04-08 Thread Bui Quang Minh
On 4/8/25 14:34, Jason Wang wrote: On Mon, Apr 7, 2025 at 10:27 AM Bui Quang Minh wrote: On 4/7/25 08:03, Xuan Zhuo wrote: On Fri, 4 Apr 2025 16:39:03 +0700, Bui Quang Minh wrote: When pausing rx (e.g. set up xdp, xsk pool, rx resize), we call napi_disable() on the receive queue's napi. In

Re: [PATCH] virtio-net: disable delayed refill when pausing rx

2025-04-08 Thread Jakub Kicinski
On Tue, 8 Apr 2025 11:28:54 +0200 Paolo Abeni wrote: > >> When napi_disable is called on an already disabled napi, it will sleep > >> in napi_disable_locked while still holding the netdev_lock. As a result, > >> later napi_enable gets stuck too as it cannot acquire the netdev_lock. > >> This leads

Re: [PATCH] virtio-net: disable delayed refill when pausing rx

2025-04-08 Thread Paolo Abeni
On 4/8/25 9:34 AM, Jason Wang wrote: > On Mon, Apr 7, 2025 at 10:27 AM Bui Quang Minh > wrote: >> On 4/7/25 08:03, Xuan Zhuo wrote: >>> On Fri, 4 Apr 2025 16:39:03 +0700, Bui Quang Minh >>> wrote: When pausing rx (e.g. set up xdp, xsk pool, rx resize), we call napi_disable() on the r

Re: [PATCH] virtio-net: disable delayed refill when pausing rx

2025-04-08 Thread Jason Wang
On Mon, Apr 7, 2025 at 10:27 AM Bui Quang Minh wrote: > > On 4/7/25 08:03, Xuan Zhuo wrote: > > On Fri, 4 Apr 2025 16:39:03 +0700, Bui Quang Minh > > wrote: > >> When pausing rx (e.g. set up xdp, xsk pool, rx resize), we call > >> napi_disable() on the receive queue's napi. In delayed refill_wo

Re: [PATCH] virtio-net: disable delayed refill when pausing rx

2025-04-06 Thread Bui Quang Minh
On 4/7/25 08:03, Xuan Zhuo wrote: On Fri, 4 Apr 2025 16:39:03 +0700, Bui Quang Minh wrote: When pausing rx (e.g. set up xdp, xsk pool, rx resize), we call napi_disable() on the receive queue's napi. In delayed refill_work, it also calls napi_disable() on the receive queue's napi. This can lea

Re: [PATCH] virtio-net: disable delayed refill when pausing rx

2025-04-06 Thread Xuan Zhuo
On Fri, 4 Apr 2025 16:39:03 +0700, Bui Quang Minh wrote: > When pausing rx (e.g. set up xdp, xsk pool, rx resize), we call > napi_disable() on the receive queue's napi. In delayed refill_work, it > also calls napi_disable() on the receive queue's napi. This can leads to > deadlock when napi_disa

[PATCH] virtio-net: disable delayed refill when pausing rx

2025-04-04 Thread Bui Quang Minh
When pausing rx (e.g. set up xdp, xsk pool, rx resize), we call napi_disable() on the receive queue's napi. In delayed refill_work, it also calls napi_disable() on the receive queue's napi. This can leads to deadlock when napi_disable() is called on an already disabled napi. This scenario can be re