From: Guillaume Nault <gnault@redhat.com>
To: David Miller <davem@davemloft.net>,
Jakub Kicinski <kuba@kernel.org>, Paolo Abeni <pabeni@redhat.com>,
Eric Dumazet <edumazet@google.com>
Cc: netdev@vger.kernel.org,
Steffen Klassert <steffen.klassert@secunet.com>,
Herbert Xu <herbert@gondor.apana.org.au>,
David Ahern <dsahern@kernel.org>,
Ido Schimmel <idosch@nvidia.com>
Subject: [PATCH net-next 1/6] xfrm: Convert xfrm_get_tos() to dscp_t.
Date: Tue, 15 Oct 2024 11:11:25 +0200 [thread overview]
Message-ID: <d30306c0b26e4c24e570c82ea62ab5b1a6b37ceb.1728982714.git.gnault@redhat.com> (raw)
In-Reply-To: <cover.1728982714.git.gnault@redhat.com>
Return a dscp_t variable to prepare for the future conversion of
xfrm_bundle_create() to dscp_t.
While there, rename the function "xfrm_get_dscp", to align its name
with the new return type.
Signed-off-by: Guillaume Nault <gnault@redhat.com>
---
net/xfrm/xfrm_policy.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/net/xfrm/xfrm_policy.c b/net/xfrm/xfrm_policy.c
index 914bac03b52a..dd472e9df059 100644
--- a/net/xfrm/xfrm_policy.c
+++ b/net/xfrm/xfrm_policy.c
@@ -2550,10 +2550,10 @@ xfrm_tmpl_resolve(struct xfrm_policy **pols, int npols, const struct flowi *fl,
}
-static int xfrm_get_tos(const struct flowi *fl, int family)
+static dscp_t xfrm_get_dscp(const struct flowi *fl, int family)
{
if (family == AF_INET)
- return fl->u.ip4.flowi4_tos & INET_DSCP_MASK;
+ return inet_dsfield_to_dscp(fl->u.ip4.flowi4_tos);
return 0;
}
@@ -2647,7 +2647,7 @@ static struct dst_entry *xfrm_bundle_create(struct xfrm_policy *policy,
xfrm_flowi_addr_get(fl, &saddr, &daddr, family);
- tos = xfrm_get_tos(fl, family);
+ tos = inet_dscp_to_dsfield(xfrm_get_dscp(fl, family));
dst_hold(dst);
--
2.39.2
next prev parent reply other threads:[~2024-10-15 9:11 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-10-15 9:11 [PATCH net-next 0/6] xfrm: Convert __xfrm4_dst_lookup() and its callers to dscp_t Guillaume Nault
2024-10-15 9:11 ` Guillaume Nault [this message]
2024-10-15 9:11 ` [PATCH net-next 2/6] xfrm: Convert xfrm_bundle_create() " Guillaume Nault
2024-10-15 9:11 ` [PATCH net-next 3/6] xfrm: Convert xfrm_dst_lookup() " Guillaume Nault
2024-10-15 11:48 ` Eyal Birger
2024-10-16 8:23 ` Guillaume Nault
2024-10-15 9:11 ` [PATCH net-next 4/6] xfrm: Convert __xfrm_dst_lookup() " Guillaume Nault
2024-10-15 9:11 ` [PATCH net-next 5/6] xfrm: Convert the ->dst_lookup() callback " Guillaume Nault
2024-10-15 9:11 ` [PATCH net-next 6/6] xfrm: Convert __xfrm4_dst_lookup() " Guillaume Nault
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=d30306c0b26e4c24e570c82ea62ab5b1a6b37ceb.1728982714.git.gnault@redhat.com \
--to=gnault@redhat.com \
--cc=davem@davemloft.net \
--cc=dsahern@kernel.org \
--cc=edumazet@google.com \
--cc=herbert@gondor.apana.org.au \
--cc=idosch@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).