Bill Fischofer(Bill-Fischofer-Linaro) replied on github web page: platform/linux-generic/odp_packet.c line 18 @@ -179,10 +179,7 @@ static inline void *packet_seg_data(odp_packet_hdr_t *pkt_hdr, uint32_t seg_idx) static inline uint16_t packet_last_seg(odp_packet_hdr_t *pkt_hdr) { - if (CONFIG_PACKET_MAX_SEGS == 1) - return 0; - else - return pkt_hdr->buf_hdr.segcount - 1; + return pkt_hdr->buf_hdr.segcount - 1;
Comment: Again, not sure why you want to remove the case optimization here. > Bill Fischofer(Bill-Fischofer-Linaro) wrote: > Why not `if (CONFIG_PACKET_SEG_DISABLED || num == 1) ...` here? There was an > attempt to generate fast-path code if it's known at compile time that > multi-segment packets are not being used. https://github.com/Linaro/odp/pull/233#discussion_r144966370 updated_at 2017-10-16 21:17:08