netfilter-devel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Florian Westphal <fw@strlen.de>
To: Phil Sutter <phil@nwl.cc>, Florian Westphal <fw@strlen.de>,
	netfilter-devel@vger.kernel.org
Subject: Re: [PATCH iptables-nft] extensions: add xt_statistics random mode translation
Date: Thu, 1 Dec 2022 13:06:10 +0100	[thread overview]
Message-ID: <20221201120610.GB7057@breakpoint.cc> (raw)
In-Reply-To: <Y4iW4R1tusL9PecX@orbyte.nwl.cc>

Phil Sutter <phil@nwl.cc> wrote:
> On Thu, Dec 01, 2022 at 11:13:17AM +0100, Florian Westphal wrote:
> > Use meta random and bitops to replicate what xt_statistics
> > is doing.
> 
> I didn't know about 'meta random', even though it's a bit older than
> numgen. What's the difference to 'numgen random'?

META_RANDOM is simpler. its really just setting a 32bit register to a
32bit random value.

No modulus, offset or anything like that is supported.

For most users, numgen random is much better because you can generate a
random number within a given range.

But this translation really does match exactly what xt_statistics is
doing.

> I'm asking because I
> once tried to fix the same issue using the latter[1], it was never
> applied, though.
> 
> Maybe you could reuse gcd_div() from my patch to reduce nominal values?

Why?  If you prefer numgen, maybe just rebase your patch and push it out?

  reply	other threads:[~2022-12-01 12:06 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-12-01 10:13 [PATCH iptables-nft] extensions: add xt_statistics random mode translation Florian Westphal
2022-12-01 11:58 ` Phil Sutter
2022-12-01 12:06   ` Florian Westphal [this message]
2022-12-01 13:14     ` Phil Sutter

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=20221201120610.GB7057@breakpoint.cc \
    --to=fw@strlen.de \
    --cc=netfilter-devel@vger.kernel.org \
    --cc=phil@nwl.cc \
    /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).