Re: [PATCH net-next] net: add sysctl ndisc_debug

From: Wang Liang
Date: Thu Jun 26 2025 - 21:14:11 EST



在 2025/6/24 22:31, Ido Schimmel 写道:
On Tue, Jun 24, 2025 at 08:51:15PM +0800, Wang Liang wrote:
Ipv6 ndisc uses ND_PRINTK to print logs. However it only works when
ND_DEBUG was set in the compilation phase. This patch adds sysctl
ndisc_debug, so we can change the print switch when system is running and
get ipv6 ndisc log to debug.
Is there a good reason to do this instead of using dynamic debug? Note
that we will never be able to remove this sysctl.

Users of vanilla kernels can only see the messages printed with 'val'
being 0 or 1. Maybe convert them to call net_{err,warn}_ratelimited()
instead of ND_PRINTK() and convert the rest to net_dbg_ratelimited() so
that users will be able to enable / disable them during runtime via the
dynamic debug interface?
Hi! Thanks for your review!

Yes, you are right. Dynamic debug is indeed a better choice.

I will use it to replace sysctl in v2.

------
Best regards
Wang Liang