[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20210805061547.3e0869ad@kicinski-fedora-pc1c0hjn.dhcp.thefacebook.com>
Date: Thu, 5 Aug 2021 06:15:47 -0700
From: Jakub Kicinski <kuba@...nel.org>
To: Leon Romanovsky <leon@...nel.org>
Cc: "David S . Miller" <davem@...emloft.net>,
Leon Romanovsky <leonro@...dia.com>,
linux-kernel@...r.kernel.org, netdev@...r.kernel.org
Subject: Re: [PATCH net-next v1] netdevsim: Forbid devlink reload when
adding or deleting ports
On Thu, 5 Aug 2021 14:05:41 +0300 Leon Romanovsky wrote:
> From: Leon Romanovsky <leonro@...dia.com>
>
> In order to remove complexity in devlink core related to
> devlink_reload_enable/disable, let's rewrite new_port/del_port
> logic to rely on internal to netdevsim lock.
>
> We should protect only reload_down flow because it destroys nsim_dev,
> which is needed for nsim_dev_port_add/nsim_dev_port_del to hold
> port_list_lock.
I don't understand why we only have to protect reload_down.
What protects us from adding a port right after down? That'd hit a
destroyed mutex, up wipes the port list etc...
> + nsim_bus_dev = nsim_dev->nsim_bus_dev;
> + if (!mutex_trylock(&nsim_bus_dev->nsim_bus_reload_lock))
> + return -EOPNOTSUPP;
Why not -EBUSY?
Powered by blists - more mailing lists