All of lore.kernel.org
 help / color / mirror / Atom feed
From: Pablo Neira Ayuso <pablo@netfilter.org>
To: netfilter-devel@vger.kernel.org
Subject: [PATCH nft 11/18] evaluate: add flowtable to the cache
Date: Fri, 30 Apr 2021 01:42:48 +0200	[thread overview]
Message-ID: <20210429234255.16840-12-pablo@netfilter.org> (raw)
In-Reply-To: <20210429234255.16840-1-pablo@netfilter.org>

If the cache does not contain this flowtable that is defined in this
batch, then add it to the cache. This allows for references to this new
flowtable in the same batch.

Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
---
 src/evaluate.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/src/evaluate.c b/src/evaluate.c
index 02115101fec3..f4c1acef0b16 100644
--- a/src/evaluate.c
+++ b/src/evaluate.c
@@ -3961,6 +3961,9 @@ static int flowtable_evaluate(struct eval_ctx *ctx, struct flowtable *ft)
 	if (table == NULL)
 		return table_not_found(ctx);
 
+	if (!ft_cache_find(table, ft->handle.flowtable.name))
+		ft_cache_add(flowtable_get(ft), table);
+
 	if (ft->hook.name) {
 		ft->hook.num = str2hooknum(NFPROTO_NETDEV, ft->hook.name);
 		if (ft->hook.num == NF_INET_NUMHOOKS)
-- 
2.20.1


  parent reply	other threads:[~2021-04-29 23:43 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-04-29 23:42 [PATCH nft 00/18] cache updates,v2 Pablo Neira Ayuso
2021-04-29 23:42 ` [PATCH nft 01/18] tests: shell: remove missing modules Pablo Neira Ayuso
2021-04-29 23:42 ` [PATCH nft 02/18] src: unbreak deletion by table handle Pablo Neira Ayuso
2021-04-29 23:42 ` [PATCH nft 03/18] rule: skip fuzzy lookup for unexisting 64-bit handle Pablo Neira Ayuso
2021-04-29 23:42 ` [PATCH nft 04/18] src: pass chain name to chain_cache_find() Pablo Neira Ayuso
2021-04-29 23:42 ` [PATCH nft 05/18] src: consolidate nft_cache infrastructure Pablo Neira Ayuso
2021-04-29 23:42 ` [PATCH nft 06/18] src: consolidate object cache infrastructure Pablo Neira Ayuso
2021-04-29 23:42 ` [PATCH nft 07/18] cache: add hashtable cache for object Pablo Neira Ayuso
2021-04-29 23:42 ` [PATCH nft 08/18] cache: add hashtable cache for flowtable Pablo Neira Ayuso
2021-04-29 23:42 ` [PATCH nft 09/18] cache: add set_cache_del() and use it Pablo Neira Ayuso
2021-04-29 23:42 ` [PATCH nft 10/18] evaluate: add set to the cache Pablo Neira Ayuso
2021-04-29 23:42 ` Pablo Neira Ayuso [this message]
2021-04-29 23:42 ` [PATCH nft 12/18] cache: missing table cache for several policy objects Pablo Neira Ayuso
2021-04-29 23:42 ` [PATCH nft 13/18] evaluate: add object to the cache Pablo Neira Ayuso
2021-04-29 23:42 ` [PATCH nft 14/18] cache: add hashtable cache for table Pablo Neira Ayuso
2021-04-29 23:42 ` [PATCH nft 15/18] evaluate: remove chain from cache on delete chain command Pablo Neira Ayuso
2021-04-29 23:42 ` [PATCH nft 16/18] evaluate: remove set from cache on delete set command Pablo Neira Ayuso
2021-04-29 23:42 ` [PATCH nft 17/18] evaluate: remove flowtable from cache on delete flowtable command Pablo Neira Ayuso
2021-04-29 23:42 ` [PATCH nft 18/18] evaluate: remove object from cache on delete object command Pablo Neira Ayuso

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=20210429234255.16840-12-pablo@netfilter.org \
    --to=pablo@netfilter.org \
    --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.