public inbox for rcu@vger.kernel.org
 help / color / mirror / Atom feed
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>,
	rcu@vger.kernel.org
Subject: Re: [PATCH nf-next 2/5] ipvs: add resizable hash tables
Date: Mon, 2 Mar 2026 20:17:25 +0100	[thread overview]
Message-ID: <aaXiPAI5mcHAt385@strlen.de> (raw)
In-Reply-To: <8cb40028-50ed-b646-ecd7-9ab47e9ba38f@ssi.bg>

Julian Anastasov <ja@ssi.bg> wrote:
> > Julian Anastasov <ja@ssi.bg> wrote:
> > > +/**
> > > + * ip_vs_rht_for_bucket_retry() - Retry bucket if entries are moved
> > > + * @t:		current table, used as cursor, struct ip_vs_rht *var
> > > + * @bucket:	index of current bucket or hash key
> > > + * @sc:		temp seqcount_t *var
> > > + * @retry:	temp int var
> > > + */
> > > +#define ip_vs_rht_for_bucket_retry(t, bucket, sc, seq, retry)		\
> > 
> > This triggers a small kdoc warning:
> > 
> > Warning: include/net/ip_vs.h:554 function parameter 'seq' not described in 'ip_vs_rht_for_bucket_retry'
> 
> 	Will fix it, thanks! Just let me know if more comments
> are expected before sending next version...

There is some checkpatch noise in patch 1:

CHECK: Alignment should match open parenthesis
#42: FILE: include/linux/rculist_bl.h:24:
+       rcu_assign_pointer(hlist_bl_first_rcu(h),
                (struct hlist_bl_node *)((unsigned long)n | LIST_BL_LOCKMASK));

CHECK: Macro argument 'member' may be better as '(member)' to avoid precedence issues
#97: FILE: include/linux/rculist_bl.h:126:
+#define hlist_bl_for_each_entry_continue_rcu(tpos, pos, member)                \
+       for (pos = rcu_dereference_raw(hlist_bl_next_rcu(&(tpos)->member)); \
+            pos &&                                                     \
+            ({ tpos = hlist_bl_entry(pos, typeof(*tpos), member); 1; }); \
+            pos = rcu_dereference_raw(hlist_bl_next_rcu(pos)))


And patch 2:
ERROR: Macros with complex values should be enclosed in parentheses
#147: FILE: include/net/ip_vs.h:583:
+#define ip_vs_rht_walk_buckets_rcu(table, head)                                \
+       ip_vs_rht_for_each_table_rcu(table, _t, _p)                     \
+               ip_vs_rht_for_each_bucket(_t, _bucket, head)            \
+                       ip_vs_rht_for_bucket_retry(_t, _bucket, _sc,    \
+                                                  _seq, _retry)

BUT SEE:

   do {} while (0) advice is over-stated in a few situations:

   The more obvious case is macros, like MODULE_PARM_DESC, invoked at

[ there is more ]

... but I don't really care, you can handle/ignore it as you see fit.

I only have a question wrt. the hash table choice.

Why are you not re-using rhashtables and instead roll your own?

No requirement, but might make sense to mention the rationale
in the commit message.

Thanks.

  reply	other threads:[~2026-03-02 19:17 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-02-26 19:50 [PATCH nf-next 0/5] IPVS changes, part 3 of 4 - per-net tables Julian Anastasov
2026-02-26 19:50 ` [PATCH nf-next 1/5] rculist_bl: add hlist_bl_for_each_entry_continue_rcu Julian Anastasov
2026-02-26 19:50 ` [PATCH nf-next 2/5] ipvs: add resizable hash tables Julian Anastasov
2026-03-01 13:23   ` Florian Westphal
2026-03-02 17:41     ` Julian Anastasov
2026-03-02 19:17       ` Florian Westphal [this message]
2026-03-02 22:18         ` Julian Anastasov
2026-03-03 20:27           ` Florian Westphal
2026-02-26 19:50 ` [PATCH nf-next 3/5] ipvs: use resizable hash table for services Julian Anastasov
2026-02-26 19:50 ` [PATCH nf-next 4/5] ipvs: switch to per-net connection table Julian Anastasov
2026-02-26 19:50 ` [PATCH nf-next 5/5] ipvs: use more keys for connection hashing 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=aaXiPAI5mcHAt385@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 \
    --cc=rcu@vger.kernel.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox