From: Xiaoliang Yang <xiaoliang.yang_1@nxp.com>
To: netdev@vger.kernel.org, linux-kernel@vger.kernel.org,
linux-kselftest@vger.kernel.org
Cc: davem@davemloft.net, edumazet@google.com, kuba@kernel.org,
pabeni@redhat.com, jhs@mojatatu.com, jiri@resnulli.us,
horms@kernel.org, shuah@kernel.org, vladimir.oltean@nxp.com,
vinicius.gomes@intel.com, fejes@inf.elte.hu,
xiaoliang.yang_1@nxp.com
Subject: [PATCH net-next 3/6] uapi: tc_act: add tc_frer UAPI header
Date: Mon, 22 Jun 2026 17:21:15 +0800 [thread overview]
Message-ID: <20260622092118.6846-4-xiaoliang.yang_1@nxp.com> (raw)
In-Reply-To: <20260622092118.6846-1-xiaoliang.yang_1@nxp.com>
Define the netlink attribute layout and enumerations for the FRER tc
action (IEEE 802.1CB Frame Replication and Elimination for Reliability).
The action is split into two functional sub-commands selected by the
TCA_FRER_FUNC attribute:
TCA_FRER_FUNC_PUSH - Egress: sequence number generation and R-TAG
insertion. The action inserts an R-TAG with
the current sequence number into the frame
before passing it on. When chained with
"action mirred egress mirror", the mirrored
copy already carries the R-TAG, so all
replicated frames on different egress paths
carry the same sequence number without any
additional shared state.
TCA_FRER_FUNC_RECOVER - Ingress: duplicate detection and elimination.
Multiple ingress filters can share the same
recovery state by referencing the same action
index, implementing Sequence Recovery across
ports (IEEE 802.1CB Section 7.4.2).
When TCA_FRER_RCVY_INDIVIDUAL flag is set,
the action uses private per-action state
(Individual Recovery, Section 7.5).
Statistics attributes map directly to the managed objects defined in
IEEE 802.1CB Table 10-1.
Signed-off-by: Xiaoliang Yang <xiaoliang.yang_1@nxp.com>
---
include/uapi/linux/tc_act/tc_frer.h | 89 +++++++++++++++++++++++++++++
1 file changed, 89 insertions(+)
create mode 100644 include/uapi/linux/tc_act/tc_frer.h
diff --git a/include/uapi/linux/tc_act/tc_frer.h b/include/uapi/linux/tc_act/tc_frer.h
new file mode 100644
index 000000000000..241e90827e26
--- /dev/null
+++ b/include/uapi/linux/tc_act/tc_frer.h
@@ -0,0 +1,89 @@
+/* SPDX-License-Identifier: GPL-2.0+ WITH Linux-syscall-note */
+/* Copyright 2026 NXP */
+
+#ifndef __LINUX_TC_FRER_H
+#define __LINUX_TC_FRER_H
+
+#include <linux/pkt_cls.h>
+
+/* Base parameters passed in TCA_FRER_PARMS */
+struct tc_frer {
+ tc_gen;
+};
+
+/**
+ * enum TCA_FRER_* - netlink attributes for the FRER tc action
+ *
+ * @TCA_FRER_FUNC: Functional sub-command (tc_frer_func).
+ * Mandatory.
+ * @TCA_FRER_TAG_TYPE: Redundancy tag type (tc_frer_tag_type).
+ * Mandatory.
+ *
+ * Push-specific attributes (TCA_FRER_FUNC_PUSH):
+ * Recover-specific attributes (TCA_FRER_FUNC_RECOVER):
+ * @TCA_FRER_RCVY_INDIVIDUAL: Flag. Force Individual Recovery.
+ * @TCA_FRER_RCVY_ALG: u8. Recovery algorithm (tc_frer_rcvy_alg).
+ * @TCA_FRER_RCVY_HISTORY_LEN: u8. SequenceHistory window size (1-32).
+ * Maps to frerSeqRcvyHistoryLength.
+ * @TCA_FRER_RCVY_RESET_MSEC: u32. Reset timer in milliseconds.
+ * 0 disables the timer.
+ * Maps to frerSeqRcvyResetMSec.
+ * @TCA_FRER_RCVY_TAKE_NO_SEQ: Flag. Accept frames without a redundancy
+ * tag and pass them unconditionally.
+ * Maps to frerSeqRcvyTakeNoSeq.
+ * @TCA_FRER_RCVY_TAG_POP: Flag. Remove the redundancy tag from
+ * frames that pass the recovery function.
+ *
+ * Read-only statistics (filled on dump, IEEE 802.1CB Table 10-1):
+ * @TCA_FRER_STATS_TAGLESS_PKTS: frerCpsSeqRcvyTaglessPackets
+ * @TCA_FRER_STATS_OUT_OF_ORDER_PKTS: frerCpsSeqRcvyOutOfOrderPackets
+ * @TCA_FRER_STATS_ROGUE_PKTS: frerCpsSeqRcvyRoguePackets
+ * @TCA_FRER_STATS_LOST_PKTS: frerCpsSeqRcvyLostPackets
+ * @TCA_FRER_STATS_RESETS: frerCpsSeqRcvyResets
+ * @TCA_FRER_STATS_PASSED_PKTS: frerCpsSeqRcvyPassedPackets
+ * @TCA_FRER_STATS_DISCARDED_PKTS: frerCpsSeqRcvyDiscardedPackets
+ * @TCA_FRER_STATS_SEQGEN_PKTS: frerCpsSeqGenPackets
+ */
+enum {
+ TCA_FRER_UNSPEC,
+ TCA_FRER_TM, /* struct tcf_t */
+ TCA_FRER_PARMS, /* struct tc_frer */
+ TCA_FRER_PAD,
+ TCA_FRER_FUNC, /* u8: tc_frer_func */
+ TCA_FRER_TAG_TYPE, /* u8: tc_frer_tag_type */
+ TCA_FRER_RCVY_INDIVIDUAL, /* NLA_FLAG */
+ TCA_FRER_RCVY_ALG, /* u8: tc_frer_rcvy_alg */
+ TCA_FRER_RCVY_HISTORY_LEN, /* u8: 1-32 */
+ TCA_FRER_RCVY_RESET_MSEC, /* u32 */
+ TCA_FRER_RCVY_TAKE_NO_SEQ, /* NLA_FLAG */
+ TCA_FRER_RCVY_TAG_POP, /* NLA_FLAG */
+ TCA_FRER_STATS_TAGLESS_PKTS, /* u64 */
+ TCA_FRER_STATS_OUT_OF_ORDER_PKTS, /* u64 */
+ TCA_FRER_STATS_ROGUE_PKTS, /* u64 */
+ TCA_FRER_STATS_LOST_PKTS, /* u64 */
+ TCA_FRER_STATS_RESETS, /* u64 */
+ TCA_FRER_STATS_PASSED_PKTS, /* u64 */
+ TCA_FRER_STATS_DISCARDED_PKTS, /* u64 */
+ TCA_FRER_STATS_SEQGEN_PKTS, /* u64 */
+ __TCA_FRER_MAX,
+};
+
+#define TCA_FRER_MAX (__TCA_FRER_MAX - 1)
+
+enum tc_frer_func {
+ TCA_FRER_FUNC_PUSH = 1,
+ TCA_FRER_FUNC_RECOVER = 2,
+};
+
+enum tc_frer_tag_type {
+ TCA_FRER_TAG_RTAG = 1,
+ TCA_FRER_TAG_HSR,
+ TCA_FRER_TAG_PRP,
+};
+
+enum tc_frer_rcvy_alg {
+ TCA_FRER_RCVY_VECTOR_ALG = 0, /* IEEE 802.1CB 7.4.3.4 */
+ TCA_FRER_RCVY_MATCH_ALG = 1, /* IEEE 802.1CB 7.4.3.5 */
+};
+
+#endif /* __LINUX_TC_FRER_H */
--
2.17.1
next prev parent reply other threads:[~2026-06-22 9:20 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-06-22 9:21 [PATCH net-next 0/6] tc: introduce FRER action (IEEE 802.1CB) Xiaoliang Yang
2026-06-22 9:21 ` [PATCH net-next 1/6] uapi: if_ether: add ETH_P_RTAG for IEEE 802.1CB R-TAG Xiaoliang Yang
2026-06-22 9:21 ` [PATCH net-next 2/6] uapi: pkt_cls: add TCA_ID_FRER action identifier Xiaoliang Yang
2026-06-22 9:21 ` Xiaoliang Yang [this message]
2026-06-22 9:21 ` [PATCH net-next 4/6] net: sched: act_frer: add FRER tc action Xiaoliang Yang
2026-06-22 9:21 ` [PATCH net-next 5/6] selftest: add tc-testing JSON test cases for act_frer Xiaoliang Yang
2026-06-22 9:21 ` [PATCH net-next 6/6] selftests: net: add kselftest for IEEE 802.1CB FRER tc action Xiaoliang Yang
2026-06-22 15:59 ` [PATCH net-next 0/6] tc: introduce FRER action (IEEE 802.1CB) Jakub Kicinski
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=20260622092118.6846-4-xiaoliang.yang_1@nxp.com \
--to=xiaoliang.yang_1@nxp.com \
--cc=davem@davemloft.net \
--cc=edumazet@google.com \
--cc=fejes@inf.elte.hu \
--cc=horms@kernel.org \
--cc=jhs@mojatatu.com \
--cc=jiri@resnulli.us \
--cc=kuba@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-kselftest@vger.kernel.org \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
--cc=shuah@kernel.org \
--cc=vinicius.gomes@intel.com \
--cc=vladimir.oltean@nxp.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox