On 15.06.2017 14:21, Savolainen, Petri (Nokia - FI/Espoo) wrote:
>
>> index d71f4464af48..3cd4a73cbefb 100644
>> --- a/platform/linux-generic/odp_event.c
>> +++ b/platform/linux-generic/odp_event.c
>> @@ -19,6 +19,11 @@ odp_event_type_t odp_event_type(odp_event_t event)
>> return _odp_buffer_event_type(odp_buffer_from_event(event));
>> }
>>
>> +odp_event_subtype_t odp_event_subtype(odp_event_t event)
>> +{
>> + return _odp_buffer_event_subtype(odp_buffer_from_event(event));
>> +}
>> +
>> void odp_event_free(odp_event_t event)
>> {
>> switch (odp_event_type(event)) {
>> diff --git a/platform/linux-generic/odp_packet.c b/platform/linux-
>> generic/odp_packet.c
>> index eb66af2d3b9c..3789feca45f9 100644
>> --- a/platform/linux-generic/odp_packet.c
>> +++ b/platform/linux-generic/odp_packet.c
>> @@ -268,6 +268,7 @@ static inline void packet_init(odp_packet_hdr_t
>> *pkt_hdr, uint32_t len)
>> CONFIG_PACKET_TAILROOM;
>>
>> pkt_hdr->input = ODP_PKTIO_INVALID;
>> + pkt_hdr->buf_hdr.event_subtype = ODP_EVENT_PACKET_BASIC;
>
>
> This is not needed if you update crypto.c with
> _odp_buffer_event_subtype_set() calls, where _odp_buffer_event_type_set() is
> done already -right? Packet_init() is done for every alloc and should avoid
> setting constant data.
I gave this idea a thought. I will update crypto.c (thanks for the
point!), but I still insist that packet_init should set subtype.
Otherwise subtype resetting should go into packet free code (which is
uglier) in my opinion. Consider ODP application receiving IPsec packets
from queue then freeing them for some reason before doing
odp_ipsec_result() call. Packet will be freed, but event_subtype will be
left as PACKET_IPSEC.
>
> There's also odp_event_types() API. Could you implement that also for
> completeness.
>
> odp_event_type_t odp_event_types(odp_event_t event, odp_event_subtype_t
> *subtype)
Sure, I will do.
--
With best wishes
Dmitry