mirror of
https://github.com/openvswitch/ovs
synced 2025-10-13 14:07:02 +00:00
dpif-netdev: non-pmd thread static_tx_qid should be constant
The non-pmd thread static_tx_qid is assumed to be equal to the highest core ID + 1. The function dp_netdev_del_pmds_on_numa() invalidates this assumption by re-distributing the static_tx_qid:s on all pmd and non-pmd threads of the "other" numa. There might be a number of unwanted effects due to the non-pmd thread static_tx_qid being changed. The actual fault, observed in OVS 2.5, was a crash due to the TX burst queues containing a NULL packet buffer pointer in the range of valid buffers, presumably caused by a race condition. In OVS 2.6 TX burst queues have been removed, nevertheless the current behavior is incorrect. The correction makes dp_netdev_del_pmds_on_numa() honor the constancy of the non-pmd static_tx_qid value by excluding all non-pmd threads from the deletion and from the re-ordering of the static_tx_qid. Signed-off-by: Patrik Andersson <patrik.r.andersson@ericsson.com> Signed-off-by: Daniele Di Proietto <diproiettod@vmware.com>
This commit is contained in:
committed by
Daniele Di Proietto
parent
314fb5ad07
commit
687a83254b
@@ -3400,7 +3400,7 @@ dp_netdev_del_pmds_on_numa(struct dp_netdev *dp, int numa_id)
|
||||
/* We cannot call dp_netdev_del_pmd(), since it alters
|
||||
* 'dp->poll_threads' (while we're iterating it) and it
|
||||
* might quiesce. */
|
||||
if (pmd->numa_id == numa_id) {
|
||||
if (pmd->numa_id == numa_id && pmd->core_id != NON_PMD_CORE_ID) {
|
||||
atomic_read_relaxed(&pmd->static_tx_qid, &free_idx[k]);
|
||||
pmd_list[k] = pmd;
|
||||
ovs_assert(k < n_pmds_on_numa);
|
||||
@@ -3418,7 +3418,7 @@ dp_netdev_del_pmds_on_numa(struct dp_netdev *dp, int numa_id)
|
||||
|
||||
atomic_read_relaxed(&pmd->static_tx_qid, &old_tx_qid);
|
||||
|
||||
if (old_tx_qid >= n_pmds) {
|
||||
if (old_tx_qid >= n_pmds && pmd->core_id != NON_PMD_CORE_ID) {
|
||||
int new_tx_qid = free_idx[--k];
|
||||
|
||||
atomic_store_relaxed(&pmd->static_tx_qid, new_tx_qid);
|
||||
|
Reference in New Issue
Block a user