nsh: headers, GSO
Subsystems (2)
cover nsh: headers, GSO
This adds header structs and helpers for NSH together with GSO support.
Note there is no code in this patchset that actually manipulates the NSH headers. That was sent to netdev by Yi Yang ("[PATCH net-next v6 0/3]
openvswitch: add NSH support"). The aim of this series is to lay the groundwork and ease the implementation for him.
In addition to openvswitch, the NSH support should be added to tc (flower to match, act_nsh to push/pop NSH headers). That will come later. There's currently no plan to support NSH by other means than those two.
The patch 3 in this patchset was written by Yi Yang, I took it from the aforementioned series and slightly modified it - see the note in the patch.
Jiri Benc (3):
ether: add NSH ethertype
vxlan: factor out VXLAN-GPE next protocol
nsh: add GSO support
Yi Yang (1):
net: add NSH header structures and helpers
drivers/net/vxlan.c | 32 +---- include/net/nsh.h | 307 ++++++++++++++++++++++++++++++++++++++++++ include/net/tun_proto.h | 49 +++++++ include/net/vxlan.h | 6 - include/uapi/linux/if_ether.h | 1 + net/Kconfig | 1 + net/Makefile | 1 + net/nsh/Kconfig | 9 ++ net/nsh/Makefile | 1 + net/nsh/nsh.c | 91 +++++++++++++ 10 files changed, 467 insertions(+), 31 deletions(-) create mode 100644 include/net/nsh.h create mode 100644 include/net/tun_proto.h create mode 100644 net/nsh/Kconfig create mode 100644 net/nsh/Makefile create mode 100644 net/nsh/nsh.c
Signature · 1 line
1.8.3.1
PATCH 1/4 ether: add NSH ethertype
The NSH draft says:
An IEEE EtherType, 0x894F, has been allocated for NSH.
--- include/uapi/linux/if_ether.h | 1 + 1 file changed, 1 insertion(+)
include/uapi/linux/if_ether.h +1 -0
@@ -99,6 +99,7 @@#define ETH_P_FIP 0x8914/* FCoE Initialization Protocol */ #define ETH_P_80221 0x8917/* IEEE 802.21 Media Independent Handover Protocol */ #define ETH_P_HSR 0x892F/* IEC 62439-3 HSRv1 */ +#define ETH_P_NSH 0x894F/* Network Service Header */ #define ETH_P_LOOPBACK 0x9000/* Ethernet loopback packet, per IEEE 802.3 */ #define ETH_P_QINQ1 0x9100/* deprecated QinQ VLAN [ NOT AN OFFICIALLY REGISTERED ID ] */ #define ETH_P_QINQ2 0x9200/* deprecated QinQ VLAN [ NOT AN OFFICIALLY REGISTERED ID ] */
Signature · 1 line
1.8.3.1
PATCH 2/4 vxlan: factor out VXLAN-GPE next protocol
In reply to Jiri BencThe values are shared between VXLAN-GPE and NSH. Originally probably by coincidence but I notified both working groups about this last year and they seem to keep the values in sync since then.
Hopefully they'll get a single IANA registry for the values, too. (I asked them for that.)
Factor out the code to be shared by the NSH implementation.
NSH and MPLS values are added in this patch, too. For MPLS, the drafts incorrectly assign only a single value, while we have two MPLS ethertypes. I raised the problem with both groups. For now, I assume the value is for unicast.
--- drivers/net/vxlan.c | 32 +++++++------------------------- include/net/tun_proto.h | 49 +++++++++++++++++++++++++++++++++++++++++++++++++ include/net/vxlan.h | 6 ------ 3 files changed, 56 insertions(+), 31 deletions(-) create mode 100644 include/net/tun_proto.h
drivers/net/vxlan.c +7 -25
@@ -26,6 +26,7 @@#include <net/inet_ecn.h> #include <net/net_namespace.h> #include <net/netns/generic.h> +#include <net/tun_proto.h> #include <net/vxlan.h> #if IS_ENABLED (CONFIG_IPV6 )
@@ -1261,19 +1262,9 @@ static bool vxlan_parse_gpe_hdr(struct vxlanhdr *unparsed,if (gpe->oam_flag)return false; -switch (gpe->next_protocol) { -case VXLAN_GPE_NP_IPV4 : - *protocol =htons (ETH_P_IP ); -break ; -case VXLAN_GPE_NP_IPV6 : - *protocol =htons (ETH_P_IPV6 ); -break ; -case VXLAN_GPE_NP_ETHERNET : - *protocol =htons (ETH_P_TEB ); -break ; -default : + *protocol =tun_p_to_eth_p (gpe->next_protocol); +if (!*protocol)return false; - } unparsed->vx_flags &= ~VXLAN_GPE_USED_BITS ;return true;
@@ -1799,19 +1790,10 @@ static int vxlan_build_gpe_hdr(struct vxlanhdr *vxh, u32 vxflags,struct vxlanhdr_gpe *gpe = (struct vxlanhdr_gpe *)vxh; gpe->np_applied =1 ; - -switch (protocol) { -case htons (ETH_P_IP ): - gpe->next_protocol =VXLAN_GPE_NP_IPV4 ; -return 0 ; -case htons (ETH_P_IPV6 ): - gpe->next_protocol =VXLAN_GPE_NP_IPV6 ; -return 0 ; -case htons (ETH_P_TEB ): - gpe->next_protocol =VXLAN_GPE_NP_ETHERNET ; -return 0 ; - } -return -EPFNOSUPPORT ; + gpe->next_protocol =tun_p_from_eth_p (protocol); +if (!gpe->next_protocol) +return -EPFNOSUPPORT ; +return 0 ; } static int vxlan_build_skb(struct sk_buff *skb, struct dst_entry *dst,
include/net/tun_proto.h new file +49 -0
49 lines not on this page · raw message
include/net/vxlan.h +0 -6
@@ -168,12 +168,6 @@ struct vxlanhdr_gpe {#define VXLAN_GPE_USED_BITS (VXLAN_HF_VER | VXLAN_HF_NP | VXLAN_HF_OAM | \ cpu_to_be32(0xff)) -/* VXLAN-GPE header Next Protocol. */ -#define VXLAN_GPE_NP_IPV4 0x01 -#define VXLAN_GPE_NP_IPV6 0x02 -#define VXLAN_GPE_NP_ETHERNET 0x03 -#define VXLAN_GPE_NP_NSH 0x04 -struct vxlan_metadata {u32 gbp; };
Signature · 1 line
1.8.3.1
PATCH 3/4 net: add NSH header structures and helpers
In reply to Jiri BencFrom: Yi Yang <[email protected]>
NSH (Network Service Header)[1] is a new protocol for service function chaining, it can be handled as a L3 protocol like IPv4 and IPv6, Eth + NSH + Inner packet or VxLAN-gpe + NSH + Inner packet are two typical use cases.
This patch adds NSH header structures and helpers for NSH GSO support and Open vSwitch NSH support.
[1] https://datatracker.ietf.org/doc/draft-ietf-sfc-nsh/
[Jiri: added nsh_hdr() helper and renamed the header struct to "struct nshhdr" to match the usual pattern. Removed packet type defines, these are now shared with VXLAN-GPE.]
--- include/net/nsh.h | 307 ++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 307 insertions(+) create mode 100644 include/net/nsh.h
include/net/nsh.h new file +307 -0
@@ -0,0 +1,307 @@ +#ifndef __NET_NSH_H +#define __NET_NSH_H 1 + +#include <linux/skbuff.h> + +/* +* Network Service Header: +* 0 1 2 3 +* 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 +* +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ +* |Ver|O|U| TTL | Length |U|U|U|U|MD Type| Next Protocol | +* +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ +* | Service Path Identifier (SPI) | Service Index | +* +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ +* | | +* ~ Mandatory/Optional Context Headers ~ +* | | +* +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ +* +* Version: The version field is used to ensure backward compatibility +* going forward with future NSH specification updates. It MUST be set +* to 0x0 by the sender, in this first revision of NSH. Given the +* widespread implementation of existing hardware that uses the first +* nibble after an MPLS label stack for ECMP decision processing, this +* document reserves version 01b and this value MUST NOT be used in +* future versions of the protocol. Please see [RFC7325] for further +* discussion of MPLS-related forwarding requirements. +* +* O bit: Setting this bit indicates an Operations, Administration, and +* Maintenance (OAM) packet. The actual format and processing of SFC +* OAM packets is outside the scope of this specification (see for +* example [I-D.ietf-sfc-oam-framework] for one approach). +* +* The O bit MUST be set for OAM packets and MUST NOT be set for non-OAM +* packets. The O bit MUST NOT be modified along the SFP. +* +* SF/SFF/SFC Proxy/Classifier implementations that do not support SFC +* OAM procedures SHOULD discard packets with O bit set, but MAY support +* a configurable parameter to enable forwarding received SFC OAM +* packets unmodified to the next element in the chain. Forwarding OAM +* packets unmodified by SFC elements that do not support SFC OAM +* procedures may be acceptable for a subset of OAM functions, but can +* result in unexpected outcomes for others, thus it is recommended to +* analyze the impact of forwarding an OAM packet for all OAM functions +* prior to enabling this behavior. The configurable parameter MUST be +* disabled by default. +* +* TTL: Indicates the maximum SFF hops for an SFP. This field is used +* for service plane loop detection. The initial TTL value SHOULD be +* configurable via the control plane; the configured initial value can +* be specific to one or more SFPs. If no initial value is explicitly +* provided, the default initial TTL value of 63 MUST be used. Each SFF +* involved in forwarding an NSH packet MUST decrement the TTL value by +* 1 prior to NSH forwarding lookup. Decrementing by 1 from an incoming +* value of 0 shall result in a TTL value of 63. The packet MUST NOT be +* forwarded if TTL is, after decrement, 0. +* +* All other flag fields, marked U, are unassigned and available for +* future use, see Section 11.2.1. Unassigned bits MUST be set to zero +* upon origination, and MUST be ignored and preserved unmodified by +* other NSH supporting elements. Elements which do not understand the +* meaning of any of these bits MUST NOT modify their actions based on +* those unknown bits. +* +* Length: The total length, in 4-byte words, of NSH including the Base +* Header, the Service Path Header, the Fixed Length Context Header or +* Variable Length Context Header(s). The length MUST be 0x6 for MD +* Type equal to 0x1, and MUST be 0x2 or greater for MD Type equal to +* 0x2. The length of the NSH header MUST be an integer multiple of 4 +* bytes, thus variable length metadata is always padded out to a +* multiple of 4 bytes. +* +* MD Type: Indicates the format of NSH beyond the mandatory Base Header +* and the Service Path Header. MD Type defines the format of the +* metadata being carried. +* +* 0x0 - This is a reserved value. Implementations SHOULD silently +* discard packets with MD Type 0x0. +* +* 0x1 - This indicates that the format of the header includes a fixed +* length Context Header (see Figure 4 below). +* +* 0x2 - This does not mandate any headers beyond the Base Header and +* Service Path Header, but may contain optional variable length Context +* Header(s). The semantics of the variable length Context Header(s) +* are not defined in this document. The format of the optional +* variable length Context Headers is provided in Section 2.5.1. +* +* 0xF - This value is reserved for experimentation and testing, as per +* [RFC3692]. Implementations not explicitly configured to be part of +* an experiment SHOULD silently discard packets with MD Type 0xF. +* +* Next Protocol: indicates the protocol type of the encapsulated data. +* NSH does not alter the inner payload, and the semantics on the inner +* protocol remain unchanged due to NSH service function chaining. +* Please see the IANA Considerations section below, Section 11.2.5. +* +* This document defines the following Next Protocol values: +* +* 0x1: IPv4 +* 0x2: IPv6 +* 0x3: Ethernet +* 0x4: NSH +* 0x5: MPLS +* 0xFE: Experiment 1 +* 0xFF: Experiment 2 +* +* Packets with Next Protocol values not supported SHOULD be silently +* dropped by default, although an implementation MAY provide a +* configuration parameter to forward them. Additionally, an +* implementation not explicitly configured for a specific experiment +* [RFC3692] SHOULD silently drop packets with Next Protocol values 0xFE +* and 0xFF. +* +* Service Path Identifier (SPI): Identifies a service path. +* Participating nodes MUST use this identifier for Service Function +* Path selection. The initial classifier MUST set the appropriate SPI +* for a given classification result. +* +* Service Index (SI): Provides location within the SFP. The initial +* classifier for a given SFP SHOULD set the SI to 255, however the +* control plane MAY configure the initial value of SI as appropriate +* (i.e., taking into account the length of the service function path). +* The Service Index MUST be decremented by a value of 1 by Service +* Functions or by SFC Proxy nodes after performing required services +* and the new decremented SI value MUST be used in the egress packet's +* NSH. The initial Classifier MUST send the packet to the first SFF in +* the identified SFP for forwarding along an SFP. If re-classification +* occurs, and that re-classification results in a new SPI, the +* (re)classifier is, in effect, the initial classifier for the +* resultant SPI. +* +* The SI is used in conjunction the with Service Path Identifier for +* Service Function Path Selection and for determining the next SFF/SF +* in the path. The SI is also valuable when troubleshooting or +* reporting service paths. Additionally, while the TTL field is the +* main mechanism for service plane loop detection, the SI can also be +* used for detecting service plane loops. +* +* When the Base Header specifies MD Type = 0x1, a Fixed Length Context +* Header (16-bytes) MUST be present immediately following the Service +* Path Header. The value of a Fixed Length Context +* Header that carries no metadata MUST be set to zero. +* +* When the base header specifies MD Type = 0x2, zero or more Variable +* Length Context Headers MAY be added, immediately following the +* Service Path Header (see Figure 5). Therefore, Length = 0x2, +* indicates that only the Base Header followed by the Service Path +* Header are present. The optional Variable Length Context Headers +* MUST be of an integer number of 4-bytes. The base header Length +* field MUST be used to determine the offset to locate the original +* packet or frame for SFC nodes that require access to that +* information. +* +* The format of the optional variable length Context Headers +* +* 0 1 2 3 +* 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 +* +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ +* | Metadata Class | Type |U| Length | +* +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ +* | Variable Metadata | +* +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ +* +* Metadata Class (MD Class): Defines the scope of the 'Type' field to +* provide a hierarchical namespace. The IANA Considerations +* Section 11.2.4 defines how the MD Class values can be allocated to +* standards bodies, vendors, and others. +* +* Type: Indicates the explicit type of metadata being carried. The +* definition of the Type is the responsibility of the MD Class owner. +* +* Unassigned bit: One unassigned bit is available for future use. This +* bit MUST NOT be set, and MUST be ignored on receipt. +* +* Length: Indicates the length of the variable metadata, in bytes. In +* case the metadata length is not an integer number of 4-byte words, +* the sender MUST add pad bytes immediately following the last metadata +* byte to extend the metadata to an integer number of 4-byte words. +* The receiver MUST round up the length field to the nearest 4-byte +* word boundary, to locate and process the next field in the packet. +* The receiver MUST access only those bytes in the metadata indicated +* by the length field (i.e., actual number of bytes) and MUST ignore +* the remaining bytes up to the nearest 4-byte word boundary. The +* Length may be 0 or greater. +* +* A value of 0 denotes a Context Header without a Variable Metadata +* field. +* +* [0] https://datatracker.ietf.org/doc/draft-ietf-sfc-nsh/ +*/ + +/** +* struct nsh_md1_ctx - Keeps track of NSH context data +* @nshc<1-4>: NSH Contexts. +*/ +struct nsh_md1_ctx { +__be32 context[4 ]; +}; + +struct nsh_md2_tlv { +__be16 md_class; +u8 type; +u8 length; +u8 md_value[]; +}; + +struct nshhdr { +__be16 ver_flags_ttl_len; +u8 mdtype; +u8 np; +__be32 path_hdr; +union { +struct nsh_md1_ctx md1; +struct nsh_md2_tlv md2; + }; +}; + +/* Masking NSH header fields. */ +#define NSH_VER_MASK 0xc000 +#define NSH_VER_SHIFT 14 +#define NSH_FLAGS_MASK 0x3000 +#define NSH_FLAGS_SHIFT 12 +#define NSH_TTL_MASK 0x0fc0 +#define NSH_TTL_SHIFT 6 +#define NSH_LEN_MASK 0x003f +#define NSH_LEN_SHIFT 0 + +#define NSH_MDTYPE_MASK 0x0f +#define NSH_MDTYPE_SHIFT 0 + +#define NSH_SPI_MASK 0xffffff00 +#define NSH_SPI_SHIFT 8 +#define NSH_SI_MASK 0x000000ff +#define NSH_SI_SHIFT 0 + +/* MD Type Registry. */ +#define NSH_M_TYPE1 0x01 +#define NSH_M_TYPE2 0x02 +#define NSH_M_EXP1 0xFE +#define NSH_M_EXP2 0xFF + +/* NSH Base Header Length */ +#define NSH_BASE_HDR_LEN 8 + +/* NSH MD Type 1 header Length. */ +#define NSH_M_TYPE1_LEN 24 + +/* NSH header maximum Length. */ +#define NSH_HDR_MAX_LEN 256 + +/* NSH context headers maximum Length. */ +#define NSH_CTX_HDRS_MAX_LEN 248 + +static inline struct nshhdr *nsh_hdr (struct sk_buff *skb) +{ +return (struct nshhdr *)skb_network_header (skb); +} + +static inline u16 nsh_hdr_len (const struct nshhdr *nsh) +{ +return ((ntohs (nsh->ver_flags_ttl_len) &NSH_LEN_MASK ) + >>NSH_LEN_SHIFT ) <<2 ; +} + +static inline u8 nsh_get_ver (const struct nshhdr *nsh) +{ +return (ntohs (nsh->ver_flags_ttl_len) &NSH_VER_MASK ) + >>NSH_VER_SHIFT ; +} + +static inline u8 nsh_get_flags (const struct nshhdr *nsh) +{ +return (ntohs (nsh->ver_flags_ttl_len) &NSH_FLAGS_MASK ) + >>NSH_FLAGS_SHIFT ; +} + +static inline u8 nsh_get_ttl (const struct nshhdr *nsh) +{ +return (ntohs (nsh->ver_flags_ttl_len) &NSH_TTL_MASK ) + >>NSH_TTL_SHIFT ; +} + +static inline void __nsh_set_xflag (struct nshhdr *nsh,u16 xflag,u16 xmask) +{ + nsh->ver_flags_ttl_len + = (nsh->ver_flags_ttl_len & ~htons (xmask)) |htons (xflag); +} + +static inline void nsh_set_flags_and_ttl (struct nshhdr *nsh,u8 flags,u8 ttl) +{ +__nsh_set_xflag (nsh, ((flags <<NSH_FLAGS_SHIFT ) &NSH_FLAGS_MASK ) | + ((ttl <<NSH_TTL_SHIFT ) &NSH_TTL_MASK ), +NSH_FLAGS_MASK |NSH_TTL_MASK ); +} + +static inline void nsh_set_flags_ttl_len (struct nshhdr *nsh,u8 flags, +u8 ttl,u8 len) +{ + len = len >>2 ; +__nsh_set_xflag (nsh, ((flags <<NSH_FLAGS_SHIFT ) &NSH_FLAGS_MASK ) | + ((ttl <<NSH_TTL_SHIFT ) &NSH_TTL_MASK ) | + ((len <<NSH_LEN_SHIFT ) &NSH_LEN_MASK ), +NSH_FLAGS_MASK |NSH_TTL_MASK |NSH_LEN_MASK ); +} + +#endif /* __NET_NSH_H */
Signature · 1 line
1.8.3.1
Re: [PATCH net-next 3/4] net: add NSH header structures and helpers
Quoted 4 lines · Jiri Benc
This patch adds NSH header structures and helpers for NSH GSO support and Open vSwitch NSH support.
One thing to know before applying this to the kernel: NSH is still a draft. It's not standardized yet. And the draft evolves, compare the version from February to the latest one:
https://tools.ietf.org/html/draft-ietf-sfc-nsh-12#section-3.2
https://tools.ietf.org/html/draft-ietf-sfc-nsh-19#section-2.2
There's really no guarantee there won't be further changes.
This patchset by itself is harmless as there's no user and everything can be changed. We should think through any uAPIs we're going to merge, though. We don't want to repeat the problems with VXLAN and changed UDP port.
Again, this patchset is harmless and can be applied even if the draft changes. Further patches may not be and need to be designed very carefully.
Jiri
PATCH 4/4 nsh: add GSO support
In reply to Jiri BencAdd a new nsh/ directory. It currently holds only GSO functions but more will come: in particular, code shared by openvswitch and tc to manipulate NSH headers.
For now, assume there's no hardware support for NSH segmentation. We can always introduce netdev->nsh_features later.
--- net/Kconfig | 1 + net/Makefile | 1 + net/nsh/Kconfig | 9 ++++++ net/nsh/Makefile | 1 + net/nsh/nsh.c | 91 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 5 files changed, 103 insertions(+) create mode 100644 net/nsh/Kconfig create mode 100644 net/nsh/Makefile create mode 100644 net/nsh/nsh.c
net/Kconfig +1 -0
@@ -235,6 +235,7 @@ source "net/openvswitch/Kconfig" source "net/vmw_vsock/Kconfig" source "net/netlink/Kconfig" source "net/mpls/Kconfig" +source "net/nsh/Kconfig" source "net/hsr/Kconfig" source "net/switchdev/Kconfig" source "net/l3mdev/Kconfig"
net/Makefile +1 -0
@@ -76,6 +76,7 @@ obj-$(CONFIG_NET_IFE) += ife/ obj-$(CONFIG_OPENVSWITCH) += openvswitch/ obj-$(CONFIG_VSOCKETS) += vmw_vsock/ obj-$(CONFIG_MPLS) += mpls/ +obj-$(CONFIG_NET_NSH) += nsh/ obj-$(CONFIG_HSR) += hsr/ ifneq ($(CONFIG_NET_SWITCHDEV),) obj-y += switchdev/
net/nsh/Kconfig new file +9 -0
@@ -0,0 +1,9 @@ +menuconfig NET_NSH + tristate "Network Service Header (NSH) protocol" + default n + ---help--- + Network Service Header is an implementation of Service Function + Chaining (RFC 7665). The current implementation in Linux supports + only MD type 1 and only with the openvswitch module. + + If unsure, say N.
net/nsh/Makefile new file +1 -0
@@ -0,0 +1 @@ +obj-$(CONFIG_NET_NSH) += nsh.o
net/nsh/nsh.c new file +91 -0
91 lines not on this page · raw message
Signature · 1 line
1.8.3.1
David Miller
maintainerFrom: Jiri Benc <[email protected]>
Date: Mon, 28 Aug 2017 21:43:20 +0200
Quoted 7 lines
This adds header structs and helpers for NSH together with GSO support.
Note there is no code in this patchset that actually manipulates the NSH headers. That was sent to netdev by Yi Yang ("[PATCH net-next v6 0/3]
openvswitch: add NSH support"). The aim of this series is to lay the groundwork and ease the implementation for him.
Quoted 6 lines
In addition to openvswitch, the NSH support should be added to tc (flower to match,
act_nshto push/pop NSH headers). That will come later. There's currently no plan to support NSH by other means than those two.The patch 3 in this patchset was written by Yi Yang, I took it from the aforementioned series and slightly modified it - see the note in the patch.
Series applied, thanks Jiri.
Quoted 10 lines · David Miller
From: Jiri Benc <[email protected]>
Date: Mon, 28 Aug 2017 21:43:20 +0200Quoted 7 lines
This adds header structs and helpers for NSH together with GSO support.
Note there is no code in this patchset that actually manipulates the NSH headers. That was sent to netdev by Yi Yang ("[PATCH net-next v6 0/3]
openvswitch: add NSH support"). The aim of this series is to lay the groundwork and ease the implementation for him.
Quoted 8 lines
Quoted 6 lines
In addition to openvswitch, the NSH support should be added to tc (flower to match,
act_nshto push/pop NSH headers). That will come later. There's currently no plan to support NSH by other means than those two.The patch 3 in this patchset was written by Yi Yang, I took it from the aforementioned series and slightly modified it - see the note in the patch.
Series applied, thanks Jiri.
Hi, Jiri
David has merged your NSH GSO series, do you have one more patch series to fix VxLAN-gpe+NSH GSO issue? I think we still need do something in skb_udp_tunnel_segment in net/ipv4/udp_offload.c to support VxLAN-gpe+NSH GSO.
I'll post new OVS NSH kernel datapath patch series if NSH GSO is done.
Quoted 4 lines · Yi
David has merged your NSH GSO series, do you have one more patch series to fix VxLAN-gpe+NSH GSO issue? I think we still need do something in
skb_udp_tunnel_segmentinnet/ipv4/udp_offload.cto support VxLAN-gpe+NSH GSO.
This should work as is.
The only issue is VXLAN-GPE offloading where not all drivers distinguish VXLAN from VXLAN-GPE in ndo_features_check, while I'm not sure their firmware actually supports VXLAN-GPE. We don't make it easy for the drivers to distinguish those two, the only way is to examine the headers. We could do better here but that's for future improvement.
Quoted 1 line
I'll post new OVS NSH kernel datapath patch series if NSH GSO is done.
Please do. Note that it's important to ensure that whenever there's a NSH header added, the nsh module gets loaded. The easiest way is to factor out code that will be shared by the NSH tc action into nsh.c. This would have to be done anyway so let's do it right away.
Jiri
Quoted 7 lines · Jiri Benc
Quoted 2 lines
I'll post new OVS NSH kernel datapath patch series if NSH GSO is done.
Please do. Note that it's important to ensure that whenever there's a NSH header added, the nsh module gets loaded. The easiest way is to factor out code that will be shared by the NSH tc action into
nsh.c. This would have to be done anyway so let's do it right away.
Do you mean we need move push_nsh from net/openvswitch/actions.c to net/nsh/nsh.c in order that kernel can load nsh kernel module automatically?
Quoted 2 lines
Jiri
Quoted 3 lines · Yi
Do you mean we need move
push_nshfromnet/openvswitch/actions.ctonet/nsh/nsh.cin order that kernel can load nsh kernel module automatically?
Yes. Without that struct sw_flow_key parameter but that's obvious.
Jiri