From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from fout-b7-smtp.messagingengine.com (fout-b7-smtp.messagingengine.com [202.12.124.150]) (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 9459F44A416 for ; Tue, 1 Sep 2026 19:58:55 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=202.12.124.150 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1788292737; cv=none; b=MolnM+Yfg8/6qkblKCuEklsgm+WCvmlTDiWVuYcdjOfNoen5BOxeydMLkBs8DFYnVAhWQYmqGX9i6FAN22ObV6a1+rgSqlI5/xcR2g4CRiLaicyTDaSx3ZHFaScVVabcWZ1M1E97jetIiobgvyMSbp18TG3z1KTTzYmwqLRvDko= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1788292737; c=relaxed/simple; bh=MGdskzSxiD/sw5yijXuFD+ea1ERwLtruXpAWf4rJoKw=; h=MIME-Version:Date:From:To:Cc:Message-Id:In-Reply-To:References: Subject:Content-Type; b=DZr16eT5DPCKPnuLZAiXLH8JJYX/58Kdf4nRwZBwavsyHTBuxNueIIzZ2E3rqkGUgSb0PP1eRGU0mKji6gAS1ICypnzHJMj9MfJNIW1e6TIaF8ZAmRfqOvHKLokFRkRkLjrGkYxDjbnzUZzHGe2KuYfiHe3g4hMtTsqnm/z9Sdg= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=fastmail.im; spf=pass smtp.mailfrom=fastmail.im; dkim=pass (2048-bit key) header.d=fastmail.im header.i=@fastmail.im header.b=S8+Wf7Th; dkim=pass (2048-bit key) header.d=messagingengine.com header.i=@messagingengine.com header.b=mYsXmG1f; arc=none smtp.client-ip=202.12.124.150 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=fastmail.im Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=fastmail.im Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=fastmail.im header.i=@fastmail.im header.b="S8+Wf7Th"; dkim=pass (2048-bit key) header.d=messagingengine.com header.i=@messagingengine.com header.b="mYsXmG1f" Received: from ams-compute-01.internal (ams-compute-01.internal [10.64.2.61]) by mailfout.stl.internal (Postfix) with ESMTP id 953B51D0004B; Tue, 1 Sep 2026 15:58:53 -0400 (EDT) Received: from ams-imap-19 ([10.64.2.39]) by ams-compute-01.internal (MEProxy); Tue, 01 Sep 2026 15:58:55 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=fastmail.im; h= cc:cc:content-transfer-encoding:content-type:content-type:date :date:from:from:in-reply-to:in-reply-to:message-id:mime-version :references:reply-to:subject:subject:to:to; s=fm3; t=1788292732; x=1788379132; bh=HtBurZwaMJiQvnqDWg1tU15j20OMcl43cDl3tYDzqnM=; b= S8+Wf7ThrHIK+esmrlnat2sh/nk72Ag7bHCTQxQL11LTmLTuFn5CO2jcdCFeCvmk J9nL7YSGSN920AGOn90p82DBq3vCpPOdyA6xZPzwkMRE6prf9q3UF6NACiNUxjGj nDpF5yam8vYB5eeo1uYnSbtss/1dEVoaqXs0XtCwDQI5Lf6m0Tfb9xvSMYFnd51H 9LGdPHZTntXDofKVzFIHxcn+DUJB6tTBNqmpJcRyvBuROk7iw7EdiI5A8riUMjkO QEF4y+SogoW0eLWr9fbVctJHno0CkdqOtkI1NGRzhE08duybG78MGMmFbuhdCglC ZZp7eavEdyDzYXt4/5AiDw== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-transfer-encoding :content-type:content-type:date:date:feedback-id:feedback-id :from:from:in-reply-to:in-reply-to:message-id:mime-version :references:reply-to:subject:subject:to:to:x-me-proxy :x-me-sender:x-me-sender:x-sasl-enc; s=fm3; t=1788292732; x= 1788379132;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wFBR4ITVbiKKsnU3A2mtdR/1tkk3RLZp1W4WA X-ME-Proxy: Feedback-ID: i559e4809:Fastmail Received: by mailuser.ams.internal (Postfix, from userid 501) id ED4892F8003D; Tue, 1 Sep 2026 15:58:46 -0400 (EDT) X-Mailer: MessagingEngine.com Webmail Interface Precedence: bulk X-Mailing-List: netdev@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-ThreadId: AQCaIXmGAEe7 Date: Tue, 01 Sep 2026 22:58:26 +0300 From: "Alice Mikityanska" To: "Jakub Kicinski" , "Willem de Bruijn" Cc: "David Ahern" , "Ido Schimmel" , "Paolo Abeni" , "David S. Miller" , "Eric Dumazet" , "Simon Horman" , "Shuah Khan" , "Hannes Frederic Sowa" , "Vadim Fedorenko" , netdev@vger.kernel.org, "Alice Mikityanska" Message-Id: In-Reply-To: References: <20260825200215.90326-1-alice.kernel@fastmail.im> <20260825200215.90326-4-alice.kernel@fastmail.im> <20260827122856.4b6eeb96@kernel.org> Subject: Re: [PATCH net v4 3/4] selftests: net: Test UDP length overflow with PMTU discover and big MTU Content-Type: text/plain Content-Transfer-Encoding: 7bit On Fri, Aug 28, 2026, at 23:35, Alice Mikityanska wrote: > On Thu, Aug 27, 2026, at 22:28, Jakub Kicinski wrote: >> On Wed, 26 Aug 2026 13:18:18 -0400 Willem de Bruijn wrote: >>> > +def check_dmesg_clean(func: str) -> bool: >>> > + with subprocess.Popen(['dmesg'], stdout=subprocess.PIPE) as dmesg: >>> > + res = subprocess.run(['grep', '-q', f'WARNING:.*{func}'], stdin=dmesg.stdout, check=False) >>> > + return res.returncode != 0 and dmesg.returncode == 0 >>> > + >>> > + >>> > +@contextmanager >>> >>> Interesting approach. In ksft the built-in defer() mechanism may be >>> preferred. Not sure. >> >> +1 small preference towards defer() if Alice is willing. >> It's be more idiomatic for our selftests > > No problem, I can switch to defer, thanks for the suggestion. I replaced try-finally with defer, but I also kept dummy_netdev() with @contextmanager, because otherwise it leads to code repetition between the two tests (even if I put ip setup into a function) and increases indent by two levels (because it would be no longer possible to compact these four with statements into one). I.e.: with ( NetNS() as ns, dummy_netdev(ns, 65556 + 20 * ipv6, ipv6), NetNSEnter(ns), socket.socket(af, socket.SOCK_DGRAM) as fd, ): vs with NetNS() as ns: ip('link add dummy type dummy', ns=ns) # this repeats with defer(ip, 'link del dummy', ns=ns): # and this ip_setup(ns, 65556 + 20 * ipv6, ipv6) with ( NetNSEnter(ns), socket.socket(af, socket.SOCK_DGRAM) as fd, ): I think the first one is better. And yes, I need to scope defer with with, otherwise it's scheduled after ns is deleted. I haven't found any other selftest that would do that, but I see this functionality is implemented in the defer class. Hope that works for you, respinnning :) >> More importantly ruff check and pylink --disable=R have to be clean >> for new tests. The test cases need a docstring explaining what they are >> trying to test. The helpers can probably get a _ prefix to mark them >> as private and silence the warning. > > Got it, will do. I thought it was OK, because all tests I saw didn't > have docstrings. > >> -- >> pw-bot: cr