On 16.06.2017 12:37, Savolainen, Petri (Nokia - FI/Espoo) wrote:
>>>>    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.
> 
> OK. We will optimize it later if needed: either set subtype to basic only 
> when it's not already basic, or add subtype as packet_init() argument (to 
> avoid first setting it to basic and then to ipsec).

Agreed.

-- 
With best wishes
Dmitry

Reply via email to