From: Pablo Neira Ayuso <pablo@netfilter.org>
To: Florian Westphal <fw@strlen.de>
Cc: netfilter-devel@vger.kernel.org
Subject: Re: [PATCH nf] netfilter: nf_tables: add rescheduling points during loop detection walks
Date: Tue, 26 Jul 2022 15:29:38 +0200 [thread overview]
Message-ID: <Yt/sQtZHB9Fs3uB7@salvia> (raw)
In-Reply-To: <20220726104435.2209-1-fw@strlen.de>
On Tue, Jul 26, 2022 at 12:44:35PM +0200, Florian Westphal wrote:
> Add explicit rescheduling points during ruleset walk.
>
> Switching to a faster algorithm is possible but this is a much
> smaller change, suitable for nf tree.
>
> Link: https://bugzilla.netfilter.org/show_bug.cgi?id=1460
Acked-by: Pablo Neira Ayuso <pablo@netfilter.org>
> Signed-off-by: Florian Westphal <fw@strlen.de>
> ---
> net/netfilter/nf_tables_api.c | 6 ++++++
> 1 file changed, 6 insertions(+)
>
> diff --git a/net/netfilter/nf_tables_api.c b/net/netfilter/nf_tables_api.c
> index 646d5fd53604..9f976b11d896 100644
> --- a/net/netfilter/nf_tables_api.c
> +++ b/net/netfilter/nf_tables_api.c
> @@ -3340,6 +3340,8 @@ int nft_chain_validate(const struct nft_ctx *ctx, const struct nft_chain *chain)
> if (err < 0)
> return err;
> }
> +
> + cond_resched();
> }
>
> return 0;
> @@ -9367,9 +9369,13 @@ static int nf_tables_check_loops(const struct nft_ctx *ctx,
> break;
> }
> }
> +
> + cond_resched();
> }
>
> list_for_each_entry(set, &ctx->table->sets, list) {
> + cond_resched();
> +
> if (!nft_is_active_next(ctx->net, set))
> continue;
> if (!(set->flags & NFT_SET_MAP) ||
> --
> 2.35.1
>
prev parent reply other threads:[~2022-07-26 13:29 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-07-26 10:44 [PATCH nf] netfilter: nf_tables: add rescheduling points during loop detection walks Florian Westphal
2022-07-26 13:29 ` Pablo Neira Ayuso [this message]
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=Yt/sQtZHB9Fs3uB7@salvia \
--to=pablo@netfilter.org \
--cc=fw@strlen.de \
--cc=netfilter-devel@vger.kernel.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.