• Florian Westphal's avatar
    netfilter: conntrack: allow increasing bucket size via sysctl too · 3183ab89
    Florian Westphal authored
    No need to restrict this to module parameter.
    
    We export a copy of the real hash size -- when user alters the value we
    allocate the new table, copy entries etc before we update the real size
    to the requested one.
    
    This is also needed because the real size is used by concurrent readers
    and cannot be changed without synchronizing the conntrack generation
    seqcnt.
    
    We only allow changing this value from the initial net namespace.
    
    Tested using http-client-benchmark vs. httpterm with concurrent
    
    while true;do
     echo $RANDOM > /proc/sys/net/netfilter/nf_conntrack_buckets
    done
    Signed-off-by: default avatarFlorian Westphal <fw@strlen.de>
    Signed-off-by: default avatarPablo Neira Ayuso <pablo@netfilter.org>
    3183ab89
nf_conntrack_standalone.c 15.3 KB