public inbox for netdev@vger.kernel.org 
 help / color / mirror / Atom feed
From: Shaohua Li <shli@kernel•org>
To: Cong Wang <xiyou.wangcong@gmail•com>
Cc: Linux Kernel Network Developers <netdev@vger•kernel.org>,
	David Miller <davem@davemloft•net>, Shaohua Li <shli@fb•com>,
	Eric Dumazet <eric.dumazet@gmail•com>,
	Florent Fourcot <flo@fourcot•fr>
Subject: Re: [PATCH V4 net 2/2] net: fix tcp reset packet flowlabel for ipv6
Date: Mon, 31 Jul 2017 16:00:02 -0700	[thread overview]
Message-ID: <20170731230002.ercfotm7qhfubbbv@kernel.org> (raw)
In-Reply-To: <CAM_iQpXOaP4JmGW4-AcL6JYbzKq_Co_Z4pWiSh1B1i=4MsakEQ@mail.gmail.com>

On Mon, Jul 31, 2017 at 03:35:02PM -0700, Cong Wang wrote:
> On Mon, Jul 31, 2017 at 3:19 PM, Shaohua Li <shli@kernel•org> wrote:
> >  static inline __be32 ip6_make_flowlabel(struct net *net, struct sk_buff *skb,
> >                                         __be32 flowlabel, bool autolabel,
> > -                                       struct flowi6 *fl6)
> > +                                       struct flowi6 *fl6, u32 hash)
> >  {
> > -       u32 hash;
> > -
> >         /* @flowlabel may include more than a flow label, eg, the traffic class.
> >          * Here we want only the flow label value.
> >          */
> > @@ -788,7 +786,8 @@ static inline __be32 ip6_make_flowlabel(struct net *net, struct sk_buff *skb,
> >              net->ipv6.sysctl.auto_flowlabels != IP6_AUTO_FLOW_LABEL_FORCED))
> >                 return flowlabel;
> >
> > -       hash = skb_get_hash_flowi6(skb, fl6);
> > +       if (skb)
> > +               hash = skb_get_hash_flowi6(skb, fl6);
> 
> 
> Why not just move skb_get_hash_flowi6() to its caller?
> This check is not necessary. If you don't want to touch
> existing callers, you can just introduce a wrapper:
> 
> 
> static inline __be32 ip6_make_flowlabel(struct net *net, struct sk_buff *skb,
>                                         __be32 flowlabel, bool autolabel,
>                                         struct flowi6 *fl6)
> {
>   u32 hash = skb_get_hash_flowi6(skb, fl6);
>   return __ip6_make_flowlabel(net, flowlabel, autolabel, hash);
> }

this will always call skb_get_hash_flowi6 for the fast path even auto flowlabel
is disabled. I thought we should avoid this.

> 
> And your code can just call:
> 
> __ip6_make_flowlabel(net, flowlabel, autolabel, sk->sk_txhash);

  reply	other threads:[~2017-07-31 23:00 UTC|newest]

Thread overview: 32+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-07-31 22:19 [PATCH V4 net 0/2] ipv6: fix flowlabel issue for reset packet Shaohua Li
2017-07-31 22:19 ` [PATCH V4 net 1/2] net: remove unnecessary rotation Shaohua Li
2017-07-31 22:19 ` [PATCH V4 net 2/2] net: fix tcp reset packet flowlabel for ipv6 Shaohua Li
2017-07-31 22:35   ` Cong Wang
2017-07-31 23:00     ` Shaohua Li [this message]
2017-08-01 21:17       ` Cong Wang
2017-08-01 21:42         ` Shaohua Li
2017-08-03  1:33           ` Cong Wang
2017-08-09 14:59 ` [PATCH V4 net 0/2] ipv6: fix flowlabel issue for reset packet Shaohua Li
2017-08-09 17:55   ` David Miller
2017-08-09 16:40 ` Tom Herbert
2017-08-10 16:30   ` Shaohua Li
2017-08-10 18:30     ` Tom Herbert
2017-08-10 19:13       ` Shaohua Li
2017-08-12  1:00         ` Tom Herbert
2017-08-15  2:52           ` Shaohua Li
2017-08-15 14:08             ` Tom Herbert
2017-08-15 22:42               ` Shaohua Li
2017-08-16  0:15                 ` Tom Herbert
2017-08-17 17:26                   ` Shaohua Li
2017-08-17 19:07                     ` Tom Herbert
2017-08-17 22:55                   ` Martin KaFai Lau
2017-08-18 14:50                     ` Tom Herbert
2017-08-18 20:51                       ` Martin KaFai Lau
2017-08-18 22:27                         ` David Miller
2017-11-08 17:44                           ` Tom Herbert
2017-11-08 20:01                             ` Tom Herbert
2017-11-08 21:41                               ` Martin KaFai Lau
2017-11-14 18:24                             ` Shaohua Li
2017-11-14 19:13                               ` Tom Herbert
2017-11-14 21:59                                 ` Shaohua Li
2017-11-15 18:27                                   ` Martin KaFai Lau

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=20170731230002.ercfotm7qhfubbbv@kernel.org \
    --to=shli@kernel$(echo .)org \
    --cc=davem@davemloft$(echo .)net \
    --cc=eric.dumazet@gmail$(echo .)com \
    --cc=flo@fourcot$(echo .)fr \
    --cc=netdev@vger$(echo .)kernel.org \
    --cc=shli@fb$(echo .)com \
    --cc=xiyou.wangcong@gmail$(echo .)com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html
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