From: Sabrina Dubroca <sd@queasysnail.net>
To: Jianbo Liu <jianbol@nvidia.com>
Cc: netdev@vger.kernel.org, davem@davemloft.net, kuba@kernel.org,
steffen.klassert@secunet.com, Cosmin Ratiu <cratiu@nvidia.com>,
Herbert Xu <herbert@gondor.apana.org.au>,
David Ahern <dsahern@kernel.org>,
Eric Dumazet <edumazet@google.com>,
Paolo Abeni <pabeni@redhat.com>, Simon Horman <horms@kernel.org>
Subject: Re: [PATCH ipsec-next v3] xfrm: Use xfrm_ip2inner_mode() unconditionally
Date: Fri, 28 Nov 2025 17:14:39 +0100 [thread overview]
Message-ID: <aSnKbzhftKx9f2yW@krikkit> (raw)
In-Reply-To: <20251128035014.3941-1-jianbol@nvidia.com>
2025-11-28, 05:48:04 +0200, Jianbo Liu wrote:
> Commit c9500d7b7de8 ("xfrm: store xfrm_mode directly, not its
> address") changed how the xfrm_mode is stored in the xfrm state. The
> inner_mode NULL check is redundant as xfrm_ip2inner_mode() now returns
> the address of an embedded structure, which cannot be NULL.
>
> Additionally, commit 61fafbee6cfe ("xfrm: Determine inner GSO type
> from packet inner protocol") updated xfrm_ip2inner_mode() to
> explicitly check x->sel.family. If the selector family is specified
> (i.e., not AF_UNSPEC), the helper now correctly returns &x->inner_mode
> directly.
Note: that commit is not in ipsec-next yet, only in ipsec. This patch
should only be applied to ipsec-next once the trees have been merged
together.
> This means the manual branching which checked for AF_UNSPEC before
> deciding whether to call the helper or use the state's inner mode
> directly is no longer necessary.
>
> This patch simplifies the code by calling xfrm_ip2inner_mode()
> unconditionally and removing the NULL checking.
>
> Signed-off-by: Jianbo Liu <jianbol@nvidia.com>
> Reviewed-by: Cosmin Ratiu <cratiu@nvidia.com>
> ---
> V3:
> - Change the commit subject (was "xfrm: Remove redundant state inner mode check").
> - Call xfrm_ip2inner_mode() unconditionally and update the commit message accordingly.
Other than the tree scheduling comment above, the patch looks ok,
thanks.
Reviewed-by: Sabrina Dubroca <sd@queasysnail.net>
--
Sabrina
prev parent reply other threads:[~2025-11-28 16:14 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-11-28 3:48 [PATCH ipsec-next v3] xfrm: Use xfrm_ip2inner_mode() unconditionally Jianbo Liu
2025-11-28 16:14 ` Sabrina Dubroca [this message]
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=aSnKbzhftKx9f2yW@krikkit \
--to=sd@queasysnail.net \
--cc=cratiu@nvidia.com \
--cc=davem@davemloft.net \
--cc=dsahern@kernel.org \
--cc=edumazet@google.com \
--cc=herbert@gondor.apana.org.au \
--cc=horms@kernel.org \
--cc=jianbol@nvidia.com \
--cc=kuba@kernel.org \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
--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).