[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CANn89i+EX_M-RPasCXct4FEA-VsRaw28_aB0M2cMvsv3XfLpoA@mail.gmail.com>
Date: Fri, 28 Feb 2025 09:29:32 +0100
From: Eric Dumazet <edumazet@...gle.com>
To: Stanislav Fomichev <sdf@...ichev.me>
Cc: netdev@...r.kernel.org, davem@...emloft.net, kuba@...nel.org,
pabeni@...hat.com, Saeed Mahameed <saeed@...nel.org>
Subject: Re: [PATCH net-next v9 01/12] net: hold netdev instance lock during ndo_open/ndo_stop
On Fri, Feb 28, 2025 at 5:53 AM Stanislav Fomichev <sdf@...ichev.me> wrote:
>
> For the drivers that use shaper API, switch to the mode where
> core stack holds the netdev lock. This affects two drivers:
>
> * iavf - already grabs netdev lock in ndo_open/ndo_stop, so mostly
> remove these
> * netdevsim - switch to _locked APIs to avoid deadlock
>
> iavf_close diff is a bit confusing, the existing call looks like this:
> iavf_close() {
> netdev_lock()
> ..
> netdev_unlock()
> wait_event_timeout(down_waitqueue)
> }
>
> I change it to the following:
> netdev_lock()
> iavf_close() {
> ..
> netdev_unlock()
> wait_event_timeout(down_waitqueue)
> netdev_lock() // reusing this lock call
> }
> netdev_unlock()
>
> Since I'm reusing existing netdev_lock call, so it looks like I only
> add netdev_unlock.
>
> Cc: Saeed Mahameed <saeed@...nel.org>
> Signed-off-by: Stanislav Fomichev <sdf@...ichev.me>
Reviewed-by: Eric Dumazet <edumazet@...gle.com>
Powered by blists - more mailing lists