diff mbox series

[ipsec-next] xfrm: add comments in the xfrm mtu calc function

Message ID m2il8bq81d.fsf@chopps.org (mailing list archive)
State Not Applicable
Delegated to: Netdev Maintainers
Headers show
Series [ipsec-next] xfrm: add comments in the xfrm mtu calc function | expand

Checks

Context Check Description
netdev/series_format warning Single patches do not need cover letters; Target tree name not specified in the subject
netdev/tree_selection success Guessed tree name to be net-next
netdev/fixes_present success Fixes tag not required for -next series
netdev/header_inline success No static functions without inline keyword in header files
netdev/build_32bit success Errors and warnings before: 1352 this patch: 1352
netdev/cc_maintainers success CCed 7 of 7 maintainers
netdev/build_clang success Errors and warnings before: 1364 this patch: 1364
netdev/verify_signedoff success Signed-off-by tag matches author and committer
netdev/deprecated_api success None detected
netdev/check_selftest success No net selftest shell script
netdev/verify_fixes success No Fixes tag
netdev/build_allmodconfig_warn success Errors and warnings before: 1375 this patch: 1375
netdev/checkpatch success total: 0 errors, 0 warnings, 0 checks, 19 lines checked
netdev/kdoc success Errors and warnings before: 0 this patch: 0
netdev/source_inline success Was 0 now: 0

Commit Message

Christian Hopps Sept. 16, 2023, 12:15 a.m. UTC
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(+)

--
2.41.0
diff mbox series

Patch

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;