🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: linux.kernel.netdev
Article #18788

Re: [PATCH iproute2-next 1/2] mnl_utils: add a dump helper for NLM_F_DUMP_INTR

#18788
From: David Ahern
Date: Wed, 18 Nov 2026 22:58
38 lines
9378 bytes
On 11/10/26 5:01 AM, Petr Oros wrote:
> The kernel sets NLM_F_DUMP_INTR on a dump message when the dumped
> objects changed between two parts of the dump, so the result can miss an
> object or list it twice. mnl_cb_run2() answers the flag with EINTR on
> the first such message. mnlu_gen_socket_sndrcv() then prints "kernel
> answers: Interrupted system call" and returns with the rest of the dump
> still queued in the socket. The caller has passed a part of the objects
> to its callback by then and cannot tell an interrupted dump from a
> request that failed.
> 
> Add mnlu_gen_socket_sndrcv_dump(). It clears the flag in every received
> message before the callbacks run, reads the dump to its end and tells
> the caller through a bool that the dump was interrupted. The caller can
> then repeat the request on the same socket or warn the user, as
> rtnl_dump_filter() does for rtnetlink dumps.
> 
> The receive loop is shared with mnlu_socket_recv_run() and
> mnlu_gen_socket_sndrcv(), which behave as before.
> 
> Reviewed-by: Ivan Vecera <ivecera@redhat.com>
> Signed-off-by: Petr Oros <poros@redhat.com>
> ---
>  include/mnl_utils.h |  5 ++++
>  lib/mnl_utils.c     | 58 +++++++++++++++++++++++++++++++++++++++------
>  2 files changed, 56 insertions(+), 7 deletions(-)
> 

...

> @@ -120,6 +143,12 @@ int mnlu_socket_recv_run(struct mnl_socket *nl, unsigned int seq, void *buf, siz
>  	return err;
>  }
>  
> +int mnlu_socket_recv_run(struct mnl_socket *nl, unsigned int seq, void *buf, size_t buf_size,
> +			 mnl_cb_t cb, void *data)

fixed the line length and applied the set to iproute2-next.
Technical Details
Message-ID: <99ccfd3c-47d6-41bd-a8d4-5036f0edafea@kernel.org>
Path: mbox-mo1.pugleaf.net!news-lax.pugleaf.net!srl.newsdeef.eu!newsfeed.bofh.team!news.nntp4.net!nntp.xenet.de!news.neodome.net!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-366491-linux-kernel-netdev=dewy.ru
References: <20261110110101.2155953-1-poros@redhat.com> <20261110110101.2155953-2-poros@redhat.com>

Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!news-lax.pugleaf.net!srl.newsdeef.eu!newsfeed.bofh.team!news.nntp4.net!nntp.xenet.de!news.neodome.net!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-366491-linux-kernel-netdev=dewy.ru
From: dsahern@kernel.org (David Ahern)
Newsgroups: linux.kernel.netdev
Subject: Re: [PATCH iproute2-next 1/2] mnl_utils: add a dump helper for
 NLM_F_DUMP_INTR
Date: Wed, 18 Nov 2026 15:58:22 -0700
Organization: Usenet Network
Message-ID: <99ccfd3c-47d6-41bd-a8d4-5036f0edafea@kernel.org>
References: <20261110110101.2155953-1-poros@redhat.com>
 <20261110110101.2155953-2-poros@redhat.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit
Injection-Info: usenet.network;
	logging-data="2722061"; mail-complaints-to="abuse@usenet.network"
Cancel-Lock: sha1:P31JsL/iRtawqPyDxfrI49U5PWg= sha256:c/q+lpU1JSImH3CWnQp3THfw5n+ypSaCwc131r8g9AE=
	sha1:1jkV8wK4Xf9Gd/6/QmQJLICGCCc= sha256:I084/1wjLDy4Ef99cCRocGEjYA6aMbFVs+YealPsZi8=
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 7AE32115404; Thu, 19 Nov 2026 01:58:47 +0300 (MSK)
X-Virus-Scanned: Debian amavisd-new at usenet.network
X-Spam-Flag: NO
X-Spam-Score: -3.401
X-Spam-Status: No, score=-3.401 tagged_above=-9999 required=6.31
	tests=[DCC_REPUT_70_89=0.1, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1,
	DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1,
	MAILING_LIST_MULTI=-1, RCVD_IN_DNSWL_MED=-2.3, SPF_HELO_NONE=0.001,
	SPF_PASS=-0.001] autolearn=ham autolearn_force=no
X-Authentication-Results: mail.dewy.ru (amavisd-new); dkim=pass (2048-bit key)
	header.d=kernel.org
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 zApT0aCBAc20;
	Thu, 19 Nov 2026 01:58:40 +0300 (MSK)
X-Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=172.234.253.10; helo=sea.lore.kernel.org; envelope-from=netdev+bounces-366491-linux-kernel-netdev=dewy.ru@vger.kernel.org; receiver=<UNKNOWN> 
X-Authentication-Results: OpenDMARC; dmarc=pass (p=quarantine dis=none) header.from=kernel.org
X-Received: from sea.lore.kernel.org (sea.lore.kernel.org [172.234.253.10])
	by mail.dewy.ru (Postfix) with ESMTPS id B2E291153E1; Thu, 19 Nov 2026 01:58:28 +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 77CEF1C774E; Wed, 18 Nov 2026 22:58:25 +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=1795042704;
	b=JoYEtrRnpXxV5jcwt3ioZdYxPMzNdbPDJUAlnwqD0hoPZy58B3NVPRDZFrpASPUksnvi
	 jnBGxjYL7zv/gZjHnbMoGE+pfmy0jWLK2+iZRBfpFPPN03HrECu817gk2HpthlG6GPbGB
	 Gz3SSC6acYPKc9Px9h4XtD4TpyAFp8WcS2Ymz+FI06Zk5QsaNFOxrd9y6pdObfGR3PWvC
	 LjvB+uiE0qyo6C+yRWgeuMrbj/anqaCqyiNQO67yJenQHLTlFm5Sy12lhs+uDwcw7LSk7
	 49P2dMzRb1qQKqBzaHMpmTvLzCpxENTNCSf2NvP+RrkmvBOByY3tVFv7mdXv9Cb1PJQ==
X-ARC-Message-Signature: i=2; d=subspace.kernel.org; s=arc20261015;
	a=rsa-sha256; c=relaxed/relaxed; t=1795042704;
	h=X-Original-To:Received: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:Content-Language:To:Cc:References:From:In-Reply-To:
	 Content-Type:Content-Transfer-Encoding;
	bh=mhhQ9Ioq+2qUazDNyhj0906QRa7/QEquZU1rpFFbyfw=;
	b=PRNECz3+297IxifTG9Wk6OgMkMekNfP7zw5UzXA2YGsddvAWyVPAAzS/qSmj00JA22vg
	 cv17Si5Ew6NvPuShNU7KGtIMlK8CLByjB1kN0mW20GknvIbLQzy5GpS/kBj/csDtlJ4VO
	 Iz+kDIByBQzvoWRk2inKrlZM3bsIPW0/CNY3pBGIcZMRr0e+a2hpBAIg+DiHLo5ztbj1p
	 j09yoC0bCr9rKWQj1CVN6AkNJcsyTJL0HWW5Mqoc0BOoXVmFsIyuEeteEWpVgCjqK+YF5
	 z/n8KuLt0bdcubUhb+M20lOnHkQlmQf1bxcsWw5YzQE6O9sAGdKf5E2HTc1Uj5VGj0A==
X-ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; 
	dkim=pass header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b="V/X+Qtf4";
	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 8484E606A325;
	Wed, 18 Nov 2026 22:58:24 +0000 (UTC)
X-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=V/X+Qtf4
X-Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=100.103.45.18
X-ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none;
	t=1795042703;
	b=HAhyGCHOtoo1DLeoySUbXbgG7QeJ68Ct7jLn2M9DHBOMhEAEWgkFyDWnov9bWI+KU3g1
	 IlsnFS2LVQ6MM4NBN9TGlXCdYMiGLhQv1d8GL4hDPSuoXhJqzzsslinnpX99YwdG1noe0
	 0octHDldof/gZkmWrA9gQ3OznKbwbA+J2aBkJtwjqtnXdB/lq7aogFkuKACgKgWpS2GPp
	 rv36/qKtPZAfMm4jJ41KM/AAvPwelk57IKibEvmZ2m90Cio8IqUIcJhl9kdpGPEawLwF8
	 f9CfLhM2pskndbTkI1mWBnkpg/I5zomaUn1f4cUiy59rlVNPJfByLzeqi4cu63tDfRQ==
X-ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015;
	a=rsa-sha256; c=relaxed/relaxed; t=1795042703;
	h=Received:DKIM-Signature:Message-ID:Date:MIME-Version:User-Agent:
	 Subject:Content-Language:To:Cc:References:From:In-Reply-To:
	 Content-Type:Content-Transfer-Encoding;
	bh=mhhQ9Ioq+2qUazDNyhj0906QRa7/QEquZU1rpFFbyfw=;
	b=R2zEmGB49CglJpBG9u7rq1HcuQ0Es/EGPuyzjSozreU7R6zrg8GGYxQ2WcMBtfjy2kcE
	 POG9c3R3J3H78XPzgN4dVO5YCTaQhKT+/OePCpuPdvyfE4WAGXQdnHsuhGb36xccPEq40
	 sWjbqU4ry8Ci136IwCIp4BW5tvE0juLxmmruwwoW+wEEdFsGzGjfmxExSYDeFFoHbp4ji
	 +ntDbNFGFppAb1AIjeXVfZweF4/uF5e8NmFCOpOYJ92FvIPaFWXn4zJ70LJeNEdphqo2d
	 LpK3/vbKPkmQE+9lSOew3Ye1Zq7Hgez93jstxuQ3vIms4rmnx3x+IOwQdcBPGSh61zw==
X-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="V/X+Qtf4";
	arc=none smtp.remote-ip=100.103.45.18
X-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 A1869606A32F
	for <netdev@vger.kernel.org>; Wed, 18 Nov 2026 22:58:23 +0000 (UTC)
X-Received: by smtp.kernel.org (Postfix) with ESMTPSA id 3B46E1F000C7;
	Wed, 18 Nov 2026 22:58:23 +0000 (UTC)
X-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org;
	s=k20260515; t=1795042703;
	bh=mhhQ9Ioq+2qUazDNyhj0906QRa7/QEquZU1rpFFbyfw=;
	h=Date:Subject:To:Cc:References:From:In-Reply-To;
	b=V/X+Qtf4hIKu5jHJX1+PxB2nEt41q8+4c/jpTdEEoFc2BI1O5PD7sdC2mW4akLaCi
	 nZusPH2dXcNLmJ3GalAKMf4fKXEz7UE9HQ+Lmb1zAKCEwsKMa7CG65R04OXI3oBQrS
	 uHOURWSFvgbDWGuHhY4tJmNHZXXV3x9EBIjdUw/u2wm35fdOdbMrdJ16dIvyvSqMc4
	 WVX47lwXYsX2wYXoBKzZsfqoL5sJJQUckzn2CIRtfML//rzy/JSCUeJjU2SQJQpNIv
	 a9XyRx2RuP5s/9LvxddJDO0SL2kjJucifzdhdSKpfEHAN3cesm9w7IU1OXibF7NEhb
	 YFZ+wWae9wvxg==
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: Stephen Hemminger <stephen@networkplumber.org>,
 Ivan Vecera <ivecera@redhat.com>, Jiri Pirko <jiri@resnulli.us>
X-In-Reply-To: <20261110110101.2155953-2-poros@redhat.com>