From: Steffen Klassert <steffen.klassert@secunet.com>
To: Sabrina Dubroca <sd@queasysnail.net>
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: Thu, 18 Apr 2024 11:50:22 +0200 [thread overview]
Message-ID: <ZiDs3n3yTLMnLzaK@gauss3.secunet.de> (raw)
In-Reply-To: <Zh01zlwo0H1BmMug@hog>
On Mon, Apr 15, 2024 at 04:12:30PM +0200, Sabrina Dubroca wrote:
> 2024-04-12, 08:05:51 +0200, Steffen Klassert wrote:
> > diff --git a/net/xfrm/xfrm_state.c b/net/xfrm/xfrm_state.c
> > index 0c306473a79d..b41b5dd72d8e 100644
> > --- a/net/xfrm/xfrm_state.c
> > +++ b/net/xfrm/xfrm_state.c
> [...]
> > @@ -1096,6 +1098,9 @@ static void xfrm_state_look_at(struct xfrm_policy *pol, struct xfrm_state *x,
> > struct xfrm_state **best, int *acq_in_progress,
> > int *error)
> > {
> > + unsigned int pcpu_id = get_cpu();
> > + put_cpu();
>
> That looks really strange to me. Is it safe? If it is, I guess you
> could just use smp_processor_id(), since you don't get anything out of
> the extra preempt_disable/enable pair.
We can use use smp_processor_id() as we just need the ID as a lookup
key.
>
> (same in xfrm_state_find)
>
>
> [...]
> > @@ -2458,6 +2478,8 @@ static int build_aevent(struct sk_buff *skb, struct xfrm_state *x, const struct
> > err = xfrm_if_id_put(skb, x->if_id);
> > if (err)
> > goto out_cancel;
> > + if (x->pcpu_num != UINT_MAX)
> > + err = nla_put_u32(skb, XFRMA_SA_PCPU, x->pcpu_num);
>
> Missing the corresponding change to xfrm_aevent_msgsize?
Right, fixed.
> [...]
> > @@ -3049,6 +3078,7 @@ const struct nla_policy xfrma_policy[XFRMA_MAX+1] = {
> > [XFRMA_SET_MARK_MASK] = { .type = NLA_U32 },
> > [XFRMA_IF_ID] = { .type = NLA_U32 },
> > [XFRMA_MTIMER_THRESH] = { .type = NLA_U32 },
> > + [XFRMA_SA_PCPU] = { .type = NLA_U32 },
>
> What about xfrm_compat? Don't we need to add XFRMA_SA_PCPU to
> compat_policy, and then some changes to the translators?
Yeah, I forgot this. The compat layer did not yet exist when
I wrote the initial pachset. The IETF standardization process
held this pachset off for about 5 years :-/
> [...]
> > @@ -3216,6 +3246,11 @@ static int build_expire(struct sk_buff *skb, struct xfrm_state *x, const struct
> > err = xfrm_if_id_put(skb, x->if_id);
> > if (err)
> > return err;
> > + if (x->pcpu_num != UINT_MAX) {
> > + err = nla_put_u32(skb, XFRMA_SA_PCPU, x->pcpu_num);
>
> Missing the corresponding change to xfrm_expire_msgsize?
Fixed.
> [...]
> > @@ -3453,6 +3490,8 @@ static int build_acquire(struct sk_buff *skb, struct xfrm_state *x,
> > err = xfrm_if_id_put(skb, xp->if_id);
> > if (!err && xp->xdo.dev)
> > err = copy_user_offload(&xp->xdo, skb);
> > + if (!err && x->pcpu_num != UINT_MAX)
> > + err = nla_put_u32(skb, XFRMA_SA_PCPU, x->pcpu_num);
>
> Missing the corresponding change to xfrm_acquire_msgsize?
Fixed.
Thanks for the review Sabrina!
next prev parent reply other threads:[~2024-04-18 9:50 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
2024-04-18 9:46 ` Steffen Klassert
2024-04-15 14:12 ` Sabrina Dubroca
2024-04-18 9:50 ` Steffen Klassert [this message]
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=ZiDs3n3yTLMnLzaK@gauss3.secunet.de \
--to=steffen.klassert@secunet.com \
--cc=antony.antony@secunet.com \
--cc=devel@linux-ipsec.org \
--cc=dxu@dxuuu.xyz \
--cc=netdev@vger.kernel.org \
--cc=paul@nohats.ca \
--cc=sd@queasysnail.net \
--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.