[ovs-dev] [PATCH v4 3/9] dp-packet: Refactor offloading API.

Ilya Maximets i.maximets at samsung.com
Mon Feb 18 12:15:17 UTC 2019


On 17.02.2019 20:00, Ophir Munk wrote:
> 
> 
>> -----Original Message-----
>> From: Ilya Maximets <i.maximets at samsung.com>
>> Sent: Friday, February 15, 2019 3:07 PM
>> To: ovs-dev at openvswitch.org; Ian Stokes <ian.stokes at intel.com>
>> Cc: Flavio Leitner <fbl at sysclose.org>; Ophir Munk
>> <ophirmu at mellanox.com>; Kevin Traynor <ktraynor at redhat.com>; Roni Bar
>> Yanai <roniba at mellanox.com>; Finn Christensen <fc at napatech.com>; Ilya
>> Maximets <i.maximets at samsung.com>
>> Subject: [PATCH v4 3/9] dp-packet: Refactor offloading API.
>>
>> 1. No reason to have mbuf related APIs in a generic code.
>> 2. Not only RSS/checksums should be invalidated in case of tunnel
>>    decapsulation or sending to 'ring' ports.
>>
>> In order to fix two above issues, new function
>> 'dp_packet_offload_invalidate' introduced. In order to clean up/unify the
>> code and simplify addition of new offloading features to non-DPDK version
>> of dp-packet, introduced 'ol_flags' bitmask. Additionally reduced code
>> complexity in 'dp_packet_clone_with_headroom' by using already existent
>> generic APIs.
>>
>> Unfortunately, we still need to have a special case for mbuf initialization
>> inside 'dp_packet_init__()'.
> 
> Do you mean by 'special case' that calling dp_packet_mbuf_init was under #ifdef DPDK_NETDEV?
> Please note that prior to this commit:
> 1. 'dp_packet_mbuf_init' was defined twice in dp-packet.h. 
> Once under #ifdef DPDK_NETDEV and a second time under the #else with an empty body.
> 2. There was no #ifdef in dp_packet_init__(). 
> 
> This commit removes the second implementation of 'dp_packet_mbuf_init' (with the empty body) and adds #ifdef in dp_packet_init__().
> +#ifdef DPDK_NETDEV
>      dp_packet_mbuf_init(b);
> +#endif
> 
> Can you please explain? 
> What happens if you restore 'dp_packet_mbuf_init' with empty body and remove the #ifdef in dp_packet_init__()?


By the 'special case' I meant calling something mbuf specific,
i.e. something that contains 'mbuf' in it's name, from the generic code.

As I wrote in reply to Flavio, we could rename this to something like
'dp_packet_init_specific()' and define in both DPDK and non-DPDK cases to
make it more generic.

Best regards, Ilya Maximets.


More information about the dev mailing list