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=1796127464; b=2tsTiCK2jWVFDqhVdIe5OpOFFbk5kqRi2pSdCthWrOnVYjob0AtPF+TLX8u9AZXQGEO8 qjEAKNAEwKr2+nTFG9GMqGxoPItBbqkUqdA20uico//uopxWVl3lCtrzpnaYiTbjoWOwQ ra6GunL7pHuxFga5NaxlKv/fi6wb0M4uf5rWkjIyRvNQeFLDERuSpcRrz/0P5w2vUUASV 3eNXzEScEc3tdO3tUm/OoJFRVUoy3i1yDVVrD4tF0cw3w1o9CzusxN2thEFgp5VRTDw8m 53uj+EJek6nkbyMnOzuIWXBDqVV9wsNq8xHy+V4O49SGx7CT6HVKJo7Z4sKqWmboCxg== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796127464; h=Received:DKIM-Signature:Subject:From:To:Cc:Date:Message-ID: In-Reply-To:References:X-sashiko-severity:Content-Type: Content-Transfer-Encoding:MIME-Version; bh=c7KPueoXj3VzGcxKSPMkMvI/Yg+NjtMgOs6A6l3ZL6s=; b=302R7XyaHGEONEOqx4rheX/BIKlLfLoMIYPqgr0URiEkMjbGhI7H1Y9pXDGu/sU4qpqg SYH5ouWiaF073FA2acHWsSL3r2nx5UYw5DkATMVmZBjZFKpKR+W/azL8j4Fmx0P82O3wz DtHpjCaSEtAgD/6BydwYi1zpMiAIbCnuLLEkj7yJC0reJvksSDSjWMn4JmLw00cEuS/f1 DGQEP0M8WPi1HQ8sz0vOVGjQaC881JwP++0FI25X3xPmfW9kyhxXrFXrcPnNivdnp7px/ zV2VnDcZWwUbXWfC/TKqVsEhdrP9PMugc0Nty7Q18jzwHKUcaF2em4WymSHKki5NowQ== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=TYv6IGWX; 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 D4363606A33F for ; Tue, 1 Dec 2026 12:17:44 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=TYv6IGWX Received: by smtp.kernel.org (Postfix) with ESMTPSA id 372C01F0089B; Tue, 1 Dec 2026 12:17:44 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1796127464; bh=c7KPueoXj3VzGcxKSPMkMvI/Yg+NjtMgOs6A6l3ZL6s=; h=Subject:From:To:Cc:Date:In-Reply-To:References; b=TYv6IGWXvtLsZrpfleyR+z8ge9Yv45hcW6YJ69F10CPoN2gmQbq7vR2ni46lJL3yP vskU5qH1Y7F1PdswqOHpV0eYu0lnN7cBix7vUhAcV9Mu9quz6u6R2krv+bAUqWNIRc Gi2wdpPHmhXyK4/8G6+D1O/amKm+lx5eFMhBpgEBJyHPYM0vAgb/+NYP0FqYvQpu4b RPdPcqmVIrphdUYfy8dqR9khs6ittOt0iU8I8gHJ0O4a9OMNE6EVosAypZFrXujoCi g80aQ9qmVpjb1+fgwRyimbA2FWS3B/paS1QpXwDrkujCOIDmS01dvZpwlBsANnmwpr d7QhESAxV/qKA== Subject: Re: [PATCH v3 2/4] net: thunderbolt: Stop queueing Rx buffers if allocation fails From: netdev-bot+sashiko@kernel.org To: mika.westerberg@linux.intel.com Cc: netdev@vger.kernel.org, YehezkelShB@gmail.com, andrew+netdev@lunn.ch, davem@davemloft.net, edumazet@kernel.org, kuba@kernel.org, pabeni@redhat.com, westeri@kernel.org Date: Tue, 01 Dec 2026 12:17:43 +0000 Message-ID: <179612746376.3146.3895025036613839913@kernel.org> In-Reply-To: <20261130113657.3440005-3-mika.westerberg@linux.intel.com> References: <20261130113657.3440005-3-mika.westerberg@linux.intel.com> X-sashiko-severity: Low Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 8bit X-Mailing-List: netdev@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Thank you for your contribution! Sashiko AI review found more severe issue(s) in other patches of this series. This mail is only an FYI, in case you want to address the nit picks below when you respin. Low priority / nit picks for your consideration: - [Low] tbnet_connected_work() in drivers/net/thunderbolt/main.c gains a napi_enable()/napi_schedule() pair in this patch. -- net: thunderbolt: Stop queueing Rx buffers if allocation fails With this patch, tbnet_alloc_rx_buffers() stops and keeps the buffers it has already queued when an allocation fails, instead of freeing them while their descriptors are still in the hardware ring. tbnet_poll() keeps NAPI polling so the allocation can be retried. NAPI enable and disable move into tbnet_connected_work() and tbnet_tear_down() so that they bracket the time the rings are running. Closes: https://sashiko.dev/#/patchset/20260902082128.1148463-1-mika.westerberg%40linux.intel.com > diff --git a/drivers/net/thunderbolt/main.c b/drivers/net/thunderbolt/main.c > index ede105cdc3a37..d5e49bc381041 100644 > --- a/drivers/net/thunderbolt/main.c > +++ b/drivers/net/thunderbolt/main.c [ ... ] > @@ -691,7 +698,11 @@ static void tbnet_connected_work(struct work_struct *work) > > ret = tbnet_alloc_tx_buffers(net); > if (ret) > - goto err_free_rx_buffers; > + goto err_stop_rings; > + > + napi_enable(&net->napi); > + /* Unmasks the ring interrupt if it was masked */ > + napi_schedule(&net->napi); [Severity: Low] tbnet_connected_work() is a work item queued on system_long_wq. It runs in a kworker in process context with BH enabled. Called from there, napi_schedule() leads to: napi_schedule() __napi_schedule() ____napi_schedule() raise_softirq_irqoff(NET_RX_SOFTIRQ) Because !in_interrupt(), raise_softirq_irqoff() only marks NET_RX_SOFTIRQ pending and wakes ksoftirqd. The softirq does not run right away. Does that mean the first tbnet_poll() waits for ksoftirqd or the next irq_exit? If so, the tb_ring_poll_complete() call that unmasks the Rx ring interrupt, which the comment above refers to, waits as well. Other drivers wrap this call in a BH-disabled section, for example virtnet_napi_do_enable() in drivers/net/virtio_net.c: napi_enable(napi); ... * Call local_bh_enable after to trigger softIRQ processing. */ local_bh_disable(); virtqueue_napi_schedule(napi, vq); local_bh_enable(); Would wrapping this napi_schedule() in local_bh_disable() and local_bh_enable() make the initial poll run as soon as BH is re-enabled? > > ret = tb_xdomain_enable_paths(net->xd, net->local_transmit_path, > net->tx_ring.ring->hop, [ ... ] -- Sashiko AI review ยท https://netdev-ai.bots.linux.dev/sashiko/#/patchset/20261130113657.3440005-1-mika.westerberg%40linux.intel.com