From mboxrd@z Thu Jan 1 00:00:00 1970 From: "Hu, Jiayu" Subject: Re: [PATCH v2 2/2] gro: support VxLAN GRO Date: Thu, 14 Dec 2017 04:37:09 +0000 Message-ID: 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> <20171213190239.5154c571@xeon-e3> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Cc: "dev@dpdk.org" , "Ananyev, Konstantin" , "Tan, Jianfeng" , "Chen, Junjie J" , "Mcnamara, John" , "matvejchikov@gmail.com" To: Stephen Hemminger Return-path: Received: from mga06.intel.com (mga06.intel.com [134.134.136.31]) by dpdk.org (Postfix) with ESMTP id 435A12030 for ; Thu, 14 Dec 2017 05:37:13 +0100 (CET) In-Reply-To: <20171213190239.5154c571@xeon-e3> Content-Language: en-US List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" Hi Stephen, > -----Original Message----- > From: Stephen Hemminger [mailto:stephen@networkplumber.org] > Sent: Thursday, December 14, 2017 11:03 AM > To: Hu, Jiayu > Cc: dev@dpdk.org; Ananyev, Konstantin ; > Tan, Jianfeng ; Chen, Junjie J > ; Mcnamara, John ; > matvejchikov@gmail.com > Subject: Re: [PATCH v2 2/2] gro: support VxLAN GRO >=20 > On Thu, 14 Dec 2017 10:49:39 +0800 > Jiayu Hu wrote: >=20 > > + /* Don't merge packets whose outer DF bits are different. */ > > + if (item->outer_is_atomic ^ outer_is_atomic) >=20 > unlikely() here? Agree. Add it in the next version. >=20 > > + return 0; > > + > > + l2_offset =3D pkt->outer_l2_len + pkt->outer_l3_len; > > + cmp =3D check_seq_option(&item->inner_item, tcp_hdr, sent_seq, > ip_id, > > + tcp_hl, tcp_dl, l2_offset, is_atomic); > > + if ((cmp =3D=3D 1) && (outer_is_atomic || (outer_ip_id =3D=3D > > + item->outer_ip_id + > > + item->inner_item.nb_merged))) >=20 > More readable if you break the line at the || Exactly, I will change it in the next version. >=20 > > + /* Append the packet. */ > > + return 1; > > + else if ((cmp =3D=3D -1) && (outer_is_atomic || (outer_ip_id + 1 =3D= =3D > > + item->outer_ip_id))) >=20 > else unecessary after return. Similar line break for readabilty. Correctly, I will change it. >=20 > > + /* Prepend the packet. */ > > + return -1; > > + else > > + return 0; > > +} > > + >=20 > maybe? > if (cmp =3D=3D 1) { > if (outer_is_atomic || > outer_ip_id =3D=3D item->outer_ip_id + item- > >inner_item.nb_merged) > return 1; > } else if (cmp =3D=3D -1) { > if (uter_is_atomic || outer_ip_id + 1 =3D=3D item->outer_ip_id) > return -1; > } > return 0; >=20 The reason to replace "if ((cmp =3D=3D 1) && (outer_is_atomic ...))" with t= wo if statements is for readability? But will two if statements make codes less efficient? Thanks, Jiayu