From: "Asbjørn Sloth Tønnesen" <ast@fiberby.net>
To: netdev@vger.kernel.org
Cc: "Asbjørn Sloth Tønnesen" <ast@fiberby.net>,
"Davide Caratti" <dcaratti@redhat.com>,
"Ilya Maximets" <i.maximets@ovn.org>,
"Jamal Hadi Salim" <jhs@mojatatu.com>,
"Cong Wang" <xiyou.wangcong@gmail.com>,
"Jiri Pirko" <jiri@resnulli.us>,
"David S. Miller" <davem@davemloft.net>,
"Eric Dumazet" <edumazet@google.com>,
"Jakub Kicinski" <kuba@kernel.org>,
"Paolo Abeni" <pabeni@redhat.com>,
"David Ahern" <dsahern@kernel.org>,
"Simon Horman" <horms@kernel.org>,
"Ratheesh Kannoth" <rkannoth@marvell.com>,
"Florian Westphal" <fw@strlen.de>,
"Alexander Lobakin" <aleksander.lobakin@intel.com>,
linux-kernel@vger.kernel.org
Subject: [PATCH net-next 1/9] net/sched: flower: define new tunnel flags
Date: Wed, 3 Jul 2024 10:45:50 +0000 [thread overview]
Message-ID: <20240703104600.455125-2-ast@fiberby.net> (raw)
In-Reply-To: <20240703104600.455125-1-ast@fiberby.net>
Define new TCA_FLOWER_KEY_FLAGS_* flags for use in struct
flow_dissector_key_control, covering the same flags
as currently exposed through TCA_FLOWER_KEY_ENC_FLAGS,
but assign them new bit positions in so that they don't
conflict with existing TCA_FLOWER_KEY_FLAGS_* flags.
Synchronize FLOW_DIS_* flags, but put the new flags
under FLOW_DIS_F_*. The idea is that we can later, move
the existing flags under FLOW_DIS_F_* as well.
Signed-off-by: Asbjørn Sloth Tønnesen <ast@fiberby.net>
---
include/net/flow_dissector.h | 17 +++++++++++++----
include/uapi/linux/pkt_cls.h | 5 +++++
2 files changed, 18 insertions(+), 4 deletions(-)
diff --git a/include/net/flow_dissector.h b/include/net/flow_dissector.h
index 3e47e123934d..f560e2c8d0e7 100644
--- a/include/net/flow_dissector.h
+++ b/include/net/flow_dissector.h
@@ -16,7 +16,8 @@ struct sk_buff;
* struct flow_dissector_key_control:
* @thoff: Transport header offset
* @addr_type: Type of key. One of FLOW_DISSECTOR_KEY_*
- * @flags: Key flags. Any of FLOW_DIS_(IS_FRAGMENT|FIRST_FRAGENCAPSULATION)
+ * @flags: Key flags.
+ * Any of FLOW_DIS_(IS_FRAGMENT|FIRST_FRAG|ENCAPSULATION|F_*)
*/
struct flow_dissector_key_control {
u16 thoff;
@@ -24,9 +25,17 @@ struct flow_dissector_key_control {
u32 flags;
};
-#define FLOW_DIS_IS_FRAGMENT BIT(0)
-#define FLOW_DIS_FIRST_FRAG BIT(1)
-#define FLOW_DIS_ENCAPSULATION BIT(2)
+/* Please keep these flags in sync with TCA_FLOWER_KEY_FLAGS_*
+ * in include/uapi/linux/pkt_cls.h, as these bit flags are exposed
+ * to userspace in some error paths, ie. unsupported flags.
+ */
+#define FLOW_DIS_IS_FRAGMENT BIT(0)
+#define FLOW_DIS_FIRST_FRAG BIT(1)
+#define FLOW_DIS_ENCAPSULATION BIT(2)
+#define FLOW_DIS_F_TUNNEL_CSUM BIT(3)
+#define FLOW_DIS_F_TUNNEL_DONT_FRAGMENT BIT(4)
+#define FLOW_DIS_F_TUNNEL_OAM BIT(5)
+#define FLOW_DIS_F_TUNNEL_CRIT_OPT BIT(6)
enum flow_dissect_ret {
FLOW_DISSECT_RET_OUT_GOOD,
diff --git a/include/uapi/linux/pkt_cls.h b/include/uapi/linux/pkt_cls.h
index b6d38f5fd7c0..24795aad7651 100644
--- a/include/uapi/linux/pkt_cls.h
+++ b/include/uapi/linux/pkt_cls.h
@@ -677,6 +677,11 @@ enum {
enum {
TCA_FLOWER_KEY_FLAGS_IS_FRAGMENT = (1 << 0),
TCA_FLOWER_KEY_FLAGS_FRAG_IS_FIRST = (1 << 1),
+ /* FLOW_DIS_ENCAPSULATION (1 << 2) is not exposed to userspace */
+ TCA_FLOWER_KEY_FLAGS_TUNNEL_CSUM = (1 << 3),
+ TCA_FLOWER_KEY_FLAGS_TUNNEL_DONT_FRAGMENT = (1 << 4),
+ TCA_FLOWER_KEY_FLAGS_TUNNEL_OAM = (1 << 5),
+ TCA_FLOWER_KEY_FLAGS_TUNNEL_CRIT_OPT = (1 << 6),
};
enum {
--
2.45.2
next prev parent reply other threads:[~2024-07-03 10:47 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-07-03 10:45 [PATCH net-next 0/9] flower: rework TCA_FLOWER_KEY_ENC_FLAGS usage Asbjørn Sloth Tønnesen
2024-07-03 10:45 ` Asbjørn Sloth Tønnesen [this message]
2024-07-03 10:59 ` [PATCH net-next 1/9] net/sched: flower: define new tunnel flags Alexander Lobakin
2024-07-04 0:20 ` Jakub Kicinski
2024-07-04 21:45 ` Asbjørn Sloth Tønnesen
2024-07-05 2:05 ` Jakub Kicinski
2024-07-03 10:45 ` [PATCH net-next 2/9] net/sched: cls_flower: prepare fl_{set,dump}_key_flags() for ENC_FLAGS Asbjørn Sloth Tønnesen
2024-07-03 10:45 ` [PATCH net-next 3/9] net/sched: cls_flower: add policy for TCA_FLOWER_KEY_FLAGS Asbjørn Sloth Tønnesen
2024-07-03 10:45 ` [PATCH net-next 4/9] flow_dissector: prepare for encapsulated control flags Asbjørn Sloth Tønnesen
2024-07-03 10:45 ` [PATCH net-next 5/9] flow_dissector: set encapsulated control flags from tun_flags Asbjørn Sloth Tønnesen
2024-07-03 10:45 ` [PATCH net-next 6/9] net/sched: cls_flower: add tunnel flags to fl_{set,dump}_key_flags() Asbjørn Sloth Tønnesen
2024-07-03 10:45 ` [PATCH net-next 7/9] net/sched: cls_flower: rework TCA_FLOWER_KEY_ENC_FLAGS usage Asbjørn Sloth Tønnesen
2024-07-03 10:45 ` [PATCH net-next 8/9] flow_dissector: cleanup FLOW_DISSECTOR_KEY_ENC_FLAGS Asbjørn Sloth Tønnesen
2024-07-03 10:45 ` [PATCH net-next 9/9] flow_dissector: set encapsulation control flags for non-IP Asbjørn Sloth Tønnesen
2024-07-03 16:19 ` [PATCH net-next 0/9] flower: rework TCA_FLOWER_KEY_ENC_FLAGS usage Davide Caratti
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=20240703104600.455125-2-ast@fiberby.net \
--to=ast@fiberby.net \
--cc=aleksander.lobakin@intel.com \
--cc=davem@davemloft.net \
--cc=dcaratti@redhat.com \
--cc=dsahern@kernel.org \
--cc=edumazet@google.com \
--cc=fw@strlen.de \
--cc=horms@kernel.org \
--cc=i.maximets@ovn.org \
--cc=jhs@mojatatu.com \
--cc=jiri@resnulli.us \
--cc=kuba@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
--cc=rkannoth@marvell.com \
--cc=xiyou.wangcong@gmail.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;
as well as URLs for NNTP newsgroup(s).