Dmitry Eremin-Solenikov(lumag) replied on github web page: platform/linux-generic/odp_packet.c line 22 @@ -2506,6 +2506,16 @@ int odp_packet_has_ref(odp_packet_t pkt) return 0; } +odp_proto_l2_type_t odp_packet_l2_type(odp_packet_t pkt) +{ + odp_packet_hdr_t *pkt_hdr = packet_hdr(pkt); + + if (pkt_hdr->p.input_flags.eth) + return ODP_PROTO_L2_TYPE_ETH; + + return ODP_PROTO_L2_TYPE_NONE;
Comment: No, because this code is implemented in the same way as the rest of `odp_packet_lX_type()` functions. > Bill Fischofer(Bill-Fischofer-Linaro) wrote: > `return pkt_hdr->p.input_flags.eth ? ODP_PROTO_L2_TYPE_ETH : > ODP_PROTO_L2_TYPE_NONE;` might be simpler here. >> Bill Fischofer(Bill-Fischofer-Linaro) wrote: >> `opt = param->num_opt ? ¶m->opt[opt_idx] : &default_opt_out;` might be >> simpler here. >>> Bill Fischofer(Bill-Fischofer-Linaro) wrote: >>> `opt = param->num_opt ? ¶m->opt[opt_idx] : &default_opt_out;` might be >>> simpler here. >>>> Bill Fischofer(Bill-Fischofer-Linaro) wrote: >>>> `opt = param->num_opt ? ¶m->opt[opt_idx] : &default_opt_out;` might be >>>> simpler here. >>>>> Bill Fischofer(Bill-Fischofer-Linaro) wrote: >>>>> `mtu = frag_mode == ODP_IPSEC_FRAG_CHECK ? ipsec_sa->out.mtu : >>>>> UINT32_MAX;` might be simpler here. >>>>>> Bill Fischofer(Bill-Fischofer-Linaro) wrote: >>>>>> `frag_mode = opt->flag.frag_mode ? opt->frag_mode : >>>>>> ipsec_sa->out.frag_mode;` might be simpler here. https://github.com/Linaro/odp/pull/502#discussion_r171026780 updated_at 2018-02-27 18:49:38