diff mbox series

[v5,2/4] test/lpm: return error on failure in rcu qsbr perf

Message ID 20201104185858.18397-3-dharmik.thakkar@arm.com (mailing list archive)
State Accepted, archived
Delegated to: David Marchand
Headers show
Series test/lpm: fix rcu qsbr perf test | expand

Checks

Context Check Description
ci/checkpatch success coding style OK

Commit Message

Dharmik Thakkar Nov. 4, 2020, 6:58 p.m. UTC
Return error if Add/Delete fail in multiwriter perf test

Return error if single or multi writer test fails

Fixes: eff30b59cc2e ("test/lpm: add RCU performance tests")
Cc: honnappa.nagarahalli@arm.com
Cc: stable@dpdk.org

Signed-off-by: Dharmik Thakkar <dharmik.thakkar@arm.com>
Reviewed-by: Ruifeng Wang <ruifeng.wang@arm.com>
Reviewed-by: Honnappa Nagarahalli <honnappa.nagarahalli@arm.com>
---
 app/test/test_lpm_perf.c | 12 ++++++++++--
 1 file changed, 10 insertions(+), 2 deletions(-)

Comments

Medvedkin, Vladimir Nov. 4, 2020, 7:35 p.m. UTC | #1
On 04/11/2020 18:58, Dharmik Thakkar wrote:
> Return error if Add/Delete fail in multiwriter perf test
> 
> Return error if single or multi writer test fails
> 
> Fixes: eff30b59cc2e ("test/lpm: add RCU performance tests")
> Cc: honnappa.nagarahalli@arm.com
> Cc: stable@dpdk.org
> 
> Signed-off-by: Dharmik Thakkar <dharmik.thakkar@arm.com>
> Reviewed-by: Ruifeng Wang <ruifeng.wang@arm.com>
> Reviewed-by: Honnappa Nagarahalli <honnappa.nagarahalli@arm.com>
> ---
>   app/test/test_lpm_perf.c | 12 ++++++++++--
>   1 file changed, 10 insertions(+), 2 deletions(-)
> 
> diff --git a/app/test/test_lpm_perf.c b/app/test/test_lpm_perf.c
> index 45164b23214b..873ecf511c97 100644
> --- a/app/test/test_lpm_perf.c
> +++ b/app/test/test_lpm_perf.c
> @@ -453,6 +453,7 @@ test_lpm_rcu_qsbr_writer(void *arg)
>   					next_hop_add) != 0) {
>   				printf("Failed to add iteration %d, route# %d\n",
>   					i, j);
> +				goto error;
>   			}
>   			pthread_mutex_unlock(&lpm_mutex);
>   		}
> @@ -464,6 +465,7 @@ test_lpm_rcu_qsbr_writer(void *arg)
>   				large_ldepth_route_table[j].depth) != 0) {
>   				printf("Failed to delete iteration %d, route# %d\n",
>   					i, j);
> +				goto error;
>   			}
>   			pthread_mutex_unlock(&lpm_mutex);
>   		}
> @@ -474,6 +476,10 @@ test_lpm_rcu_qsbr_writer(void *arg)
>   	__atomic_fetch_add(&gwrite_cycles, total_cycles, __ATOMIC_RELAXED);
>   
>   	return 0;
> +
> +error:
> +	pthread_mutex_unlock(&lpm_mutex);
> +	return -1;
>   }
>   
>   /*
> @@ -947,9 +953,11 @@ test_lpm_perf(void)
>   	rte_lpm_delete_all(lpm);
>   	rte_lpm_free(lpm);
>   
> -	test_lpm_rcu_perf();
> +	if (test_lpm_rcu_perf() < 0)
> +		return -1;
>   
> -	test_lpm_rcu_perf_multi_writer();
> +	if (test_lpm_rcu_perf_multi_writer() < 0)
> +		return -1;
>   
>   	return 0;
>   }
> 

Acked-by: Vladimir Medvedkin <vladimir.medvedkin@intel.com>
diff mbox series

Patch

diff --git a/app/test/test_lpm_perf.c b/app/test/test_lpm_perf.c
index 45164b23214b..873ecf511c97 100644
--- a/app/test/test_lpm_perf.c
+++ b/app/test/test_lpm_perf.c
@@ -453,6 +453,7 @@  test_lpm_rcu_qsbr_writer(void *arg)
 					next_hop_add) != 0) {
 				printf("Failed to add iteration %d, route# %d\n",
 					i, j);
+				goto error;
 			}
 			pthread_mutex_unlock(&lpm_mutex);
 		}
@@ -464,6 +465,7 @@  test_lpm_rcu_qsbr_writer(void *arg)
 				large_ldepth_route_table[j].depth) != 0) {
 				printf("Failed to delete iteration %d, route# %d\n",
 					i, j);
+				goto error;
 			}
 			pthread_mutex_unlock(&lpm_mutex);
 		}
@@ -474,6 +476,10 @@  test_lpm_rcu_qsbr_writer(void *arg)
 	__atomic_fetch_add(&gwrite_cycles, total_cycles, __ATOMIC_RELAXED);
 
 	return 0;
+
+error:
+	pthread_mutex_unlock(&lpm_mutex);
+	return -1;
 }
 
 /*
@@ -947,9 +953,11 @@  test_lpm_perf(void)
 	rte_lpm_delete_all(lpm);
 	rte_lpm_free(lpm);
 
-	test_lpm_rcu_perf();
+	if (test_lpm_rcu_perf() < 0)
+		return -1;
 
-	test_lpm_rcu_perf_multi_writer();
+	if (test_lpm_rcu_perf_multi_writer() < 0)
+		return -1;
 
 	return 0;
 }