[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <14c9b1de-7dd5-4f94-a604-6007991ac17b@redhat.com>
Date: Fri, 29 Nov 2024 19:02:38 +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:13, Paolo Abeni wrote:
> 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.
Thinking again about it, I would use 'net_initialized', unless someone
has a better option.
Thanks,
Paolo
Powered by blists - more mailing lists