[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <aTbeKpBL0qVtjyY-@strlen.de>
Date: Mon, 8 Dec 2025 15:18:25 +0100
From: Florian Westphal <fw@...len.de>
To: Nick Wood <nwood@...udflare.com>
Cc: Jesper Dangaard Brouer <hawk@...nel.org>,
netfilter-devel@...r.kernel.org,
Pablo Neira Ayuso <pablo@...filter.org>, netdev@...r.kernel.org,
phil@....cc, Eric Dumazet <eric.dumazet@...il.com>,
"David S. Miller" <davem@...emloft.net>,
Jakub Kicinski <kuba@...nel.org>, Paolo Abeni <pabeni@...hat.com>,
kernel-team@...udflare.com, mfleming@...udflare.com,
matt@...dmodwrite.com, aforster@...udflare.com
Subject: Re: [PATCH nf-next RFC 1/3] xt_statistic: taking GRO/GSO into
account for nth-match
Nick Wood <nwood@...udflare.com> wrote:
> > It was easier to change the nth code (and easier for me to reason about)
> > than dealing with converting the the formula to use an integer
> > approximation (given we don't have floating point calc in kernel).
>
> with s = integer sample rate (i.e s=100 if we're sampling 1/100)
> and n = nr_packets:
>
> sample_threshold = [ 2**32 //s //s ] * [n*(s - (n-1))] ;
>
> if get_random_u32 < sample_threshold {
> sample_single_subpacket
> }*
Thanks for clarifying. But we can't do that within the limitations
imposed by the netfilter framework.
We can only flag the entire skb/aggregate as either matching or not
matching. We can't signal a 'match this subpacket'.
While we could split the aggregate within the conditional, we can't
(re)inject splitted packets back into the processing pipeline.
If there is a way, I can't think of anything. At least not without
major rework of the entire netfilter stack :-|
Powered by blists - more mailing lists