* [PATCH] netfilter: conntrack: document sparse hash table eviction
@ 2026-11-06 13:58 Vikash SS
2026-11-06 14:06 ` Pablo Neira Ayuso
2026-11-06 14:30 ` [PATCH v2] " Vikash SS
0 siblings, 2 replies; 3+ messages in thread
From: Vikash SS @ 2026-11-06 13:58 UTC (permalink / raw)
To: netfilter-devel; +Cc: pablo, fw, linux-doc, corbet, Vikash SS
When nf_conntrack_max is significantly smaller than
nf_conntrack_buckets, the hash table can become sparsely populated.
The early_drop() path examines at most 8 consecutive hash buckets
when searching for eviction candidates. Under table exhaustion,
this bounded search may fail to find an eligible entry even when
evictable connections exist elsewhere in the table.
Document this limitation to clarify the implications of configuring
nf_conntrack_max significantly below nf_conntrack_buckets.
Signed-off-by: Vikash SS <thisisforspotifyvikash@gmail.com>
---
Documentation/networking/nf_conntrack-sysctl.rst | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/Documentation/networking/nf_conntrack-sysctl.rst b/Documentation/networking/nf_conntrack-sysctl.rst
index 4426cce2a..fc07a950b 100644
--- a/Documentation/networking/nf_conntrack-sysctl.rst
+++ b/Documentation/networking/nf_conntrack-sysctl.rst
@@ -99,6 +99,10 @@ nf_conntrack_max - INTEGER
the reversed address). This means that with default settings a maxed-out
table will have a average hash chain length of 2, not 1.
+ Setting nf_conntrack_max much lower than nf_conntrack_buckets
+ may cause early eviction to fail under table exhaustion, as
+ the eviction search may not find entries in sparse hash tables.
+
nf_conntrack_tcp_be_liberal - BOOLEAN
- 0 - disabled (default)
- not 0 - enabled
--
2.34.1
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH] netfilter: conntrack: document sparse hash table eviction
2026-11-06 13:58 [PATCH] netfilter: conntrack: document sparse hash table eviction Vikash SS
@ 2026-11-06 14:06 ` Pablo Neira Ayuso
2026-11-06 14:30 ` [PATCH v2] " Vikash SS
1 sibling, 0 replies; 3+ messages in thread
From: Pablo Neira Ayuso @ 2026-11-06 14:06 UTC (permalink / raw)
To: Vikash SS; +Cc: netfilter-devel, fw, linux-doc, corbet
On Fri, Nov 06, 2026 at 01:58:16PM +0000, Vikash SS wrote:
> When nf_conntrack_max is significantly smaller than
> nf_conntrack_buckets, the hash table can become sparsely populated.
>
> The early_drop() path examines at most 8 consecutive hash buckets
> when searching for eviction candidates. Under table exhaustion,
> this bounded search may fail to find an eligible entry even when
> evictable connections exist elsewhere in the table.
>
> Document this limitation to clarify the implications of configuring
> nf_conntrack_max significantly below nf_conntrack_buckets.
>
> Signed-off-by: Vikash SS <thisisforspotifyvikash@gmail.com>
> ---
> Documentation/networking/nf_conntrack-sysctl.rst | 4 ++++
> 1 file changed, 4 insertions(+)
>
> diff --git a/Documentation/networking/nf_conntrack-sysctl.rst b/Documentation/networking/nf_conntrack-sysctl.rst
> index 4426cce2a..fc07a950b 100644
> --- a/Documentation/networking/nf_conntrack-sysctl.rst
> +++ b/Documentation/networking/nf_conntrack-sysctl.rst
> @@ -99,6 +99,10 @@ nf_conntrack_max - INTEGER
> the reversed address). This means that with default settings a maxed-out
> table will have a average hash chain length of 2, not 1.
>
> + Setting nf_conntrack_max much lower than nf_conntrack_buckets
> + may cause early eviction to fail under table exhaustion, as
> + the eviction search may not find entries in sparse hash tables.
Maybe provide a positive hint:
+ Make sure nf_conntrack_max is equal to or larger than
+ nf_conntrack_buckets, otherwise early drop may fail to evict
+ entries when it gets full.
> nf_conntrack_tcp_be_liberal - BOOLEAN
> - 0 - disabled (default)
> - not 0 - enabled
> --
> 2.34.1
>
^ permalink raw reply [flat|nested] 3+ messages in thread
* [PATCH v2] netfilter: conntrack: document sparse hash table eviction
2026-11-06 13:58 [PATCH] netfilter: conntrack: document sparse hash table eviction Vikash SS
2026-11-06 14:06 ` Pablo Neira Ayuso
@ 2026-11-06 14:30 ` Vikash SS
1 sibling, 0 replies; 3+ messages in thread
From: Vikash SS @ 2026-11-06 14:30 UTC (permalink / raw)
To: netfilter-devel; +Cc: pablo, fw, linux-doc, corbet, Vikash SS
When nf_conntrack_max is significantly smaller than
nf_conntrack_buckets, the hash table can become sparsely populated.
The early_drop() path examines at most 8 consecutive hash buckets
when searching for eviction candidates. Under table exhaustion,
this bounded search may fail to find an eligible entry even when
evictable connections exist elsewhere in the table.
Document this limitation to clarify the implications of configuring
nf_conntrack_max significantly below nf_conntrack_buckets.
Signed-off-by: Vikash SS <thisisforspotifyvikash@gmail.com>
---
Changes in v2:
- Reword documentation to provide configuration guidance,
as suggested by Pablo Neira Ayuso.
Documentation/networking/nf_conntrack-sysctl.rst | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/Documentation/networking/nf_conntrack-sysctl.rst b/Documentation/networking/nf_conntrack-sysctl.rst
index 4426cce2a..c7e9016ac 100644
--- a/Documentation/networking/nf_conntrack-sysctl.rst
+++ b/Documentation/networking/nf_conntrack-sysctl.rst
@@ -99,6 +99,10 @@ nf_conntrack_max - INTEGER
the reversed address). This means that with default settings a maxed-out
table will have a average hash chain length of 2, not 1.
+ Make sure nf_conntrack_max is equal to or larger than
+ nf_conntrack_buckets, otherwise early drop may fail to evict
+ entries when it gets full.
+
nf_conntrack_tcp_be_liberal - BOOLEAN
- 0 - disabled (default)
- not 0 - enabled
--
2.34.1
^ permalink raw reply related [flat|nested] 3+ messages in thread
end of thread, other threads:[~2026-11-06 14:30 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-11-06 13:58 [PATCH] netfilter: conntrack: document sparse hash table eviction Vikash SS
2026-11-06 14:06 ` Pablo Neira Ayuso
2026-11-06 14:30 ` [PATCH v2] " Vikash SS
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox