From: Florian Westphal <fw@strlen.de>
To: Donald Hunter <donald.hunter@gmail.com>
Cc: Pablo Neira Ayuso <pablo@netfilter.org>,
Nikolaos Gkarlis <nickgarlis@gmail.com>,
netfilter-devel@vger.kernel.org
Subject: Re: [PATCH] netfilter: nfnetlink: always ACK batch end if requested
Date: Wed, 8 Oct 2025 16:50:20 +0200 [thread overview]
Message-ID: <aOZ6LEfjQrh_NLz5@strlen.de> (raw)
In-Reply-To: <CAD4GDZxhOZOp1uJ=V-oEnjfU2B7B4NaTSYJBj7mr=ogfPb68Jg@mail.gmail.com>
Donald Hunter <donald.hunter@gmail.com> wrote:
> Thanks for the cc. I'm having difficulty catching up with the thread
> of conversation, so forgive me if I miss something.
>
> > Yes, I am inclined not to add more features to bf2ac490d28c (and
> > follow up fixes patches that came with it).
>
> Is there a problem with bf2ac490d28c or just with things that have
> come after it?
it broke golang library for nftables:
https://github.com/google/nftables/issues/329
Fix is:
https://git.kernel.org/pub/scm/linux/kernel/git/netfilter/nf-next.git/commit/?id=09efbac953f6f076a07735f9ba885148d4796235
Current discussion centers more on what bf2ac490d28c wants,
what it does, what netlink can provide in practice and what
userspace would expect/need.
> > > > I suspect the author of bf2ac490d28c is making wrong assumptions on
> > > > the number of acknowledgements that are going to be received by
> > > > userspace.
>
> Hopefully not. In the success case, ask for an ack, get an ack.
> Without that guarantee to userspace, we'd need to extend the YNL spec
> to say which messages don't honour acks.
Its not about the types, its more about available buffer space for acks.
> > > > #2 If you set NLM_F_ACK in your netlink messages in the batch:
> > > > You get one acknowledgement for each message in the batch, with a
> > > > sufficiently large batch, this may overrun the userspace socket
> > > > buffer (ENOBUFS), then maybe the kernel was successful to fully
> > > > process the transaction but some of those acks get lost.
>
> Are people reporting ENOBUFS because of ACKs in practice or is this theoretical?
It happens in practice, e.g.:
https://lore.kernel.org/netfilter/aKrK6h2zYdqj2unR@lilyboudoir.localdomain/
(every set element triggers another error message).
Note, this is without NLM_F_ACK, just due to error messages
triggered during batch processing.
> I think we should try to specify the behaviour and see if it makes
> sense before layering more functionality onto what is there.
I think we can all agree on that :-)
> I can describe how the YNL python code sees the world, when it asks for ACKs:
>
> 1. An ack for BEGIN, cmd, cmd, ... , END in the success scenario.
> 2. An ack for BEGIN, cmd, cmd, ... up to the first ERROR in a failure scenario.
Thanks for clarifying.
This should work, IFF the batch is small enough so receive buffer can
hold all acks.
nftables doesn't bail out on first error (transaction will fail and
no permanent changes are made, but it will move to next contained
message.
next prev parent reply other threads:[~2025-10-08 14:50 UTC|newest]
Thread overview: 28+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-10-01 21:15 [PATCH] netfilter: nfnetlink: always ACK batch end if requested Nikolaos Gkarlis
2025-10-02 9:48 ` Fernando Fernandez Mancera
2025-10-02 10:41 ` Nikolaos Gkarlis
2025-10-02 11:03 ` Fernando Fernandez Mancera
2025-10-04 9:26 ` [PATCH v2 0/2] " Nikolaos Gkarlis
2025-10-04 9:26 ` [PATCH v2 1/2] netfilter: nfnetlink: " Nikolaos Gkarlis
2025-10-04 9:26 ` [PATCH v2 2/2] selftests: netfilter: add nfnetlink ACK handling tests Nikolaos Gkarlis
2025-10-04 10:46 ` Florian Westphal
2025-10-04 11:08 ` Nikolaos Gkarlis
2025-10-04 12:26 ` Florian Westphal
2025-10-05 10:43 ` Nikolaos Gkarlis
2025-10-05 11:42 ` Florian Westphal
2025-10-05 12:54 ` [PATCH v3] " Nikolaos Gkarlis
2025-10-08 10:26 ` Florian Westphal
2025-10-08 10:37 ` Nikolaos Gkarlis
2025-10-08 10:39 ` Florian Westphal
2026-02-04 16:33 ` Florian Westphal
2025-10-04 9:38 ` [PATCH v2 0/2] always ACK batch end if requested Nikolaos Gkarlis
2025-10-02 10:10 ` [PATCH] netfilter: nfnetlink: " Florian Westphal
2025-10-02 10:46 ` Nikolaos Gkarlis
2025-10-07 20:33 ` Pablo Neira Ayuso
2025-10-08 7:28 ` Florian Westphal
2025-10-08 11:33 ` Pablo Neira Ayuso
2025-10-08 13:35 ` Donald Hunter
2025-10-08 14:50 ` Florian Westphal [this message]
2025-10-08 8:41 ` Nikolaos Gkarlis
2025-10-08 11:09 ` Pablo Neira Ayuso
2025-10-08 14:50 ` Nikolaos Gkarlis
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=aOZ6LEfjQrh_NLz5@strlen.de \
--to=fw@strlen.de \
--cc=donald.hunter@gmail.com \
--cc=netfilter-devel@vger.kernel.org \
--cc=nickgarlis@gmail.com \
--cc=pablo@netfilter.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.