Article View: linux.kernel.netdev
Article #20735Re: [PATCH net-next] selftests: net: reuseport_addr_any: report epoll_wait timeouts honestly
From: Hangbin Liu
Date: Mon, 23 Nov 2026 05:38
Date: Mon, 23 Nov 2026 05:38
32 lines
9601 bytes
9601 bytes
On Fri, Nov 20, 2026 at 07:58:55AM +0100, Omokefe Emmanuel Onanaroghene wrote:
> receive_once() waits 3ms for a packet but only checks for errors
> (i < 0). On timeout (i == 0) it falls through and uses ev.data.fd
> uninitialized. recv() on a garbage fd fails with a misleading
> "failed to recv" (or worse, blocks or returns a bogus fd). Report
> the timeout for what it is; errnum 0, since epoll_wait sets no
> errno on timeout.
>
> Signed-off-by: Omokefe Emmanuel Onanaroghene <emmaonana18@gmail.com>
> ---
> tools/testing/selftests/net/reuseport_addr_any.c | 2 ++
> 1 file changed, 2 insertions(+)
>
> diff --git a/tools/testing/selftests/net/reuseport_addr_any.c b/tools/testing/selftests/net/reuseport_addr_any.c
> index 1c43401a1c807..2e8aa83f68dd0 100644
> --- a/tools/testing/selftests/net/reuseport_addr_any.c
> +++ b/tools/testing/selftests/net/reuseport_addr_any.c
> @@ -155,6 +155,8 @@ static int receive_once(int epfd, int proto)
> i = epoll_wait(epfd, &ev, 1, 3);
> if (i < 0)
> error(1, errno, "epoll_wait failed");
> + if (i == 0)
> + error(1, 0, "epoll_wait timed out waiting for packet");
>
> if (proto == SOCK_STREAM) {
> fd = accept(ev.data.fd, NULL, NULL);
> --
> 2.43.0
>
Reviewed-by: Hangbin Liu <liuhangbin@kylinos.cn>
Technical Details
Message-ID:
<20261123053856.GH10218@Liu-laptop>Path:
mbox-mo1.pugleaf.net!srv.newsdeef.eu!news.mb-net.net!open-news-network.org!news.nntp4.net!nntp.xenet.de!news.neodome.net!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-369053-linux-kernel-netdev=dewy.ruReferences:
<20261120065855.22628-1-emmaonana18@gmail.com>Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!srv.newsdeef.eu!news.mb-net.net!open-news-network.org!news.nntp4.net!nntp.xenet.de!news.neodome.net!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-369053-linux-kernel-netdev=dewy.ru From: hangbin.liu@linux.dev (Hangbin Liu) Newsgroups: linux.kernel.netdev Subject: Re: [PATCH net-next] selftests: net: reuseport_addr_any: report epoll_wait timeouts honestly Date: Mon, 23 Nov 2026 13:38:56 +0800 Organization: Usenet Network Message-ID: <20261123053856.GH10218@Liu-laptop> References: <20261120065855.22628-1-emmaonana18@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Injection-Info: usenet.network; logging-data="3801161"; mail-complaints-to="abuse@usenet.network" Cancel-Lock: sha1:tUfM8f7vdnNWfQtVKjcNKi2mejM= sha256:O6ovm3SIz0kan+0wSY2M4+xg3M0/fGoLhf4pIp03oJo= sha1:jhSsafMzAN0zFKXMPQOHQUImib4= sha256:PxM8wwaMjKwxIlLU1AZIbGsINxI67mskNY0W9E7TXZk= Content-Disposition: inline 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 B5920125D8E; Mon, 23 Nov 2026 08:39:27 +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 (1024-bit key) header.d=linux.dev 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 WOhOuZls24JV; Mon, 23 Nov 2026 08:39:24 +0300 (MSK) X-Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=172.234.253.10; helo=sea.lore.kernel.org; envelope-from=netdev+bounces-369053-linux-kernel-netdev=dewy.ru@vger.kernel.org; receiver=<UNKNOWN> X-Authentication-Results: OpenDMARC; dmarc=fail (p=none dis=none) header.from=linux.dev X-Received: from sea.lore.kernel.org (sea.lore.kernel.org [172.234.253.10]) by mail.dewy.ru (Postfix) with ESMTPS id 15941125D89; Mon, 23 Nov 2026 08:39:15 +0300 (MSK) X-Received: from smtp.subspace.kernel.org (conduit.subspace.kernel.org [100.77.114.92]) by sea.lore.kernel.org (Postfix) with ESMTP id A15DD2CFBB; Mon, 23 Nov 2026 05:39:11 +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=1795412351; b=n0M0rKPBN1tawHg4X2PAY3c5kZ4boD6j501OKORCL0ynTyqA8oHu09PKimeXV5Q9ZuEG RGQVjMGFELxmun+wbhfl2e+2a5BHHMsUqNKVjgIzFeQjRyunkQTvewFxwLtKH/QcHIPXU 8QZPzntCiRFgud1cEfx2R0f94XANZ+y18vffhNEDqUmspc/Gyf9DOQfZEW6dVBAuNZ98B 94KmhYJxP/7W+w861DZvAe+nTZCJHBURzBLY4AlQQPEsSTl1gmO4iqUJ9ScYWvpzbdNS2 t4a4c+OLRP2nhPAcEnJ4gKPEQQFgnMjjlge7dxtczbCG3tCpWDQy4Zkvc0OzzYU6erw== X-ARC-Message-Signature: i=2; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1795412351; h=X-Original-To:Received:DMARC-Filter:X-Envelope-To:DKIM-Signature: X-Envelope-To:Received:X-Mizu-Trace-ID:X-Migadu-Flow:Date:From:To:Cc: Subject:Message-ID:References:X-Mailing-List:List-Id:List-Post: List-Help:List-Subscribe:List-Unsubscribe:List-Owner:Precedence: MIME-Version:Content-Type:Content-Disposition:In-Reply-To; bh=9fZC67cJJ/GjqV+nhFxv50Ir/g4Ncc4bsSbtF+FPqMU=; b=WLNPqJhTMaRX62hkzOOxEYu7qL/Wqaw/XHane1/snaI5Re0m591oxNUlLinNy4FF3jAC EPy8/RgaWb+pzBLYoxpy0qv5ZHk9Rd4oXCq7mhkmxfk+anSiiMwMoSrOtvfd4BeR4JOAQ UhsNPGFti9y0GxEQcUFHrhicTvKeO6e98BlH56Ely+MlvBj1I8Y1qcjWgA16JShfGcKXf olUEbiS8lMYtL3Z49A16s0WOm2Y9N4eapzLYiGJ/cJ0wk0kBdoklC+sCaOOYD01Ts7l69 cilTXF2HAjKh9X4KHOKZ3NRDI9byI8GhM+QuOpu1f/UN9Ic4JtggfSBfPKf8MnP6wEQ== X-ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dkim=pass header.d=linux.dev header.i=@linux.dev header.a=rsa-sha256 header.s=key1 header.b=OJheM6XN; dmarc=pass header.from=linux.dev; spf=pass smtp.mailfrom=linux.dev; 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 77ED6606A331; Mon, 23 Nov 2026 05:39:11 +0000 (UTC) X-Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key, unprotected) header.d=linux.dev header.i=@linux.dev header.a=rsa-sha256 header.s=key1 header.b=OJheM6XN X-Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=95.215.58.144 X-ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1795412350; b=iQjeT0c3hza1qJymT9AIBSbWAGXXBZvXF4SxcH0rSvJFPaj3Tf0sKeb2dDfxyGaJ/Mqn gixHblUtVKHqhMsUDIeHfMYvYOLH/HHfC6X4jeX1EmPOFIHiIQscBjKmcs/Chv8CDeGfK YUv2t97tcsTojdTlodS/2uyTFmEE9KnNrW6TJCjk6QCMQggR+rwkA5d2/s/dQOJBxjVBW f4KkKtcShpvGskF5AWVZ9MPHZ577KGYzoK4k4+oBmRJQC9q1oFQaHJyY5qc2v8B7VNpl5 KTQQC1Re2GrS7Z2+0zAkihgpYhJTUcuXL/R8fEFFb6fcpy99Sz0ie68Jp4vE3jTlhAg== X-ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1795412350; h=DMARC-Filter:X-Envelope-To:DKIM-Signature:X-Envelope-To:Received: X-Mizu-Trace-ID:X-Migadu-Flow:Date:From:To:Cc:Subject:Message-ID: References:MIME-Version:Content-Type:Content-Disposition:In-Reply-To; bh=9fZC67cJJ/GjqV+nhFxv50Ir/g4Ncc4bsSbtF+FPqMU=; b=5fxr/k42Xzb1fcx7I34EJNNO5Bc53OiodR8kJ9OJPJ6+/3AS1ALoo7IM3ZklI0d758W0 2iwqQ8N7Vaq8qJdmqoxIIiMpOHslv13PpymgQyMG9U0thgGXaXjBRbsIUXVme+PbNsyu9 752fZ4LhRtP/4dXwi49a3YWZo1cJ6zHYh+vBhW+v5eHPH7L1Ok6vFayfVXfiVWUmBiu+J 94VI/iv/UGGPAEfcwrmngNkgESOljwXDwBbD+MmHINRPhkTev0cRjonSBnQesstYcIvg5 wBptPliGt8uVTSZVbQf6He1AB+Bu63IUOxFjppy3kzfjjoLG15hXJp9KjwB/K3FaDWg== X-ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass header.from=linux.dev; spf=pass smtp.mailfrom=linux.dev; dkim=pass header.d=linux.dev header.i=@linux.dev header.a=rsa-sha256 header.s=key1 header.b=OJheM6XN; arc=none smtp.remote-ip=95.215.58.144 X-Received: from mta1.migadu.com (out-144.mta1.migadu.com [95.215.58.144]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 0406F606A32E for <netdev@vger.kernel.org>; Mon, 23 Nov 2026 05:39:09 +0000 (UTC) X-DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org 0406F606A32E X-Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.dev X-Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linux.dev X-Envelope-To: netdev@vger.kernel.org X-DKIM-Signature: a=rsa-sha256; bh=GGgKl6H2K6gHd6hfWzXd1Bt9/gcGE2YwIrAA2CbG6HE=; c=simple/simple; d=linux.dev; h=from:to:subject:date:message-id:mime-version:content-type; s=key1; t=1795412347; v=1; x=1796017147; b=OJheM6XNmkjKLELNqpyXr1iE+WMP8bwEStj1ztPkWTyBCt43i7svWeJ5eQF7MvEVAGKFPuDl 0NcZYGSB55t39ls9W4uFbaHdWJBxoohMz6bWoxQ74kf+rlSv1gI8maU/M3n6hq8p5+IL0BU3j3h vTbtM7KzjNxxcqb0jyn1C6tE= X-Envelope-To: netdev@vger.kernel.org X-Received: by mta10.migadu.com with ESMTPS id 80c29ab3a696dce2; Mon, 23 Nov 2026 05:39:07 +0000 X-Mizu-Trace-ID: 80c29ab3a696dce2 X-Migadu-Flow: FLOW_OUT X-Cc: netdev@vger.kernel.org, linux-kselftest@vger.kernel.org, "David S . Miller" <davem@davemloft.net>, Eric Dumazet <edumazet@kernel.org>, Jakub Kicinski <kuba@kernel.org>, Paolo Abeni <pabeni@redhat.com>, Simon Horman <horms@kernel.org>, Shuah Khan <shuah@kernel.org>, linux-kernel@vger.kernel.org, skhan@linuxfoundation.org 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-In-Reply-To: <20261120065855.22628-1-emmaonana18@gmail.com>