Skip to content

Commit b731551

Browse files
committed
dpif-netdev: Fix Auto Load Balance debug log.
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 a 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 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 to fix logs. Fixes: 46e04ec ("dpif-netdev: Calculate per numa variance.") Reported-at: https://issues.redhat.com/browse/FDP-1145 Signed-off-by: Kevin Traynor <[email protected]> Acked-by: Simon Horman <[email protected]> Reviewed-by: David Marchand <[email protected]>
1 parent a735a13 commit b731551

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

lib/dpif-netdev.c

+5-3
Original file line numberDiff line numberDiff line change
@@ -6509,9 +6509,6 @@ pmd_rebalance_dry_run(struct dp_netdev *dp)
65096509
struct sched_numa_list numa_list_cur;
65106510
struct sched_numa_list numa_list_est;
65116511
bool thresh_met = false;
6512-
uint64_t current_var, estimate_var;
6513-
struct sched_numa *numa_cur, *numa_est;
6514-
uint64_t improvement = 0;
65156512

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

@@ -6527,9 +6524,14 @@ pmd_rebalance_dry_run(struct dp_netdev *dp)
65276524
/* Check if cross-numa polling, there is only one numa with PMDs. */
65286525
if (!sched_numa_list_cross_numa_polling(&numa_list_est) ||
65296526
sched_numa_list_count(&numa_list_est) == 1) {
6527+
struct sched_numa *numa_cur;
65306528

65316529
/* Calculate variances. */
65326530
HMAP_FOR_EACH (numa_cur, node, &numa_list_cur.numas) {
6531+
uint64_t current_var, estimate_var;
6532+
struct sched_numa *numa_est;
6533+
uint64_t improvement = 0;
6534+
65336535
numa_est = sched_numa_list_lookup(&numa_list_est,
65346536
numa_cur->numa_id);
65356537
if (!numa_est) {

0 commit comments

Comments
 (0)