netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Zhu Yanjun <yanjun.zhu@linux.dev>
To: Sabrina Dubroca <sd@queasysnail.net>, netdev@vger.kernel.org
Cc: Leon Romanovsky <leonro@nvidia.com>,
	Steffen Klassert <steffen.klassert@secunet.com>
Subject: Re: [PATCH ipsec 1/3] xfrm: restore GSO for SW crypto
Date: Tue, 29 Jul 2025 09:06:36 -0700	[thread overview]
Message-ID: <f86f5c83-0fc2-4c40-b8f9-f20f5b755cb1@linux.dev> (raw)
In-Reply-To: <b5c3f4e2623d940ed51df2b79a2af4cc55b40a55.1753631391.git.sd@queasysnail.net>


在 2025/7/28 8:17, Sabrina Dubroca 写道:
> Commit 49431af6c4ef incorrectly assumes that the GSO path is only used
> by HW offload, but it's also useful for SW crypto.
>
> This patch re-enables GSO for SW crypto. It's not an exact revert to
> preserve the other changes made to xfrm_dev_offload_ok afterwards, but
> it reverts all of its effects.
>
> Fixes: 49431af6c4ef ("xfrm: rely on XFRM offload")
> Signed-off-by: Sabrina Dubroca <sd@queasysnail.net>

Thanks a lot.

Reviewed-by: Zhu Yanjun <yanjun.zhu@linux.dev>

Zhu Yanjun

> ---
>   net/xfrm/xfrm_device.c | 9 +++++++--
>   1 file changed, 7 insertions(+), 2 deletions(-)
>
> diff --git a/net/xfrm/xfrm_device.c b/net/xfrm/xfrm_device.c
> index d2819baea414..1f88472aaac0 100644
> --- a/net/xfrm/xfrm_device.c
> +++ b/net/xfrm/xfrm_device.c
> @@ -415,10 +415,12 @@ bool xfrm_dev_offload_ok(struct sk_buff *skb, struct xfrm_state *x)
>   	struct net_device *dev = x->xso.dev;
>   	bool check_tunnel_size;
>   
> -	if (x->xso.type == XFRM_DEV_OFFLOAD_UNSPECIFIED)
> +	if (!x->type_offload ||
> +	    (x->xso.type == XFRM_DEV_OFFLOAD_UNSPECIFIED && x->encap))
>   		return false;
>   
> -	if ((dev == xfrm_dst_path(dst)->dev) && !xdst->child->xfrm) {
> +	if ((!dev || dev == xfrm_dst_path(dst)->dev) &&
> +	    !xdst->child->xfrm) {
>   		mtu = xfrm_state_mtu(x, xdst->child_mtu_cached);
>   		if (skb->len <= mtu)
>   			goto ok;
> @@ -430,6 +432,9 @@ bool xfrm_dev_offload_ok(struct sk_buff *skb, struct xfrm_state *x)
>   	return false;
>   
>   ok:
> +	if (!dev)
> +		return true;
> +
>   	check_tunnel_size = x->xso.type == XFRM_DEV_OFFLOAD_PACKET &&
>   			    x->props.mode == XFRM_MODE_TUNNEL;
>   	switch (x->props.family) {

-- 
Best Regards,
Yanjun.Zhu


  parent reply	other threads:[~2025-07-29 16:06 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-07-28 15:17 [PATCH ipsec 0/3] xfrm: some fixes for GSO with SW crypto Sabrina Dubroca
2025-07-28 15:17 ` [PATCH ipsec 1/3] xfrm: restore GSO for " Sabrina Dubroca
2025-07-29 13:05   ` Leon Romanovsky
2025-07-29 16:06   ` Zhu Yanjun [this message]
2025-07-28 15:17 ` [PATCH ipsec 2/3] Revert "xfrm: Remove unneeded device check from validate_xmit_xfrm" Sabrina Dubroca
2025-07-29 13:06   ` Leon Romanovsky
2025-07-29 15:27   ` Cosmin Ratiu
2025-07-30 10:26     ` Sabrina Dubroca
2025-07-30 12:32       ` Cosmin Ratiu
2025-07-30 14:02         ` Sabrina Dubroca
2025-07-28 15:17 ` [PATCH ipsec 3/3] udp: also consider secpath when evaluating ipsec use for checksumming Sabrina Dubroca

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=f86f5c83-0fc2-4c40-b8f9-f20f5b755cb1@linux.dev \
    --to=yanjun.zhu@linux.dev \
    --cc=leonro@nvidia.com \
    --cc=netdev@vger.kernel.org \
    --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 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).