netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Li RongQing <roy.qing.li@gmail.com>
To: Steffen Klassert <steffen.klassert@secunet.com>
Cc: netdev <netdev@vger.kernel.org>
Subject: Re: [PATCH][next] xfrm: optimise xfrm_policy_lookup_bytype
Date: Tue, 12 May 2015 16:25:07 +0800	[thread overview]
Message-ID: <CAJFZqHywcxDx1vLTtTqVfVe6hoG1M8PYH4a-7HZ9XrFJPAM-Gw@mail.gmail.com> (raw)
In-Reply-To: <20150511120616.GS8928@secunet.com>

On Mon, May 11, 2015 at 8:06 PM, Steffen Klassert
<steffen.klassert@secunet.com> wrote:
> Please explain why it is unnecessary to continue with the
> loop here. In general a commit message should explain why
> this code is changed.
>
Ok, I will add


>> +                     break;
>
> priority is initialized with ~0U at the beginning of this function.
> What if someone has an inexact policy with priority ~0U configured?
> With your change, this policy will never match because we don't even
> try to search for it.

The original code can not handle this kind of policy whose priority is ~0U,
I will fix it when resubmit this patch.

1121         chain = &net->xfrm.policy_inexact[dir];
1122         hlist_for_each_entry(pol, chain, bydst) {
1123                 err = xfrm_policy_match(pol, fl, type, family, dir);
1124                 if (err) {
1125                         if (err == -ESRCH)
1126                                 continue;
1127                         else {
1128                                 ret = ERR_PTR(err);
1129                                 goto fail;
1130                         }
1131                 } else if (pol->priority < priority) {
1132                         ret = pol;
1133                         break;
1134                 }
1135         }

  reply	other threads:[~2015-05-12  8:25 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-05-09 11:17 [PATCH][next] xfrm: optimise xfrm_policy_lookup_bytype roy.qing.li
2015-05-11 12:06 ` Steffen Klassert
2015-05-12  8:25   ` Li RongQing [this message]
2015-05-12 11:37     ` Steffen Klassert

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=CAJFZqHywcxDx1vLTtTqVfVe6hoG1M8PYH4a-7HZ9XrFJPAM-Gw@mail.gmail.com \
    --to=roy.qing.li@gmail.com \
    --cc=netdev@vger.kernel.org \
    --cc=steffen.klassert@secunet.com \
    /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).