From: Shaohua Li <s...@kernel.org> Date: Mon, 31 Jul 2017 12:30:27 -0700
> On Mon, Jul 31, 2017 at 11:10:38AM -0700, Cong Wang wrote: >> On Mon, Jul 31, 2017 at 10:08 AM, Shaohua Li <s...@kernel.org> wrote: >> > +/* Like ip6_make_flowlabel, but already has hash */ >> > +static inline __be32 ip6_make_flowlabel_from_hash(struct net *net, >> > + bool autolabel, u32 hash) >> > +{ >> > + __be32 flowlabel; >> > + >> > + if (net->ipv6.sysctl.auto_flowlabels == IP6_AUTO_FLOW_LABEL_OFF || >> > + (!autolabel && >> > + net->ipv6.sysctl.auto_flowlabels != >> > IP6_AUTO_FLOW_LABEL_FORCED)) >> > + return 0; >> > + >> > + flowlabel = (__force __be32)hash & IPV6_FLOWLABEL_MASK; >> > + >> > + if (net->ipv6.sysctl.flowlabel_state_ranges) >> > + flowlabel |= IPV6_FLOWLABEL_STATELESS_FLAG; >> > + >> > + return flowlabel; >> > +} >> >> I still don't see why you have to duplicate the code, >> for me you can just refactor ip6_make_flowlabel() >> and pass the hash as a parameter and pass >> 'flowlabel' as 0, and no run-time overhead. > > Still need extra check. Ok, I updated the patch. This is not how you post a new version of a patch. It is especially not the way to post a new version of a patch which is part of a series. You always must make a clean, fresh, patch posting. Not as a reply to a discussion email. And when the patch is part of a series, you must repost the entire series along with the "[PATCH ... 0/N] " header posting.