Thread View: linux.kernel.netdev
1 messages
1 total messages
Started by David Ahern
Wed, 18 Nov 2026 22:58
Re: [PATCH iproute2-next 1/2] mnl_utils: add a dump helper for NLM_F_DUMP_INTR
Author: David Ahern
Date: Wed, 18 Nov 2026 22:58
Date: Wed, 18 Nov 2026 22:58
38 lines
9378 bytes
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.
Thread Navigation
This is a paginated view of messages in the thread with full content displayed inline.
Messages are displayed in chronological order, with the original post highlighted in green.
Use pagination controls to navigate through all messages in large threads.
Back to All Threads