Dmitry Eremin-Solenikov(lumag) replied on github web page: include/odp/api/spec/packet.h line 17 @@ -71,6 +71,51 @@ extern "C" { * Packet is red */ +/** + * Protocol + */ +typedef enum odp_proto_t { + /** No protocol defined */ + ODP_PROTO_NONE = 0, + + /** Ethernet (including VLAN) */ + ODP_PROTO_ETH, + + /** IP (including IPv4 and IPv6) */ + ODP_PROTO_IP, + + /** UDP */
Comment: I felt easier to reparse both L3 and L4 headers in IPsec case, especially since transport mode ESP can en/decrypt some of L3 headers in IPv6 case. > Dmitry Eremin-Solenikov(lumag) wrote: > @Bill-Fischofer-Linaro In IPsec case Next Header field will contain 4 for > IPv4 and 41 for IPv6. >> Bill Fischofer(Bill-Fischofer-Linaro) wrote: >> That might be overly complicated since until a decrypted tunnel mode IPsec >> packet is parsed you don't know whether it's IPv4 or IPv6. It's parsing that >> makes that determination. >>> Bill Fischofer(Bill-Fischofer-Linaro) wrote: >>> @lumag IPsec operating in transport mode is, I'd imagine, the main use case >>> here. >>>> Dmitry Eremin-Solenikov(lumag) wrote: >>>> What is the usecase for parsing a packet starting from L4 header? Also >>>> there are several (lots) of other L4 protocols. Do we want to support them >>>> all here? >>>>> Dmitry Eremin-Solenikov(lumag) wrote: >>>>> Maybe it would be better to split this into separate IPv4 and IPv6 >>>>> packets. It would be an error to pass IPv6 packet with ethtype (or IP >>>>> tunnel type) being set to IPv4. >>>>>> Petri Savolainen(psavol) wrote: >>>>>> A vector of packets is CPU vector instructions friendly. >>>>>>> Petri Savolainen(psavol) wrote: >>>>>>> The use case is mentioned in log message: parse after decrypt/IP >>>>>>> reassembly. Application has recreated an inner packet and needs to >>>>>>> parse it before continue. This is inherently SW parse which may be >>>>>>> accelerated with CPU vector instructions, etc. >>>>>>>> Bill Fischofer(Bill-Fischofer-Linaro) wrote: >>>>>>>> What's the use case for a multi() form of this API? Might VPP use it? >>>>>>>> Perhaps Sachin can comment? >>>>>>>>> Bill Fischofer(Bill-Fischofer-Linaro) wrote: >>>>>>>>> We had considered an `odp_packet_parse()` function some time back but >>>>>>>>> it was rejected as something that would not fit well with hardware >>>>>>>>> parsers. What's changed? https://github.com/Linaro/odp/pull/273#discussion_r149461865 updated_at 2017-11-07 18:31:45