Netdev List
 help / color / mirror / Atom feed
* [PATCH iproute2] ip-xfrm: add support for XFRM_POLICY_CPU_ACQUIRE
@ 2026-10-30 10:13 Nicolas Dichtel
  2026-11-16  9:10 ` Nicolas Dichtel
  0 siblings, 1 reply; 2+ messages in thread
From: Nicolas Dichtel @ 2026-10-30 10:13 UTC (permalink / raw)
  To: Stephen Hemminger
  Cc: David Ahern, Sabrina Dubroca, Steffen Klassert, netdev,
	Nicolas Dichtel

This flag is used to enable RFC 9611. The corresponding option for states
is 'pcpu-num', see commit b544c7c5c7cb ("ip-xfrm: add pcpu-num support").

Link: https://www.rfc-editor.org/info/rfc9611
Signed-off-by: Nicolas Dichtel <nicolas.dichtel@6wind.com>
---
 ip/ipxfrm.c        |  1 +
 ip/xfrm_policy.c   |  4 +++-
 man/man8/ip-xfrm.8 | 10 +++++++---
 3 files changed, 11 insertions(+), 4 deletions(-)

diff --git a/ip/ipxfrm.c b/ip/ipxfrm.c
index 586d24fb8594..78d9e1929760 100644
--- a/ip/ipxfrm.c
+++ b/ip/ipxfrm.c
@@ -1094,6 +1094,7 @@ void xfrm_policy_info_print(struct xfrm_userpolicy_info *xpinfo,
 		fprintf(fp, "flag ");
 		XFRM_FLAG_PRINT(fp, flags, XFRM_POLICY_LOCALOK, "localok");
 		XFRM_FLAG_PRINT(fp, flags, XFRM_POLICY_ICMP, "icmp");
+		XFRM_FLAG_PRINT(fp, flags, XFRM_POLICY_CPU_ACQUIRE, "cpu-acquire");
 		if (flags)
 			fprintf(fp, "%x", flags);
 	}
diff --git a/ip/xfrm_policy.c b/ip/xfrm_policy.c
index e60acd5bb98f..5261a292f468 100644
--- a/ip/xfrm_policy.c
+++ b/ip/xfrm_policy.c
@@ -61,7 +61,7 @@ static void usage(void)
 		"PTYPE := main | sub\n"
 		"ACTION := allow | block\n"
 		"FLAG-LIST := [ FLAG-LIST ] FLAG\n"
-		"FLAG := localok | icmp\n"
+		"FLAG := localok | icmp | cpu-acquire\n"
 		"LIMIT-LIST := [ LIMIT-LIST ] limit LIMIT\n"
 		"LIMIT := { time-soft | time-hard | time-use-soft | time-use-hard } SECONDS |\n"
 		"         { byte-soft | byte-hard } SIZE | { packet-soft | packet-hard } COUNT\n"
@@ -139,6 +139,8 @@ static int xfrm_policy_flag_parse(__u8 *flags, int *argcp, char ***argvp)
 				*flags |= XFRM_POLICY_LOCALOK;
 			else if (strcmp(*argv, "icmp") == 0)
 				*flags |= XFRM_POLICY_ICMP;
+			else if (strcmp(*argv, "cpu-acquire") == 0)
+				*flags |= XFRM_POLICY_CPU_ACQUIRE;
 			else {
 				PREV_ARG(); /* back track */
 				break;
diff --git a/man/man8/ip-xfrm.8 b/man/man8/ip-xfrm.8
index 4c278ccba38c..50fbb1a7d93d 100644
--- a/man/man8/ip-xfrm.8
+++ b/man/man8/ip-xfrm.8
@@ -376,7 +376,7 @@ ip-xfrm \- transform configuration
 
 .ti -8
 .IR FLAG " :="
-.BR localok " | " icmp
+.BR localok " | " icmp " | " cpu-acquire
 
 .ti -8
 .IR LIMIT-LIST " := [ " LIMIT-LIST " ]"
@@ -674,8 +674,12 @@ is a number that defaults to zero.
 
 .TP
 .I FLAG-LIST
-contains one or both of the following optional flags:
-.BR local " or " icmp "."
+contains one or more of the following optional flags:
+.BR localok ", " icmp ", or " cpu-acquire "."
+.B cpu-acquire
+enables per-CPU SAs (RFC 9611): the acquire messages generated for this
+policy carry the number of the CPU that processed the packet, see
+.BR pcpu-num "."
 
 .TP
 .I LIMIT-LIST
-- 
2.47.3


^ permalink raw reply related	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2026-11-16  9:10 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-10-30 10:13 [PATCH iproute2] ip-xfrm: add support for XFRM_POLICY_CPU_ACQUIRE Nicolas Dichtel
2026-11-16  9:10 ` Nicolas Dichtel

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox