[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <aIA0kYa1oi6YPQX8@calendula>
Date: Wed, 23 Jul 2025 03:02:09 +0200
From: Pablo Neira Ayuso <pablo@...filter.org>
To: lvxiafei <xiafei_xupt@....com>
Cc: coreteam@...filter.org, davem@...emloft.net, edumazet@...gle.com,
horms@...nel.org, kadlec@...filter.org, kuba@...nel.org,
linux-kernel@...r.kernel.org, lvxiafei@...setime.com,
netdev@...r.kernel.org, netfilter-devel@...r.kernel.org,
pabeni@...hat.com, fw@...len.de
Subject: Re: [PATCH V2] netfilter: nf_conntrack: table full detailed log
On Thu, May 22, 2025 at 05:19:54PM +0800, lvxiafei wrote:
> From: lvxiafei <lvxiafei@...setime.com>
>
> Add the netns field in the "nf_conntrack: table full,
> dropping packet" log to help locate the specific netns
> when the table is full.
>
> Signed-off-by: lvxiafei <lvxiafei@...setime.com>
> ---
> net/netfilter/nf_conntrack_core.c | 6 +++++-
> 1 file changed, 5 insertions(+), 1 deletion(-)
>
> diff --git a/net/netfilter/nf_conntrack_core.c b/net/netfilter/nf_conntrack_core.c
> index 7f8b245e287a..47036a9d4acc 100644
> --- a/net/netfilter/nf_conntrack_core.c
> +++ b/net/netfilter/nf_conntrack_core.c
> @@ -1659,7 +1659,11 @@ __nf_conntrack_alloc(struct net *net,
> if (!conntrack_gc_work.early_drop)
> conntrack_gc_work.early_drop = true;
> atomic_dec(&cnet->count);
> - net_warn_ratelimited("nf_conntrack: table full, dropping packet\n");
> + if (net == &init_net)
> + net_warn_ratelimited("nf_conntrack: table full, dropping packet\n");
> + else
> + net_warn_ratelimited("nf_conntrack: table full in netns %u, dropping packet\n",
> + net->ns.inum);
This is slightly better, but it still does not say what packet has
been dropped, right?
Probably a similar approach to nf_tcp_log_invalid() would better here.
Thus, nf_log infrastructure could be used as logging hub.
Logging the packet probably provides more context information than
simply logging the netns inode number.
Powered by blists - more mailing lists