Netdev List
 help / color / mirror / Atom feed
From: Nicolas Dichtel <nicolas.dichtel@6wind.com>
To: Stephen Hemminger <stephen@networkplumber.org>
Cc: David Ahern <dsahern@gmail.com>,
	Sabrina Dubroca <sd@queasysnail.net>,
	Steffen Klassert <steffen.klassert@secunet.com>,
	netdev@vger.kernel.org,
	Nicolas Dichtel <nicolas.dichtel@6wind.com>
Subject: [PATCH iproute2] ip-xfrm: add support for XFRM_POLICY_CPU_ACQUIRE
Date: Fri, 30 Oct 2026 11:13:59 +0100	[thread overview]
Message-ID: <20261030101359.1907972-1-nicolas.dichtel@6wind.com> (raw)

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


             reply	other threads:[~2026-10-30 10:14 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-10-30 10:13 Nicolas Dichtel [this message]
2026-11-16  9:10 ` [PATCH iproute2] ip-xfrm: add support for XFRM_POLICY_CPU_ACQUIRE Nicolas Dichtel

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=20261030101359.1907972-1-nicolas.dichtel@6wind.com \
    --to=nicolas.dichtel@6wind.com \
    --cc=dsahern@gmail.com \
    --cc=netdev@vger.kernel.org \
    --cc=sd@queasysnail.net \
    --cc=steffen.klassert@secunet.com \
    --cc=stephen@networkplumber.org \
    /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