netdevsim: Forbid devlink reload when adding or deleting ports
authorLeon Romanovsky <leonro@nvidia.com>
Thu, 5 Aug 2021 11:02:45 +0000 (14:02 +0300)
committerDavid S. Miller <davem@davemloft.net>
Thu, 5 Aug 2021 12:31:24 +0000 (13:31 +0100)
commit23809a726c0d004b9d2474333181f8da07360469
treec2bf92e3e279561d16cb3b3b97ecc43f868c84fe
parentf8b17a0bd96065e4511858689916bb729dbb881b
netdevsim: Forbid devlink reload when adding or deleting ports

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 lcok.

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.

Signed-off-by: Leon Romanovsky <leonro@nvidia.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/netdevsim/bus.c
drivers/net/netdevsim/dev.c