Netdev List
 help / color / mirror / Atom feed
From: David Ahern <dsahern@kernel.org>
To: Petr Oros <poros@redhat.com>, netdev@vger.kernel.org
Cc: Stephen Hemminger <stephen@networkplumber.org>,
	Ivan Vecera <ivecera@redhat.com>, Jiri Pirko <jiri@resnulli.us>
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	[thread overview]
Message-ID: <99ccfd3c-47d6-41bd-a8d4-5036f0edafea@kernel.org> (raw)
In-Reply-To: <20261110110101.2155953-2-poros@redhat.com>

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.



  reply	other threads:[~2026-11-18 22:58 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-10 11:00 [PATCH iproute2-next 0/2] dpll: do not fail on interrupted dumps Petr Oros
2026-11-10 11:01 ` [PATCH iproute2-next 1/2] mnl_utils: add a dump helper for NLM_F_DUMP_INTR Petr Oros
2026-11-18 22:58   ` David Ahern [this message]
2026-11-10 11:01 ` [PATCH iproute2-next 2/2] dpll: warn about interrupted dumps Petr Oros

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=99ccfd3c-47d6-41bd-a8d4-5036f0edafea@kernel.org \
    --to=dsahern@kernel.org \
    --cc=ivecera@redhat.com \
    --cc=jiri@resnulli.us \
    --cc=netdev@vger.kernel.org \
    --cc=poros@redhat.com \
    --cc=stephen@networkplumber.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox