diff mbox

[PATCHv2] validation: pktio: initialize pkt_seq

Message ID 1463143491-13172-1-git-send-email-maxim.uvarov@linaro.org
State Accepted
Commit 21dd40b6cab39aa359337cca56094eccdefc24c2
Headers show

Commit Message

Maxim Uvarov May 13, 2016, 12:44 p.m. UTC
Initialize to zero pkt_seq array first used
in recv_packets_tmo().
https://bugs.linaro.org/show_bug.cgi?id=2222

Signed-off-by: Maxim Uvarov <maxim.uvarov@linaro.org>
---
 test/validation/pktio/pktio.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

Comments

Elo, Matias (Nokia - FI/Espoo) May 13, 2016, 1:12 p.m. UTC | #1
Reviewed-and-tested-by: Matias Elo <matias.elo@nokia.com>

> -----Original Message-----

> From: lng-odp [mailto:lng-odp-bounces@lists.linaro.org] On Behalf Of EXT Maxim

> Uvarov

> Sent: Friday, May 13, 2016 3:45 PM

> To: lng-odp@lists.linaro.org

> Subject: [lng-odp] [PATCHv2] validation: pktio: initialize pkt_seq

> 

> Initialize to zero pkt_seq array first used

> in recv_packets_tmo().

> https://bugs.linaro.org/show_bug.cgi?id=2222

> 

> Signed-off-by: Maxim Uvarov <maxim.uvarov@linaro.org>

> ---

>  test/validation/pktio/pktio.c | 4 +++-

>  1 file changed, 3 insertions(+), 1 deletion(-)

> 

> diff --git a/test/validation/pktio/pktio.c b/test/validation/pktio/pktio.c

> index a51e0b2..d035a26 100644

> --- a/test/validation/pktio/pktio.c

> +++ b/test/validation/pktio/pktio.c

> @@ -919,9 +919,11 @@ static void test_recv_tmo(recv_tmo_mode_e mode)

>  	ret = odp_pktout_queue(pktio_tx, &pktout_queue, 1);

>  	CU_ASSERT_FATAL(ret > 0);

> 

> +	memset(pkt_seq, 0, sizeof(pkt_seq));

> +

>  	/* No packets sent yet, so should wait */

>  	ns = 100 * ODP_TIME_MSEC_IN_NS;

> -	ret = recv_packets_tmo(pktio_rx, pkt_tbl, pkt_seq, 1, mode,

> +	ret = recv_packets_tmo(pktio_rx, &pkt_tbl[0], &pkt_seq[0], 1, mode,

>  			       odp_pktin_wait_time(ns), ns);

>  	CU_ASSERT(ret == 0);

> 

> --

> 2.7.1.250.gff4ea60

> 

> _______________________________________________

> lng-odp mailing list

> lng-odp@lists.linaro.org

> https://lists.linaro.org/mailman/listinfo/lng-odp
Maxim Uvarov May 16, 2016, 7:02 p.m. UTC | #2
Merged,
Maxim.

On 05/13/16 16:12, Elo, Matias (Nokia - FI/Espoo) wrote:
> Reviewed-and-tested-by: Matias Elo <matias.elo@nokia.com>
>
>> -----Original Message-----
>> From: lng-odp [mailto:lng-odp-bounces@lists.linaro.org] On Behalf Of EXT Maxim
>> Uvarov
>> Sent: Friday, May 13, 2016 3:45 PM
>> To: lng-odp@lists.linaro.org
>> Subject: [lng-odp] [PATCHv2] validation: pktio: initialize pkt_seq
>>
>> Initialize to zero pkt_seq array first used
>> in recv_packets_tmo().
>> https://bugs.linaro.org/show_bug.cgi?id=2222
>>
>> Signed-off-by: Maxim Uvarov <maxim.uvarov@linaro.org>
>> ---
>>   test/validation/pktio/pktio.c | 4 +++-
>>   1 file changed, 3 insertions(+), 1 deletion(-)
>>
>> diff --git a/test/validation/pktio/pktio.c b/test/validation/pktio/pktio.c
>> index a51e0b2..d035a26 100644
>> --- a/test/validation/pktio/pktio.c
>> +++ b/test/validation/pktio/pktio.c
>> @@ -919,9 +919,11 @@ static void test_recv_tmo(recv_tmo_mode_e mode)
>>   	ret = odp_pktout_queue(pktio_tx, &pktout_queue, 1);
>>   	CU_ASSERT_FATAL(ret > 0);
>>
>> +	memset(pkt_seq, 0, sizeof(pkt_seq));
>> +
>>   	/* No packets sent yet, so should wait */
>>   	ns = 100 * ODP_TIME_MSEC_IN_NS;
>> -	ret = recv_packets_tmo(pktio_rx, pkt_tbl, pkt_seq, 1, mode,
>> +	ret = recv_packets_tmo(pktio_rx, &pkt_tbl[0], &pkt_seq[0], 1, mode,
>>   			       odp_pktin_wait_time(ns), ns);
>>   	CU_ASSERT(ret == 0);
>>
>> --
>> 2.7.1.250.gff4ea60
>>
>> _______________________________________________
>> lng-odp mailing list
>> lng-odp@lists.linaro.org
>> https://lists.linaro.org/mailman/listinfo/lng-odp
diff mbox

Patch

diff --git a/test/validation/pktio/pktio.c b/test/validation/pktio/pktio.c
index a51e0b2..d035a26 100644
--- a/test/validation/pktio/pktio.c
+++ b/test/validation/pktio/pktio.c
@@ -919,9 +919,11 @@  static void test_recv_tmo(recv_tmo_mode_e mode)
 	ret = odp_pktout_queue(pktio_tx, &pktout_queue, 1);
 	CU_ASSERT_FATAL(ret > 0);
 
+	memset(pkt_seq, 0, sizeof(pkt_seq));
+
 	/* No packets sent yet, so should wait */
 	ns = 100 * ODP_TIME_MSEC_IN_NS;
-	ret = recv_packets_tmo(pktio_rx, pkt_tbl, pkt_seq, 1, mode,
+	ret = recv_packets_tmo(pktio_rx, &pkt_tbl[0], &pkt_seq[0], 1, mode,
 			       odp_pktin_wait_time(ns), ns);
 	CU_ASSERT(ret == 0);