All of lore.kernel.org
 help / color / mirror / Atom feed
From: Christian Hopps <chopps@chopps.org>
To: devel@linux-ipsec.org
Cc: Steffen Klassert <steffen.klassert@secunet.com>,
	Herbert Xu <herbert@gondor.apana.org.au>,
	"David S. Miller" <davem@davemloft.net>,
	Eric Dumazet <edumazet@google.com>,
	Jakub Kicinski <kuba@kernel.org>, Paolo Abeni <pabeni@redhat.com>,
	netdev@vger.kernel.org, Christian Hopps <chopps@labn.net>,
	Christian Hopps <chopps@chopps.org>
Subject: [PATCH ipsec-next] xfrm: add comments in the xfrm mtu calc function
Date: Fri, 15 Sep 2023 20:15:17 -0400	[thread overview]
Message-ID: <m2il8bq81d.fsf@chopps.org> (raw)

Document the [p]mtu values used by, and calculated for xfrms.

Signed-off-by: Christian Hopps <chopps@chopps.org>
---
 net/xfrm/xfrm_policy.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/net/xfrm/xfrm_policy.c b/net/xfrm/xfrm_policy.c
index 5c61ec04b839..2480717654b6 100644
--- a/net/xfrm/xfrm_policy.c
+++ b/net/xfrm/xfrm_policy.c
@@ -3858,15 +3858,19 @@ static void xfrm_init_pmtu(struct xfrm_dst **bundle, int nr)
 		u32 pmtu, route_mtu_cached;
 		struct dst_entry *dst;

+		/* Get the xfrm's dst [p]mtu (i.e., the xfrm's intf/route). */
 		dst = &xdst->u.dst;
 		pmtu = dst_mtu(xfrm_dst_child(dst));
 		xdst->child_mtu_cached = pmtu;

+		/* Subtract the xfrm mode overhead. */
 		pmtu = xfrm_state_mtu(dst->xfrm, pmtu);

+		/* Get the inner traffic route's MTU. */
 		route_mtu_cached = dst_mtu(xdst->route);
 		xdst->route_mtu_cached = route_mtu_cached;

+		/* Update the xfrm's dst MTU to the minimum of these. */
 		if (pmtu > route_mtu_cached)
 			pmtu = route_mtu_cached;

--
2.41.0

                 reply	other threads:[~2023-09-16  0:40 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=m2il8bq81d.fsf@chopps.org \
    --to=chopps@chopps.org \
    --cc=chopps@labn.net \
    --cc=davem@davemloft.net \
    --cc=devel@linux-ipsec.org \
    --cc=edumazet@google.com \
    --cc=herbert@gondor.apana.org.au \
    --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 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.