[v3,1/2] test/distributor: fix flush with worker shutdown test

Message ID 1562321046-25195-1-git-send-email-hkalra@marvell.com (mailing list archive)
State Accepted, archived
Delegated to: Thomas Monjalon
Headers
Series [v3,1/2] test/distributor: fix flush with worker shutdown test |

Checks

Context Check Description
ci/checkpatch success coding style OK
ci/mellanox-Performance-Testing success Performance Testing PASS
ci/intel-Performance-Testing success Performance Testing PASS
ci/Intel-compilation fail apply issues

Commit Message

Harman Kalra July 5, 2019, 10:05 a.m. UTC
  On restarting worker 0 after shutdown, packets handled by
worker 0 must be incremented only when a packet is received by
it.

Fixes: c3eabff124e6 ("distributor: add unit tests")
Cc: stable@dpdk.org

Signed-off-by: Harman Kalra <hkalra@marvell.com>
---
 app/test/test_distributor.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
  

Comments

Hunt, David July 17, 2019, 3:30 p.m. UTC | #1
Hi Harman,

On 05/07/2019 11:05, Harman Kalra wrote:
> On restarting worker 0 after shutdown, packets handled by
> worker 0 must be incremented only when a packet is received by
> it.
>
> Fixes: c3eabff124e6 ("distributor: add unit tests")
> Cc: stable@dpdk.org
>
> Signed-off-by: Harman Kalra <hkalra@marvell.com>
> ---
>   app/test/test_distributor.c | 3 ++-
>   1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/app/test/test_distributor.c b/app/test/test_distributor.c
> index 8084c0794..5d71bf87c 100644
> --- a/app/test/test_distributor.c
> +++ b/app/test/test_distributor.c
> @@ -374,7 +374,8 @@ handle_work_for_shutdown_test(void *arg)
>   				id, buf, buf, num);
>   
>   		while (!quit) {
> -			worker_stats[id].handled_packets++, count++;
> +			worker_stats[id].handled_packets += num;
> +			count += num;
>   			rte_pktmbuf_free(pkt);
>   			num = rte_distributor_get_pkt(d, id, buf, buf, num);
>   		}


Change makes sense. Builds OK, Runs OK, test passes.

Acked-by: David Hunt <david.hunt@intel.com>
  

Patch

diff --git a/app/test/test_distributor.c b/app/test/test_distributor.c
index 8084c0794..5d71bf87c 100644
--- a/app/test/test_distributor.c
+++ b/app/test/test_distributor.c
@@ -374,7 +374,8 @@  handle_work_for_shutdown_test(void *arg)
 				id, buf, buf, num);
 
 		while (!quit) {
-			worker_stats[id].handled_packets++, count++;
+			worker_stats[id].handled_packets += num;
+			count += num;
 			rte_pktmbuf_free(pkt);
 			num = rte_distributor_get_pkt(d, id, buf, buf, num);
 		}