[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <7eec1423-d298-4fc1-bbbd-b4a7ed14d471@redhat.com>
Date: Fri, 29 Nov 2024 18:13:10 +0100
From: Paolo Abeni <pabeni@...hat.com>
To: David Ahern <dsahern@...nel.org>, netdev@...r.kernel.org
Cc: "David S. Miller" <davem@...emloft.net>,
Eric Dumazet <edumazet@...gle.com>, Jakub Kicinski <kuba@...nel.org>,
Simon Horman <horms@...nel.org>
Subject: Re: [PATCH net] ipmr: tune the ipmr_can_free_table() checks.
On 11/29/24 18:01, David Ahern wrote:
> On 11/29/24 3:23 AM, Paolo Abeni wrote:
>> diff --git a/net/ipv4/ipmr.c b/net/ipv4/ipmr.c
>> index c5b8ec5c0a8c..d814a352cc05 100644
>> --- a/net/ipv4/ipmr.c
>> +++ b/net/ipv4/ipmr.c
>> @@ -122,7 +122,7 @@ static void ipmr_expire_process(struct timer_list *t);
>>
>> static bool ipmr_can_free_table(struct net *net)
>> {
>> - return !check_net(net) || !net->ipv4.mr_rules_ops;
>> + return !check_net(net) || !net->list.next;
>> }
>>
>> static struct mr_table *ipmr_mr_table_iter(struct net *net,
>> diff --git a/net/ipv6/ip6mr.c b/net/ipv6/ip6mr.c
>> index 7f1902ac3586..37224a5f1bbe 100644
>> --- a/net/ipv6/ip6mr.c
>> +++ b/net/ipv6/ip6mr.c
>> @@ -110,7 +110,7 @@ static void ipmr_expire_process(struct timer_list *t);
>>
>> static bool ip6mr_can_free_table(struct net *net)
>> {
>> - return !check_net(net) || !net->ipv6.mr6_rules_ops;
>> + return !check_net(net) || !net->list.next;
>> }
>>
>> static struct mr_table *ip6mr_mr_table_iter(struct net *net,
>
> this exposes internal namespace details to ipmr code. How about a helper
> in net_namespace.h that indicates the intent here?
Makes sense. What about something alike:
static bool net_setup_completed(struct net *net)
{
return net->list.next;
}
in net_namespace.h?
The question is mainly about the name, which I'm notably bad to pick.
Thanks,
Paolo
Powered by blists - more mailing lists