Skip to contentSkip to conversation

xfrm: add comments in the xfrm mtu calc function

PATCH New Christian Hopps 1 participant 1 message Sep 16, 2023

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 xfrm: add comments in the xfrm mtu calc function

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

---
net/xfrm/xfrm_policy.c | 4 ++++

1 file changed, 4 insertions(+)
net/xfrm/xfrm_policy.c +0 -0
index 5c61ec04b839..2480717654b6 100644
@@ -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