bnxt_en: extend RTNL to VF check in devlink driver_reinit
authorEdwin Peer <edwin.peer@broadcom.com>
Mon, 15 Nov 2021 07:37:59 +0000 (02:37 -0500)
committerDavid S. Miller <davem@davemloft.net>
Mon, 15 Nov 2021 14:13:20 +0000 (14:13 +0000)
commit46d08f55d24e69e921456b5a40717da09199267b
tree12bfb4df6bdf06bef7e23ecf8545c39528617fd1
parente97b21e94652f5f0d1c196452c111151f6d15883
bnxt_en: extend RTNL to VF check in devlink driver_reinit

The fixes the race condition between configuring SR-IOV and devlink
reload.  The SR-IOV configure logic already takes the RTNL lock,
setting sriov_cfg under the lock while changes are underway. Extend
the lock scope in devlink driver_reinit to cover the VF check and
don't run concurrently with SR-IOV configure.

Reported-by: Leon Romanovsky <leon@kernel.org>
Fixes: 228ea8c187d8 ("bnxt_en: implement devlink dev reload driver_reinit")
Cc: Leon Romanovsky <leon@kernel.org>
Reviewed-by: Somnath Kotur <somnath.kotur@broadcom.com>
Reviewed-by: Pavan Chebbi <pavan.chebbi@broadcom.com>
Reviewed-by: Andy Gospodarek <gospo@broadcom.com>
Signed-off-by: Edwin Peer <edwin.peer@broadcom.com>
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/broadcom/bnxt/bnxt_devlink.c