[PATCH v2 2/8] net/netvsc: fix race conditions on VF add/remove events
Stephen Hemminger
stephen at networkplumber.org
Mon Feb 23 18:40:04 CET 2026
On Fri, 20 Feb 2026 18:45:21 -0800
longli at linux.microsoft.com wrote:
> + rte_rwlock_read_lock(&hv->vf_lock);
> + vf_dev = hn_get_vf_dev(hv);
> + if (hv->vf_ctx.vf_vsc_switched && vf_dev &&
> + vf_dev->data->dev_started) {
> + void *sub_q = vf_dev->data->tx_queues[queue_id];
> +
> + nb_tx = (*vf_dev->tx_pkt_burst)
> + (sub_q, tx_pkts, nb_pkts);
> rte_rwlock_read_unlock(&hv->vf_lock);
> + return nb_tx;
> }
> + rte_rwlock_read_unlock(&hv->vf_lock);
ok, but read locks not free. It does incur an additional cache miss
which may impact performance.
Might be better in future to have some form of lockless access here.
More information about the stable
mailing list