On Thu, 14 Dec 2017 10:49:39 +0800
Jiayu Hu <jiayu...@intel.com> wrote:

> +     /* Don't merge packets whose outer DF bits are different. */
> +     if (item->outer_is_atomic ^ outer_is_atomic)

unlikely() here?

> +             return 0;
> +
> +     l2_offset = pkt->outer_l2_len + pkt->outer_l3_len;
> +     cmp = check_seq_option(&item->inner_item, tcp_hdr, sent_seq, ip_id,
> +                     tcp_hl, tcp_dl, l2_offset, is_atomic);
> +     if ((cmp == 1) && (outer_is_atomic || (outer_ip_id ==
> +                                     item->outer_ip_id +
> +                                     item->inner_item.nb_merged)))

More readable if you break the line at the ||

> +             /* Append the packet. */
> +             return 1;
> +     else if ((cmp == -1) && (outer_is_atomic || (outer_ip_id + 1 ==
> +                                     item->outer_ip_id)))

else unecessary after return. Similar line break for readabilty.

> +             /* Prepend the packet. */
> +             return -1;
> +     else
> +             return 0;
> +}
> +

maybe?
        if (cmp == 1) {
                if (outer_is_atomic ||
                    outer_ip_id == item->outer_ip_id + 
item->inner_item.nb_merged)
                        return 1;
        } else if (cmp == -1) {
                if (uter_is_atomic || outer_ip_id + 1 == item->outer_ip_id)
                        return -1;
        }
        return 0;


Reply via email to