netfilter-devel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Florian Westphal <fw@strlen.de>
To: Ander Juaristi <a@juaristi.eus>
Cc: netfilter-devel@vger.kernel.org
Subject: Re: [PATCH] netfilter: nft_dynset: support for element deletion
Date: Sat, 13 Jul 2019 18:59:40 +0200	[thread overview]
Message-ID: <20190713165940.gyqrhab4z3eookgl@breakpoint.cc> (raw)
In-Reply-To: <20190713160302.31308-1-a@juaristi.eus>

Ander Juaristi <a@juaristi.eus> wrote:
> This patch implements the delete operation from the ruleset.
> 
> It implements a new delete() function in nft_set_rhash. It is simpler
> to use than the already existing remove(), because it only takes the set
> and the key as arguments, whereas remove() expects a full
> nft_set_elem structure.

Looks good, I plan to review all your posted patches on monday.

some nits below, 

> --- a/include/net/netfilter/nf_tables.h
> +++ b/include/net/netfilter/nf_tables.h
> @@ -312,6 +312,8 @@ struct nft_set_ops {
>  						  const struct nft_expr *expr,
>  						  struct nft_regs *regs,
>  						  const struct nft_set_ext **ext);
> +	bool				(*delete)(const struct nft_set *set,
> +						  const u32 *key);

Can you add a small comment here that explains the functions at the
start are those used on packet path, and rest are control plane/slow
path ones?

> +static bool nft_dynset_update(uint8_t sreg_key, int op, u64 timeout,

Can you use plain u8 here?  In case you haven't seen it, there is
scripts/checkpatch.pl in the kernel tree.

> +	if (he == NULL)
> +		return false;
> +
> +	rhashtable_remove_fast(&priv->ht, &he->node, nft_rhash_params);
> +	return true;

Perhaps add a small comment here that rhashtable_remove_fast retval
is ignored intentionally?

I.e., don't make this return false in case two cpus race to remove same
entry.

Otherwise, this looks really good, thanks for working on this!

  reply	other threads:[~2019-07-13 16:59 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-07-13 16:03 [PATCH] netfilter: nft_dynset: support for element deletion Ander Juaristi
2019-07-13 16:59 ` Florian Westphal [this message]
2019-07-15 16:22   ` Ander Juaristi
2019-07-15 19:54     ` Florian Westphal
2019-08-08 20:41 ` kbuild test robot

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=20190713165940.gyqrhab4z3eookgl@breakpoint.cc \
    --to=fw@strlen.de \
    --cc=a@juaristi.eus \
    --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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).