From mboxrd@z Thu Jan 1 00:00:00 1970 From: Stephen Hemminger Subject: Re: [PATCH v2 2/2] gro: support VxLAN GRO Date: Wed, 13 Dec 2017 19:02:39 -0800 Message-ID: <20171213190239.5154c571@xeon-e3> References: <1511579860-37020-1-git-send-email-jiayu.hu@intel.com> <1513219779-100115-1-git-send-email-jiayu.hu@intel.com> <1513219779-100115-3-git-send-email-jiayu.hu@intel.com> Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Cc: dev@dpdk.org, konstantin.ananyev@intel.com, jianfeng.tan@intel.com, junjie.j.chen@intel.com, john.mcnamara@intel.com, matvejchikov@gmail.com To: Jiayu Hu Return-path: Received: from mail-pg0-f65.google.com (mail-pg0-f65.google.com [74.125.83.65]) by dpdk.org (Postfix) with ESMTP id 9CA291B00E for ; Thu, 14 Dec 2017 04:02:42 +0100 (CET) Received: by mail-pg0-f65.google.com with SMTP id g7so2523779pgs.0 for ; Wed, 13 Dec 2017 19:02:42 -0800 (PST) In-Reply-To: <1513219779-100115-3-git-send-email-jiayu.hu@intel.com> List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" On Thu, 14 Dec 2017 10:49:39 +0800 Jiayu Hu 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;