Messages in this thread | | | Date | Tue, 9 Aug 2022 11:05:19 +0800 (GMT+08:00) | From | "Lin Ma" <> | Subject | Re: [PATCH v0] idb: Add rtnl_lock to avoid data race |
| |
Hello there,
> > What about the disable path coming from sysfs? This looks incomplete to > me. Perhaps take a look at commit 1e53834ce541 ("ixgbe: Add locking to > prevent panic when setting sriov_numvfs to zero") for some inspiration.
Thanks for the advice, I sent the new version of the patch which uses a new spinlock to avoid race cases such as described in commit 1e53834ce541.
Additionally, I also keep the rtnl_lock to eliminate the races that come from netdev core. Although this can also be handled with the newly added spinlock, I found that adding the spinlock every time accessing the VF resources is not trivial. (If you think that keep using the spinlock is better I will craft a new version of patch)
It seems that ixgbe_disable_sriov also suffers from the mentioned races from netdev core. If you think the rtnl_lock solution is fine, I will also send a patch for that driver too.
Thanks Lin Ma | |