Skip to content

Commit

Permalink
dpif-netdev: Fix Auto Load Balance debug log.
Browse files Browse the repository at this point in the history
In the case where there is a NUMA node that has a zero variance
improvement, the log will report it's variance improvement as value for
the previous NUMA node with a non-zero variance improvement.

For example in an artificial case:
|dpif_netdev|DBG|Numa node 1. Current variance 1000 Estimated variance 0.
Variance improvement 100%.
                     ^^^ correct value

|dpif_netdev|DBG|Numa node 0. Current variance 0 Estimated variance 0.
Variance improvement 100%.
                     ^^^ incorrect value for Numa 0, value from Numa 1

This is caused by not resetting the improvement variable between loops.

This is a debug log reporting issue only, non-zero variance improvement
will still trigger rebalance where appropriate.

Move improvement and other variables into the loop code block.

Fixes: 58fed7e ("dpif-netdev: Make PMD auto load balance use common rxq scheduling.")
Reported-at: https://issues.redhat.com/browse/FDP-1145
Signed-off-by: Kevin Traynor <ktraynor@redhat.com>
  • Loading branch information
kevintraynor committed Feb 11, 2025
1 parent b9be729 commit 46e9eee
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions lib/dpif-netdev.c
Original file line number Diff line number Diff line change
Expand Up @@ -6518,10 +6518,8 @@ pmd_rebalance_dry_run(struct dp_netdev *dp)
{
struct sched_numa_list numa_list_cur;
struct sched_numa_list numa_list_est;
struct sched_numa *numa_cur;
bool thresh_met = false;
uint64_t current_var, estimate_var;
struct sched_numa *numa_cur, *numa_est;
uint64_t improvement = 0;

VLOG_DBG("PMD auto load balance performing dry run.");

Expand All @@ -6540,6 +6538,10 @@ pmd_rebalance_dry_run(struct dp_netdev *dp)

/* Calculate variances. */
HMAP_FOR_EACH (numa_cur, node, &numa_list_cur.numas) {
uint64_t current_var, estimate_var;
struct sched_numa *numa_est;
uint64_t improvement = 0;

numa_est = sched_numa_list_lookup(&numa_list_est,
numa_cur->numa_id);
if (!numa_est) {
Expand Down

0 comments on commit 46e9eee

Please sign in to comment.