From: "Hu, Jiayu" <jiayu.hu@intel.com>
To: Stephen Hemminger <stephen@networkplumber.org>
Cc: "dev@dpdk.org" <dev@dpdk.org>,
"Ananyev, Konstantin" <konstantin.ananyev@intel.com>,
"Tan, Jianfeng" <jianfeng.tan@intel.com>,
"Chen, Junjie J" <junjie.j.chen@intel.com>,
"Mcnamara, John" <john.mcnamara@intel.com>,
"matvejchikov@gmail.com" <matvejchikov@gmail.com>
Subject: Re: [dpdk-dev] [PATCH v2 2/2] gro: support VxLAN GRO
Date: Thu, 14 Dec 2017 04:37:09 +0000 [thread overview]
Message-ID: <ED946F0BEFE0A141B63BABBD629A2A9B3881E4FE@shsmsx102.ccr.corp.intel.com> (raw)
In-Reply-To: <20171213190239.5154c571@xeon-e3>
Hi Stephen,
> -----Original Message-----
> From: Stephen Hemminger [mailto:stephen@networkplumber.org]
> Sent: Thursday, December 14, 2017 11:03 AM
> To: Hu, Jiayu <jiayu.hu@intel.com>
> Cc: dev@dpdk.org; Ananyev, Konstantin <konstantin.ananyev@intel.com>;
> Tan, Jianfeng <jianfeng.tan@intel.com>; Chen, Junjie J
> <junjie.j.chen@intel.com>; Mcnamara, John <john.mcnamara@intel.com>;
> matvejchikov@gmail.com
> Subject: Re: [PATCH v2 2/2] gro: support VxLAN GRO
>
> On Thu, 14 Dec 2017 10:49:39 +0800
> Jiayu Hu <jiayu.hu@intel.com> wrote:
>
> > + /* Don't merge packets whose outer DF bits are different. */
> > + if (item->outer_is_atomic ^ outer_is_atomic)
>
> unlikely() here?
Agree. Add it in the next version.
>
> > + 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 ||
Exactly, I will change it in the next version.
>
> > + /* 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.
Correctly, I will change it.
>
> > + /* 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;
>
The reason to replace "if ((cmp == 1) && (outer_is_atomic ...))" with two if statements is
for readability?
But will two if statements make codes less efficient?
Thanks,
Jiayu
next prev parent reply other threads:[~2017-12-14 4:37 UTC|newest]
Thread overview: 31+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-11-25 3:17 [dpdk-dev] [PATCH 0/2] Support " Jiayu Hu
2017-11-25 3:17 ` [dpdk-dev] [PATCH 1/2] gro: TCP/IPV4 GRO codes cleanup Jiayu Hu
2017-11-25 3:17 ` [dpdk-dev] [PATCH 2/2] gro: support VxLAN GRO Jiayu Hu
2017-12-14 2:49 ` [dpdk-dev] [PATCH v2 0/2] Support " Jiayu Hu
2017-12-14 2:49 ` [dpdk-dev] [PATCH v2 1/2] gro: code cleanup Jiayu Hu
2017-12-14 2:49 ` [dpdk-dev] [PATCH v2 2/2] gro: support VxLAN GRO Jiayu Hu
2017-12-14 2:58 ` Stephen Hemminger
2017-12-14 3:02 ` Stephen Hemminger
2017-12-14 4:37 ` Hu, Jiayu [this message]
2017-12-22 7:25 ` [dpdk-dev] [PATCH v3 0/2] Support " Jiayu Hu
2017-12-22 7:25 ` [dpdk-dev] [PATCH v3 1/2] gro: code cleanup Jiayu Hu
2017-12-29 3:53 ` Chen, Junjie J
2018-01-02 11:26 ` Bruce Richardson
2018-01-03 1:07 ` Tan, Jianfeng
2018-01-03 1:27 ` Stephen Hemminger
2017-12-22 7:25 ` [dpdk-dev] [PATCH v3 2/2] gro: support VxLAN GRO Jiayu Hu
2017-12-22 8:17 ` Chen, Junjie J
2017-12-25 6:36 ` Jiayu Hu
2017-12-29 3:53 ` Chen, Junjie J
2017-12-29 3:52 ` [dpdk-dev] [PATCH v3 0/2] Support " Chen, Junjie J
2018-01-05 6:12 ` [dpdk-dev] [PATCH v4 " Jiayu Hu
2018-01-05 6:12 ` [dpdk-dev] [PATCH v4 1/2] gro: code cleanup Jiayu Hu
2018-01-08 1:15 ` Yao, Lei A
2018-01-10 0:09 ` Thomas Monjalon
2018-01-10 1:55 ` Hu, Jiayu
2018-01-05 6:12 ` [dpdk-dev] [PATCH v4 2/2] gro: support VxLAN GRO Jiayu Hu
2018-01-10 14:03 ` [dpdk-dev] [PATCH v5 0/3] Support " Jiayu Hu
2018-01-10 14:03 ` [dpdk-dev] [PATCH v5 1/3] gro: codes cleanup Jiayu Hu
2018-01-10 14:03 ` [dpdk-dev] [PATCH v5 2/3] gro: comply RFC 6864 to process IPv4 ID Jiayu Hu
2018-01-10 14:03 ` [dpdk-dev] [PATCH v5 3/3] gro: support VxLAN GRO Jiayu Hu
2018-01-11 22:15 ` [dpdk-dev] [PATCH v5 0/3] Support " Thomas Monjalon
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=ED946F0BEFE0A141B63BABBD629A2A9B3881E4FE@shsmsx102.ccr.corp.intel.com \
--to=jiayu.hu@intel.com \
--cc=dev@dpdk.org \
--cc=jianfeng.tan@intel.com \
--cc=john.mcnamara@intel.com \
--cc=junjie.j.chen@intel.com \
--cc=konstantin.ananyev@intel.com \
--cc=matvejchikov@gmail.com \
--cc=stephen@networkplumber.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).