From: Florian Westphal <fw@strlen.de>
To: Julian Anastasov <ja@ssi.bg>
Cc: Simon Horman <horms@verge.net.au>,
Pablo Neira Ayuso <pablo@netfilter.org>,
lvs-devel@vger.kernel.org, netfilter-devel@vger.kernel.org,
Dust Li <dust.li@linux.alibaba.com>,
Jiejian Wu <jiejian@linux.alibaba.com>
Subject: Re: [PATCH nf-next 1/3] ipvs: show the current conn_tab size to users
Date: Sat, 4 Apr 2026 12:30:40 +0200 [thread overview]
Message-ID: <adDoUEwfuYpdGanf@strlen.de> (raw)
In-Reply-To: <20260323162523.44964-2-ja@ssi.bg>
Julian Anastasov <ja@ssi.bg> wrote:
> As conn_tab is per-net, better to show the current hash table size
> to users instead of the ip_vs_conn_tab_size (max).
>
> Signed-off-by: Julian Anastasov <ja@ssi.bg>
> ---
> net/netfilter/ipvs/ip_vs_ctl.c | 26 ++++++++++++++++++++++----
> 1 file changed, 22 insertions(+), 4 deletions(-)
>
> diff --git a/net/netfilter/ipvs/ip_vs_ctl.c b/net/netfilter/ipvs/ip_vs_ctl.c
> index b472e564b769..3129b15dadc2 100644
> --- a/net/netfilter/ipvs/ip_vs_ctl.c
> +++ b/net/netfilter/ipvs/ip_vs_ctl.c
> @@ -281,6 +281,13 @@ static void est_reload_work_handler(struct work_struct *work)
> mutex_unlock(&ipvs->est_mutex);
> }
>
> +static int get_conn_tab_size(struct netns_ipvs *ipvs)
> +{
> + struct ip_vs_rht *t = rcu_dereference(ipvs->conn_tab);
> +
> + return t? t->size : 0;
> +}
Pablo suggest to make this self-contained so callers don't have to
handle rcu read lock:
static int get_conn_tab_size(struct netns_ipvs *ipvs)
{
const struct ip_vs_rht *t;
int size = 0;
rcu_read_lock();
t = rcu_dereference(ipvs->conn_tab);
if (t)
size = t->size;
rcu_read_unlock();
return size;
}
next prev parent reply other threads:[~2026-04-04 10:30 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-03-23 16:25 [PATCH nf-next 0/3] IPVS changes, part 4 of 4 - extras Julian Anastasov
2026-03-23 16:25 ` [PATCH nf-next 1/3] ipvs: show the current conn_tab size to users Julian Anastasov
2026-04-04 10:30 ` Florian Westphal [this message]
2026-04-04 14:58 ` Julian Anastasov
2026-03-23 16:25 ` [PATCH nf-next 2/3] ipvs: add ip_vs_status info Julian Anastasov
2026-03-23 16:25 ` [PATCH nf-next 3/3] ipvs: add conn_lfactor and svc_lfactor sysctl vars Julian Anastasov
2026-03-24 13:02 ` Florian Westphal
2026-03-25 4:54 ` Julian Anastasov
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=adDoUEwfuYpdGanf@strlen.de \
--to=fw@strlen.de \
--cc=dust.li@linux.alibaba.com \
--cc=horms@verge.net.au \
--cc=ja@ssi.bg \
--cc=jiejian@linux.alibaba.com \
--cc=lvs-devel@vger.kernel.org \
--cc=netfilter-devel@vger.kernel.org \
--cc=pablo@netfilter.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.