diff mbox

validation: crypto: remove data offset workaround

Message ID 1418474884-31440-1-git-send-email-taras.kondratiuk@linaro.org
State Accepted
Commit e90e08a3be9e56efd0cab190f510e05d9f232dda
Headers show

Commit Message

Taras Kondratiuk Dec. 13, 2014, 12:48 p.m. UTC
Current crypto tests calculate range offsets expecting a bug in crypto
implementation: data offsets are applied relatively to a start of a
buffer instead of start of data in a packet. This bug is fixed in
linux-generic by recent buffer/packet rework patches, so all crypto
tests fails now. Remove this workaround.

Signed-off-by: Taras Kondratiuk <taras.kondratiuk@linaro.org>
---
This patch should be merged just after Bill's buffer/packet changes
for v0.5.
---
 test/validation/crypto/odp_crypto_test_async_inp.c | 4 +---
 test/validation/crypto/odp_crypto_test_sync_inp.c  | 4 +---
 2 files changed, 2 insertions(+), 6 deletions(-)

Comments

Taras Kondratiuk Dec. 15, 2014, 2:36 p.m. UTC | #1
Hi Alex

Could you please take a look on this, so we can merge it together with
buffer/packet changes.

On 12/13/2014 02:48 PM, Taras Kondratiuk wrote:
> Current crypto tests calculate range offsets expecting a bug in crypto
> implementation: data offsets are applied relatively to a start of a
> buffer instead of start of data in a packet. This bug is fixed in
> linux-generic by recent buffer/packet rework patches, so all crypto
> tests fails now. Remove this workaround.
> 
> Signed-off-by: Taras Kondratiuk <taras.kondratiuk@linaro.org>
> ---
> This patch should be merged just after Bill's buffer/packet changes
> for v0.5.
> ---
>  test/validation/crypto/odp_crypto_test_async_inp.c | 4 +---
>  test/validation/crypto/odp_crypto_test_sync_inp.c  | 4 +---
>  2 files changed, 2 insertions(+), 6 deletions(-)
> 
> diff --git a/test/validation/crypto/odp_crypto_test_async_inp.c b/test/validation/crypto/odp_crypto_test_async_inp.c
> index c140c0f..96d4c3f 100644
> --- a/test/validation/crypto/odp_crypto_test_async_inp.c
> +++ b/test/validation/crypto/odp_crypto_test_async_inp.c
> @@ -67,9 +67,7 @@ static void alg_test(enum odp_crypto_op op,
>  	CU_ASSERT(pkt != ODP_PACKET_INVALID);
>  	uint8_t *data_addr = odp_packet_data(pkt);
>  	memcpy(data_addr, input_vec, input_vec_len);
> -	/* offsets are relative to buffer address (not packet data)
> -	until https://bugs.linaro.org/show_bug.cgi?id=387 is fixed */
> -	int data_off = data_addr - (uint8_t *)odp_buffer_addr(buf);
> +	const int data_off = 0;
>  
>  	/* Prepare input/output params */
>  	odp_crypto_op_params_t op_params;
> diff --git a/test/validation/crypto/odp_crypto_test_sync_inp.c b/test/validation/crypto/odp_crypto_test_sync_inp.c
> index b63fd4d..f37ad54 100644
> --- a/test/validation/crypto/odp_crypto_test_sync_inp.c
> +++ b/test/validation/crypto/odp_crypto_test_sync_inp.c
> @@ -56,9 +56,7 @@ static void alg_test(enum odp_crypto_op op,
>  	CU_ASSERT(pkt != ODP_PACKET_INVALID);
>  	uint8_t *data_addr = odp_packet_data(pkt);
>  	memcpy(data_addr, input_vec, input_vec_len);
> -	/* offsets are relative to buffer address (not packet data)
> -	until https://bugs.linaro.org/show_bug.cgi?id=387 is fixed */
> -	int data_off = data_addr - (uint8_t *)odp_buffer_addr(buf);
> +	const int data_off = 0;
>  
>  	/* Prepare input/output params */
>  	odp_crypto_op_params_t op_params;
>
Alexandru Badicioiu Dec. 15, 2014, 2:44 p.m. UTC | #2
On 13 December 2014 at 14:48, Taras Kondratiuk <taras.kondratiuk@linaro.org>
wrote:
>
> Current crypto tests calculate range offsets expecting a bug in crypto
> implementation: data offsets are applied relatively to a start of a
> buffer instead of start of data in a packet. This bug is fixed in
> linux-generic by recent buffer/packet rework patches, so all crypto
> tests fails now. Remove this workaround.
>
> Signed-off-by: Taras Kondratiuk <taras.kondratiuk@linaro.org>
>
    Reviewed-by: Alexandru Badicioiu <alexandru.badicioiu@linaro.org>

> ---
> This patch should be merged just after Bill's buffer/packet changes
> for v0.5.
> ---
>  test/validation/crypto/odp_crypto_test_async_inp.c | 4 +---
>  test/validation/crypto/odp_crypto_test_sync_inp.c  | 4 +---
>  2 files changed, 2 insertions(+), 6 deletions(-)
>
> diff --git a/test/validation/crypto/odp_crypto_test_async_inp.c
> b/test/validation/crypto/odp_crypto_test_async_inp.c
> index c140c0f..96d4c3f 100644
> --- a/test/validation/crypto/odp_crypto_test_async_inp.c
> +++ b/test/validation/crypto/odp_crypto_test_async_inp.c
> @@ -67,9 +67,7 @@ static void alg_test(enum odp_crypto_op op,
>         CU_ASSERT(pkt != ODP_PACKET_INVALID);
>         uint8_t *data_addr = odp_packet_data(pkt);
>         memcpy(data_addr, input_vec, input_vec_len);
> -       /* offsets are relative to buffer address (not packet data)
> -       until https://bugs.linaro.org/show_bug.cgi?id=387 is fixed */
> -       int data_off = data_addr - (uint8_t *)odp_buffer_addr(buf);
> +       const int data_off = 0;
>
>         /* Prepare input/output params */
>         odp_crypto_op_params_t op_params;
> diff --git a/test/validation/crypto/odp_crypto_test_sync_inp.c
> b/test/validation/crypto/odp_crypto_test_sync_inp.c
> index b63fd4d..f37ad54 100644
> --- a/test/validation/crypto/odp_crypto_test_sync_inp.c
> +++ b/test/validation/crypto/odp_crypto_test_sync_inp.c
> @@ -56,9 +56,7 @@ static void alg_test(enum odp_crypto_op op,
>         CU_ASSERT(pkt != ODP_PACKET_INVALID);
>         uint8_t *data_addr = odp_packet_data(pkt);
>         memcpy(data_addr, input_vec, input_vec_len);
> -       /* offsets are relative to buffer address (not packet data)
> -       until https://bugs.linaro.org/show_bug.cgi?id=387 is fixed */
> -       int data_off = data_addr - (uint8_t *)odp_buffer_addr(buf);
> +       const int data_off = 0;
>
>         /* Prepare input/output params */
>         odp_crypto_op_params_t op_params;
> --
> 1.9.1
>
>
Maxim Uvarov Dec. 16, 2014, 8:40 a.m. UTC | #3
Merged,
Maxim.

On 12/13/2014 03:48 PM, Taras Kondratiuk wrote:
> Current crypto tests calculate range offsets expecting a bug in crypto
> implementation: data offsets are applied relatively to a start of a
> buffer instead of start of data in a packet. This bug is fixed in
> linux-generic by recent buffer/packet rework patches, so all crypto
> tests fails now. Remove this workaround.
>
> Signed-off-by: Taras Kondratiuk <taras.kondratiuk@linaro.org>
> ---
> This patch should be merged just after Bill's buffer/packet changes
> for v0.5.
> ---
>   test/validation/crypto/odp_crypto_test_async_inp.c | 4 +---
>   test/validation/crypto/odp_crypto_test_sync_inp.c  | 4 +---
>   2 files changed, 2 insertions(+), 6 deletions(-)
>
> diff --git a/test/validation/crypto/odp_crypto_test_async_inp.c b/test/validation/crypto/odp_crypto_test_async_inp.c
> index c140c0f..96d4c3f 100644
> --- a/test/validation/crypto/odp_crypto_test_async_inp.c
> +++ b/test/validation/crypto/odp_crypto_test_async_inp.c
> @@ -67,9 +67,7 @@ static void alg_test(enum odp_crypto_op op,
>   	CU_ASSERT(pkt != ODP_PACKET_INVALID);
>   	uint8_t *data_addr = odp_packet_data(pkt);
>   	memcpy(data_addr, input_vec, input_vec_len);
> -	/* offsets are relative to buffer address (not packet data)
> -	until https://bugs.linaro.org/show_bug.cgi?id=387 is fixed */
> -	int data_off = data_addr - (uint8_t *)odp_buffer_addr(buf);
> +	const int data_off = 0;
>   
>   	/* Prepare input/output params */
>   	odp_crypto_op_params_t op_params;
> diff --git a/test/validation/crypto/odp_crypto_test_sync_inp.c b/test/validation/crypto/odp_crypto_test_sync_inp.c
> index b63fd4d..f37ad54 100644
> --- a/test/validation/crypto/odp_crypto_test_sync_inp.c
> +++ b/test/validation/crypto/odp_crypto_test_sync_inp.c
> @@ -56,9 +56,7 @@ static void alg_test(enum odp_crypto_op op,
>   	CU_ASSERT(pkt != ODP_PACKET_INVALID);
>   	uint8_t *data_addr = odp_packet_data(pkt);
>   	memcpy(data_addr, input_vec, input_vec_len);
> -	/* offsets are relative to buffer address (not packet data)
> -	until https://bugs.linaro.org/show_bug.cgi?id=387 is fixed */
> -	int data_off = data_addr - (uint8_t *)odp_buffer_addr(buf);
> +	const int data_off = 0;
>   
>   	/* Prepare input/output params */
>   	odp_crypto_op_params_t op_params;
diff mbox

Patch

diff --git a/test/validation/crypto/odp_crypto_test_async_inp.c b/test/validation/crypto/odp_crypto_test_async_inp.c
index c140c0f..96d4c3f 100644
--- a/test/validation/crypto/odp_crypto_test_async_inp.c
+++ b/test/validation/crypto/odp_crypto_test_async_inp.c
@@ -67,9 +67,7 @@  static void alg_test(enum odp_crypto_op op,
 	CU_ASSERT(pkt != ODP_PACKET_INVALID);
 	uint8_t *data_addr = odp_packet_data(pkt);
 	memcpy(data_addr, input_vec, input_vec_len);
-	/* offsets are relative to buffer address (not packet data)
-	until https://bugs.linaro.org/show_bug.cgi?id=387 is fixed */
-	int data_off = data_addr - (uint8_t *)odp_buffer_addr(buf);
+	const int data_off = 0;
 
 	/* Prepare input/output params */
 	odp_crypto_op_params_t op_params;
diff --git a/test/validation/crypto/odp_crypto_test_sync_inp.c b/test/validation/crypto/odp_crypto_test_sync_inp.c
index b63fd4d..f37ad54 100644
--- a/test/validation/crypto/odp_crypto_test_sync_inp.c
+++ b/test/validation/crypto/odp_crypto_test_sync_inp.c
@@ -56,9 +56,7 @@  static void alg_test(enum odp_crypto_op op,
 	CU_ASSERT(pkt != ODP_PACKET_INVALID);
 	uint8_t *data_addr = odp_packet_data(pkt);
 	memcpy(data_addr, input_vec, input_vec_len);
-	/* offsets are relative to buffer address (not packet data)
-	until https://bugs.linaro.org/show_bug.cgi?id=387 is fixed */
-	int data_off = data_addr - (uint8_t *)odp_buffer_addr(buf);
+	const int data_off = 0;
 
 	/* Prepare input/output params */
 	odp_crypto_op_params_t op_params;