From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (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 5ABBE23AB81; Fri, 3 Apr 2026 00:40:51 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1775176851; cv=none; b=eFKQht50ZSyDE+gqYE0XPwOM8fPF1qb78AppZVQtzzYWuUZJv/T7CGr5PeW0yzRfE2S6TcUXMXv/zoAJ/MTEEQYV7KrH+2cXjgvn2ycUH7l8fqVKLx/0VViVCSWvmdgTcRuj18wXDHYRzZgzawiGsLqXQje6dYlT/hB67Kb7888= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1775176851; c=relaxed/simple; bh=NJ+8mEhNn9wUSa9R8VvhGJpfu23Mm7qVZmFxt2lVutQ=; h=Date:From:To:Cc:Subject:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=Bd+8emBlhdt8QQMMpJgjxYEUFq5kOy8Effn+U/NKxiteqhb3da4uW2O+k8Pm0yk2xvjJoHRMAa592JtxXFLmaxJ+IBN6TcVefWQ/ADPnUq9bub7qAKmjukwR6+8PkORHJfxJqu5E19k2bAsVSj14FFMnylx9U3uUP+gLj6ddhPg= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=bNJsrNHf; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="bNJsrNHf" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 2F130C116C6; Fri, 3 Apr 2026 00:40:50 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1775176851; bh=NJ+8mEhNn9wUSa9R8VvhGJpfu23Mm7qVZmFxt2lVutQ=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=bNJsrNHfYcRJm007j4S0gUwfNrjeWvZdoHliWvtkVxFWWc3/1jlesn+xPpAqsNfry HhSfY4bIiG6NLXrsbLCFeWKAJ6+3sJEDrdS8gHJ1u9OBgNqTkxXL7Y4Y3XuLfTkwbT gh3zzJA7WItfiCMP76cE/w0dGh4w88Q7/aeFZOpCpGt1s9fSkApVEdjpalyO83PeXY AEsd+6qBgB/SsrF3y4d8FXKBR+CCRachkUBXC0xV/V8w7UlVaYG9iD2h2Ry0bqJYP+ 9GBOnmYjagrPaC5X4llk/14Li576IXy7ywUsYIQbvNA0KxyjFvi+cYMfyynW6KI4lz UiTTZ3PrZQRrA== Date: Thu, 2 Apr 2026 17:40:49 -0700 From: Jakub Kicinski To: Sam Edwards Cc: Andrew Lunn , "David S. Miller" , Eric Dumazet , Paolo Abeni , Maxime Coquelin , Alexandre Torgue , "Russell King (Oracle)" , Maxime Chevallier , Ovidiu Panait , Vladimir Oltean , Baruch Siach , Serge Semin , Giuseppe Cavallaro , netdev@vger.kernel.org, linux-stm32@st-md-mailman.stormreply.com, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH net v4 0/2] stmmac crash/stall fixes when under memory pressure Message-ID: <20260402174049.0ac088cc@kernel.org> In-Reply-To: References: <20260401041929.12392-1-CFSworks@gmail.com> <20260402080542.293e8729@kernel.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable On Thu, 2 Apr 2026 09:53:43 -0700 Sam Edwards wrote: > On Thu, Apr 2, 2026 at 8:05=E2=80=AFAM Jakub Kicinski w= rote: > > I meant we need both a threshold, and a delay :( =20 >=20 > Hi Jakub - got it: when the critical threshold is reached, allow the > NAPI instance to sleep and start a timer instead. >=20 > 1) We'd either have to leave interrupts masked or let them race > against the timer. Either one is manageable, but I feel like those > interactions carry *just* enough regression risk to bump that patch to > -next. >=20 > 2) Could you point out which NAPI driver best handles this situation? > I'd like to replicate its approach. Not sure, the last few NICs I worked on had the ability for SW=20 to trigger IRQs exactly because of the Rx buffer depletion issue. fbnic_napi_depletion_check() for example. But let's not overthink it.. say we arm a timer and let the IRQ=20 be unmasked. The timer just runs napi_schedule(). napi_schedule()=20 is thread-safe, if IRQ fires with the timer armed - no problem.