event/dsw: avoid reusing previously recorded events
authorMattias Rönnblom <mattias.ronnblom@ericsson.com>
Mon, 4 May 2020 09:30:59 +0000 (11:30 +0200)
committerJerin Jacob <jerinj@marvell.com>
Mon, 4 May 2020 11:48:28 +0000 (13:48 +0200)
Avoid reusing recorded events when performing a migration, since this
may make the migration selection logic pick an already-moved flow.

Fixes: f6257b22e767 ("event/dsw: add load balancing")
Cc: stable@dpdk.org
Reported-by: Venky Venkatesh <vvenkatesh@paloaltonetworks.com>
Signed-off-by: Mattias Rönnblom <mattias.ronnblom@ericsson.com>
drivers/event/dsw/dsw_event.c

index 8323903..e5e3597 100644 (file)
@@ -821,6 +821,9 @@ dsw_port_consider_emigration(struct dsw_evdev *dsw,
        if (dsw->num_ports == 1)
                return;
 
+       if (seen_events_len < DSW_MAX_EVENTS_RECORDED)
+               return;
+
        DSW_LOG_DP_PORT(DEBUG, source_port->id, "Considering emigration.\n");
 
        /* Randomize interval to avoid having all threads considering