On 11/24/26 10:52, David Marchand wrote:
Move list insertion (resp. removal) out of common_construct()
(resp. common_destruct()) into their callers.
In constructors, the device is not visible to other threads until
inserted in the list, so field initialization does not need the
mutex.
netdev_request_reconfigure() is moved next to the list insertion
in each constructor.
In the vhost server constructor, rte_vhost_driver_start() is kept
under the mutex so that vhost event callbacks cannot race with
list insertion.
In the eth destructor, the mutex still covers the sibling check and
DPDK device close/remove to prevent races on shared rte_device
objects.
In the vhost destructor, only the orphan check and list removal
need the mutex.
While at it, move the per-device mutex init out of common_construct()
and destroy out of common_destruct() into their per-type callers.
Introduce vhost_common_destruct() to mirror vhost_common_construct(),
carrying the OVS_EXCLUDED(dev->mutex) annotation required by the
dpdk_vhost_driver_unregister() callback path.
This prepares for replacing dpdk_mutex with per-type list mutexes.
Signed-off-by: David Marchand<[email protected]>
---
Changes since RFC v2:
- fixed leak in case of rte_vhost_driver_start failure,
---
lib/netdev-dpdk.c | 78 +++++++++++++++++++++++++++++------------------
1 file changed, 48 insertions(+), 30 deletions(-)
Acked-by: Kevin Traynor <[email protected]>
_______________________________________________
dev mailing list
[email protected]
https://mail.openvswitch.org/mailman/listinfo/ovs-dev