mirror-linux/net/openvswitch
Toke Høiland-Jørgensen 5498227676 net: openvswitch: Avoid needlessly taking the RTNL on vport destroy
The openvswitch teardown code will immediately call
ovs_netdev_detach_dev() in response to a NETDEV_UNREGISTER notification.
It will then start the dp_notify_work workqueue, which will later end up
calling the vport destroy() callback. This callback takes the RTNL to do
another ovs_netdev_detach_port(), which in this case is unnecessary.
This causes extra pressure on the RTNL, in some cases leading to
"unregister_netdevice: waiting for XX to become free" warnings on
teardown.

We can straight-forwardly avoid the extra RTNL lock acquisition by
checking the device flags before taking the lock, and skip the locking
altogether if the IFF_OVS_DATAPATH flag has already been unset.

Fixes: b07c26511e ("openvswitch: fix vport-netdev unregister")
Tested-by: Adrian Moreno <amorenoz@redhat.com>
Signed-off-by: Toke Høiland-Jørgensen <toke@redhat.com>
Acked-by: Eelco Chaudron <echaudro@redhat.com>
Acked-by: Aaron Conole <aconole@redhat.com>
Link: https://patch.msgid.link/20251211115006.228876-1-toke@redhat.com
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
2025-12-22 12:25:11 +01:00
..
Kconfig sctp: use skb_crc32c() instead of __skb_checksum() 2025-05-21 15:40:16 -07:00
Makefile openvswitch: add trace points 2021-06-22 10:47:32 -07:00
actions.c net: openvswitch: remove never-working support for setting nsh fields 2025-11-14 18:13:24 -08:00
conntrack.c netfilter: nf_conncount: rework API to use sk_buff directly 2025-11-28 00:05:49 +00:00
conntrack.h net/sched: act_api: fix miss set post_ct for ovs after do conntrack in act_ct 2021-03-16 15:22:18 -07:00
datapath.c net: openvswitch: allow providing upcall pid for the 'execute' command 2025-07-07 14:30:39 -07:00
datapath.h net: openvswitch: allow providing upcall pid for the 'execute' command 2025-07-07 14:30:39 -07:00
dp_notify.c net: replace use of system_wq with system_percpu_wq 2025-09-22 17:40:30 -07:00
drop.h net: openvswitch: add misc error drop reasons 2023-08-14 08:01:06 +01:00
flow.c net: openvswitch: Use for_each_cpu() where appropriate 2025-08-20 19:47:22 -07:00
flow.h net: openvswitch: reduce cpu_used_mask memory 2023-02-06 22:36:29 -08:00
flow_netlink.c net: openvswitch: fix middle attribute validation in push_nsh() action 2025-12-10 00:46:55 -08:00
flow_netlink.h net: openvswitch: remove never-working support for setting nsh fields 2025-11-14 18:13:24 -08:00
flow_table.c net: openvswitch: Use for_each_cpu() where appropriate 2025-08-20 19:47:22 -07:00
flow_table.h net: openvswitch: Annotate struct mask_array with __counted_by 2023-10-17 13:56:03 +02:00
meter.c genetlink: remove userhdr from struct genl_info 2023-08-15 14:54:44 -07:00
meter.h net: openvswitch: remove unnecessary linux/genetlink.h include 2024-04-01 21:44:34 -07:00
openvswitch_trace.c openvswitch: add trace points 2021-06-22 10:47:32 -07:00
openvswitch_trace.h tracing/treewide: Remove second parameter of __assign_str() 2024-05-22 20:14:47 -04:00
vport-geneve.c rtnetlink: Honour NLM_F_ECHO flag in rtnl_delete_link 2022-10-31 18:10:21 -07:00
vport-gre.c rtnetlink: Honour NLM_F_ECHO flag in rtnl_delete_link 2022-10-31 18:10:21 -07:00
vport-internal_dev.c net: rename netns_local to netns_immutable 2025-03-04 12:44:48 +01:00
vport-internal_dev.h
vport-netdev.c net: openvswitch: Avoid needlessly taking the RTNL on vport destroy 2025-12-22 12:25:11 +01:00
vport-netdev.h
vport-vxlan.c rtnetlink: Honour NLM_F_ECHO flag in rtnl_delete_link 2022-10-31 18:10:21 -07:00
vport.c net: openvswitch: allow providing upcall pid for the 'execute' command 2025-07-07 14:30:39 -07:00
vport.h net: openvswitch: fix kernel-doc warnings in internal headers 2025-03-24 09:30:21 -07:00