All of lore.kernel.org
 help / color / mirror / Atom feed
From: Leon Romanovsky <leon@kernel.org>
To: Sabrina Dubroca <sd@queasysnail.net>
Cc: Steffen Klassert <steffen.klassert@secunet.com>,
	"David S. Miller" <davem@davemloft.net>,
	Eric Dumazet <edumazet@google.com>,
	Herbert Xu <herbert@gondor.apana.org.au>,
	Jakub Kicinski <kuba@kernel.org>,
	netdev@vger.kernel.org, Paolo Abeni <pabeni@redhat.com>
Subject: Re: [PATCH ipsec-next v1 1/5] xfrm: delay initialization of offload path till its actually requested
Date: Fri, 6 Jun 2025 20:05:12 +0300	[thread overview]
Message-ID: <20250606170512.GH7435@unreal> (raw)
In-Reply-To: <aEMFdAPopn9Td-Dn@krikkit>

On Fri, Jun 06, 2025 at 05:12:52PM +0200, Sabrina Dubroca wrote:
> 2025-06-05, 17:16:24 +0300, Leon Romanovsky wrote:
> > On Thu, Jun 05, 2025 at 03:09:19PM +0200, Sabrina Dubroca wrote:
> > > Hello,
> > > 
> > > I think we need to revert this patch. It causes a severe performance
> > > regression for SW IPsec (around 40-50%).
> > > 
> > > 2025-02-19, 15:50:57 +0200, Leon Romanovsky wrote:
> > > > From: Leon Romanovsky <leonro@nvidia.com>
> > > > 
> > > > XFRM offload path is probed even if offload isn't needed at all. Let's
> > > > make sure that x->type_offload pointer stays NULL for such path to
> > > > reduce ambiguity.
> > > 
> > > x->type_offload is used for GRO with SW IPsec, not just for HW offload.
> > 
> > Thanks for the report, can you please try the following fix?
> 
> Seems to work in my setup. That's basically a revert of every
> functional change in 585b64f5a620 ("xfrm: delay initialization of
> offload path till its actually requested"), except that now we set
> ->type_offload during xfrm_state_construct instead of
> __xfrm_init_state, so other callers of __xfrm_init_state
> (xfrm_state_migrate and pfkey - we can ignore ipcomp since it doesn't
> have ->type_offload) won't get ->type_offload set correctly. I'm not
> sure we want that.
> 
> Do you need to also revert 49431af6c4ef ("xfrm: rely on XFRM offload")
> from this series? The assumption that x->type_offload is set only for
> HW offload isn't correct.

I don't think so, we are not setting x->type_offload in crypto and packet
offload modes and it is enough for us to rely on offload type.

  230 int xfrm_dev_state_add(struct net *net, struct xfrm_state *x,
  231                        struct xfrm_user_offload *xuo,
  232                        struct netlink_ext_ack *extack)
  233 {
  ...
  308         if (!x->type_offload) {
  309                 NL_SET_ERR_MSG(extack, "Type doesn't support offload");
  310                 dev_put(dev);
  311                 return -EINVAL;
  312         }

Thanks

> 
> -- 
> Sabrina

  reply	other threads:[~2025-06-06 17:05 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-02-19 13:50 [Intel-wired-lan] [PATCH ipsec-next v1 0/5] Support PMTU in tunnel mode for packet offload Leon Romanovsky
2025-02-19 13:50 ` Leon Romanovsky
2025-02-19 13:50 ` [PATCH ipsec-next v1 1/5] xfrm: delay initialization of offload path till its actually requested Leon Romanovsky
2025-06-05 13:09   ` Sabrina Dubroca
2025-06-05 14:16     ` Leon Romanovsky
2025-06-06 15:12       ` Sabrina Dubroca
2025-06-06 17:05         ` Leon Romanovsky [this message]
2025-02-19 13:50 ` [PATCH ipsec-next v1 2/5] xfrm: simplify SA initialization routine Leon Romanovsky
2025-02-19 13:50 ` [PATCH ipsec-next v1 3/5] xfrm: rely on XFRM offload Leon Romanovsky
2025-02-19 13:51 ` [Intel-wired-lan] [PATCH ipsec-next v1 4/5] xfrm: provide common xdo_dev_offload_ok callback implementation Leon Romanovsky
2025-02-19 13:51   ` Leon Romanovsky
2025-02-19 13:51 ` [PATCH ipsec-next v1 5/5] xfrm: check for PMTU in tunnel mode for packet offload Leon Romanovsky
2025-02-25  8:57 ` [Intel-wired-lan] [PATCH ipsec-next v1 0/5] Support " Steffen Klassert
2025-02-25  8:57   ` 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=20250606170512.GH7435@unreal \
    --to=leon@kernel.org \
    --cc=davem@davemloft.net \
    --cc=edumazet@google.com \
    --cc=herbert@gondor.apana.org.au \
    --cc=kuba@kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    --cc=sd@queasysnail.net \
    --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 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.