-
Notifications
You must be signed in to change notification settings - Fork 52.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Justin Iurman says: ==================== Support for the IOAM Pre-allocated Trace with IPv6 v5: - Refine types, min/max and default values for new sysctls - Introduce a "_wide" sysctl for each "ioam6_id" sysctl - Add more validation on headers before processing data - RCU for sc <> ns pointers + appropriate accessors - Generic Netlink policies are now per op, not per family anymore - Address other comments/remarks from Jakub (thanks again) - Revert "__packed" to "__attribute__((packed))" for uapi headers - Add tests to cover the functionality added, as requested by David Ahern v4: - Address warnings from checkpatch (ignore errors related to unnamed bitfields in the first patch) - Use of hweight32 (thanks Jakub) - Remove inline keyword from static functions in C files and let the compiler decide what to do (thanks Jakub) v3: - Fix warning "unused label 'out_unregister_genl'" by adding conditional macro - Fix lwtunnel output redirect bug: dst cache useless in this case, use orig_output instead v2: - Fix warning with static for __ioam6_fill_trace_data - Fix sparse warning with __force when casting __be64 to __be32 - Fix unchecked dereference when removing IOAM namespaces or schemas - exthdrs.c: Don't drop by default (now: ignore) to match the act bits "00" - Add control plane support for the inline insertion (lwtunnel) - Provide uapi structures - Use __net_timestamp if skb->tstamp is empty - Add note about the temporary IANA allocation - Remove support for "removable" TLVs - Remove support for virtual/anonymous tunnel decapsulation In-situ Operations, Administration, and Maintenance (IOAM) records operational and telemetry information in a packet while it traverses a path between two points in an IOAM domain. It is defined in draft-ietf-ippm-ioam-data [1]. IOAM data fields can be encapsulated into a variety of protocols. The IPv6 encapsulation is defined in draft-ietf-ippm-ioam-ipv6-options [2], via extension headers. IOAM can be used to complement OAM mechanisms based on e.g. ICMP or other types of probe packets. This patchset implements support for the Pre-allocated Trace, carried by a Hop-by-Hop. Therefore, a new IPv6 Hop-by-Hop TLV option is introduced, see IANA [3]. The three other IOAM options are not included in this patchset (Incremental Trace, Proof-of-Transit and Edge-to-Edge). The main idea behind the IOAM Pre-allocated Trace is that a node pre-allocates some room in packets for IOAM data. Then, each IOAM node on the path will insert its data. There exist several interesting use- cases, e.g. Fast failure detection/isolation or Smart service selection. Another killer use-case is what we have called Cross-Layer Telemetry, see the demo video on its repository [4], that aims to make the entire stack (L2/L3 -> L7) visible for distributed tracing tools (e.g. Jaeger), instead of the current L5 -> L7 limited view. So, basically, this is a nice feature for the Linux Kernel. This patchset also provides support for the control plane part, but only for the inline insertion (host-to-host use case), through lightweight tunnels. Indeed, for in-transit traffic, the solution is to have an IPv6-in-IPv6 encapsulation, which brings some difficulties and still requires a little bit of work and discussion (ie anonymous tunnel decapsulation and multi egress resolution). - Patch 1: IPv6 IOAM headers definition - Patch 2: Data plane support for Pre-allocated Trace - Patch 3: IOAM Generic Netlink API - Patch 4: Support for IOAM injection with lwtunnels - Patch 5: Documentation for new IOAM sysctls - Patch 6: Test for the IOAM insertion with IPv6 [1] https://tools.ietf.org/html/draft-ietf-ippm-ioam-data [2] https://tools.ietf.org/html/draft-ietf-ippm-ioam-ipv6-options [3] https://www.iana.org/assignments/ipv6-parameters/ipv6-parameters.xhtml#ipv6-parameters-2 [4] https://github.com/iurmanj/cross-layer-telemetry ==================== Signed-off-by: David S. Miller <davem@davemloft.net>
- Loading branch information
Showing
27 changed files
with
2,393 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,26 @@ | ||
| .. SPDX-License-Identifier: GPL-2.0 | ||
| ===================== | ||
| IOAM6 Sysfs variables | ||
| ===================== | ||
|
|
||
|
|
||
| /proc/sys/net/conf/<iface>/ioam6_* variables: | ||
| ============================================= | ||
|
|
||
| ioam6_enabled - BOOL | ||
| Accept (= enabled) or ignore (= disabled) IPv6 IOAM options on ingress | ||
| for this interface. | ||
|
|
||
| * 0 - disabled (default) | ||
| * 1 - enabled | ||
|
|
||
| ioam6_id - SHORT INTEGER | ||
| Define the IOAM id of this interface. | ||
|
|
||
| Default is ~0. | ||
|
|
||
| ioam6_id_wide - INTEGER | ||
| Define the wide IOAM id of this interface. | ||
|
|
||
| Default is ~0. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,13 @@ | ||
| /* SPDX-License-Identifier: GPL-2.0+ */ | ||
| /* | ||
| * IPv6 IOAM | ||
| * | ||
| * Author: | ||
| * Justin Iurman <justin.iurman@uliege.be> | ||
| */ | ||
| #ifndef _LINUX_IOAM6_H | ||
| #define _LINUX_IOAM6_H | ||
|
|
||
| #include <uapi/linux/ioam6.h> | ||
|
|
||
| #endif /* _LINUX_IOAM6_H */ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,13 @@ | ||
| /* SPDX-License-Identifier: GPL-2.0+ */ | ||
| /* | ||
| * IPv6 IOAM Generic Netlink API | ||
| * | ||
| * Author: | ||
| * Justin Iurman <justin.iurman@uliege.be> | ||
| */ | ||
| #ifndef _LINUX_IOAM6_GENL_H | ||
| #define _LINUX_IOAM6_GENL_H | ||
|
|
||
| #include <uapi/linux/ioam6_genl.h> | ||
|
|
||
| #endif /* _LINUX_IOAM6_GENL_H */ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,13 @@ | ||
| /* SPDX-License-Identifier: GPL-2.0+ */ | ||
| /* | ||
| * IPv6 IOAM Lightweight Tunnel API | ||
| * | ||
| * Author: | ||
| * Justin Iurman <justin.iurman@uliege.be> | ||
| */ | ||
| #ifndef _LINUX_IOAM6_IPTUNNEL_H | ||
| #define _LINUX_IOAM6_IPTUNNEL_H | ||
|
|
||
| #include <uapi/linux/ioam6_iptunnel.h> | ||
|
|
||
| #endif /* _LINUX_IOAM6_IPTUNNEL_H */ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,67 @@ | ||
| /* SPDX-License-Identifier: GPL-2.0+ */ | ||
| /* | ||
| * IPv6 IOAM implementation | ||
| * | ||
| * Author: | ||
| * Justin Iurman <justin.iurman@uliege.be> | ||
| */ | ||
|
|
||
| #ifndef _NET_IOAM6_H | ||
| #define _NET_IOAM6_H | ||
|
|
||
| #include <linux/net.h> | ||
| #include <linux/ipv6.h> | ||
| #include <linux/ioam6.h> | ||
| #include <linux/rhashtable-types.h> | ||
|
|
||
| struct ioam6_namespace { | ||
| struct rhash_head head; | ||
| struct rcu_head rcu; | ||
|
|
||
| struct ioam6_schema __rcu *schema; | ||
|
|
||
| __be16 id; | ||
| __be32 data; | ||
| __be64 data_wide; | ||
| }; | ||
|
|
||
| struct ioam6_schema { | ||
| struct rhash_head head; | ||
| struct rcu_head rcu; | ||
|
|
||
| struct ioam6_namespace __rcu *ns; | ||
|
|
||
| u32 id; | ||
| int len; | ||
| __be32 hdr; | ||
|
|
||
| u8 data[0]; | ||
| }; | ||
|
|
||
| struct ioam6_pernet_data { | ||
| struct mutex lock; | ||
| struct rhashtable namespaces; | ||
| struct rhashtable schemas; | ||
| }; | ||
|
|
||
| static inline struct ioam6_pernet_data *ioam6_pernet(struct net *net) | ||
| { | ||
| #if IS_ENABLED(CONFIG_IPV6) | ||
| return net->ipv6.ioam6_data; | ||
| #else | ||
| return NULL; | ||
| #endif | ||
| } | ||
|
|
||
| struct ioam6_namespace *ioam6_namespace(struct net *net, __be16 id); | ||
| void ioam6_fill_trace_data(struct sk_buff *skb, | ||
| struct ioam6_namespace *ns, | ||
| struct ioam6_trace_hdr *trace); | ||
|
|
||
| int ioam6_init(void); | ||
| void ioam6_exit(void); | ||
|
|
||
| int ioam6_iptunnel_init(void); | ||
| void ioam6_iptunnel_exit(void); | ||
|
|
||
| #endif /* _NET_IOAM6_H */ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,133 @@ | ||
| /* SPDX-License-Identifier: GPL-2.0+ WITH Linux-syscall-note */ | ||
| /* | ||
| * IPv6 IOAM implementation | ||
| * | ||
| * Author: | ||
| * Justin Iurman <justin.iurman@uliege.be> | ||
| */ | ||
|
|
||
| #ifndef _UAPI_LINUX_IOAM6_H | ||
| #define _UAPI_LINUX_IOAM6_H | ||
|
|
||
| #include <asm/byteorder.h> | ||
| #include <linux/types.h> | ||
|
|
||
| #define IOAM6_U16_UNAVAILABLE U16_MAX | ||
| #define IOAM6_U32_UNAVAILABLE U32_MAX | ||
| #define IOAM6_U64_UNAVAILABLE U64_MAX | ||
|
|
||
| #define IOAM6_DEFAULT_ID (IOAM6_U32_UNAVAILABLE >> 8) | ||
| #define IOAM6_DEFAULT_ID_WIDE (IOAM6_U64_UNAVAILABLE >> 8) | ||
| #define IOAM6_DEFAULT_IF_ID IOAM6_U16_UNAVAILABLE | ||
| #define IOAM6_DEFAULT_IF_ID_WIDE IOAM6_U32_UNAVAILABLE | ||
|
|
||
| /* | ||
| * IPv6 IOAM Option Header | ||
| */ | ||
| struct ioam6_hdr { | ||
| __u8 opt_type; | ||
| __u8 opt_len; | ||
| __u8 :8; /* reserved */ | ||
| #define IOAM6_TYPE_PREALLOC 0 | ||
| __u8 type; | ||
| } __attribute__((packed)); | ||
|
|
||
| /* | ||
| * IOAM Trace Header | ||
| */ | ||
| struct ioam6_trace_hdr { | ||
| __be16 namespace_id; | ||
|
|
||
| #if defined(__LITTLE_ENDIAN_BITFIELD) | ||
|
|
||
| __u8 :1, /* unused */ | ||
| :1, /* unused */ | ||
| overflow:1, | ||
| nodelen:5; | ||
|
|
||
| __u8 remlen:7, | ||
| :1; /* unused */ | ||
|
|
||
| union { | ||
| __be32 type_be32; | ||
|
|
||
| struct { | ||
| __u32 bit7:1, | ||
| bit6:1, | ||
| bit5:1, | ||
| bit4:1, | ||
| bit3:1, | ||
| bit2:1, | ||
| bit1:1, | ||
| bit0:1, | ||
| bit15:1, /* unused */ | ||
| bit14:1, /* unused */ | ||
| bit13:1, /* unused */ | ||
| bit12:1, /* unused */ | ||
| bit11:1, | ||
| bit10:1, | ||
| bit9:1, | ||
| bit8:1, | ||
| bit23:1, /* reserved */ | ||
| bit22:1, | ||
| bit21:1, /* unused */ | ||
| bit20:1, /* unused */ | ||
| bit19:1, /* unused */ | ||
| bit18:1, /* unused */ | ||
| bit17:1, /* unused */ | ||
| bit16:1, /* unused */ | ||
| :8; /* reserved */ | ||
| } type; | ||
| }; | ||
|
|
||
| #elif defined(__BIG_ENDIAN_BITFIELD) | ||
|
|
||
| __u8 nodelen:5, | ||
| overflow:1, | ||
| :1, /* unused */ | ||
| :1; /* unused */ | ||
|
|
||
| __u8 :1, /* unused */ | ||
| remlen:7; | ||
|
|
||
| union { | ||
| __be32 type_be32; | ||
|
|
||
| struct { | ||
| __u32 bit0:1, | ||
| bit1:1, | ||
| bit2:1, | ||
| bit3:1, | ||
| bit4:1, | ||
| bit5:1, | ||
| bit6:1, | ||
| bit7:1, | ||
| bit8:1, | ||
| bit9:1, | ||
| bit10:1, | ||
| bit11:1, | ||
| bit12:1, /* unused */ | ||
| bit13:1, /* unused */ | ||
| bit14:1, /* unused */ | ||
| bit15:1, /* unused */ | ||
| bit16:1, /* unused */ | ||
| bit17:1, /* unused */ | ||
| bit18:1, /* unused */ | ||
| bit19:1, /* unused */ | ||
| bit20:1, /* unused */ | ||
| bit21:1, /* unused */ | ||
| bit22:1, | ||
| bit23:1, /* reserved */ | ||
| :8; /* reserved */ | ||
| } type; | ||
| }; | ||
|
|
||
| #else | ||
| #error "Please fix <asm/byteorder.h>" | ||
| #endif | ||
|
|
||
| #define IOAM6_TRACE_DATA_SIZE_MAX 244 | ||
| __u8 data[0]; | ||
| } __attribute__((packed)); | ||
|
|
||
| #endif /* _UAPI_LINUX_IOAM6_H */ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,52 @@ | ||
| /* SPDX-License-Identifier: GPL-2.0+ WITH Linux-syscall-note */ | ||
| /* | ||
| * IPv6 IOAM Generic Netlink API | ||
| * | ||
| * Author: | ||
| * Justin Iurman <justin.iurman@uliege.be> | ||
| */ | ||
|
|
||
| #ifndef _UAPI_LINUX_IOAM6_GENL_H | ||
| #define _UAPI_LINUX_IOAM6_GENL_H | ||
|
|
||
| #define IOAM6_GENL_NAME "IOAM6" | ||
| #define IOAM6_GENL_VERSION 0x1 | ||
|
|
||
| enum { | ||
| IOAM6_ATTR_UNSPEC, | ||
|
|
||
| IOAM6_ATTR_NS_ID, /* u16 */ | ||
| IOAM6_ATTR_NS_DATA, /* u32 */ | ||
| IOAM6_ATTR_NS_DATA_WIDE,/* u64 */ | ||
|
|
||
| #define IOAM6_MAX_SCHEMA_DATA_LEN (255 * 4) | ||
| IOAM6_ATTR_SC_ID, /* u32 */ | ||
| IOAM6_ATTR_SC_DATA, /* Binary */ | ||
| IOAM6_ATTR_SC_NONE, /* Flag */ | ||
|
|
||
| IOAM6_ATTR_PAD, | ||
|
|
||
| __IOAM6_ATTR_MAX, | ||
| }; | ||
|
|
||
| #define IOAM6_ATTR_MAX (__IOAM6_ATTR_MAX - 1) | ||
|
|
||
| enum { | ||
| IOAM6_CMD_UNSPEC, | ||
|
|
||
| IOAM6_CMD_ADD_NAMESPACE, | ||
| IOAM6_CMD_DEL_NAMESPACE, | ||
| IOAM6_CMD_DUMP_NAMESPACES, | ||
|
|
||
| IOAM6_CMD_ADD_SCHEMA, | ||
| IOAM6_CMD_DEL_SCHEMA, | ||
| IOAM6_CMD_DUMP_SCHEMAS, | ||
|
|
||
| IOAM6_CMD_NS_SET_SCHEMA, | ||
|
|
||
| __IOAM6_CMD_MAX, | ||
| }; | ||
|
|
||
| #define IOAM6_CMD_MAX (__IOAM6_CMD_MAX - 1) | ||
|
|
||
| #endif /* _UAPI_LINUX_IOAM6_GENL_H */ |
Oops, something went wrong.