The goal for me is to get this into monarch_lts so I posted it on master first.

If API-next should fix this, I'll post the monarch patch instead


Nicolas


Le 12/07/2016 à 10:21 AM, Savolainen, Petri (Nokia - FI/Espoo) a écrit :
> Pool re-implementation in api-next fixes a number of validation test bugs. 
> This may be fixed already there, since I first implemented pools with single 
> segment. Also concat test tried to concat a single packet into the end of 
> itself...
>
> I suggest to postpone this until api-next is merged to master, or try 
> api-next in the meanwhile.
>
> -Petri
>
>> -----Original Message-----
>> From: lng-odp [mailto:lng-odp-boun...@lists.linaro.org] On Behalf Of
>> Nicolas Morey-Chaisemartin
>> Sent: Wednesday, December 07, 2016 11:01 AM
>> To: lng-odp@lists.linaro.org
>> Subject: [lng-odp] [PATCH] validation: packet: fix concat test
>>
>> concat test assumes that segmentation is supported.
>> Add an extra concat_test_packet  that can fit twice into
>>  seglen if segmentation is not supported.
>>
>> Signed-off-by: Nicolas Morey-Chaisemartin <nmo...@kalray.eu>
>> ---
>>
>> The patch should be applied on monarch_lts too. apart from the path
>> change, it applies withotu conflict.
>>
>>  test/common_plat/validation/api/packet/packet.c | 23 ++++++++++++++++++--
>> ---
>>  1 file changed, 18 insertions(+), 5 deletions(-)
>>
>> diff --git a/test/common_plat/validation/api/packet/packet.c
>> b/test/common_plat/validation/api/packet/packet.c
>> index a4426e2..b8af2f8 100644
>> --- a/test/common_plat/validation/api/packet/packet.c
>> +++ b/test/common_plat/validation/api/packet/packet.c
>> @@ -15,12 +15,12 @@
>>  #define PACKET_TAILROOM_RESERVE  4
>>
>>  static odp_pool_t packet_pool, packet_pool_no_uarea,
>> packet_pool_double_uarea;
>> -static uint32_t packet_len;
>> +static uint32_t packet_len, concat_packet_len;
>>
>>  static uint32_t segmented_packet_len;
>>  static odp_bool_t segmentation_supported = true;
>>
>> -odp_packet_t test_packet, segmented_test_packet;
>> +odp_packet_t test_packet, concat_test_packet, segmented_test_packet;
>>
>>  static struct udata_struct {
>>      uint64_t u64;
>> @@ -111,6 +111,18 @@ int packet_suite_init(void)
>>              data++;
>>      }
>>
>> +    if (segmentation_supported)
>> +            concat_packet_len = packet_len;
>> +    else
>> +            concat_packet_len = packet_len / 2;
>> +
>> +    concat_test_packet = odp_packet_alloc(packet_pool,
>> concat_packet_len);
>> +
>> +    for (i = 0; i < concat_packet_len; i++) {
>> +            odp_packet_copy_from_mem(concat_test_packet, i, 1, &data);
>> +            data++;
>> +    }
>> +
>>      udat = odp_packet_user_area(test_packet);
>>      udat_size = odp_packet_user_area_size(test_packet);
>>      if (!udat || udat_size != sizeof(struct udata_struct))
>> @@ -1152,8 +1164,9 @@ void packet_test_concatsplit(void)
>>      uint32_t pkt_len;
>>      odp_packet_t splits[4];
>>
>> -    pkt = odp_packet_copy(test_packet, odp_packet_pool(test_packet));
>> -    pkt_len = odp_packet_len(test_packet);
>> +    pkt = odp_packet_copy(concat_test_packet,
>> +                          odp_packet_pool(concat_test_packet));
>> +    pkt_len = odp_packet_len(concat_test_packet);
>>      CU_ASSERT_FATAL(pkt != ODP_PACKET_INVALID);
>>
>>      CU_ASSERT(odp_packet_concat(&pkt, pkt) == 0);
>> @@ -1165,7 +1178,7 @@ void packet_test_concatsplit(void)
>>      CU_ASSERT(odp_packet_data(pkt) != odp_packet_data(pkt2));
>>      CU_ASSERT(odp_packet_len(pkt) == odp_packet_len(pkt2));
>>      _packet_compare_data(pkt, pkt2);
>> -    _packet_compare_data(pkt, test_packet);
>> +    _packet_compare_data(pkt, concat_test_packet);
>>
>>      odp_packet_free(pkt);
>>      odp_packet_free(pkt2);
>> --
>> 2.10.1.4.g0ffc436

Reply via email to