🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: linux.kernel.netdev
Article #21299

Re: [PATCH net v7] tun: bound the NAPI receive queue

#21299
From: Antonio Quartulli
Date: Mon, 23 Nov 2026 20:50
53 lines
11266 bytes

On 22/11/2026 00:37, netdev-bot+sashiko@kernel.org wrote:
> Thank you for your contribution! Sashiko AI review found 2 potential
> issue(s) to consider.
> 
> Critical: 0 · High: 1 · Medium: 1 · Low: 0
> 
> If you believe none of the issues are legitimate, please reply to each
> issue of Medium severity or higher and explain why the AI is wrong.
> If any of them are legitimate and you plan to respin, please let patchwork
> know by including "pw-bot: cr" as a separate line at the end of your reply
> (one such reply per series is enough).
> 
> - [High] Bounding the IFF_NAPI queue by packet count only
>    (net_hotdata.max_backlog skbs per tun_file, ignoring size) does not…


Right, and the commit message says so under "Still open": this bounds
each queue the way enqueue_to_backlog() bounds the per-CPU backlog, but
not the memory a user can queue. Closing that needs the queued skbs
charged to the writer's memcg, which touches more allocation sites (one
in vhost-net) and every tun user, so it will be a separate change.


> - [Medium] The patch silently changes behaviour for IFF_NAPI users who
>    set a finite send buffer with TUNSETSNDBUF, and the commit message…
> 

True for a send buffer larger than about netdev_max_backlog packets:
there the queue limit now drops before the writer would block on socket
memory. With a smaller send buffer the writer still blocks first. A full
queue dropping instead of pushing back is also what netif_rx() does for
a full backlog, regardless of the send buffer, and blocking on the NAPI
queue would need a wait/wake mechanism tun does not have.
I'd rather
keep the fix minimal; netdev_max_backlog tunes the limit and be done 
with it.


Given the above, I am not going to respin.


Regards,


-- 
Antonio Quartulli

CEO and Co-Founder
Mandelbit Srl
https://www.mandelbit.com
Technical Details
Message-ID: <c663141e-78bf-41cf-81d0-fdda6fcbca74@mandelbit.com>
Path: mbox-mo1.pugleaf.net!srv.newsdeef.eu!newsfeed.bofh.team!news.nntp4.net!nntp.xenet.de!news.neodome.net!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-369758-linux-kernel-netdev=dewy.ru
References: <20261119153056.353156-1-antonio@mandelbit.com> <179530424233.3135.6226986969775563090@kernel.org>

Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!srv.newsdeef.eu!newsfeed.bofh.team!news.nntp4.net!nntp.xenet.de!news.neodome.net!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-369758-linux-kernel-netdev=dewy.ru
From: antonio@mandelbit.com (Antonio Quartulli)
Newsgroups: linux.kernel.netdev
Subject: Re: [PATCH net v7] tun: bound the NAPI receive queue
Date: Mon, 23 Nov 2026 21:50:11 +0100
Organization: Usenet Network
Message-ID: <c663141e-78bf-41cf-81d0-fdda6fcbca74@mandelbit.com>
References: <20261119153056.353156-1-antonio@mandelbit.com>
 <179530424233.3135.6226986969775563090@kernel.org>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit
Injection-Info: usenet.network;
	logging-data="3982120"; mail-complaints-to="abuse@usenet.network"
Cancel-Lock: sha1:scpYipnvcvAilfSaP/SWA7YQIGU= sha256:abpX1mJqge/cKT5s9VSpzHIr0YCMLpofuB549nOdc4g=
	sha1:k5F8jadlbFB2QOboRvgXu72TKIA= sha256:Q0ikM1A4di0tJEsh7PYOEA07kkriciUogPSNdGW378s=
Content-Language: en-US
List-ID: <netdev.vger.kernel.org>
X-Mailpost-Empty-Hdrs: X-Spam-Level
X-Received: from localhost (localhost [127.0.0.1])
	by mail.dewy.ru (Postfix) with ESMTP id 98F42125DC1; Mon, 23 Nov 2026 23:50:42 +0300 (MSK)
X-Virus-Scanned: Debian amavisd-new at usenet.network
X-Spam-Flag: NO
X-Spam-Score: -3.05
X-Spam-Status: No, score=-3.05 tagged_above=-9999 required=6.31
	tests=[DCC_REPUT_70_89=0.1, DKIM_SIGNED=0.1, DKIM_VALID=-0.1,
	DKIM_VALID_AU=-0.1, HEADER_FROM_DIFFERENT_DOMAINS=0.249,
	MAILING_LIST_MULTI=-1, RCVD_IN_DNSWL_MED=-2.3, SPF_HELO_NONE=0.001,
	SPF_PASS=-0.001, URIBL_BLOCKED=0.001] autolearn=ham autolearn_force=no
X-Authentication-Results: mail.dewy.ru (amavisd-new); dkim=pass (2048-bit key)
	header.d=mandelbit.com
X-Received: from mail.dewy.ru ([127.0.0.1])
	by localhost (mail.dewy.ru [127.0.0.1]) (amavisd-new, port 10024)
	with ESMTP id iQ2YJkqirjqS;
	Mon, 23 Nov 2026 23:50:32 +0300 (MSK)
X-Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=172.105.105.114; helo=tor.lore.kernel.org; envelope-from=netdev+bounces-369758-linux-kernel-netdev=dewy.ru@vger.kernel.org; receiver=<UNKNOWN> 
X-Authentication-Results: OpenDMARC; dmarc=none (p=none dis=none) header.from=mandelbit.com
X-Received: from tor.lore.kernel.org (tor.lore.kernel.org [172.105.105.114])
	by mail.dewy.ru (Postfix) with ESMTPS id 32A3C125DC5; Mon, 23 Nov 2026 23:50:23 +0300 (MSK)
X-Received: from smtp.subspace.kernel.org (conduit.subspace.kernel.org [100.77.114.92])
	by tor.lore.kernel.org (Postfix) with ESMTP id A65492DBC0; Mon, 23 Nov 2026 20:50:21 +0000 (UTC)
X-Authentication-Results: smtp.subspace.kernel.org; arc=pass header.oldest-pass=0 smtp.remote-ip=127.0.0.1
X-ARC-Seal: i=2; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=pass;
	t=1795467020;
	b=HZwrL0KgjGjcz0RuGK5GSgqi2r5cRKikFCx/V/cVNwdNRow2wone77n80w0RIYYe6wMi
	 LCs5TBom1Hkv+VHkJijgK9ocUQXrmKHQAMzLorlVsI0cXLCBv8uEoS7pMTF36vMOtdiCJ
	 BAlst6gPs8z7idS1VCBZFimr8bH6r386T9N3LW540s55zMtvfd+SSx9Sb5EUkRX2boFZS
	 uepdyHEUneFCHO0nLVLg3BTFWvEO1JiiPh2O9YivjP9TSeYG7gny+JmIH9zORYrW8HfUR
	 8FLB3cuovL7IyMDUBb5lfrnof6BOR+8eioEHMkAkyxkW9YtA4bMcv6FT8hJ9uDpRZmA==
X-ARC-Message-Signature: i=2; d=subspace.kernel.org; s=arc20261015;
	a=rsa-sha256; c=relaxed/relaxed; t=1795467020;
	h=X-Original-To:Received:DMARC-Filter:Received:DKIM-Signature:
	 Message-ID:Date:X-Mailing-List:List-Id:List-Post:List-Help:
	 List-Subscribe:List-Unsubscribe:List-Owner:Precedence:MIME-Version:
	 User-Agent:Subject:To:Cc:References:Content-Language:From:
	 Organization:In-Reply-To:Content-Type:Content-Transfer-Encoding:
	 X-Rspamd-Queue-Id;
	bh=ZNYA94p3wyS8MJFRTvI2DM9YWDVViRJcOxfX03aG+YQ=;
	b=M6WIhgng8xwvFH6GtgBBLalYdWvnSsXsFOWIluOieBiiEXrEf+eZ9yK4TQXE4AQB8TbV
	 cdrd43SB9IbV33ndlaH0gAD99YMd01u0NCYoPOcH6wHSHgsOERUOh76GBbkWkeI8ZZOrM
	 NfdvbuKM92mxa9EnpaKI8zzXp0Pgi84cECShrf7wBkyZTYNSWhF8tNq3LymOBGXLitwRQ
	 ZbPh9DDBVcDlBo0Gibuo96I0pqsdTUeoUYg8i+Iyv5cxv6yjPYK3NfdnWAr12qaoN7V8P
	 tpGJTKwmLa9Mlw1EAjxZG41S0a8zGbWhAkqV2oGrQRniLXEzW+P9Hau67P4fs2eIhcg==
X-ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; 
	dkim=pass header.d=mandelbit.com header.i=@mandelbit.com header.a=rsa-sha256 header.s=MBO0001 header.b=yE7+gK8y;
	dmarc=none header.from=mandelbit.com;
	spf=pass smtp.mailfrom=mandelbit.com;
	arc=pass header.oldest-pass=0 smtp.remote-ip=127.0.0.1
X-Received: from localhost.localdomain (localhost [127.0.0.1])
	by smtp.subspace.kernel.org (Postfix) with ESMTP id B2FF0606A33A;
	Mon, 23 Nov 2026 20:50:20 +0000 (UTC)
X-Authentication-Results: smtp.subspace.kernel.org;
	dkim=pass (2048-bit key, unprotected) header.d=mandelbit.com header.i=@mandelbit.com header.a=rsa-sha256 header.s=MBO0001 header.b=yE7+gK8y
X-Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=195.10.208.42
X-ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none;
	t=1795467019;
	b=1khbo4P2BE2RqWT0A2itfbYgD2Y32AeyTa0xtAhAJfokzyj/RumNTBNTsDnFiFJkkYI6
	 QfEAhL8aQNfP5x7p0Cfs4I40JTuKV0Zg9LkERIGXc+a+vC/hOBkp5qLKNTPyoolLsJz4D
	 /JYuzKeTGRqPRWYhBnOEmwNe/16hnf/7XtXdq1lrWfBogHhI7rLqCoQBY3hmavd9yqyj6
	 RCrgsHKx67JPskHdZo/2Qk/M5q7lINhZPNJRqtZWJ/wzkZafpMUcwsU3xe069zJDMsW5Q
	 c5WXcENBUyUc9eAwYHnx4aRKSCLBOgpPJjZYVYgDHREQiVwzDUBYlwoanijqGZFOCBw==
X-ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015;
	a=rsa-sha256; c=relaxed/relaxed; t=1795467019;
	h=DMARC-Filter:Received:DKIM-Signature:Message-ID:Date:MIME-Version:
	 User-Agent:Subject:To:Cc:References:Content-Language:From:
	 Organization:In-Reply-To:Content-Type:Content-Transfer-Encoding:
	 X-Rspamd-Queue-Id;
	bh=ZNYA94p3wyS8MJFRTvI2DM9YWDVViRJcOxfX03aG+YQ=;
	b=hu3ne48CwW0tlyIuJiUyTFkPDsoqg929zXNHbsP5IrJwqkD6ZVQS5DTrn28eVifW97t9
	 ySlUTat4OocMDbyu4MW6pkcpAA8bUiBOFK7TC2MqTnkzQ7XhQePzub6QO9Y5ZLblHr9aK
	 ISqGjpjX89GaYHq1bR9SdakRFnA/aF46gjbRb5Vuda6ru2iEbMYGq3i0p7xoJ1io5bIZe
	 OKgjUmH9po7LkrrD10VlIvCG+RTxMVRDYny1jxxkFimlsXdiEqcCGlTmiiSNGMS/nCTmh
	 N1rMccq7yVvxpUp/SzEnurSskiqF+cfRkPJCF+O+2wc4BVJUouiGJZmIDKFUZenxQEw==
X-ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; 
	dmarc=none header.from=mandelbit.com;
	spf=pass smtp.mailfrom=mandelbit.com;
	dkim=pass header.d=mandelbit.com header.i=@mandelbit.com header.a=rsa-sha256 header.s=MBO0001 header.b=yE7+gK8y;
	arc=none smtp.remote-ip=195.10.208.42
X-Received: from mout-b-112.mailbox.org (mout-b-112.mailbox.org [195.10.208.42])
	(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
	 key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256)
	(No client certificate requested)
	by smtp.subspace.kernel.org (Postfix) with ESMTPS id 2CCD7606A321;
	Mon, 23 Nov 2026 20:50:19 +0000 (UTC)
X-DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org 2CCD7606A321
X-Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=mandelbit.com
X-Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=mandelbit.com
X-Received: from smtp102.mailbox.org (smtp102.mailbox.org [IPv6:2001:67c:2050:b231:465::102])
	(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
	 key-exchange X25519MLKEM768 server-signature RSA-PSS (4096 bits) server-digest SHA256)
	(No client certificate requested)
	by mout-b-112.mailbox.org (Postfix) with ESMTPS id 4jYJ3q15xwz5wWG;
	Mon, 23 Nov 2026 21:50:15 +0100 (CET)
X-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=mandelbit.com;
	s=MBO0001; t=1795467015;
	h=from:from:reply-to:subject:subject:date:date:message-id:message-id:
	 to:to:cc:cc:mime-version:mime-version:content-type:content-type:
	 content-transfer-encoding:content-transfer-encoding:
	 in-reply-to:in-reply-to:references:references;
	bh=ZNYA94p3wyS8MJFRTvI2DM9YWDVViRJcOxfX03aG+YQ=;
	b=yE7+gK8y71CCSIXYMcs5D3wXsCcXx9mWGsWUfx+a0+LCkNQKF+rwLIofC2hkL4APTqWNN4
	HFq9r7SqP7KSwHxKjHL4XA2iXwskA8wP4DeE0EEQafbRuAca3OkegadQTGTLgPrhJ6vxec
	NjpkPw6PHcybKEi3Hc+xYOOjW3qyD2KosatSURlrTADe2iBAMgqCDzPEJ4SBbpOhRuZhAu
	fo7tiDans35cQFpMIBk1V2GJa9fVGumHGOicaQw58VeXSLi1qUFaPHVSvUD3I53LVblCOY
	oKGCWsHLnAtwr8Y+hcAjMoPsNggktFQ4llBZtxgVe46TI8zIN0kXipNzyQjVwg==
X-Authentication-Results: outgoing_mbo_mout;
	dkim=none;
	spf=pass (outgoing_mbo_mout: domain of antonio@mandelbit.com designates 2001:67c:2050:b231:465::102 as permitted sender) smtp.mailfrom=antonio@mandelbit.com
X-Mailing-List: netdev@vger.kernel.org
X-List-Post: <mailto:netdev@vger.kernel.org>
X-List-Help: <mailto:netdev+help@vger.kernel.org>
X-List-Subscribe: <mailto:netdev+subscribe@vger.kernel.org>
X-List-Unsubscribe: <mailto:netdev+unsubscribe@vger.kernel.org>
X-List-Owner: <mailto:netdev+owner@vger.kernel.org>
X-Precedence: list
X-User-Agent: Mozilla Thunderbird
X-Cc: willemdebruijn.kernel@gmail.com, jasowangio@gmail.com,
 andrew+netdev@lunn.ch, davem@davemloft.net, edumazet@kernel.org,
 kuba@kernel.org, pabeni@redhat.com, horms@kernel.org, mst@redhat.com,
 eperezma@redhat.com, ast@kernel.org, daniel@iogearbox.net, hawk@kernel.org,
 john.fastabend@gmail.com, sdf@fomichev.me, maheshb@google.com,
 peterpenkov96@gmail.com, netdev@vger.kernel.org,
 virtualization@lists.linux.dev, bpf@vger.kernel.org
X-Organization: Mandelbit SRL
X-In-Reply-To: <179530424233.3135.6226986969775563090@kernel.org>
X-Rspamd-Queue-Id: 4jYJ3q15xwz5wWG