Matias Elo(matiaselo) replied on github web page:

platform/linux-generic/include/odp_packet_internal.h
line 9
@@ -197,7 +197,7 @@ static inline void packet_init(odp_packet_hdr_t *pkt_hdr, 
uint32_t len)
        uint32_t seg_len;
        int num = pkt_hdr->buf_hdr.segcount;
 
-       if (odp_likely(CONFIG_PACKET_MAX_SEGS == 1 || num == 1)) {
+       if (odp_likely(num == 1)) {


Comment:
OK, I'll restore the CONFIG_PACKET_SEG_DISABLED checks. 

> Bill Fischofer(Bill-Fischofer-Linaro) wrote:
> 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_r145041630
updated_at 2017-10-17 07:03:23

Reply via email to