[v2] test/ipsec: fix performance test failure

Message ID 20220621133046.2827485-1-vladimir.medvedkin@intel.com (mailing list archive)
State Accepted, archived
Delegated to: akhil goyal
Headers
Series [v2] test/ipsec: fix performance test failure |

Checks

Context Check Description
ci/checkpatch success coding style OK
ci/Intel-compilation success Compilation OK
ci/intel-Testing success Testing PASS
ci/iol-aarch64-compile-testing success Testing PASS
ci/iol-aarch64-unit-testing success Testing PASS
ci/iol-x86_64-unit-testing success Testing PASS
ci/iol-x86_64-compile-testing success Testing PASS
ci/github-robot: build success github build: passed
ci/iol-intel-Performance success Performance Testing PASS
ci/iol-intel-Functional success Functional Testing PASS
ci/iol-mellanox-Performance success Performance Testing PASS
ci/iol-abi-testing success Testing PASS

Commit Message

Vladimir Medvedkin June 21, 2022, 1:30 p.m. UTC
  This patch initializes with 0 rte_ipsec_sa_prm inside the ipsec_sa struct.
Before it was passed uninitialized to rte_ipsec_sa_init(),
which does not check whether prm->ipsec_xform.esn.value is greater
than sa->sqn_mask.

Bugzilla ID: 1023
Fixes: f7f3ac6dcbe2 ("test/ipsec: add performance cases")
Cc: stable@dpdk.org

Signed-off-by: Vladimir Medvedkin <vladimir.medvedkin@intel.com>
---

Notes:
    v2:
     - fix gcc4 warnings

 app/test/test_ipsec_perf.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
  

Comments

Akhil Goyal June 21, 2022, 5:23 p.m. UTC | #1
> This patch initializes with 0 rte_ipsec_sa_prm inside the ipsec_sa struct.
> Before it was passed uninitialized to rte_ipsec_sa_init(),
> which does not check whether prm->ipsec_xform.esn.value is greater
> than sa->sqn_mask.
> 
> Bugzilla ID: 1023
> Fixes: f7f3ac6dcbe2 ("test/ipsec: add performance cases")
> Cc: stable@dpdk.org
> 
> Signed-off-by: Vladimir Medvedkin <vladimir.medvedkin@intel.com>
> ---
> 
> Notes:
>     v2:
>      - fix gcc4 warnings
Applied to dpdk-next-crypto

Thanks.
  
Yu Jiang June 23, 2022, 11:18 a.m. UTC | #2
> -----Original Message-----
> From: Vladimir Medvedkin <vladimir.medvedkin@intel.com>
> Sent: Tuesday, June 21, 2022 9:31 PM
> To: dev@dpdk.org
> Cc: gakhil@marvell.com; stable@dpdk.org; Konstantin Ananyev
> <konstantin.v.ananyev@yandex.ru>; Iremonger, Bernard
> <bernard.iremonger@intel.com>
> Subject: [PATCH v2] test/ipsec: fix performance test failure
> 
> This patch initializes with 0 rte_ipsec_sa_prm inside the ipsec_sa struct.
> Before it was passed uninitialized to rte_ipsec_sa_init(), which does not
> check whether prm->ipsec_xform.esn.value is greater than sa->sqn_mask.
> 
> Bugzilla ID: 1023
> Fixes: f7f3ac6dcbe2 ("test/ipsec: add performance cases")
> Cc: stable@dpdk.org
> 
> Signed-off-by: Vladimir Medvedkin <vladimir.medvedkin@intel.com>
> ---
> 
> Notes:
>     v2:
>      - fix gcc4 warnings
> 
>  app/test/test_ipsec_perf.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/app/test/test_ipsec_perf.c b/app/test/test_ipsec_perf.c index
> 346a851648..11de9a6aac 100644
> --- a/app/test/test_ipsec_perf.c
> +++ b/app/test/test_ipsec_perf.c
> @@ -592,8 +592,8 @@ testsuite_teardown(void)  static int
>  test_libipsec_perf(void)
>  {
> -	struct ipsec_sa sa_out;
> -	struct ipsec_sa sa_in;
> +	struct ipsec_sa sa_out = { .sa_prm = { 0 } };
> +	struct ipsec_sa sa_in = { .sa_prm = { 0 } };
>  	uint32_t i;
>  	int ret;
> 
> --
> 2.25.1
Tested-by: Yu Jiang  <YuX.Jiang@intel.com>
  

Patch

diff --git a/app/test/test_ipsec_perf.c b/app/test/test_ipsec_perf.c
index 346a851648..11de9a6aac 100644
--- a/app/test/test_ipsec_perf.c
+++ b/app/test/test_ipsec_perf.c
@@ -592,8 +592,8 @@  testsuite_teardown(void)
 static int
 test_libipsec_perf(void)
 {
-	struct ipsec_sa sa_out;
-	struct ipsec_sa sa_in;
+	struct ipsec_sa sa_out = { .sa_prm = { 0 } };
+	struct ipsec_sa sa_in = { .sa_prm = { 0 } };
 	uint32_t i;
 	int ret;