All of lore.kernel.org
 help / color / mirror / Atom feed
From: Simon Horman <horms@kernel.org>
To: Steffen Klassert <steffen.klassert@secunet.com>
Cc: netdev@vger.kernel.org, devel@linux-ipsec.org,
	Paul Wouters <paul@nohats.ca>,
	Antony Antony <antony.antony@secunet.com>,
	Tobias Brunner <tobias@strongswan.org>, Daniel Xu <dxu@dxuuu.xyz>
Subject: Re: [PATCH ipsec-next 1/3] xfrm: Add support for per cpu xfrm state handling.
Date: Sun, 14 Apr 2024 12:05:34 +0100	[thread overview]
Message-ID: <20240414110534.GD645060@kernel.org> (raw)
In-Reply-To: <20240412060553.3483630-2-steffen.klassert@secunet.com>

On Fri, Apr 12, 2024 at 08:05:51AM +0200, Steffen Klassert wrote:

...

> diff --git a/net/xfrm/xfrm_state.c b/net/xfrm/xfrm_state.c

...

> @@ -1115,13 +1120,18 @@ static void xfrm_state_look_at(struct xfrm_policy *pol, struct xfrm_state *x,
>  							&fl->u.__fl_common))
>  			return;
>  
> +		if (x->pcpu_num != UINT_MAX && x->pcpu_num != pcpu_id)
> +			return;
> +
>  		if (!*best ||
> +		    ((*best)->pcpu_num == UINT_MAX && x->pcpu_num == pcpu_id) ||
>  		    (*best)->km.dying > x->km.dying ||
>  		    ((*best)->km.dying == x->km.dying &&
>  		     (*best)->curlft.add_time < x->curlft.add_time))
>  			*best = x;
>  	} else if (x->km.state == XFRM_STATE_ACQ) {
> -		*acq_in_progress = 1;
> +		if (!*best || (*best && x->pcpu_num == pcpu_id))

Hi Steffen,

a minor nit from my side: I think this can be expressed as follows.

		if (!*best || x->pcpu_num == pcpu_id)

Flagged by Coccinelle

> +			*acq_in_progress = 1;
>  	} else if (x->km.state == XFRM_STATE_ERROR ||
>  		   x->km.state == XFRM_STATE_EXPIRED) {
>  		if ((!x->sel.family ||

...

  parent reply	other threads:[~2024-04-14 11:05 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-04-12  6:05 [PATCH ipsec-next 0/3] Add support for per cpu xfrm states Steffen Klassert
2024-04-12  6:05 ` [PATCH ipsec-next 1/3] xfrm: Add support for per cpu xfrm state handling Steffen Klassert
2024-04-12 10:37   ` Tobias Brunner
2024-04-18  9:45     ` Steffen Klassert
2024-04-14 11:05   ` Simon Horman [this message]
2024-04-18  9:46     ` Steffen Klassert
2024-04-15 14:12   ` Sabrina Dubroca
2024-04-18  9:50     ` Steffen Klassert
2024-04-12  6:05 ` [PATCH ipsec-next 2/3] xfrm: Cache used outbound xfrm states at the policy Steffen Klassert
2024-04-16 21:51   ` Daniel Xu
2024-04-18 10:01     ` Steffen Klassert
2024-04-12  6:05 ` [PATCH ipsec-next 3/3] xfrm: Add an inbound percpu state cache Steffen Klassert
2024-05-02 12:20 ` [PATCH ipsec-next 0/3] Add support for per cpu xfrm states Antony Antony
2024-05-02 12:38   ` Steffen Klassert
  -- strict thread matches above, loose matches on Subject: below --
2024-04-13  0:36 [PATCH ipsec-next 3/3] xfrm: Add an inbound percpu state cache kernel test robot
2024-04-16  2:33 ` kernel test robot

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=20240414110534.GD645060@kernel.org \
    --to=horms@kernel.org \
    --cc=antony.antony@secunet.com \
    --cc=devel@linux-ipsec.org \
    --cc=dxu@dxuuu.xyz \
    --cc=netdev@vger.kernel.org \
    --cc=paul@nohats.ca \
    --cc=steffen.klassert@secunet.com \
    --cc=tobias@strongswan.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.