Message ID | 20210312150444.355207-17-atenart@kernel.org (mailing list archive) |
---|---|
State | Superseded |
Delegated to: | Netdev Maintainers |
Headers | show |
Series | net: xps: improve the xps maps handling | expand |
Context | Check | Description |
---|---|---|
netdev/cover_letter | success | Link |
netdev/fixes_present | success | Link |
netdev/patch_count | fail | Series longer than 15 patches |
netdev/tree_selection | success | Clearly marked for net-next |
netdev/subject_prefix | success | Link |
netdev/cc_maintainers | warning | 1 maintainers not CCed: virtualization@lists.linux-foundation.org |
netdev/source_inline | success | Was 0 now: 0 |
netdev/verify_signedoff | success | Link |
netdev/module_param | success | Was 0 now: 0 |
netdev/build_32bit | success | Errors and warnings before: 0 this patch: 0 |
netdev/kdoc | success | Errors and warnings before: 0 this patch: 0 |
netdev/verify_fixes | success | Link |
netdev/checkpatch | success | total: 0 errors, 0 warnings, 0 checks, 27 lines checked |
netdev/build_allmodconfig_warn | success | Errors and warnings before: 0 this patch: 0 |
netdev/header_inline | success | Link |
diff --git a/drivers/net/virtio_net.c b/drivers/net/virtio_net.c index dde9bbcc5ff0..54d2277f6c98 100644 --- a/drivers/net/virtio_net.c +++ b/drivers/net/virtio_net.c @@ -2027,7 +2027,9 @@ static int virtnet_cpu_online(unsigned int cpu, struct hlist_node *node) { struct virtnet_info *vi = hlist_entry_safe(node, struct virtnet_info, node); + rtnl_lock(); virtnet_set_affinity(vi); + rtnl_unlock(); return 0; } @@ -2035,7 +2037,9 @@ static int virtnet_cpu_dead(unsigned int cpu, struct hlist_node *node) { struct virtnet_info *vi = hlist_entry_safe(node, struct virtnet_info, node_dead); + rtnl_lock(); virtnet_set_affinity(vi); + rtnl_unlock(); return 0; } @@ -2883,7 +2887,9 @@ static int init_vqs(struct virtnet_info *vi) goto err_free; get_online_cpus(); + rtnl_lock(); virtnet_set_affinity(vi); + rtnl_unlock(); put_online_cpus(); return 0;
netif_set_xps_queue must be called with the rtnl lock taken, and this is now enforced using ASSERT_RTNL(). In virtio_net, netif_set_xps_queue is called by virtnet_set_affinity. As this function can be called from an ethtool helper, we can't take the rtnl lock directly in it. Instead we take the rtnl lock when calling virtnet_set_affinity when the rtnl lock isn't taken already. Signed-off-by: Antoine Tenart <atenart@kernel.org> --- drivers/net/virtio_net.c | 6 ++++++ 1 file changed, 6 insertions(+)