[v2] event/dsw: avoid reusing previously recorded events

Message ID 20200504093059.12458-1-hofors@lysator.liu.se (mailing list archive)
State Accepted, archived
Delegated to: Jerin Jacob
Headers
Series [v2] event/dsw: avoid reusing previously recorded events |

Checks

Context Check Description
ci/checkpatch warning coding style issues
ci/iol-intel-Performance success Performance Testing PASS
ci/iol-nxp-Performance success Performance Testing PASS
ci/iol-mellanox-Performance success Performance Testing PASS
ci/iol-testing success Testing PASS
ci/travis-robot warning Travis build: failed
ci/Intel-compilation success Compilation OK

Commit Message

Mattias Rönnblom May 4, 2020, 9:30 a.m. UTC
  From: Mattias Rönnblom <mattias.ronnblom@ericsson.com>

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>
---
V2: rebase

 drivers/event/dsw/dsw_event.c | 3 +++
 1 file changed, 3 insertions(+)
  

Comments

Jerin Jacob May 4, 2020, 11:52 a.m. UTC | #1
On Mon, May 4, 2020 at 3:01 PM Mattias Rönnblom <hofors@lysator.liu.se> wrote:
>
> From: Mattias Rönnblom <mattias.ronnblom@ericsson.com>
>
> 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>
> ---
> V2: rebase


Fixed following checkpatch warnings and applied to
dpdk-next-eventdev/master. Thanks.

WARNING:SUSPECT_CODE_INDENT: suspect code indent for conditional
statements (8, 12)
#26: FILE: drivers/event/dsw/dsw_event.c:824:
+       if (seen_events_len < DSW_MAX_EVENTS_RECORDED)
+           return;

WARNING:TABSTOP: Statements should start on a tabstop
#27: FILE: drivers/event/dsw/dsw_event.c:825:
+           return;


>  drivers/event/dsw/dsw_event.c | 3 +++
>  1 file changed, 3 insertions(+)
>
> diff --git a/drivers/event/dsw/dsw_event.c b/drivers/event/dsw/dsw_event.c
> index 832390373..367cf8590 100644
> --- a/drivers/event/dsw/dsw_event.c
> +++ b/drivers/event/dsw/dsw_event.c
> @@ -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
> --
> 2.20.1
>
  

Patch

diff --git a/drivers/event/dsw/dsw_event.c b/drivers/event/dsw/dsw_event.c
index 832390373..367cf8590 100644
--- a/drivers/event/dsw/dsw_event.c
+++ b/drivers/event/dsw/dsw_event.c
@@ -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