OSDN Git Service

netdevsim: replace port_list_lock with devlink instance lock
authorJakub Kicinski <kuba@kernel.org>
Fri, 18 Mar 2022 19:23:42 +0000 (12:23 -0700)
committerDavid S. Miller <davem@davemloft.net>
Mon, 21 Mar 2022 14:11:38 +0000 (14:11 +0000)
commit76eea6c2e663f7e9fbc258c82811ad9e657e085f
tree1c58d92bc84501a0064e648534130c88add05a71
parent8879b32a3a809a183e6e2998725a0f33c4e42d41
netdevsim: replace port_list_lock with devlink instance lock

Take advantage of the devlink instance lock for protecting
the port list. This will simplify locking even more once
all devlink callbacks hold the instance lock.

We need to add locking in nsim_dev_port_add_all() which used
to assume higher layer protection when accessing the list.

Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/netdevsim/dev.c
drivers/net/netdevsim/netdevsim.h