Bill Fischofer(Bill-Fischofer-Linaro) replied on github web page:

platform/linux-generic/odp_packet.c
line 241
@@ -2146,7 +2146,7 @@ odp_packet_t odp_packet_ref(odp_packet_t pkt, uint32_t 
offset)
        link_hdr->buf_hdr.seg[0].len  = seg->len  - seg_offset;
        buffer_ref_inc(seg->hdr);
 
-       for (i = 1; i < num_copy; i++) {
+       for (i = 1; CONFIG_PACKET_SEGS_PER_HDR > 1 && i < num_copy; i++) {


Comment:
Not clear why this is necessary. If `CONFIG_PACKET_SEGS_PER_HDR == 1` then 
`num_copy` should be 1 here so the original `for` loop will also not execute. 
Or am I missing something here?

> Bill Fischofer(Bill-Fischofer-Linaro) wrote:
> Same comment here.


>> Bill Fischofer(Bill-Fischofer-Linaro) wrote:
>> 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_r144968393
updated_at 2017-10-16 21:17:08

Reply via email to