[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CANn89iJidv66=HHWTcE+WU_HUU70SutE0EDwFR3GFsKUh9D2hA@mail.gmail.com>
Date: Fri, 7 Feb 2025 09:34:40 +0100
From: Eric Dumazet <edumazet@...gle.com>
To: Kuniyuki Iwashima <kuniyu@...zon.com>
Cc: "David S. Miller" <davem@...emloft.net>, Jakub Kicinski <kuba@...nel.org>,
Paolo Abeni <pabeni@...hat.com>, Simon Horman <horms@...nel.org>, Ido Schimmel <idosch@...sch.org>,
Kuniyuki Iwashima <kuni1840@...il.com>, netdev@...r.kernel.org
Subject: Re: [PATCH v2 net-next 5/8] net: fib_rules: Factorise fib_newrule()
and fib_delrule().
On Fri, Feb 7, 2025 at 8:27 AM Kuniyuki Iwashima <kuniyu@...zon.com> wrote:
>
> fib_nl_newrule() / fib_nl_delrule() is the doit() handler for
> RTM_NEWRULE / RTM_DELRULE but also called from vrf_newlink().
>
> Currently, we hold RTNL on both paths but will not on the former.
>
> Also, we set dev_net(dev)->rtnl to skb->sk in vrf_fib_rule() because
> fib_nl_newrule() / fib_nl_delrule() fetch net as sock_net(skb->sk).
>
> Let's Factorise the two functions and pass net and rtnl_held flag.
>
> Signed-off-by: Kuniyuki Iwashima <kuniyu@...zon.com>
Much nicer, thanks !
Reviewed-by: Eric Dumazet <edumazet@...gle.com>
Powered by blists - more mailing lists