From: ext Ola Liljedahl [mailto:[email protected]] Sent: Thursday, April 16, 2015 5:03 PM To: Savolainen, Petri (Nokia - FI/Espoo) Cc: ext Zoltan Kiss; [email protected] Subject: Re: [lng-odp] [RFC API-NEXT PATCH] packet_io: add bitmap to specify what level of parsing needed
On 16 April 2015 at 15:37, Ola Liljedahl <[email protected]<mailto:[email protected]>> wrote: Do we really need to be able to specify what parsing to do to this level of detail? An implementation cannot efficiently check these all of these flags, the code would be drowning in conditionals. Why not specify whether parsing should be done for (or stop at) for layer-2, layer-3 and layer-4 (or not at all)? The functions in packet_flags.h must be associated with one of these levels. Of course a (SW) parser implementation could aggregate the specific bit flags and compute the corresponding parsing levels and use that when deciding how far into the packet to parse. This tells to the implementation which parse results ( odp_packet_has_xxx() ) the application is going to use. If e.g. application will never call odp_packet_has_sctp() (or some more detailed, new flag we’d add in the future: odp_packet_has_stcp_xxx()) and the implementation does not have HW support for that, implementation could now skip SW parsing of that protocol altogether. It does not hurt (no SW overhead) if implementation has HW support for the protocol and does parsing in any case. Results are undefined, if application first claims not to use a parse results, but then uses that after all (e.g. _has_xxx() may return 0, even when the packet has xxx). -Petri
_______________________________________________ lng-odp mailing list [email protected] https://lists.linaro.org/mailman/listinfo/lng-odp
